cancel
Showing results for 
Search instead for 
Did you mean: 

Reorganization of Cube headers

Posted on February 28, 2016 at 20:14

It would be nice if you could move into a header the definition of GPIO_MODE, GPIO_MODE, ... GPIO_CR_CNF_ANALOG, GPIO_CR_MODE_INPUT, GPIO_CR_CNF_ANALOG, ...GPIO_CR_CNF_AF_OUTPUT_OD currently in stm32fNxx_hal_gpio.c

These definitions may be useful to automatically generate configuration functions with external tools.

CubeMX does a great job if you've to configure pins once but HAL_GPIO_Init() may be not as efficient as it has to be if you've to switch GPIO configuration in the middle of an interrupt and assigning pin functions manually is so '90 and is terribly error prone.

Having to cut&paste code from stm32fNxx_hal_gpio.c is annoying and error prone as well.

thanks

#hal. #cubemx #headers
1 REPLY 1
Amel NASRI
ST Employee
Posted on February 29, 2016 at 15:35

Hi borgonovo.ivan_sergi,

In the stm32fNxx_hal_gpio.c, the private constants are defined: they are the constants that will be used ONLY locally in the current .c file.

In the header file, you will find the defines for the parameters that you will need in the initialization of your GPIO for example.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.