

#ifdef        GLOBALS_BSP_CAN
    #define   EXTERN_BSP_CAN
    
#else
    #define   EXTERN_BSP_CAN     extern
#endif

#ifndef _BSP_CAN_H_
#define _BSP_CAN_H_

    #define     SJW_1Tq                  0
    #define     SJW_2Tq                  1
    #define     SJW_3Tq                  2
    #define     SAMP_1                   0
    #define     Seg1_11Tq                10
    #define     Seg1_12Tq                11
    #define     Seg1_8Tq                 7
    #define     Seg2_7Tq                 6
    #define     Seg2_8Tq                 7
    #define     Seg1_4Tq                 3
    #define     Seg1_5Tq                 4
    #define     Seg1_6Tq                 5
    #define     Seg2_1Tq                 0
    #define     Seg2_2Tq                 1
    #define     Seg2_3Tq                 2
    #define     Seg2_4Tq                 3
    #define     IDAM_2_32Bit             0
    #define     IDAM_4_16Bit             1
    #define     IDHIT0                   0
    #define     empoty                   0
    #define     full                     1
    #define     msg_full                 1
    #define     bit0_mask                1
    #define     bit1_mask                2
    #define     bit2_mask                4
    #define     bit3_mask                8
    #define     bit4_mask                16
    #define     bit5_mask                32
    #define     bit6_mask                64
    #define     bit7_mask                128
        #define               Register_Len				16 
        #define               CheckFlag                 0x55
     #define     KeyON                1    
     #define     KeyOFF                0

    #define     success      1
    #define     failt        0
    #define     qi           1
    #define     GET_EXTPGN(id)         (((((((INT32U)id&0xFF0000)>>16) >= 0xF0)?((INT32U)id & 0x00FF00):0)|((INT32U)id & 0x2FF0000)) >> 8)
    
    EXTERN_BSP_CAN               void    bsp_CAN_Init(void);    
    EXTERN_BSP_CAN          INT32U          bsp_GET_EXTEND_ID(INT8U *IDR0_Add);
    EXTERN_BSP_CAN               INT32U  bsp_GET_PGN(INT8U *IDR0_Add); 
    EXTERN_BSP_CAN               INT16U  bsp_GET_STAND_ID(INT8U *IDR0_Add);
    EXTERN_BSP_CAN               INT8U   bsp_GET_STAND_SA(INT8U *IDR3_Add); 
    EXTERN_BSP_CAN     interrupt void    bsp_CAN_Rev_isr(void); 
    EXTERN_BSP_CAN               INT32U   bsp_CANSendFrame (INT32U id,INT8U priority,INT8U length,INT8U *txdata);
     #if qi
    EXTERN_BSP_CAN               INT8U   bsp_CANSendExtFrame (INT32U id,INT8U priority,INT8U length,INT8U *txdata);
     #else
    EXTERN_BSP_CAN               INT8U   bsp_CANSendExtFrame(INT32U id,INT8U prio ,INT8U len,INT8U *dat);
    
     #endif

     	 	EXTERN_BSP_CAN		void            bsp_IIC_delay(void);
#endif /* _BSP_CAN_H_ */
