| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 187 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 187 Page - STMicroelectronics |
|
187 / 245 page ![]() UM0851 Human interface device (HID) drivers Doc ID 16604 Rev 2 187/245 Common configuration of all ADC channels can be done using the following calls: User level: ioctl(fd, ADCIOC_CONFIG, &config); On success, zero is returned otherwise -1 is returned and errno is set appropriately. Kernel level: spear_adc_configure(dev, ADC_CHANNEL0, &config); On success, zero is returned otherwise negative standard kernel errors are returned. The above functions will be successful if the ADC is not being used by another user. In the function calls, config is an instance of struct adc_config: struct adc_config { enum adc_conv_mode mode; /* mode to be configured, can be single or continuous . */ enum adc_volt_ref volt_ref; /* reference of voltage, can be internal or external */ unsigned int mvolt; /* This is reference voltage applied to ADC. It will be useful in calculating output voltage in millivolts. Provide mvolt in millivolt. */ enum adc_scan_ref scan_ref; /* reference of scan rate, can be internal or external */ #ifdef CONFIG_MACH_SPEAR300 enum adc_resolution resolution; /* resolution of output data, can be normal, 10 bit, or high, 17 bit, only for SPEAR300*/ #endif unsigned int req_clk; /* ADC clock requested, in Hz */ unsigned int avail_clk; /* closest clock less than equal to req_clk possible, in Hz */ }; The default configuration done at initialization is: struct adc_config adc_config = { .mode = CONTINUOUS_CONVERSION; .volt_ref = EXTERNAL_VOLT; .mvolt = 2500, .scan_ref = INTERNAL_SCAN; #ifdef CONFIG_MACH_SPEAR300 .resolution = NORMAL_RESOLUTION; #endif .req_clk = 14000000}; ADC channel configuration Channel configuration can be done using the following calls: User level: ioctl (fd, ADCIOC_CHAN_CONFIG, &chan_config); On success, a zero is returned otherwise -1 is returned and errno is set appropriately. |
|
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 |