-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuart.h
38 lines (31 loc) · 825 Bytes
/
uart.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef UART_H
#define UART_H
#include "driver.h"
#include "string.h"
/* commands recieved by Bluetooth */
#define SET 0x10
#define GET 0x20
#define DISP 0x30
#define TOGGLE 0x40
#define PING 0xFF
/* data to be set received by Bluetooth */
#define UART_TIME 0x01
#define UART_DATE 0x02
#define SHOW_INTERVALS 0x03
/* flags to be transmitted */
#define ALIVE 0x66
#define START_FLAG 0x7D
typedef enum {
WAIT, /* Do not change */
CMD, /* Do not change */
SET_BT_SI,
SET_BT_SJ,
/*insert new command here */
EXIT, /* Do not change */
END /* Do not change */
} BT_states;
void UART_init(void);
void UART_commands_exec(volatile time_t* time_to_set, volatile display_t* user_data_to_set);
bool set_BT_power_save (volatile time_t* curr_time);
bool UART_check_timeout (int32_t current_time_stamp);
#endif /* UART_H */