|
-
-
- #include <Arduino.h>
- #include "HardwareSerial.h"
-
- #ifndef SERIAL5_TX_BUFFER_SIZE
- #define SERIAL5_TX_BUFFER_SIZE 40
- #endif
- #ifndef SERIAL5_RX_BUFFER_SIZE
- #define SERIAL5_RX_BUFFER_SIZE 64
- #endif
- #define IRQ_PRIORITY 64
-
-
- void IRQHandler_Serial5()
- {
- Serial5.IRQHandler();
- }
-
- static BUFTYPE tx_buffer5[SERIAL5_TX_BUFFER_SIZE];
- static BUFTYPE rx_buffer5[SERIAL5_RX_BUFFER_SIZE];
- uint8_t _serialEvent5_default __attribute__((weak)) PROGMEM = 0 ;
-
- static HardwareSerial::hardware_t UART8_Hardware = {
- 4, IRQ_LPUART8, &IRQHandler_Serial5,
- &serialEvent5, &_serialEvent5_default,
- CCM_CCGR6, CCM_CCGR6_LPUART8(CCM_CCGR_ON),
- #if defined(ARDUINO_TEENSY41)
- {{21,2, &IOMUXC_LPUART8_RX_SELECT_INPUT, 1}, {46, 2, &IOMUXC_LPUART8_RX_SELECT_INPUT, 0}},
- {{20,2, &IOMUXC_LPUART8_TX_SELECT_INPUT, 1}, {47, 2, &IOMUXC_LPUART8_TX_SELECT_INPUT, 0}},
- 43,
- 2,
- #else
- {{21,2, &IOMUXC_LPUART8_RX_SELECT_INPUT, 1}, {38, 2, &IOMUXC_LPUART8_RX_SELECT_INPUT, 0}},
- {{20,2, &IOMUXC_LPUART8_TX_SELECT_INPUT, 1}, {39, 2, &IOMUXC_LPUART8_TX_SELECT_INPUT, 0}},
- 35,
- 2,
- #endif
- IRQ_PRIORITY, 38, 24,
- XBARA1_OUT_LPUART8_TRG_INPUT
- };
- HardwareSerial Serial5(&IMXRT_LPUART8, &UART8_Hardware, tx_buffer5, SERIAL5_TX_BUFFER_SIZE,
- rx_buffer5, SERIAL5_RX_BUFFER_SIZE);
|