Microchip® Advanced Software Framework

can.h File Reference
#include "conf_can.h"
#include "canif.h"
#include "compiler.h"
#include "preprocessor.h"

Data Structures

struct  can_mob_t
 

Macros

#define CAN_CMD_ACCEPTED   0x00
 This constant is used as return value for "can_cmd" function. More...
 
#define CAN_CMD_REFUSED   0xFF
 This constant is used as return value for "can_cmd" function. More...
 
#define CAN_DATA_FRAME   0
 This constant is used for MOB Initialization request. More...
 
#define CAN_MOB_NOT_ALLOCATED   0xFF
 This constant is used for MOB Allocation status. More...
 
#define CAN_REMOTE_FRAME   1
 This constant is used for MOB Initialization request. More...
 
#define CAN_STATUS_BUSOFF   0x04
 This constant is used as return value for "can_get_status" function. More...
 
#define CAN_STATUS_COMPLETED   0x00
 This constant is used as return value for "can_get_status" function. More...
 
#define CAN_STATUS_ERROR   0x02
 This constant is used as return value for "can_get_status" function. More...
 
#define CAN_STATUS_NOT_COMPLETED   0x01
 This constant is used as return value for "can_get_status" function. More...
 
#define CAN_STATUS_WAKEUP   0x03
 This constant is used as return value for "can_get_status" function. More...
 

Functions

void can_clear_status (U8 ch, U8 mob)
 Clear All Status on CAN Channel for a selected MOB. More...
 
U8 can_enable_interrupt (U8 ch)
 Enable interrupt on CAN Channel. More...
 
Union64 can_get_mob_data (U8 ch, U8 handle)
 Get Mob data from a selected MOB. More...
 
U8 can_get_mob_dlc (U8 ch, U8 handle)
 Get Mob dlc from a selected MOB. More...
 
U32 can_get_mob_id (U8 ch, U8 handle)
 Get Mob ID from a selected MOB. More...
 
U8 can_init (U8 ch, U32 can_msg_ram_add, U8 operating_mode, void(*can_msg_callback)(U8, U8))
 Initialize CAN channel. More...
 
U8 can_mob_alloc (U8 ch)
 Allocate one MOB in a specific CAN Channel. More...
 
U8 can_mob_free (U8 ch, U8 handle)
 Free one specific MOB in a specific CAN Channel. More...
 
U8 can_mob_get_status (U8 ch, U8 handle)
 Get Mob status from a selected MOB. More...
 
U8 can_rx (U8 ch, U8 handle, U8 req_type, const can_msg_t *can_msg)
 Start Reception. More...
 
U8 can_tx (U8 ch, U8 handle, U8 dlc, U8 req_type, const can_msg_t *can_msg)
 Start Transmission. More...