mirror of
https://github.com/WeActStudio/ArduinoCore-AT32F4.git
synced 2026-05-21 01:12:00 +00:00
@@ -150,6 +150,30 @@ void HardwareSerial::begin(
|
||||
crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_USART3_PERIPH_CLOCK, TRUE);
|
||||
}
|
||||
else if(_USARTx == UART4)
|
||||
{
|
||||
GPIOx = GPIOA;
|
||||
Tx_Pin = GPIO_Pin_0;
|
||||
Rx_Pin = GPIO_Pin_1;
|
||||
USARTx_IRQn = UART4_IRQn;
|
||||
|
||||
crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_UART4_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK,TRUE);
|
||||
gpio_pin_remap_config(UART4_GMUX_0010, TRUE);
|
||||
}
|
||||
else if(_USARTx == UART5)
|
||||
{
|
||||
GPIOx = GPIOB;
|
||||
Tx_Pin = GPIO_Pin_9;
|
||||
Rx_Pin = GPIO_Pin_8;
|
||||
USARTx_IRQn = UART5_IRQn;
|
||||
|
||||
crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_UART5_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK,TRUE);
|
||||
gpio_pin_remap_config(UART5_GMUX_0001, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
@@ -290,3 +314,21 @@ extern "C" SERIAL_3_IRQ_HANDLER_DEF()
|
||||
Serial3.IRQHandler();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SERIAL_4_ENABLE
|
||||
HardwareSerial Serial4(SERIAL_4_UART);
|
||||
|
||||
extern "C" SERIAL_4_IRQ_HANDLER_DEF()
|
||||
{
|
||||
Serial4.IRQHandler();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SERIAL_5_ENABLE
|
||||
HardwareSerial Serial5(SERIAL_5_UART);
|
||||
|
||||
extern "C" SERIAL_5_IRQ_HANDLER_DEF()
|
||||
{
|
||||
Serial5.IRQHandler();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -126,4 +126,12 @@ extern HardwareSerial Serial2;
|
||||
extern HardwareSerial Serial3;
|
||||
#endif
|
||||
|
||||
#if SERIAL_4_ENABLE
|
||||
extern HardwareSerial Serial4;
|
||||
#endif
|
||||
|
||||
#if SERIAL_5_ENABLE
|
||||
extern HardwareSerial Serial5;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -54,6 +54,18 @@
|
||||
# define SERIAL_3_IRQ_HANDLER_DEF() void USART3_IRQHandler(void)
|
||||
#endif
|
||||
|
||||
#define SERIAL_4_ENABLE 1
|
||||
#if SERIAL_4_ENABLE
|
||||
# define SERIAL_4_UART UART4
|
||||
# define SERIAL_4_IRQ_HANDLER_DEF() void UART4_IRQHandler(void)
|
||||
#endif
|
||||
|
||||
#define SERIAL_5_ENABLE 1
|
||||
#if SERIAL_5_ENABLE
|
||||
# define SERIAL_5_UART UART5
|
||||
# define SERIAL_5_IRQ_HANDLER_DEF() void UART5_IRQHandler(void)
|
||||
#endif
|
||||
|
||||
/* Wire (Software I2C) */
|
||||
#define WIRE_USE_FULL_SPEED_I2C 0
|
||||
#define WIRE_SDA_PIN PB7
|
||||
|
||||
@@ -65,4 +65,4 @@ tools.Artery_ISP_Console.path={runtime.tools.Artery_ISP_Console.path}
|
||||
|
||||
tools.Artery_ISP_Console.upload.params.verbose=-d
|
||||
tools.Artery_ISP_Console.upload.params.quiet=
|
||||
tools.Artery_ISP_Console.upload.pattern=sh "{path}/{cmd}" "{build.path}/{build.project_name}.hex"
|
||||
tools.Artery_ISP_Console.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.hex"
|
||||
|
||||
Reference in New Issue
Block a user