LIN_master_portable_Arduino 1.9
Arduino library for Local Interconnect Network master node emulation
Loading...
Searching...
No Matches
LIN_master_HardwareSerial_STM32.h
Go to the documentation of this file.
1
9// assert STM32 platform
10#if defined(ARDUINO_ARCH_STM32)
11
12/*-----------------------------------------------------------------------------
13 MODULE DEFINITION FOR MULTIPLE INCLUSION
14-----------------------------------------------------------------------------*/
15#ifndef _LIN_MASTER_HW_SERIAL_STM32_H_
16#define _LIN_MASTER_HW_SERIAL_STM32_H_
17
18
19/*-----------------------------------------------------------------------------
20 INCLUDE FILES
21-----------------------------------------------------------------------------*/
22
23// include required libraries
24#include <LIN_master_Base.h>
25
26
27/*-----------------------------------------------------------------------------
28 GLOBAL CLASS
29-----------------------------------------------------------------------------*/
36{
37 // PROTECTED VARIABLES
38 protected:
39
40 HardwareSerial *pSerial;
41 UART_HandleTypeDef *huart;
42 uint32_t pinRx;
43 uint32_t pinTx;
44 #if !defined(USART_CR2_LINEN)
45 uint32_t brr;
46 #endif
47
48 // PROTECTED METHODS
49 protected:
50
53
56
59
60
61 // PUBLIC METHODS
62 public:
63
65 LIN_Master_HardwareSerial_STM32(HardwareSerial &Interface, uint32_t PinRx, uint32_t PinTx,
66 const char NameLIN[] = "Master", const int8_t PinTxEN = INT8_MIN);
67
69 void begin(uint16_t Baudrate = 19200);
70
72 void end(void);
73
74}; // class LIN_master_HardwareSerial_STM32
75
76
77/*-----------------------------------------------------------------------------
78 END OF MODULE DEFINITION FOR MULTIPLE INLUSION
79-----------------------------------------------------------------------------*/
80#endif // _LIN_MASTER_HW_SERIAL_STM32_H_
81
82#endif // ARDUINO_ARCH_STM32
83
84/*-----------------------------------------------------------------------------
85 END OF FILE
86-----------------------------------------------------------------------------*/
Base class for LIN master emulation (non-functional)
LIN master node base class.
state_t
state of LIN master state machine. Use bitmasks for fast checking multiple states
LIN master node class via STM32 HardwareSerial.
UART_HandleTypeDef * huart
pointer to underlying HAL UART handle
LIN_Master_Base::state_t _sendBreak(void)
Send LIN break.
void begin(uint16_t Baudrate=19200)
Open serial interface.
LIN_Master_Base::state_t _receiveFrame(void)
Read and check LIN frame.
LIN_Master_Base::state_t _sendFrame(void)
Send LIN bytes (request frame: SYNC+ID+DATA[]+CHK; response frame: SYNC+ID)
HardwareSerial * pSerial
serial interface used for LIN
uint32_t brr
BRR value if LIN mode is not available.