EPD Extension Kit for MSP430 LaunchPad

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Uart_Controller.h
Go to the documentation of this file.
1
34 #ifndef __DATACONTROLLER_H_
35 #define __DATACONTROLLER_H_
36 #include "Uart_Driver.h"
37
39 #define __System_Buffer_Size BUFFER_SIZE
40 #define __System_Buffer_Mark __System_Buffer_Size-1
41
42 #define __System_Packet_Header 0xB3
43 #define __System_Packet_Length_Min 6
44 #define __System_Packet_Length_Max PAYLOAD_SIZE
45 #define __System_Packet_Length_Mark (__System_Packet_Length_Max-1)
48 #define __Kit_ID 0x10
49 #define __Temperature 0x11
50 #define __EPD_Board 0x12
51 #define __Firmware_Version 0x1F
52
53 #define __Clear_Image 0x20
54 #define __Load_Image 0x21
55 #define __Show_Image 0x22
56
57 #define __Clear_ASCII 0x30
58 #define __Load_ASCII 0x31
59 #define __Show_ASCII 0x32
60
61 #define __Clear_Custom_Image 0x40
62 #define __Load_Custom_Image 0x41
63 #define __Show_Custom_Image 0x42
64 #define __Show_Index_Custom_Image 0x43
65
66 #define __Clear_Slideshow_Image 0x50
67 #define __Load_Slideshow_Image 0x51
68 #define __Show_Slideshow_Image 0x52
69 #define __Slideshow_On 0x53
70 #define __Slideshow_Off 0x54
71
72 #define __Reload_Current_Image 0x60
73 #define __Clear_All_Flash 0x61
74 #define __Trigger_LED 0x62
75
76 /******************************************************************/
77 enum
78 {
79 Sys_Packets_Header = 0,
80 Sys_Packets_Length ,
81 Sys_Packets_Address ,
82 Sys_Packets_Command_Type
83 };
84
85
102 typedef struct {
103 uint8_t packet_header;
104 uint8_t packet_length;
105 uint16_t kit_id;
106 uint8_t command_type;
107 uint8_t data[__System_Packet_Length_Max];
108 } system_packets_t;
109
110 typedef void (*receive_packets_event)(system_packets_t * packet);
111
112
113 /*****************************************************************/
114 void poll_system_packet_buffer(void);
115 void data_controller_init(receive_packets_event OnRxPacketEvent);
116 void return_system_packets(system_packets_t *packet);
117 void return_packets(system_packets_t *packet,uint8_t *Datas,uint8_t len);
118 void return_system_packet_result(system_packets_t *packet,uint8_t Result);
119
120 #endif