STM32: RESET GPIO during init is configurable

Default value is disabled
pull/14032/head
jeromecoutant 2020-12-11 16:56:20 +01:00
parent 9c0cfa9a44
commit d689e90917
2 changed files with 11 additions and 0 deletions

View File

@ -94,6 +94,7 @@ MBED_WEAK void TargetBSP_Init(void) {
/** Do nothing */
}
#if MBED_CONF_TARGET_GPIO_RESET_AT_INIT
void GPIO_Full_Init(void) {
GPIO_InitTypeDef GPIO_InitStruct;
@ -160,6 +161,7 @@ void GPIO_Full_Init(void) {
__HAL_RCC_GPIOK_CLK_DISABLE();
#endif
}
#endif
// This function is called after RAM initialization and before main.
void mbed_sdk_init()
@ -309,8 +311,10 @@ void mbed_sdk_init()
#endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */
#endif /* DEVICE_RTC */
#if MBED_CONF_TARGET_GPIO_RESET_AT_INIT
/* Reset all GPIO */
GPIO_Full_Init();
#endif
/* BSP initialization hook (external RAM, etc) */
TargetBSP_Init();

View File

@ -1157,6 +1157,10 @@
"lpticker_lptim_clock": {
"help": "Default value for LPTIM clock (lpticker_lptim == 1). Value is the dividing factor. Choose 1, 2 or 4",
"value": 1
},
"gpio_reset_at_init": {
"help": "if value set, all GPIO are reset during init",
"value": false
}
},
"overrides": {
@ -3200,6 +3204,9 @@
"macro_name": "CLOCK_SOURCE"
}
},
"overrides": {
"gpio_reset_at_init": true
},
"device_has_add": [
"ANALOGOUT",
"SERIAL_ASYNCH",