Subversion Repositories HomeAutomation

Rev

Rev 250 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 250 Rev 253
Line 63... Line 63...
63
        /* read as 32bit unsigned data */
63
        /* read as 32bit unsigned data */
64
        uint32_t dwords[2];
64
        uint32_t dwords[2];
65
    } Data;
65
    } Data;
66
} Can_Message_t;
66
} Can_Message_t;
67
 
67
 
-
 
68
//---------------------------------------------------------------------------
-
 
69
// CAN ID definitions
68
 
70
 
-
 
71
#define CAN_MASK_CLASS      0x1E000000
-
 
72
#define CAN_SHIFT_CLASS     25
69
/*-----------------------------------------------------------------------------
73
//------------------------------------
-
 
74
#define CAN_NMT             0x00UL
-
 
75
#define CAN_MASK_NMT_TYPE   0x01F00000
-
 
76
#define CAN_SHIFT_NMT_TYPE  20
-
 
77
#define CAN_MASK_NMT_NID    0x000F0000
-
 
78
#define CAN_SHIFT_NMT_NID   16
-
 
79
#define CAN_MASK_NMT_SID    0x0000FF00
-
 
80
#define CAN_SHIFT_NMT_SID   8
-
 
81
#define CAN_MASK_NMT_RID    0x000000FF
70
 * Public Function Prototypes
82
#define CAN_SHIFT_NMT_RID   0
-
 
83
#define CAN_NMT_RESET       0x00UL
-
 
84
#define CAN_NMT_BIOS_START  0x01UL  //D0: VER7:0, D1:VER15:8, D2: 0 if no app, >0 if app
-
 
85
#define CAN_NMT_PGM_START   0x02UL  //D0: ADR7:0, D1:ADR15:8, D2:ADR23:16, D3:ADR31:24
-
 
86
#define CAN_NMT_PGM_DATA    0x03UL  //D0: OFS7:0, D1: OFS15:8, D(n+2): DATAn7:0 [n=0..x] [x=0..5]
-
 
87
#define CAN_NMT_PGM_END     0x04UL  //D0: CRC7:0, D1: CRC15:8
-
 
88
#define CAN_NMT_PGM_ACK     0x05UL  //D0: OFS7:0, D1: OFS15:8
-
 
89
#define CAN_NMT_PGM_NACK    0x06UL  //D0: OFS7:0, D1: OFS15:8
-
 
90
#define CAN_NMT_START_APP   0x07UL
-
 
91
#define CAN_NMT_APP_START   0x08UL  //D0: ID7:0, D1:ID15:8, D2: VER7:0, D3:VER15:8
-
 
92
#define CAN_NMT_HEARTBEAT   0x09UL
71
 *---------------------------------------------------------------------------*/
93
//------------------------------------
72
 
-
 
-
 
94
#define CAN_SNS             0x02UL
-
 
95
#define CAN_MASK_SNS_FUNCC  0x01FF8000
73
//Can_Return_t Can_Init(void);
96
#define CAN_SHIFT_SNS_FUNCC 15
74
//Can_Return_t Can_Send(Can_Message_t* msg);
97
#define CAN_MASK_SNS_NID    0x00007E00
75
//void Can_Service(void);
98
#define CAN_SHIFT_SNS_NID   9
76
//Can_Return_t Can_Receive(Can_Message_t *msg);
99
#define CAN_MASK_SNS_SID    0x000001FF
-
 
100
#define CAN_SHIFT_SNS_SID   0
-
 
101
//------------------------------------
-
 
102
#define CAN_PKT             0x0c000000
-
 
103
//------------------------------------
-
 
104
#define CAN_CON             0x10000000
-
 
105
//------------------------------------
-
 
106
#define CAN_TST             0x1E000000
-
 
107
//------------------------------------
77
 
108
 
78
#endif
109
#endif