root / Version 1.7 / RS232_MUX.X / frame_definitions.h @ f4faa2c5
Historique | Voir | Annoter | Télécharger (1,14 ko)
1 |
#ifndef FRAME_DEFINITIONS
|
---|---|
2 |
#define FRAME_DEFINITIONS
|
3 |
|
4 |
//Frame structure
|
5 |
// STX ADDR(n + FRAME_ADDR) DATA CR_CHAR LF_CHAR
|
6 |
|
7 |
#define STX 0x02 |
8 |
#define CR_CHAR 0x0D |
9 |
#define LF_CHAR 0x0A |
10 |
#define FRAME_ADDR_1 '$' |
11 |
#define FRAME_ADDR_2 '$' |
12 |
|
13 |
#define MASTER_ID 'M' |
14 |
|
15 |
|
16 |
|
17 |
#define MAX232_WRITE_COMMAND "WRCFG" |
18 |
#define MAX232_WRITE_SIZE 5 |
19 |
#define MAX232_READ_RAM_COMMAND "RDCFG0" |
20 |
#define MAX232_READ_RAM_SIZE 6 |
21 |
#define MAX232_READ_ROM_COMMAND "RDCFG1" |
22 |
#define MAX232_READ_ROM_SIZE 6 |
23 |
//VCOM configuration frame
|
24 |
|
25 |
// -> [STX M $$ Bxxxxx Fxxx Cx EOX]
|
26 |
// -> B = Bauds (9600/19200/38400)
|
27 |
// -> F = Frame data structure (exemple : F8N1)
|
28 |
// -> C = COM port destination
|
29 |
|
30 |
#define MAX232_B_STR_INDEX 0 //always 4 |
31 |
//#define MAX232_F_STR_INDEX 10 //can be 10 or lower...
|
32 |
//#define MAX232_C_STR_INDEX 14 //can 14 or lower ...
|
33 |
#define MAX232_B_STR_CHAR 'B' |
34 |
#define MAX232_F_STR_CHAR 'F' |
35 |
#define MAX232_C_STR_CHAR 'C' |
36 |
|
37 |
|
38 |
#define CESAR_SHIFT 65 //Identifier will be A B C D [65 66 67 68] then we must move them to 0 1 2 3 |
39 |
|
40 |
#endif /* XC_HEADER_TEMPLATE_H */ |
41 |
|