circuitpython/ports/stm32/boards/NUCLEO_H743ZI/board_init.c
iabdalkader fabfacf3d7 stm32/boards: Add new NUCLEO_H743ZI board configuration files.
USB serial and mass storage works, and the REPL is also available via the
UART through the on-board ST-LINK.
2018-03-09 15:08:11 +11:00

16 lines
470 B
C

#include STM32_HAL_H
void NUCLEO_H743ZI_board_early_init(void) {
GPIO_InitTypeDef GPIO_InitStructure;
__HAL_RCC_GPIOG_CLK_ENABLE();
// Turn off the USB switch
GPIO_InitStructure.Pin = GPIO_PIN_6;
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_PULLDOWN;
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOG, &GPIO_InitStructure);
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_6, GPIO_PIN_RESET);
}