| 1 |
#include STM32_HAL_H |
| 2 |
|
| 3 |
void NETDUINO_PLUS_2_board_early_init(void) { |
| 4 |
|
| 5 |
__HAL_RCC_GPIOB_CLK_ENABLE(); |
| 6 |
|
| 7 |
// Turn off the backlight. LCD_BL_CTRL = PK3 |
| 8 |
GPIO_InitTypeDef GPIO_InitStructure; |
| 9 |
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH; |
| 10 |
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; |
| 11 |
GPIO_InitStructure.Pull = GPIO_PULLUP; |
| 12 |
|
| 13 |
#if MICROPY_HW_ENABLE_SDCARD |
| 14 |
// Turn on the power enable for the sdcard (PB1) |
| 15 |
GPIO_InitStructure.Pin = GPIO_PIN_1; |
| 16 |
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure); |
| 17 |
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET); |
| 18 |
#endif |
| 19 |
|
| 20 |
// Turn on the power for the 5V on the expansion header (PB2) |
| 21 |
GPIO_InitStructure.Pin = GPIO_PIN_2; |
| 22 |
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure); |
| 23 |
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_SET); |
| 24 |
} |