LIN_slave_portable_Arduino 1.3
Arduino library for Local Interconnect Network slave node emulation
Loading...
Searching...
No Matches
LIN_slave_HardwareSerial_ESP8266.cpp
Go to the documentation of this file.
1
12// include files
14
15// assert ESP8266 platform
16#if defined(_LIN_SLAVE_HW_SERIAL_ESP8266_H_)
17
18
19/**************************
20 * PUBLIC METHODS
21**************************/
22
34 LIN_Slave_Base::version_t Version, const char NameLIN[], uint32_t TimeoutRx, const int8_t PinTxEN) :
35 LIN_Slave_HardwareSerial(Serial, MinFramePause, Version, NameLIN, TimeoutRx, PinTxEN)
36{
37 // Debug serial initialized in begin() -> no debug output here
38
39 // store parameters in class variables
40 this->swapPins = SwapPins; // use alternate pins Rx=D7 / Tx=D8 for Serial0
41
42} // LIN_Slave_HardwareSerial_ESP8266::LIN_Slave_HardwareSerial_ESP8266()
43
44
45
52{
53 // call parent class method
55
56 // optionally route Serial0 to alternate pins
57 if (this->swapPins == true)
58 this->pSerial->swap();
59
60 // print debug message
61 DEBUG_PRINT(2, "ok, pin swap=%d", (int) this->swapPins);
62
63} // LIN_Slave_HardwareSerial_ESP8266::begin()
64
65
66
72{
73 // call base class method
75
76 // close serial interface
77 this->pSerial->end();
78
79 // print debug message
80 DEBUG_PRINT(2, " ");
81
82} // LIN_Slave_HardwareSerial_ESP8266::end()
83
84#endif // _LIN_SLAVE_HW_SERIAL_ESP8266_H_
85
86/*-----------------------------------------------------------------------------
87 END OF FILE
88-----------------------------------------------------------------------------*/
LIN slave emulation library using a HardwareSerial interface of ESP8266.
version_t
LIN protocol version.
virtual void end(void)
Close serial interface.
LIN_Slave_HardwareSerial_ESP8266(bool SwapPins=false, uint16_t MinFramePause=1000L, 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 begin(uint16_t Baudrate=19200)
Open serial interface.
LIN slave node class via generic HardwareSerial.
HardwareSerial * pSerial
pointer to serial interface used for LIN
void begin(uint16_t Baudrate=19200)
Open serial interface.