-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
66 lines (52 loc) · 996 Bytes
/
common.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef COMMON_H
#define COMMON_H
#include <stdint.h>
/**
* Configure NRF24 registers that are common for prx and ptr.
*/
void common_config();
/**
* Set prx listen address.
*/
void prx_addr(uint8_t *addr, uint8_t addr_len);
/**
* Set receiver address and listen address for acks.
*/
void receiver_addr(uint8_t *addr, uint8_t addr_len);
/**
* Go to POWER UP state.
*/
void power_up();
/**
* Got to POWER DOWN state.
*/
void power_down();
/**
* Check if data is ready in the RX FIFO by querying which data pipe has data available.
*/
uint8_t rx_data_ready();
/**
* Clock in received data from RX FIFO.
*/
int8_t get_rx_data(uint8_t *rx_data);
/**
* Flush TX FIFO. In prx this holds ACK payloads.
*/
void flush_tx();
/**
* Flush RX FIFO.
*/
void flush_rx();
/**
* Clear interrupt flags.
*/
void clean_int_flags();
/**
* Flush TX and RX FIFOs and clear interrupt flags.
*/
void clean_up();
/**
* Stop activities and free up hardware.
*/
void shutdown();
#endif