]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/uoled/oledlib.h
robofsm: Added estimated position based on odometry
[eurobot/public.git] / src / uoled / oledlib.h
1 #ifndef _OLEDLIB_H
2 #define _OLEDLIB_H
3
4 #include <stdint.h>
5 #include <robottype.h>
6 #include <robottype.h>
7
8 #define MSG_START ':'
9 #define MSG_START_DISP 150
10 #define MSG_SIZE 31
11 #define MSG_TERM '~'
12
13 #define HW_STATUS_MSG_SIZE 10
14 #define SWITCH_MODE_MSG_SIZE 6
15 #define VOLTAGE_MSG_SIZE 19 
16 #define FSM_STATE_MSG_SIZE 22
17 #define POSITION_MSG_SIZE 14
18 #define COLOR_MSG_SIZE 3
19 #define LIFT_MSG_SIZE 6
20 #define PUCKS_MSG_SIZE 3
21 #define CONF_MSG_SIZE 4
22
23 #define VOLTAGE_MSG 'V'
24 #define FSM_STATE_MSG 'F'
25 #define HW_STATUS_MSG 163
26 #define COLOR_MSG 'c'
27 #define POSITION_MSG 'P'
28 #define MOVE_FSM_STATE_MSG 'M'
29 #define LIFT_MSG 'L'
30 #define PUCKS_MSG 'p'
31 #define GAME_CONF_MSG 'g'
32
33 #define MSG_LIFT_CAL 151
34 #define MSG_PUSHER_IN 152
35 #define MSG_PUSHER_OUT 153
36 #define MSG_LIFT_UP 154
37 #define MSG_LIFT_DOWN 155
38 #define MSG_CMU_INIT 156
39 #define MSG_START_ACT 157
40 #define MSG_COLOR 158
41 #define MSG_RESTART 162
42 #define MSG_INIT 160
43 #define MSG_STATUS 161
44
45 #define ACTUATORS 180
46 #define GET_READY 181
47 #define ROBOT_RESTART 182
48 #define SWITCH_TO_STATUS 183
49 #define SWITCH_TO_CONTROL 184
50 #define SWITCH_TO_STATUS_DONE 185
51 #define SWITCH_TO_CONTROL_DONE 186
52 #define SET_COLOR 187
53 #define SET_MODE 188
54
55 #define CHANGE_MODE_REP 200
56 #define CHANGE_MODE_REQ 201
57 #define CHANGE_MODE_STATUS 202
58 #define CHANGE_MODE_CONTROL 203
59
60 #define MODE_STATUS 1
61 #define MODE_CONTROL 2
62
63 #define HW_STATUS_OK 1
64 #define HW_STATUS_FAILED 0
65 #define HW_STATUS_WARNING 2
66
67 #define STATUS_MOTION 0
68 #define STATUS_UZV 1
69 #define STATUS_LFT 2
70 #define STATUS_CHE 3
71 #define STATUS_CAM 4
72 #define STATUS_HOK 5
73 #define STATUS_PWR 6
74 #define STATUS_STA 7
75
76 struct mode_info {
77         uint8_t mode;
78         uint8_t status; 
79 };
80
81 struct voltages {
82         double voltage33;
83         double voltage50;
84         double voltage80;
85         double voltageBAT;
86 };
87
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 int oled_switch_mode(uint8_t *buff, int buff_size, uint8_t mode, uint8_t status);
92 int oled_send_voltage(uint8_t *buff, int buff_size, struct pwr_voltage_type *volt);
93 int oled_set_color(uint8_t *buff, int buff_size, uint8_t color);
94 int oled_send_position(uint8_t *buff, int buff_size, struct robot_pos_type *pos);
95 int oled_send_fsm_state(uint8_t *buff, int buff_size, const char *name, int len, uint8_t type);
96 int oled_send_hw_status(uint8_t *buff, int buff_size, uint8_t *status);
97 int oled_send_pucks_nr(uint8_t *buff, int buff_size, char nr);
98 int oled_send_lift_pos(uint8_t *buff, int buff_size, uint16_t pos);
99 int oled_send_game_conf(uint8_t *buff, int buff_size, uint8_t conf);
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif  //_OLEDLIB_H