|
-
-
- #include <Arduino.h>
- #include "HardwareSerial.h"
-
- #ifndef SERIAL7_TX_BUFFER_SIZE
- #define SERIAL7_TX_BUFFER_SIZE 40
- #endif
- #ifndef SERIAL7_RX_BUFFER_SIZE
- #define SERIAL7_RX_BUFFER_SIZE 64
- #endif
- #define IRQ_PRIORITY 64
-
- void IRQHandler_Serial7()
- {
- Serial7.IRQHandler();
- }
-
- void serial_event_check_serial7()
- {
- if (Serial7.available()) serialEvent7();
- }
-
-
-
- static BUFTYPE tx_buffer7[SERIAL7_TX_BUFFER_SIZE];
- static BUFTYPE rx_buffer7[SERIAL7_RX_BUFFER_SIZE];
-
- static HardwareSerial::hardware_t UART7_Hardware = {
- 6, IRQ_LPUART7, &IRQHandler_Serial7, &serial_event_check_serial7,
- CCM_CCGR5, CCM_CCGR5_LPUART7(CCM_CCGR_ON),
- 28,
- 29,
- 0xff,
- IOMUXC_LPUART7_RX_SELECT_INPUT,
- 2,
- 2,
- 0,
- 1,
-
- IRQ_PRIORITY, 38, 24,
- };
- HardwareSerial Serial7(&IMXRT_LPUART7, &UART7_Hardware, tx_buffer7, SERIAL7_TX_BUFFER_SIZE,
- rx_buffer7, SERIAL7_RX_BUFFER_SIZE);
-
-
- void serialEvent7() __attribute__((weak));
- void serialEvent7() {Serial7.disableSerialEvents(); }
|