LIN_master  0.1
Arduino LIN master emulation with preemptive background operation
LIN_master.h File Reference

Base class for LIN master emulation. More...

#include "Arduino.h"
#include "Tasks.h"

Go to the source code of this file.

Data Structures

class  LIN_Master
 LIN master node base class. More...
 

Macros

#define LIN_DEBUG_SERIAL   Serial
 Serial interface used for debug output.
 
#define LIN_DEBUG_LEVEL   0
 Debug level (0=no output, 1=error msg, 2=sent/received bytes)
 

Typedefs

typedef void(* decoder_t) (uint8_t, uint8_t *)
 typedef for data decoder to hadle received data
 

Enumerations

enum  LIN_version_t { LIN_V1 = 1, LIN_V2 = 2 }
 LIN version of checksum. More...
 
enum  LIN_frame_t { LIN_MASTER_REQUEST = 1, LIN_SLAVE_RESPONSE = 2 }
 LIN frame type. More...
 
enum  LIN_error_t {
  LIN_SUCCESS = 0x00, LIN_ERROR_STATE = 0x01, LIN_ERROR_ECHO = 0x02, LIN_ERROR_TIMEOUT = 0x04,
  LIN_ERROR_CHK = 0x08, LIN_ERROR_MISC = 0x80
}
 LIN communication error codes. More...
 
enum  LIN_status_t { LIN_STATE_OFF = 0, LIN_STATE_IDLE = 1, LIN_STATE_BREAK = 2, LIN_STATE_FRAME = 3 }
 state of LIN master state machine More...
 

Detailed Description

Base class for LIN master emulation.

This library provides the base class for a master node emulation of a LIN bus. For an explanation of the LIN bus and protocol e.g. see https://en.wikipedia.org/wiki/Local_Interconnect_Network

Author
Georg Icking-Konert
Date
2020-03-14
Version
0.1

Definition in file LIN_master.h.

Enumeration Type Documentation

◆ LIN_error_t

LIN communication error codes.

Enumerator
LIN_SUCCESS 

no error

LIN_ERROR_STATE 

error in LIN state machine

LIN_ERROR_ECHO 

error reading LIN echo

LIN_ERROR_TIMEOUT 

LIN receive timeout.

LIN_ERROR_CHK 

LIN checksum error.

LIN_ERROR_MISC 

misc error, should not occur

Definition at line 67 of file LIN_master.h.

◆ LIN_frame_t

LIN frame type.

Enumerator
LIN_MASTER_REQUEST 

LIN protocol version 1.

LIN_SLAVE_RESPONSE 

LIN protocol version 2.

Definition at line 58 of file LIN_master.h.

◆ LIN_status_t

state of LIN master state machine

Enumerator
LIN_STATE_OFF 

LIN instance inactive.

LIN_STATE_IDLE 

no LIN transmission ongoing

LIN_STATE_BREAK 

break is being transmitted

LIN_STATE_FRAME 

frame is being transmitted

Definition at line 80 of file LIN_master.h.

◆ LIN_version_t

LIN version of checksum.

Enumerator
LIN_V1 

LIN protocol version 1.

LIN_V2 

LIN protocol version 2.

Definition at line 49 of file LIN_master.h.