Firmware SDK
twr_spirit1.h
1 #ifndef _TWR_SPIRIT1_H
2 #define _TWR_SPIRIT1_H
3 
4 #include <twr_tick.h>
5 
9 
11 
12 #define TWR_SPIRIT1_MAX_PACKET_SIZE 64
13 
15 
17 
18 typedef enum
19 {
22 
25 
28 
30 
34 
35 bool twr_spirit1_init(void);
36 
40 
41 bool twr_spirit1_deinit(void);
42 
46 
47 void twr_spirit1_set_event_handler(void (*event_handler)(twr_spirit1_event_t, void *), void *event_param);
48 
51 
52 void *twr_spirit1_get_tx_buffer(void);
53 
56 
57 void twr_spirit1_set_tx_length(size_t length);
58 
61 
62 size_t twr_spirit1_get_tx_length(void);
63 
66 
67 void *twr_spirit1_get_rx_buffer(void);
68 
71 
72 size_t twr_spirit1_get_rx_length(void);
73 
76 
77 int twr_spirit1_get_rx_rssi(void);
78 
81 
83 
85 
86 void twr_spirit1_tx(void);
87 
89 
90 void twr_spirit1_rx(void);
91 
93 
94 void twr_spirit1_sleep(void);
95 
97 
98 #endif // _TWR_SPIRIT1_H
bool twr_spirit1_deinit(void)
Deitialize.
Definition: twr_spirit1.c:150
void * twr_spirit1_get_rx_buffer(void)
Get RX buffer.
Definition: twr_spirit1.c:191
void * twr_spirit1_get_tx_buffer(void)
Get TX buffer.
Definition: twr_spirit1.c:176
void twr_spirit1_tx(void)
Enter TX state.
Definition: twr_spirit1.c:228
twr_spirit1_event_t
Callback events.
Definition: twr_spirit1.h:19
void twr_spirit1_set_rx_timeout(twr_tick_t timeout)
Set TX timeout.
Definition: twr_spirit1.c:206
size_t twr_spirit1_get_tx_length(void)
Get TX buffer length.
Definition: twr_spirit1.c:186
int twr_spirit1_get_rx_rssi(void)
Get RSSI.
Definition: twr_spirit1.c:201
void twr_spirit1_sleep(void)
Enter sleep state.
Definition: twr_spirit1.c:248
void twr_spirit1_set_tx_length(size_t length)
Set TX buffer length.
Definition: twr_spirit1.c:181
bool twr_spirit1_init(void)
Initialize.
Definition: twr_spirit1.c:98
size_t twr_spirit1_get_rx_length(void)
Get RX buffer length.
Definition: twr_spirit1.c:196
void twr_spirit1_rx(void)
Enter RX state.
Definition: twr_spirit1.c:238
void twr_spirit1_set_event_handler(void(*event_handler)(twr_spirit1_event_t, void *), void *event_param)
Set callback function.
Definition: twr_spirit1.c:170
@ TWR_SPIRIT1_EVENT_RX_TIMEOUT
Event is RX timeout.
Definition: twr_spirit1.h:27
@ TWR_SPIRIT1_EVENT_TX_DONE
Event is TX done.
Definition: twr_spirit1.h:21
@ TWR_SPIRIT1_EVENT_RX_DONE
Event is RX done.
Definition: twr_spirit1.h:24
uint64_t twr_tick_t
Timestamp data type.
Definition: twr_tick.h:16