-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial import of low-level ADC driver interface #616
Conversation
/** | ||
* @brief Definition available ADC devices | ||
* | ||
* Each ADC device is base on a hardware ADC converter which can have one or more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...based..., and ADC means "analog->digital converter", so the word "converter" is redundant
Dammit, that's what happens if you do turbo-commenting... |
* | ||
* This file is subject to the terms and conditions of the LGPLv2 License. | ||
* See the file LICENSE in the top level directory for more details. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Futile.
Maybe the API could also reflect the possiblity of reading the ADC using DMA? Or reading the ADC periodically? |
Ok, as far as I looked through RIOTs code, almost all of the header files have a copyright notice in them, so we should try to be consitent - either way... |
Well, ok then. It doesn't hurt. ;) |
For the periodical/DMA applications - I left them out so far, as for (i) I wanted to keep the interface as slim as possible, for (ii) we don't have any hardcore ADC applications that depend on strict timings, and (iii) periodic and DMA based ADC runmodes do often need quite complex coupling of different MCU peripherals (alt least timer, ADC, maybe even synchronization with a center aligend PWM) and for this it is almost impossible to find a portable interface... But Im open to suggestions :-) |
I have an example for (ii), but I agree that for these cases it's okay to extend the interface: |
Added UNDEFINED device to adc_t and rebased. Can someone ack this? |
ACK |
Please use direction tags in |
done |
Squash and go. |
sqashed and go. |
Initial import of low-level ADC driver interface
Fixed tons of spelling errors Fixed typo in ADC_NUMOF macro drivers: adjustment to low-level adc drvier IF drivers: added [in|out] to doxygen @param comments
Proposal of a low-level ADC driver interface.
Very simple ADC interface for single conversions that have to manually triggered. Most platforms are capable of many more fancy functions, but for simple usage this interface should suffice...
The mappings to pins and hardware conversion units is statically defined for each board in the 'periph_conf.h'.
The two helper functions are very useful, as most times ADC values are representing physical values that have completely different ranges, e.g. 10-bit ADC values from 0 to 1023 could be mapped to temperature values from -40.0°C to 120.0°C.