Electronic Components Datasheet Search
  English  ▼

X  

UM0851 Datasheet(PDF) 188 Page - STMicroelectronics

Part # UM0851
Description  SPEAr is a family of highly customizable ARM-based embedded
PDF  245 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

UM0851 Datasheet(HTML) 188 Page - STMicroelectronics

Back Button UM0851 Datasheet HTML 184Page - STMicroelectronics UM0851 Datasheet HTML 185Page - STMicroelectronics UM0851 Datasheet HTML 186Page - STMicroelectronics UM0851 Datasheet HTML 187Page - STMicroelectronics UM0851 Datasheet HTML 188Page - STMicroelectronics UM0851 Datasheet HTML 189Page - STMicroelectronics UM0851 Datasheet HTML 190Page - STMicroelectronics UM0851 Datasheet HTML 191Page - STMicroelectronics UM0851 Datasheet HTML 192Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 188 / 245 page
background image
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



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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