Lines Matching full:channels

48  * @channels:		the channel info array
49 * @num_channels: number of channels
51 * Has the side effect of filling the channels[i].location values used
54 static unsigned int size_from_channelarray(struct iio_channel_info *channels, int num_channels) in size_from_channelarray() argument
61 if (channels[i].bytes > max) in size_from_channelarray()
62 max = channels[i].bytes; in size_from_channelarray()
63 if (bytes % channels[i].bytes == 0) in size_from_channelarray()
64 channels[i].location = bytes; in size_from_channelarray()
66 channels[i].location = bytes - bytes % channels[i].bytes in size_from_channelarray()
67 + channels[i].bytes; in size_from_channelarray()
69 bytes = channels[i].location + channels[i].bytes; in size_from_channelarray()
178 * @channels: information about the channels.
181 * @num_channels: number of channels
183 static void process_scan(char *data, struct iio_channel_info *channels, in process_scan() argument
189 switch (channels[k].bytes) { in process_scan()
192 print1byte(*(uint8_t *)(data + channels[k].location), in process_scan()
193 &channels[k]); in process_scan()
196 print2byte(*(uint16_t *)(data + channels[k].location), in process_scan()
197 &channels[k]); in process_scan()
200 print4byte(*(uint32_t *)(data + channels[k].location), in process_scan()
201 &channels[k]); in process_scan()
204 print8byte(*(uint64_t *)(data + channels[k].location), in process_scan()
205 &channels[k]); in process_scan()
226 fprintf(stderr, "Enabling/disabling channels: can't open %s\n", in enable_disable_all_channels()
246 perror("Enabling/disabling channels: " in enable_disable_all_channels()
257 " -a Auto-activate all available channels\n" in print_usage()
258 " -A Force-activate ALL channels\n" in print_usage()
302 /* Disable channels if auto-enabled */ in cleanup()
306 fprintf(stderr, "Failed to disable all channels\n"); in cleanup()
368 struct iio_channel_info *channels = NULL; in main() local
552 * Parse the files in scan_elements to identify what channels are in main()
555 ret = build_channel_array(dev_dir_name, buffer_idx, &channels, &num_channels); in main()
563 fprintf(stderr, "Auto-channels selected but some channels " in main()
565 fprintf(stderr, "Proceeding without activating any channels\n"); in main()
570 fprintf(stderr, "Enabling all channels\n"); in main()
574 fprintf(stderr, "Failed to enable all channels\n"); in main()
578 /* This flags that we need to disable the channels again */ in main()
581 ret = build_channel_array(dev_dir_name, buffer_idx, &channels, in main()
590 fprintf(stderr, "Still no channels after " in main()
598 "No channels are enabled, we have nothing to scan.\n"); in main()
599 fprintf(stderr, "Enable channels manually in " in main()
601 "/*_en or pass -a to autoenable channels and " in main()
691 scan_size = size_from_channelarray(channels, num_channels); in main()
758 process_scan(data + scan_size * i, channels, in main()
773 free(channels[i].name); in main()
774 free(channels[i].generic_name); in main()
776 free(channels); in main()