mirror of
https://github.com/WeActStudio/ArduinoCore-AT32F4.git
synced 2026-05-21 01:12:00 +00:00
@@ -184,6 +184,8 @@ void HardwareSerial::begin(
|
||||
|
||||
crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_USART6_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
|
||||
gpio_pin_remap_config(USART6_GMUX, TRUE);
|
||||
}
|
||||
else if (_USARTx == UART7)
|
||||
{
|
||||
@@ -214,12 +216,18 @@ void HardwareSerial::begin(
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_default_para_init(&gpio_init_struct);
|
||||
gpio_init_struct.gpio_pins = Tx_Pin | Rx_Pin;
|
||||
gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
|
||||
gpio_init_struct.gpio_pins = Tx_Pin;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init(GPIOx, &gpio_init_struct);
|
||||
|
||||
gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
|
||||
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
|
||||
gpio_init_struct.gpio_pins = Rx_Pin;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_UP;
|
||||
gpio_init(GPIOx, &gpio_init_struct);
|
||||
|
||||
usart_init(_USARTx, baudRate, SERIAL_ConfigGrp[config].data_bit, SERIAL_ConfigGrp[config].stop_bit);
|
||||
|
||||
@@ -138,9 +138,11 @@ extern HardwareSerial Serial5;
|
||||
#if SERIAL_6_ENABLE
|
||||
extern HardwareSerial Serial6;
|
||||
#endif
|
||||
|
||||
#if SERIAL_7_ENABLE
|
||||
extern HardwareSerial Serial7;
|
||||
#endif
|
||||
|
||||
#if SERIAL_8_ENABLE
|
||||
extern HardwareSerial Serial8;
|
||||
#endif
|
||||
|
||||
@@ -270,8 +270,8 @@ void GPIOx_Init(
|
||||
*/
|
||||
void GPIO_JTAG_Disable(void)
|
||||
{
|
||||
// RCC_APB2PeriphClockCmd(RCC_APB2PERIPH_AFIO, ENABLE);
|
||||
// GPIO_PinsRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
|
||||
crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
|
||||
gpio_pin_remap_config(SWJTAG_GMUX_010, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@ void Core_Init(void)
|
||||
{
|
||||
system_clock_config();
|
||||
nvic_priority_group_config(NVIC_PRIORITY_GROUP_2);
|
||||
// GPIO_JTAG_Disable();
|
||||
GPIO_JTAG_Disable();
|
||||
Delay_Init();
|
||||
ADCx_Init(ADC1);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
{
|
||||
"name": "AT32F403ACGU7 Core Board",
|
||||
"architecture": "at32f403a",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.9",
|
||||
"category": "Contributed",
|
||||
"url": "https://github.com/WeActStudio/ArduinoCore-AT32F4/archive/refs/heads/main.zip",
|
||||
"archiveFileName": "ArduinoCore-AT32F4-main.zip",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
##==============================================##
|
||||
name=WeActStudio AT32F403A Boards
|
||||
version=0.0.8
|
||||
version=0.0.9
|
||||
##==============================================##
|
||||
|
||||
####AT32 compile variables
|
||||
|
||||
Reference in New Issue
Block a user