LIN_slave_portable_Arduino 1.4
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// assert ESP8266 platform
13#if defined(ARDUINO_ARCH_ESP8266)
14
15// include files
17
18
19
20/**************************
21 * PUBLIC METHODS
22**************************/
23
35 LIN_Slave_Base::version_t Version, const char NameLIN[], uint32_t TimeoutRx, const int8_t PinTxEN) :
36 LIN_Slave_HardwareSerial(Serial, MinFramePause, Version, NameLIN, TimeoutRx, PinTxEN)
37{
38 // Debug serial initialized in begin() -> no debug output here
39
40 // store parameters in class variables
41 this->swapPins = SwapPins; // use alternate pins Rx=D7 / Tx=D8 for Serial0
42
43} // LIN_Slave_HardwareSerial_ESP8266::LIN_Slave_HardwareSerial_ESP8266()
44
45
46
53{
54 // call parent class method
56
57 // optionally route Serial0 to alternate pins
58 if (this->swapPins == true)
59 this->pSerial->swap();
60
61 // print debug message
62 DEBUG_PRINT(2, "ok, pin swap=%d", (int) this->swapPins);
63
64} // LIN_Slave_HardwareSerial_ESP8266::begin()
65
66
67
73{
74 // call base class method
76
77 // close serial interface
78 this->pSerial->end();
79
80 // print debug message
81 DEBUG_PRINT(2, " ");
82
83} // LIN_Slave_HardwareSerial_ESP8266::end()
84
85#endif // ARDUINO_ARCH_ESP8266
86
87/*-----------------------------------------------------------------------------
88 END OF FILE
89-----------------------------------------------------------------------------*/
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.