Go to the source code of this file.
void rfhelp_init |
( |
void |
| ) |
|
void rfhelp_power_down |
( |
void |
| ) |
|
void rfhelp_power_up |
( |
void |
| ) |
|
int rfhelp_read_rx_data |
( |
char * |
data, |
|
|
int * |
len, |
|
|
int * |
pipe |
|
) |
| |
Read data from the RX fifo
- Parameters
-
data | Pointer to the array in which to store the data. |
len | Pointer to variable storing the data length. |
pipe | Pointer to the pipe on which the data was received. Can be 0. |
- Returns
- 1: Read OK, more data to read. 0: Read OK -1: No RX data -2: Wrong length read. Something is likely wrong.
int rfhelp_read_rx_data_crc |
( |
char * |
data, |
|
|
int * |
len, |
|
|
int * |
pipe |
|
) |
| |
Same as rfhelp_read_rx_data, but will check if there is a valid CRC in the end of the payload.
- Parameters
-
data | Pointer to the array in which to store the data. |
len | Pointer to variable storing the data length. |
pipe | Pointer to the pipe on which the data was received. Can be 0. |
- Returns
- 1: Read OK, more data to read. 0: Read OK -1: No RX data -2: Wrong length read. Something is likely wrong. -3: Data read, but CRC does not match.
void rfhelp_restart |
( |
void |
| ) |
|
int rfhelp_rf_status |
( |
void |
| ) |
|
int rfhelp_send_data |
( |
char * |
data, |
|
|
int |
len |
|
) |
| |
Set TX mode, send data, wait for result, set RX mode.
- Parameters
-
data | The data to be sent. |
len | Length of the data. |
- Returns
- 0: Send OK. -1: Max RT. -2: Timeout
int rfhelp_send_data_crc |
( |
char * |
data, |
|
|
int |
len |
|
) |
| |
Same as rfhelp_send_data, but will add a crc checksum to the end. This is useful for protecting against corruption between the NRF and the MCU in case there are errors on the SPI bus.
- Parameters
-
data | The data to be sent. |
len | Length of the data. Should be no more than 30 bytes. |
- Returns
- 0: Send OK. -1: Max RT. -2: Timeout
void rfhelp_set_rx_addr |
( |
int |
pipe, |
|
|
const char * |
addr, |
|
|
int |
addr_len |
|
) |
| |
void rfhelp_set_tx_addr |
( |
const char * |
addr, |
|
|
int |
addr_len |
|
) |
| |