Library Functions.
More...
Library Functions.
Here are listed very basic functions to work with NRF modules
| void TM_NRF24L01_Clear_Interrupts |
( |
void |
| ) |
|
Clears interrupt status.
- Parameters
-
- Return values
-
| uint8_t TM_NRF24L01_DataReady |
( |
void |
| ) |
|
Checks if data is ready to be read from NRF24L01+.
- Parameters
-
- Return values
-
| Data | ready status:
- 0: No data available for receive in bufferReturns
- > 0: Data is ready to be collected
|
| void TM_NRF24L01_GetData |
( |
uint8_t * |
data | ) |
|
Gets data from NRF24L01+.
- Parameters
-
| *data | Pointer to 8-bits array where data from NRF will be saved |
- Return values
-
| uint8_t TM_NRF24L01_GetRetransmissionsCount |
( |
void |
| ) |
|
Gets number of retransmissions needed in last transmission.
- Parameters
-
- Return values
-
| Number | of retransmissions, between 0 and 15. |
| uint8_t TM_NRF24L01_GetStatus |
( |
void |
| ) |
|
Gets NRLF+ status register value.
- Parameters
-
- Return values
-
Gets transmissions status.
- Parameters
-
- Return values
-
| uint8_t TM_NRF24L01_Init |
( |
uint8_t |
channel, |
|
|
uint8_t |
payload_size |
|
) |
| |
Initializes NRF24L01+ module.
- Parameters
-
| channel | channel you will use for communication, from 0 to 125 eg. working frequency from 2.4 to 2.525 GHz |
| payload_size | maximum data to be sent in one packet from one NRF to another. |
- Note
- Maximal payload size is 32bytes
- Return values
-
| void TM_NRF24L01_PowerDown |
( |
void |
| ) |
|
| void TM_NRF24L01_PowerUpRx |
( |
void |
| ) |
|
Sets NRF24L01+ to RX mode.
- Note
- In this mode is NRF able to receive data from another NRF module. This is default mode and should be used all the time, except when sending data
- Parameters
-
- Return values
-
| void TM_NRF24L01_PowerUpTx |
( |
void |
| ) |
|
Sets NRF24L01+ to TX mode.
- Note
- In this mode is NRF able to send data to another NRF module
- Parameters
-
- Return values
-
Reads interrupts from NRF.
- Parameters
-
- Return values
-
| IRQ | status
- 0: No interrupts are active
- > 0: At least one interrupt is active
|
| void TM_NRF24L01_SetChannel |
( |
uint8_t |
channel | ) |
|
Sets working channel.
- Note
- Channel value is just an offset in units MHz from 2.4GHz For example, if you select channel 65, then operation frequency will be set to 2.465GHz.
- Parameters
-
| channel | RF channel where device will operate |
- Return values
-
| void TM_NRF24L01_SetMyAddress |
( |
uint8_t * |
adr | ) |
|
Sets own address. This is used for settings own id when communication with other modules.
- Note
- "Own" address of one device must be the same as "TX" address of other device (and vice versa), if you want to get successful communication
- Parameters
-
| *adr | Pointer to 5-bytes length array with address |
- Return values
-
Sets RF parameters for NRF24L01+.
- Parameters
-
- Return values
-
| void TM_NRF24L01_SetTxAddress |
( |
uint8_t * |
adr | ) |
|
Sets address you will communicate with.
- Note
- "Own" address of one device must be the same as "TX" address of other device (and vice versa), if you want to get successful communication
- Parameters
-
| *adr | Pointer to 5-bytes length array with address |
- Return values
-
| void TM_NRF24L01_Transmit |
( |
uint8_t * |
data | ) |
|
Transmits data with NRF24L01+ to another NRF module.
- Parameters
-
| *data | Pointer to 8-bit array with data. Maximum length of array can be the same as "payload_size" parameter on initialization |
- Return values
-