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 pSerial->swap();
60
61 // optional debug output (debug level 2)
62 #if defined(LIN_SLAVE_DEBUG_SERIAL) && (LIN_SLAVE_DEBUG_LEVEL >= 2)
63 LIN_SLAVE_DEBUG_SERIAL.print(this->nameLIN);
64 LIN_SLAVE_DEBUG_SERIAL.println(": LIN_Slave_HardwareSerial_ESP8266::begin()");
65 #endif
66
67} // LIN_Slave_HardwareSerial_ESP8266::begin()
68
69
70
76{
77 // call base class method
79
80 // close serial interface
81 pSerial->end();
82
83 // optional debug output (debug level 2)
84 #if defined(LIN_SLAVE_DEBUG_SERIAL) && (LIN_SLAVE_DEBUG_LEVEL >= 2)
85 LIN_SLAVE_DEBUG_SERIAL.print(this->nameLIN);
86 LIN_SLAVE_DEBUG_SERIAL.println(": LIN_Slave_HardwareSerial_ESP8266::end()");
87 #endif
88
89} // LIN_Slave_HardwareSerial_ESP8266::end()
90
91#endif // ARDUINO_ARCH_ESP8266
92
93/*-----------------------------------------------------------------------------
94 END OF FILE
95-----------------------------------------------------------------------------*/
LIN slave emulation library using a HardwareSerial interface of ESP8266.
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.
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.