a-lunev commented on pull request #5012:
URL: https://github.com/apache/incubator-nuttx/pull/5012#issuecomment-996414497


   > Yes that is the idea. It is a breaking change and has to be documented 
very well. So that people can get back to working and know what slew rates they 
had.
   
   I'm thinking about two more possible approaches:
   
   **Approach N2**: get rid of stm32h7x3xx_pinmap.h (and all similar files for 
all families) at all.
   Let's consider one of the following potential change in stm32h7x3xx_pinmap.h:
   before:
   `#define GPIO_SDMMC2_CMD         
(GPIO_ALT|GPIO_AF9|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
   `
   after:
   `#define GPIO_SDMMC2_CMD_2         (GPIO_ALT|GPIO_AF9|GPIO_PORTA|GPIO_PIN0)`
   
   And the following line is going to be added to board.h:
   `#define GPIO_SDMMC2_CMD         
(GPIO_SDMMC2_CMD_2|GPIO_SPEED_50MHz|GPIO_PUSHPULL)`
   
   Currently there are about 1,500 defines in stm32h7x3xx_pinmap.h and all or 
part of 1,500 defines (depending on a particular board) are going to migrate to 
board.h files.
   
   Then if we look into board.h, "GPIO_SDMMC2_CMD_2" and all the other referred 
constants may be confusing (because of "_ < number >" endings).
   Possibly it would be better to have the whole (not split) define in board.h, 
namely:
   `#define GPIO_SDMMC2_CMD         
(GPIO_ALT|GPIO_AF9|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
   `
   In this case it would be more clear how a pin is configured for given board.
   
   **Approach N3**: the same as Approach N1 (the one you have suggested), 
however use a port label instead of "_ < number > ".
   The potential change in stm32h7x3xx_pinmap.h:
   before:
   `#define GPIO_SDMMC2_CMD         
(GPIO_ALT|GPIO_AF9|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
   `
   after:
   `#define GPIO_SDMMC2_CMD_PA0         
(GPIO_ALT|GPIO_AF9|GPIO_PORTA|GPIO_PIN0)`
   
   And the following line is going to be added to board.h:
   `#define GPIO_SDMMC2_CMD         
(GPIO_SDMMC2_CMD_PA0|GPIO_SPEED_50MHz|GPIO_PUSHPULL)`
   
   What do you think?


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