| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 188 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 188 Page - STMicroelectronics |
|
188 / 245 page ![]() Human interface device (HID) drivers UM0851 188/245 Doc ID 16604 Rev 2 Kernel level: spear_adc_chan_configure(dev, &chan_config); On success zero is returned otherwise negative standard kernel errors are returned. In the function calls, chan_config is an instance of struct adc_chan_config: struct adc_chan_config { enum adc_chan_id chan_id; /* channel to be configured */ enum adc_avg_samples avg_samples; /* number of average samples */ unsigned int scan_rate; /* rate at which ADC converts data, in microseconds */ int scan_rate_fixed; /* if 1 configured scan rate should be equal to requested can rate, else if 0 configured scan rate can be less than equal to requested scan rate.*/ }; The above functions configure an ADC channel if the ADC device is already configured. They also initiate the conversion. In SINGLE_CONVERSION mode the channel must be configured before each conversion. In CONTINUOUS_CONVERSION mode, the ADC channel is configured only once and then multiple read commands may follow. The scan rate is common to all ADC channels. So changing the scan rate affects all ADC channels. In non-DMA mode, the scan rate is configured to the minimum scan rate requested and already configured by the channel configurations. In DMA mode: ● If DMA is requested and the scan rate of the DMA is lower than the already configured scan rate, then the scan rate is configured. ● Otherwise an error is returned. If DMA is already configured and a new non-DMA request is made: ● If the requested scan rate is less than already configured scan rate then an error is returned ● Otherwise the scan rate is not changed and success is returned. This function returns zero on success and -1 on error and errno is set appropriately. Read converted data After configuring the ADC channel, you can read the converted voltage on the ADC channel. The output data is in millivolts. The converted data can be read using the following calls: User level: read(fd, &data, count); On success, it returns the number of bytes copied otherwise -1 is returned and errno is set appropriately. Kernel level: spear_adc_get_data(dev, ADC_CHANNEL0, &data, count); /* Data: is variable in which converted voltage in millivolts will |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |