Subversion Repositories HomeAutomation

Rev

Rev 270 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 270 Rev 800
1
#ifndef __COMPILER_H
1
#ifndef __COMPILER_H
2
#define __COMPILER_H
2
#define __COMPILER_H
3
 
3
 
4
#define UART_START_BYTE 253
4
#define UART_START_BYTE 253
5
#define UART_END_BYTE 250
5
#define UART_END_BYTE 250
6
#define PACKET_LENGTH 17
6
#define PACKET_LENGTH 17
7
 
7
 
8
//<FUNCT>
8
//<FUNCT>
9
#define FUNCT_BOOTLOADER 0x0
9
#define FUNCT_BOOTLOADER 0x0
10
 
10
 
11
//<FUNCC> configuration packet
11
//<FUNCC> configuration packet
12
#define FUNCC_BOOT_INIT 0x01 //för att initiera en programmering.
12
#define FUNCC_BOOT_INIT 0x01 //för att initiera en programmering.
13
#define FUNCC_BOOT_ADDR 0x02  //för att ändra adress.
13
#define FUNCC_BOOT_ADDR 0x02  //för att ändra adress.
14
#define FUNCC_BOOT_DONE 0x05  //för att avsluta en programmering.
14
#define FUNCC_BOOT_DONE 0x05  //för att avsluta en programmering.
15
 
15
 
16
//<FUNCC> program packet
16
//<FUNCC> program packet
17
#define FUNCC_BOOT_PGM 0x03 //för att indikera att detta är programdata som ska skrivas.
17
#define FUNCC_BOOT_PGM 0x03 //för att indikera att detta är programdata som ska skrivas.
18
 
18
 
19
//<FUNCC> ack packet
19
//<FUNCC> ack packet
20
#define FUNCC_BOOT_ACK 0x04 //för att indikera att detta är en ACK.
20
#define FUNCC_BOOT_ACK 0x04 //för att indikera att detta är en ACK.
21
 
21
 
22
#define MY_ID 0x91 
22
#define MY_ID 0x91 
23
#define MY_NID 0x00
23
#define MY_NID 0x00
24
#define TARGET_ID 0x78
24
#define TARGET_ID 0x78
25
 
25
 
26
#define ADDRL_INDEX 0
26
#define ADDRL_INDEX 0
27
#define ADDRH_INDEX 1
27
#define ADDRH_INDEX 1
28
#define ADDRU_INDEX 2
28
#define ADDRU_INDEX 2
29
#define RID_INDEX 4
29
#define RID_INDEX 4
30
#define ERR_INDEX 4
30
#define ERR_INDEX 4
31
 
31
 
32
//<ERR> 8 bitar feltyp
32
//<ERR> 8 bitar feltyp
33
#define ERR_NO_ERROR 0x00 //= inget fel
33
#define ERR_NO_ERROR 0x00 //= inget fel
34
#define ERR_ERROR 0x01 //= fel
34
#define ERR_ERROR 0x01 //= fel
35
 
35
 
36
#define TIMEOUT_MS 150
36
#define TIMEOUT_MS 150
37
 
37
 
38
#endif
38
#endif