acassis commented on PR #12621:
URL: https://github.com/apache/nuttx/pull/12621#issuecomment-2209609206

   > @acassis Got it, I've added the peripheral support table to the BL808 page 
(moved and expanded from the ox64 page) and created the new config. I'll go 
ahead and mark this as ready for review, but I would still like to double check 
about the ADC conversion return format:
   > 
   > > 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?
   > 
   > If there is an expected output format for the return values, please let me 
know so I can make sure the driver follows it.
   
   The interface expect a data in "int32_t", but I think it is this way only 
for compatibility for some ADC that could have different range (imagine an ADC 
symmetric power supply voltage where you can have positive and negative 
voltage).  
   
   ```
     CODE int (*au_receive)(FAR struct adc_dev_s *dev, uint8_t ch,
                            int32_t data);
   ```
   
   For common ADC used on most microcontrollers the value will be only integer 
0 to 65535 range for 16-bit, so you don't need to do anything else.


-- 
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