Microchip® Advanced Software Framework

lin.h File Reference
#include <avr32/io.h>
#include "compiler.h"
#include "usart.h"
#include "conf_lin.h"

Data Structures

struct  st_lin_message
 This structure allows to handle a LIN message and, at the end of the received/transmitted message, allows to call a function associated to this message, the update or the capture of "signals". More...
 

Macros

#define LIN_LAST_ERR_LENGHT   0x04
 Default length of the 'lin_last_error[]' array. More...
 
#define LIN_OVERLOAD_INT   ((U16)0x00FF)
 Error report definitions. More...
 
#define NUMBER_OF_LIN_FRAMES_NODE0   8
 
LIN Versions
#define LIN_2x   0
 Lin 2.x Version. More...
 
#define LIN_1x   1
 Lin 1.x Version. More...
 

Enumerations

enum  enum_lin_cmd {
  PUBLISH,
  SUBSCRIBE,
  IGNORE
}
 This enumeration is used to select an action for a specific message declared in st_lin_message structure. Note: XXX_STAND_BY keeps the direction (PUBLISH or SUBSCRIBE) for a message that will be IGNORE. When the 'stand_by' will be finished, PUBLISH_STAND_BY would become PUBLISH and SUBSCRIBE_STAND_BY would become SUBSCRIBE. An IGNORE message could become either PUBLISH or SUBSCRIBE. More...
 

Functions

U8 lin_init (bool master, U8 l_node, U16 b_rate, long pba_hz)
 This function initializes the LIN controller and, if needed, the LIN interrupts. More...
 
U8 lin_send_cmd (U8 l_node, U8 l_id, U8 l_len)
 This function commands the sending of the LIN header, MASTER task of MASTER node. More...
 

Variables

volatile st_lin_message lin_descript_list_node0 [NUMBER_OF_LIN_FRAMES_NODE0]
 Array of structure of type:'st_lin_message'. Default: 8 elements. More...
 
volatile U16 lin_error_number_node0
 Counter of LIN error. If an error clearly linked to a message (i.e. time-out) the status of this message is written with the error (LINERR). More...
 
volatile U8 lin_handle_node0
 Index in lin_descript_list[], 'lin_handle' is set after processing IDOK and verified once RXOK or TXOK rises. More...
 
volatile U16 lin_last_errors_node0 []
 Last error FIFO: lin_handle | status. Default: 4 elements. More...