You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/17 14:00:37 UTC

[GitHub] [incubator-nuttx] hartmannathan commented on a change in pull request #1051: [DO NOT MERGE] Add support for STM32G474 family

hartmannathan commented on a change in pull request #1051:
URL: https://github.com/apache/incubator-nuttx/pull/1051#discussion_r426265023



##########
File path: arch/arm/src/stm32/hardware/stm32_adc_v2.h
##########
@@ -86,18 +86,24 @@
 
 /* Base addresses ***********************************************************************************/
 
-#define STM32_ADC1_OFFSET            0x0000
-#define STM32_ADC2_OFFSET            0x0100
-#define STM32_ADC3_OFFSET            0x0000
-#define STM32_ADC4_OFFSET            0x0100
-#define STM32_ADCCMN_OFFSET          0x0300
+/* G47x has the ADC base addresses are defined in stm32g47xxx_memorymap.h.
+ * Other P/Ns have ADC base addresses are defined here.
+ */
 
-#define STM32_ADC1_BASE              (STM32_ADC1_OFFSET + STM32_ADC12_BASE) /* ADC1 Master ADC */
-#define STM32_ADC2_BASE              (STM32_ADC2_OFFSET + STM32_ADC12_BASE) /* ADC2 Slave ADC */
-#define STM32_ADC3_BASE              (STM32_ADC3_OFFSET + STM32_ADC34_BASE) /* ADC3 Master ADC */
-#define STM32_ADC4_BASE              (STM32_ADC4_OFFSET + STM32_ADC34_BASE) /* ADC4 Slave ADC */
-#define STM32_ADC12CMN_BASE          (STM32_ADCCMN_OFFSET + STM32_ADC12_BASE) /* ADC1, ADC2 common */
-#define STM32_ADC34CMN_BASE          (STM32_ADCCMN_OFFSET + STM32_ADC34_BASE) /* ADC3, ADC4 common */
+#if !defined(CONFIG_STM32_STM32G47XX)

Review comment:
       Can you tell me why the ADC driver is different from all other drivers? For all other drivers, peripheral base addresses are defined in the memorymap header.
   
   It is less work to define ADC base addresses for G4 in stm32_adc_v2.h like you suggest. But I think it is more consistent with other drivers to move them all to the memorymap headers, unless there is a good reason not to.
   
   I'll take your suggestion and move the defines to stm32_adc_v2.h for now, but we should consider moving all of them to the memorymap header in a later PR.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org