30 bool send_data(const unsigned char * buffer, int numbytes); |
30 bool send_data(const unsigned char * buffer, int numbytes); |
31 void print_help(); |
31 void print_help(); |
32 void print_cli_options(); |
32 void print_cli_options(); |
33 int dec2bcd(int decimal); |
33 int dec2bcd(int decimal); |
34 int bcd2dec(int bcd); |
34 int bcd2dec(int bcd); |
35 void signal_handler_IO (int status); |
35 void DecodeCMD (); |
|
36 void read_data(); |
36 bool write_gfx_ram(const unsigned char * buffer, int numbytes); |
37 bool write_gfx_ram(const unsigned char * buffer, int numbytes); |
37 |
38 |
38 static const unsigned char CMD_DISP_CLEAR_SCREEN[] = {0xAA,0x10,0x00,0x00}; |
39 static const unsigned char CMD_DISP_CLEAR_SCREEN[] = {0xAA,0x10,0x00,0x00}; |
39 static const unsigned char CMD_SET_MODE_MANAGED[] = {0xAA,0x70,0x00,0x00}; |
40 static const unsigned char CMD_SET_MODE_MANAGED[] = {0xAA,0x70,0x00,0x00}; |
40 static const unsigned char CMD_SET_MODE_UNMANAGED[] = {0xAA,0x71,0x00,0x00}; |
41 static const unsigned char CMD_SET_MODE_UNMANAGED[] = {0xAA,0x71,0x00,0x00}; |
41 static const unsigned char CMD_GET_CLOCK_MEMORY[] = {0xAA,0x40,0x00,0x00}; |
42 static const unsigned char CMD_GET_CLOCK_MEMORY[] = {0xAA,0x40,0x00,0x00}; |
42 static unsigned char CMD_SET_PWM1[] = {0xAA,0x45,0x00,0x01,0x00}; |
43 static unsigned char CMD_SET_PWM1[] = {0xAA,0x45,0x00,0x01,0x00}; |
43 static unsigned char CMD_SET_PWM2[] = {0xAA,0x46,0x00,0x01,0x00}; |
44 static unsigned char CMD_SET_PWM2[] = {0xAA,0x46,0x00,0x01,0x00}; |
|
45 static unsigned char CMD_BOOT[] = {0xAA,0x80,0x00,0x00}; |
44 #define BAUDRATE B921600 |
46 #define BAUDRATE B921600 |
|
47 |
|
48 |
|
49 const unsigned char CMD_HDR_SYNC = 0; |
|
50 const unsigned char CMD_HDR_COMMAND = 1; |
|
51 const unsigned char CMD_HDR_LENGTH = 2; |
|
52 const unsigned char CMD_DATA_START = 4; |
|
53 |
|
54 const unsigned char CMD_SYNC_SEND = 0xAA; |
|
55 const unsigned char CMD_SYNC_RECV = 0x55; |
|
56 const unsigned char CMD_ESCAPE_BYTE = 0x42; |
|
57 |
45 |
58 |
46 /*! \brief configuration set by command line */ |
59 /*! \brief configuration set by command line */ |
47 struct config { |
60 struct config { |
48 bool debug; |
61 bool debug; |
49 int verbosity; |
62 int verbosity; |