Subversion Repositories HomeAutomation

Rev

Details | Last modification | View Log | SVN | RSS feed

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