-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCANIO.def
47 lines (38 loc) · 1.16 KB
/
CANIO.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#define ALLOW_GET_CMD
;#define MODE_SELF_VERIFY
;#define NEAR_JUMP
#define HIGH_INT_VECT 0x808
#define LOW_INT_VECT 0x818
#define RESET_VECT 0x800
#define CAN_CD_BIT RXB0EIDH,0 ; AKHE changed *all* to EIDH from EIDL
#define CAN_PG_BIT RXB0EIDH,1
#define CANTX_CD_BIT TXB0EIDH,0
;
; Response messages are 0x14 (20) and 0x15 (21)
;
;
#define CAN_TXB0SIDH 0x00 ; TX buffer 0 ID
#define CAN_TXB0SIDL 0x08
#define CAN_TXB0EIDH 0x14
#define CAN_TXB0EIDL 0x00
;
; accept only class=0, type=16,17,18,19, origin=all
; all priorities, hardcoded or not.
;
#define CAN_RXF0SIDH 0x00 ; RX filter 0
#define CAN_RXF0SIDL 0x08
#define CAN_RXF0EIDH 0x10
#define CAN_RXF0EIDL 0x00
#define CAN_RXM0SIDH 0x0f ; RX mask 0
#define CAN_RXM0SIDL 0xff
#define CAN_RXM0EIDH 0xfc
#define CAN_RXM0EIDL 0x00
; 125 kbps, 32MHz XTAL, HL PLL
;#define CAN_BRGCON1 0x07 ; Data rate control
;#define CAN_BRGCON2 0xb8
;#define CAN_BRGCON3 0x05
; 125 kbps, 40MHz XTAL, HL PLL
#define CAN_BRGCON1 0x09 ; Data rate control
#define CAN_BRGCON2 0xb8
#define CAN_BRGCON3 0x05
#define CAN_CIOCON b'00100000' ; CAN IO control