Commit b3436873 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

configure baseboard wake pin

parent 62988474
......@@ -98,6 +98,16 @@ void gpio_init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(BASEBOARD_ENABLE_GPIO_Port, &GPIO_InitStruct);
/* configure baseboard wake pin as output low */
HAL_GPIO_DeInit(BASEBOARD_WAKE_GPIO_Port, BASEBOARD_WAKE_Pin);
HAL_GPIO_WritePin(BASEBOARD_WAKE_GPIO_Port, BASEBOARD_WAKE_Pin, GPIO_PIN_RESET);
GPIO_InitStruct.Pin = BASEBOARD_WAKE_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(BASEBOARD_WAKE_GPIO_Port, &GPIO_InitStruct);
/* configure COM_PROG and COM_PROG2 as output */
HAL_GPIO_DeInit(BASEBOARD_EXT3_SWITCH_GPIO_Port, BASEBOARD_EXT3_SWITCH_Pin);
HAL_GPIO_DeInit(BASEBOARD_DEBUG_GPIO_Port, BASEBOARD_DEBUG_Pin);
......
......@@ -67,6 +67,7 @@
#define BASEBOARD_IS_ENABLED() PIN_STATE(BASEBOARD_ENABLE)
#define BASEBOARD_ENABLE() PIN_SET(BASEBOARD_ENABLE)
#define BASEBOARD_DISABLE() PIN_CLR(BASEBOARD_ENABLE)
#define BASEBOARD_WAKE() PIN_CLR(BASEBOARD_WAKE); PIN_SET(BASEBOARD_WAKE); delay_us(100); PIN_CLR(BASEBOARD_WAKE)
#endif /* BASEBOARD */
#ifndef BASEBOARD
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment