mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
32 lines
750 B
C
32 lines
750 B
C
|
/*
|
||
|
* Copyright 2021 MindMotion Microelectronics Co., Ltd.
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/
|
||
|
|
||
|
#include "pin_init.h"
|
||
|
#include "hal_rcc.h"
|
||
|
#include "hal_gpio.h"
|
||
|
|
||
|
void BOARD_InitPins(void)
|
||
|
{
|
||
|
/* PB6 - UART1_TX. */
|
||
|
GPIO_Init_Type gpio_init;
|
||
|
gpio_init.Pins = GPIO_PIN_6;
|
||
|
gpio_init.PinMode = GPIO_PinMode_AF_PushPull;
|
||
|
gpio_init.Speed = GPIO_Speed_50MHz;
|
||
|
GPIO_Init(GPIOB, &gpio_init);
|
||
|
GPIO_PinAFConf(GPIOB, gpio_init.Pins, GPIO_AF_7);
|
||
|
|
||
|
/* PB7 - UART1_RX. */
|
||
|
gpio_init.Pins = GPIO_PIN_7;
|
||
|
gpio_init.PinMode = GPIO_PinMode_In_Floating;
|
||
|
gpio_init.Speed = GPIO_Speed_50MHz;
|
||
|
GPIO_Init(GPIOB, &gpio_init);
|
||
|
GPIO_PinAFConf(GPIOB, gpio_init.Pins, GPIO_AF_7);
|
||
|
}
|
||
|
|
||
|
|
||
|
/* EOF. */
|