|
-
-
- #include <Arduino.h>
- #include "HardwareSerial.h"
- #if defined(__IMXRT1052__)
-
- #ifndef SERIAL8_TX_BUFFER_SIZE
- #define SERIAL8_TX_BUFFER_SIZE 40
- #endif
- #ifndef SERIAL8_RX_BUFFER_SIZE
- #define SERIAL8_RX_BUFFER_SIZE 64
- #endif
- #define IRQ_PRIORITY 64
-
- void IRQHandler_Serial8()
- {
- Serial8.IRQHandler();
- }
-
- void serial_event_check_serial8()
- {
- if (Serial8.available()) serialEvent8();
- }
-
-
-
-
- static BUFTYPE tx_buffer8[SERIAL8_TX_BUFFER_SIZE];
- static BUFTYPE rx_buffer8[SERIAL8_RX_BUFFER_SIZE];
-
- static HardwareSerial::hardware_t UART5_Hardware = {
- 7, IRQ_LPUART5, &IRQHandler_Serial8, &serial_event_check_serial8,
- CCM_CCGR3, CCM_CCGR3_LPUART5(CCM_CCGR_ON),
- 30,
- 31,
- 0xff,
- IOMUXC_LPUART5_RX_SELECT_INPUT,
- 2,
- 2,
- 0,
- 0,
- IRQ_PRIORITY, 38, 24,
- };
- HardwareSerial Serial8(&IMXRT_LPUART5, &UART5_Hardware, tx_buffer8, SERIAL8_TX_BUFFER_SIZE,
- rx_buffer8, SERIAL8_RX_BUFFER_SIZE);
-
- void serialEvent8() __attribute__((weak));
- void serialEvent8() {Serial8.disableSerialEvents(); }
- #endif
|