| LIN_master_portable_Arduino 1.4 Arduino library for Local Interconnect Network master node emulation

Loading...
Searching...
No Matches
LIN_master_HardwareSerial.h
Go to the documentation of this file.
1
9/*-----------------------------------------------------------------------------
10 MODULE DEFINITION FOR MULTIPLE INCLUSION
11-----------------------------------------------------------------------------*/
12#ifndef _LIN_MASTER_HW_SERIAL_H_
13#define _LIN_MASTER_HW_SERIAL_H_
14
15
16/*-----------------------------------------------------------------------------
17 INCLUDE FILES
18-----------------------------------------------------------------------------*/
19
20// include required libraries
21#include <LIN_master_Base.h>
22
23
24/*-----------------------------------------------------------------------------
25 GLOBAL CLASS
26-----------------------------------------------------------------------------*/
32 class LIN_Master_HardwareSerial : public LIN_Master_Base
33{
34 // PROTECTED VARIABLES
35 protected:
36
37 HardwareSerial *pSerial;
38
39
40 // PROTECTED METHODS
41 protected:
42
44 LIN_Master_Base::state_t _sendBreak(void);
45
47 LIN_Master_Base::state_t _sendFrame(void);
48
50 LIN_Master_Base::state_t _receiveFrame(void);
51
52
53 // PUBLIC METHODS
54 public:
55
57 LIN_Master_HardwareSerial(HardwareSerial &Interface, const char NameLIN[] = "Master", const int8_t PinTxEN = INT8_MIN);
58
60 void begin(uint16_t Baudrate = 19200);
61
63 void end(void);
64
65}; // class LIN_Master_HardwareSerial
66
67
68/*-----------------------------------------------------------------------------
69 END OF MODULE DEFINITION FOR MULTIPLE INLUSION
70-----------------------------------------------------------------------------*/
71#endif // _LIN_MASTER_HW_SERIAL_H_
72
73/*-----------------------------------------------------------------------------
74 END OF FILE
75-----------------------------------------------------------------------------*/
LIN_master_Base.h
Base class for LIN master emulation (non-functional)
LIN_Master_Base
LIN master node base class.
Definition LIN_master_Base.h:106
LIN_Master_Base::state_t
state_t
state of LIN master state machine. Use bitmasks for fast checking multiple states
Definition LIN_master_Base.h:128
LIN_Master_HardwareSerial
LIN master node class via HardwareSerial.
Definition LIN_master_HardwareSerial.h:33
LIN_Master_HardwareSerial::end
void end(void)
Close serial interface.
Definition LIN_master_HardwareSerial.cpp:246
LIN_Master_HardwareSerial::pSerial
HardwareSerial * pSerial
serial interface used for LIN
Definition LIN_master_HardwareSerial.h:37
LIN_Master_HardwareSerial::begin
void begin(uint16_t Baudrate=19200)
Open serial interface.
Definition LIN_master_HardwareSerial.cpp:221
LIN_Master_HardwareSerial::_sendBreak
LIN_Master_Base::state_t _sendBreak(void)
Send LIN break.
Definition LIN_master_HardwareSerial.cpp:18
LIN_Master_HardwareSerial::_sendFrame
LIN_Master_Base::state_t _sendFrame(void)
Send LIN bytes (request frame: SYNC+ID+DATA[]+CHK; response frame: SYNC+ID)
Definition LIN_master_HardwareSerial.cpp:66
LIN_Master_HardwareSerial::_receiveFrame
LIN_Master_Base::state_t _receiveFrame(void)
Read and check LIN frame.
Definition LIN_master_HardwareSerial.cpp:132