-
-
- #include <Arduino.h>
- #include "HardwareSerial.h"
-
- #ifndef SERIAL6_TX_BUFFER_SIZE
- #define SERIAL6_TX_BUFFER_SIZE 40
- #endif
- #ifndef SERIAL6_RX_BUFFER_SIZE
- #define SERIAL6_RX_BUFFER_SIZE 64
- #endif
- #define IRQ_PRIORITY 64
-
- void IRQHandler_Serial6()
- {
- Serial6.IRQHandler();
- }
-
- void serial_event_check_serial6()
- {
- if (Serial6.available()) serialEvent6();
- }
-
-
-
- static BUFTYPE tx_buffer6[SERIAL6_TX_BUFFER_SIZE];
- static BUFTYPE rx_buffer6[SERIAL6_RX_BUFFER_SIZE];
- uint32_t IOMUXC_LPUART1_RX_SELECT_INPUT;
-
- static HardwareSerial::hardware_t UART1_Hardware = {
- 5, IRQ_LPUART1, &IRQHandler_Serial6, &serial_event_check_serial6,
- CCM_CCGR5, CCM_CCGR5_LPUART1(CCM_CCGR_ON),
- 25,
- 24,
- 0xff,
- IOMUXC_LPUART1_RX_SELECT_INPUT,
- 2,
- 2,
- 0,
- 0,
- IRQ_PRIORITY, 38, 24,
-
- };
-
- HardwareSerial Serial6(&IMXRT_LPUART1, &UART1_Hardware, tx_buffer6, SERIAL6_TX_BUFFER_SIZE,
- rx_buffer6, SERIAL6_RX_BUFFER_SIZE);
-
- void serialEvent6() __attribute__((weak));
- void serialEvent6() {Serial6.disableSerialEvents(); }
|