Lines Matching +full:aac +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
12 * generic_buffer -n <device_name> -t <trigger_name>
36 * enum autochan - state for the automatic channel enabling mechanism
45 * size_from_channelarray() - calculate the storage size of a scan
61 channels[i].location = bytes - bytes % channels[i].bytes in size_from_channelarray()
77 input >>= info->shift; in print1byte()
78 input &= info->mask; in print1byte()
79 if (info->is_signed) { in print1byte()
80 int8_t val = (int8_t)(input << (8 - info->bits_used)) >> in print1byte()
81 (8 - info->bits_used); in print1byte()
82 printf("%05f ", ((float)val + info->offset) * info->scale); in print1byte()
84 printf("%05f ", ((float)input + info->offset) * info->scale); in print1byte()
91 if (info->be) in print2byte()
100 input >>= info->shift; in print2byte()
101 input &= info->mask; in print2byte()
102 if (info->is_signed) { in print2byte()
103 int16_t val = (int16_t)(input << (16 - info->bits_used)) >> in print2byte()
104 (16 - info->bits_used); in print2byte()
105 printf("%05f ", ((float)val + info->offset) * info->scale); in print2byte()
107 printf("%05f ", ((float)input + info->offset) * info->scale); in print2byte()
114 if (info->be) in print4byte()
123 input >>= info->shift; in print4byte()
124 input &= info->mask; in print4byte()
125 if (info->is_signed) { in print4byte()
126 int32_t val = (int32_t)(input << (32 - info->bits_used)) >> in print4byte()
127 (32 - info->bits_used); in print4byte()
128 printf("%05f ", ((float)val + info->offset) * info->scale); in print4byte()
130 printf("%05f ", ((float)input + info->offset) * info->scale); in print4byte()
137 if (info->be) in print8byte()
146 input >>= info->shift; in print8byte()
147 input &= info->mask; in print8byte()
148 if (info->is_signed) { in print8byte()
149 int64_t val = (int64_t)(input << (64 - info->bits_used)) >> in print8byte()
150 (64 - info->bits_used); in print8byte()
152 if (info->scale == 1.0f && info->offset == 0.0f) in print8byte()
156 ((float)val + info->offset) * info->scale); in print8byte()
158 printf("%05f ", ((float)input + info->offset) * info->scale); in print8byte()
163 * process_scan() - print out the values in SI units
210 scanelemdir[sizeof(scanelemdir)-1] = '\0'; in enable_disable_all_channels()
216 return -EIO; in enable_disable_all_channels()
219 ret = -ENOENT; in enable_disable_all_channels()
221 if (iioutils_check_suffix(ent->d_name, "_en")) { in enable_disable_all_channels()
224 ent->d_name); in enable_disable_all_channels()
225 ret = write_sysfs_int(ent->d_name, scanelemdir, in enable_disable_all_channels()
229 ent->d_name); in enable_disable_all_channels()
233 if (closedir(dp) == -1) { in enable_disable_all_channels()
236 return -errno; in enable_disable_all_channels()
245 " -a Auto-activate all available channels\n" in print_usage()
246 " -A Force-activate ALL channels\n" in print_usage()
247 " -c <n> Do n conversions, or loop forever if n < 0\n" in print_usage()
248 " -e Disable wait for event (new data)\n" in print_usage()
249 " -g Use trigger-less mode\n" in print_usage()
250 " -l <n> Set buffer length to n samples\n" in print_usage()
251 " --device-name -n <name>\n" in print_usage()
252 " --device-num -N <num>\n" in print_usage()
254 " --trigger-name -t <name>\n" in print_usage()
255 " --trigger-num -T <num>\n" in print_usage()
257 " -w <n> Set delay between reads in us (event-less mode)\n"); in print_usage()
271 /* Disconnect the trigger - just write a dummy name. */ in cleanup()
276 strerror(-ret)); in cleanup()
285 strerror(-ret)); in cleanup()
288 /* Disable channels if auto-enabled */ in cleanup()
301 exit(-signum); in sig_handler()
314 exit(-1); in register_cleanup()
320 { "device-name", 1, 0, 'n' },
321 { "device-num", 1, 0, 'N' },
322 { "trigger-name", 1, 0, 't' },
323 { "trigger-num", 1, 0, 'T' },
337 int fp = -1; in main()
344 int dev_num = -1, trig_num = -1; in main()
356 while ((c = getopt_long(argc, argv, "aAc:egl:n:N:t:T:w:?", longopts, in main()
357 NULL)) != -1) { in main()
370 ret = -errno; in main()
385 ret = -errno; in main()
397 ret = -errno; in main()
408 return -errno; in main()
414 ret = -errno; in main()
420 ret = -1; in main()
429 ret = -1; in main()
432 fprintf(stderr, "Only one of --device-num or --device-name needs to be set\n"); in main()
434 ret = -1; in main()
448 return -ENOMEM; in main()
453 ret = -ENOMEM; in main()
464 printf("trigger-less mode selected\n"); in main()
469 return -ENOMEM; in main()
487 "%s-dev%d", device_name, dev_num); in main()
489 ret = -ENOMEM; in main()
494 /* Look for this "-devN" trigger */ in main()
497 /* OK try the simpler "-trigger" suffix instead */ in main()
500 "%s-trigger", device_name); in main()
502 ret = -ENOMEM; in main()
530 fprintf(stderr, "Auto-channels selected but some channels " in main()
558 "auto-enabling, giving up\n"); in main()
568 "/*_en or pass -a to autoenable channels and " in main()
570 ret = -ENOENT; in main()
582 ret = -ENOMEM; in main()
611 "Failed to enable buffer: %s\n", strerror(-ret)); in main()
618 ret = -ENOMEM; in main()
624 ret = -ENOMEM; in main()
630 if (fp == -1) { /* TODO: If it isn't there make the node */ in main()
631 ret = -errno; in main()
643 ret = poll(&pfd, 1, -1); in main()
645 ret = -errno; in main()
674 if (fp >= 0 && close(fp) == -1) in main()
679 for (i = num_channels - 1; i >= 0; i--) { in main()