root / Version 1.5 / RS232_MUX.X / frame_definitions.h @ f0dbe1d9
Historique | Voir | Annoter | Télécharger (1000 octets)
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_READ_COMMAND "RDCFG" |
19 |
|
20 |
//VCOM configuration frame
|
21 |
|
22 |
// -> [STX M $$ Bxxxxx Fxxx Cx EOX]
|
23 |
// -> B = Bauds (9600/19200/38400)
|
24 |
// -> F = Frame data structure (exemple : F8N1)
|
25 |
// -> C = COM port destination
|
26 |
|
27 |
#define MAX232_B_STR_INDEX 0 //always 4 |
28 |
//#define MAX232_F_STR_INDEX 10 //can be 10 or lower...
|
29 |
//#define MAX232_C_STR_INDEX 14 //can 14 or lower ...
|
30 |
#define MAX232_B_STR_CHAR 'B' |
31 |
#define MAX232_F_STR_CHAR 'F' |
32 |
#define MAX232_C_STR_CHAR 'C' |
33 |
|
34 |
|
35 |
#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 |
36 |
|
37 |
#endif /* XC_HEADER_TEMPLATE_H */ |
38 |
|