Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

can_lib.h

Go to the documentation of this file.
00001 
00016 #ifndef _CAN_LIB_H_
00017 #define _CAN_LIB_H_
00018 
00019 /*_____ I N C L U D E - F I L E S ____________________________________________*/
00020 
00021 #include "can_drv.h"
00022 
00023 
00024 
00025 /*_____ C O N S T A N T E S - D E F I N I T I O N  ___________________________*/
00030 #define CAN_CMD_REFUSED  0xFF
00031 
00035 #define CAN_CMD_ACCEPTED 0x00
00036 
00041 #define CAN_STATUS_COMPLETED     0x00
00042 
00046 #define CAN_STATUS_NOT_COMPLETED 0x01
00047 
00051 #define CAN_STATUS_DISABLED      0x02
00052 
00053 
00054 
00055 /*_____ T Y P E D E F - D E C L A R A T I O N ________________________________*/
00060 typedef enum {
00061   CMD_TX,
00062   CMD_TX_REMOTE,
00063   CMD_RX, 
00064   CMD_ABORT
00065 } can_cmd_t; 
00066 
00071 typedef union{
00072   Uint32 ext;
00073   Uint16 std;
00074   Uchar  tab[4];
00075 } can_id_t; 
00076 
00081 typedef struct{
00082   Uchar rtr : 1;
00083   Uchar ide : 1;
00084   Uchar dummy :6;
00085 } can_ctrl_t;
00086 
00101 typedef  struct{
00102   Uchar      handle; 
00103   can_cmd_t  cmd; 
00104   can_id_t   id;
00105   Uchar      dlc;  
00106   Uchar*    pt_data; 
00107   Uchar      status; 
00108   can_ctrl_t ctrl;   
00109 } st_cmd_t;
00110 
00111 
00112 /*_____ P R O T O T Y P E S - D E C L A R A T I O N __________________________*/
00127 extern void   can_init(void);
00154 extern Uchar  can_cmd (st_cmd_t *);
00164 extern Uchar  can_getstatus (st_cmd_t *); 
00165 
00166 
00167 
00168 #endif /* _CAN_LIB_H_ */

Generated on Thu Apr 1 15:49:28 2004 for Library CAN by doxygen 1.3.6