Browse Source
And update the GPIO init for NUCLEO_H743ZI to consistently use the mphal functions.pull/3829/head
rolandvs
7 years ago
committed by
Damien George
4 changed files with 16 additions and 11 deletions
@ -0,0 +1,8 @@ |
|||
#include "py/mphal.h" |
|||
|
|||
void NUCLEO_F767ZI_board_early_init(void) { |
|||
// Turn off the USB switch
|
|||
#define USB_PowerSwitchOn pin_G6 |
|||
mp_hal_pin_output(USB_PowerSwitchOn); |
|||
mp_hal_pin_low(USB_PowerSwitchOn); |
|||
} |
|
@ -1,15 +1,8 @@ |
|||
#include STM32_HAL_H |
|||
#include "py/mphal.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); |
|||
#define USB_PowerSwitchOn pin_G6 |
|||
mp_hal_pin_output(USB_PowerSwitchOn); |
|||
mp_hal_pin_low(USB_PowerSwitchOn); |
|||
} |
|||
|
Loading…
Reference in new issue