henryrov opened a new pull request, #12621:
URL: https://github.com/apache/nuttx/pull/12621

   ## Summary
   This change implements a character driver for the general purpose ADC of the 
BL808, based on the hardware scanning functionality. The driver supports 
setting different conversion resolutions and the order of channels to be 
scanned via menuconfig.
   
   From my testing, the driver in its current state is functional. I've opened 
this as a draft PR mostly because I have a question about the return format for 
the ADC readings, and I would appreciate some feedback. Currently, the driver 
returns unsigned ADC readings on the least significant 16 bits of the return 
data (ie max positive reading of 65535), which is the output format for the ADC 
hardware as configured. From looking at other ADC drivers, I saw that some also 
keep the same output format as provided by the hardware, while others return 
their values shifted left to represent signed 32-bit numbers. Is one of these 
approaches considered standard or preferred over the other?
   
   ## Impact
   Improved hardware support.
   
   ## Testing
   Navigate to menuconfig->System Type->BL808 Peripheral Support, enable the 
GPADC and set the associated options. Also enable ADC support under Device 
Drivers, and make sure the ADC buffer size is larger than the number of 
channels you have set to be scanned. Finally, enable the ADC example under 
Application Configuration and set the path to /dev/gpadc. To test external 
channels, use `bl808_configgpio` to configure the pin associated with each 
channel (floating, analog function).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to