LIN_master  0.1
Arduino LIN master emulation with preemptive background operation
LIN_master1.cpp
Go to the documentation of this file.
1 
11 // include files
12 #include "Arduino.h"
13 #include "LIN_master1.h"
14 
15 
18 
19 
25 {
26  // store used serial interface
27  pSerial = &Serial1; // store pointer to used serial
28  #if defined(__AVR__) // on AVR also store "double baudrate" control register (for sync break)
29  UCSRA = &UCSR1A;
30  #endif
31 
32  // store callback functions for task scheduler
36 
37  // for debug store class name for convenience
38  #if (LIN_DEBUG_LEVEL != 0)
39  sprintf(serialName, "LIN_Master_1");
40  #endif
41 
42 } // LIN_Master_1::LIN_Master_1()
43 
44 
45 
51 void LIN_master1_send(void)
52 {
53  // call class method
54  LIN_master1.handlerSend();
55 
56 } // LIN_master1_send
57 
58 
59 
66 {
67  // call class method
68  LIN_master1.handlerReceive();
69 
70 } // LIN_master1_receive
71 
72 
73 
79 void LIN_master1_copy(uint8_t numData, uint8_t *data)
80 {
81  // copy received data to user buffer
82  LIN_master1.defaultCallback(numData, data);
83 
84 } // LIN_master1_copy
LIN_Master_1()
class constructor
Definition: LIN_master1.cpp:24
void defaultCallback(uint8_t numData, uint8_t *data)
receive callback function to copy data to buffer
Definition: LIN_master.cpp:664
void(* wrapperDefaultCallback)(uint8_t, uint8_t *)
wrapper for default receive callback function
Definition: LIN_master.h:115
LIN master emulation library for Serial1.
void handlerSend(void)
LIN master receive handler for task scheduler.
Definition: LIN_master.cpp:378
void handlerReceive(void)
send handler for task scheduler
Definition: LIN_master.cpp:481
void LIN_master1_copy(uint8_t numData, uint8_t *data)
Wrapper for LIN_master1 default receive callback function.
Definition: LIN_master1.cpp:79
void LIN_master1_send(void)
Wrapper for LIN_master1 transmission handler.
Definition: LIN_master1.cpp:51
void LIN_master1_receive(void)
Wrapper for LIN_master1 reception handler.
Definition: LIN_master1.cpp:65
void(* wrapperReceive)(void)
wrapper for reception handler (for task scheduler)
Definition: LIN_master.h:114
LIN master node class.
Definition: LIN_master1.h:38
void(* wrapperSend)(void)
wrapper for transmission handler (for task scheduler)
Definition: LIN_master.h:113
LIN_Master_1 LIN_master1
instance of LIN master via Serial1
Definition: LIN_master1.cpp:17
HardwareSerial * pSerial
pointer to used serial
Definition: LIN_master.h:109