11#if defined(ARDUINO_ARCH_ESP32)
25#if (LIN_SLAVE_ESP32_MAX_SERIAL >= 1)
32 void LIN_Slave_HardwareSerial_ESP32::_onSerialReceiveError0(hardwareSerial_error_t Err)
35 if ((Serial.peek() == 0x00) && (Err == UART_BREAK_ERROR))
46#if (LIN_SLAVE_ESP32_MAX_SERIAL >= 2)
53 void LIN_Slave_HardwareSerial_ESP32::_onSerialReceiveError1(hardwareSerial_error_t Err)
56 if ((Serial1.peek() == 0x00) && (Err == UART_BREAK_ERROR))
67#if (LIN_SLAVE_ESP32_MAX_SERIAL >= 3)
74 void LIN_Slave_HardwareSerial_ESP32::_onSerialReceiveError2(hardwareSerial_error_t Err)
77 if ((Serial2.peek() == 0x00) && (Err == UART_BREAK_ERROR))
165 #if (LIN_SLAVE_ESP32_MAX_SERIAL >= 1)
169 pSerial->onReceiveError(LIN_Slave_HardwareSerial_ESP32::_onSerialReceiveError0);
172 #if (LIN_SLAVE_ESP32_MAX_SERIAL >= 2)
176 pSerial->onReceiveError(LIN_Slave_HardwareSerial_ESP32::_onSerialReceiveError1);
179 #if (LIN_SLAVE_ESP32_MAX_SERIAL >= 3)
183 pSerial->onReceiveError(LIN_Slave_HardwareSerial_ESP32::_onSerialReceiveError2);
191 #if defined(LIN_SLAVE_DEBUG_SERIAL) && (LIN_SLAVE_DEBUG_LEVEL >= 2)
192 LIN_SLAVE_DEBUG_SERIAL.print(this->
nameLIN);
193 LIN_SLAVE_DEBUG_SERIAL.println(
": LIN_Slave_HardwareSerial_ESP32::begin()");
213 #if defined(LIN_SLAVE_DEBUG_SERIAL) && (LIN_SLAVE_DEBUG_LEVEL >= 2)
214 LIN_SLAVE_DEBUG_SERIAL.print(this->
nameLIN);
215 LIN_SLAVE_DEBUG_SERIAL.println(
": LIN_Slave_HardwareSerial_ESP32::end()");
LIN slave emulation library using a HardwareSerial interface of ESP32.
LIN slave node base class.
uint16_t baudrate
communication baudrate [Baud]
virtual void begin(uint16_t Baudrate=19200)
Open serial interface.
char nameLIN[LIN_SLAVE_BUFLEN_NAME]
LIN node name, e.g. for debug.
version_t
LIN protocol version.
virtual void end(void)
Close serial interface.
uint8_t pinTx
pin used for transmit
LIN_Slave_HardwareSerial_ESP32(HardwareSerial &Interface, uint8_t PinRx, uint8_t PinTx, LIN_Slave_Base::version_t Version=LIN_Slave_Base::LIN_V2, const char NameLIN[]="Slave", uint32_t TimeoutRx=1500L, const int8_t PinTxEN=INT8_MIN)
Class constructor.
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 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