kywwilson11 commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2146019106


##########
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##########
@@ -1132,6 +1155,19 @@ static void adc_common_cfg(struct stm32_dev_s *priv)
   uint32_t clrbits = 0;
   uint32_t setbits = 0;
 
+#if defined(CONFIG_STM32F0L0G0_STM32G0)
+
+  clrbits |= ADC_CCR_PRESC_MASK | ADC_CCR_VREFEN |
+             ADC_CCR_TSEN | ADC_CCR_VBATEN;
+
+#  ifdef STM32_ADC_CCR_PRESC
+  setbits |= STM32_ADC_CCR_PRESC;
+#  else
+  setbits |= ADC_CCR_PRESC_DIV4;

Review Comment:
   I agree. The prescaler was not arbitrary. Given 64 MHz is the highest speed 
for STM32G0 chips, dividing by 4 would get it to 16 MHz or below. This logic 
may be flawed as I guess it might be possible to send a clock faster than 64 
MHz. 
   
   Regardless, I agree. I think this prescaler should just be defined in 
board.h if needed at all. 



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