11#if defined(ARDUINO_ARCH_ESP32)
16#ifndef _LIN_SLAVE_HW_SERIAL_ESP32_H_
17#define _LIN_SLAVE_HW_SERIAL_ESP32_H_
33#if !defined(LIN_SLAVE_ESP32_MAX_SERIAL)
34 #define LIN_SLAVE_ESP32_MAX_SERIAL 3
39 #undef LIN_SLAVE_ESP32_MAX_SERIAL
40 #define LIN_SLAVE_ESP32_MAX_SERIAL 2
68 #if (LIN_SLAVE_ESP32_MAX_SERIAL >= 1)
70 static void _onSerialReceiveError0(hardwareSerial_error_t Err);
72 #error no HardwareSerial available for this board
74 #if (LIN_SLAVE_ESP32_MAX_SERIAL >= 2)
76 static void _onSerialReceiveError1(hardwareSerial_error_t Err);
78 #if (LIN_SLAVE_ESP32_MAX_SERIAL >= 3)
80 static void _onSerialReceiveError2(hardwareSerial_error_t Err);
112 void begin(uint16_t Baudrate = 19200);
Base class for LIN slave emulation (non-functional)
LIN slave node base class.
version_t
LIN protocol version.
@ LIN_V2
LIN protocol version 2.x.
LIN slave node class via ESP32 HardwareSerial.
uint8_t pinTx
pin used for transmit
bool available(void)
check if a byte is available in Rx buffer
void end(void)
Close serial interface.
HardwareSerial * pSerial
pointer to serial interface used for LIN
static bool flagBreak[LIN_SLAVE_ESP32_MAX_SERIAL]
break flags for Serial0..N
void begin(uint16_t Baudrate=19200)
Open serial interface.
uint8_t _serialPeek(void)
peek next byte from Rx buffer
void _serialWrite(uint8_t buf[], uint8_t num)
write bytes to Tx buffer
uint8_t pinRx
pin used for receive
bool _getBreakFlag(void)
Get break detection flag.
void _resetBreakFlag(void)
Clear break detection flag.
uint8_t idxSerial
index to flagBreak[] of this instance
uint8_t _serialRead(void)
read next byte from Rx buffer