NRF24L01 Library
Functions

nrf24l01.c File Reference

#include "nrf24l01.h"
#include "cpu_lpc1000.h"

Functions

char NRF24L01_ReadReg (char Reg)
 Read a register.
char NRF24L01_WriteReg (char Reg, char Value)
 Returns the STATUS register and then modify a register.
char NRF24L01_ReadRegBuf (char Reg, char *Buf, int Size)
 Returns the STATUS register and then read "n" registers.
char NRF24L01_WriteRegBuf (char Reg, char *Buf, int Size)
 Returns the STATUS register and then write "n" registers.
char NRF24L01_Get_Status (void)
 Returns the STATUS register.
char NRF24L01_Get_CD (void)
 Returns the carrier signal in RX mode (high when detected)
void NRF24L01_Set_Power (char Mode)
 Select power mode.
void NRF24L01_Set_CH (char CH)
 Select the radio channel.
void NRF24L01_Set_ShockBurst (char Mode)
 Select Enhanced ShockBurst ON/OFF.
void NRF24L01_Set_Address_Width (char Width)
 Select the address width.
void NRF24L01_Set_Device_Mode (char Device_Mode)
 Select mode receiver or transmitter.
void NRF24L01_Set_RX_Pipe (char PipeNum, char *Address, int AddressSize, char PayloadSize)
 Enables and configures the pipe receiving the data.
void NRF24L01_Disable_All_Pipes (void)
 Disable all pipes.
char NRF24L01_Clear_Interrupts (void)
 Returns the STATUS register and then clear all interrupts.
void NRF24L01_Set_TX_Address (char *Address, int Size)
 Sets the direction of transmission.
void NRF24L01_Flush_TX (void)
 Empty the transmit buffer.
void NRF24L01_Flush_RX (void)
 Empty the receive buffer.
void NRF24L01_Init (char Device_Mode, char CH, char DataRate, char *Address, char Address_Width, char Size_Payload)
 Initializes the device.
void NRF24L01_RF_TX (void)
 Turn on transmitter, and transmits the data loaded into the buffer.
void NRF24L01_Write_TX_Buf (char *Buf, int Size)
 Writes the buffer of data transmission.
void NRF24L01_Read_RX_Buf (char *Buf, int Size)
 Read the data reception buffer.

Function Documentation

char NRF24L01_Clear_Interrupts ( void  )

Returns the STATUS register and then clear all interrupts.

Returns:
STATUS Register
void NRF24L01_Disable_All_Pipes ( void  )

Disable all pipes.

void NRF24L01_Flush_RX ( void  )

Empty the receive buffer.

void NRF24L01_Flush_TX ( void  )

Empty the transmit buffer.

char NRF24L01_Get_CD ( void  )

Returns the carrier signal in RX mode (high when detected)

Returns:
CD
char NRF24L01_Get_Status ( void  )

Returns the STATUS register.

Returns:
STATUS Register
void NRF24L01_Init ( char  Device_Mode,
char  CH,
char  DataRate,
char *  Address,
char  Address_Width,
char  Size_Payload 
)

Initializes the device.

Parameters:
Device_Mode= _TX_MODE, _RX_MODE
CH= 0..125
DataRate= _1Mbps, _2Mbps
AddressAddress
Address_WidthWidth direction: 3..5
Size_PayloadData buffer size
See also:
_TX_MODE
_RX_MODE
_1Mbps
_2Mbps
void NRF24L01_Read_RX_Buf ( char *  Buf,
int  Size 
)

Read the data reception buffer.

Parameters:
BufBuffer with data received
SizeBuffer size
char NRF24L01_ReadReg ( char  Reg)

Read a register.

Parameters:
RegRegister to read
Returns:
Registry Value
char NRF24L01_ReadRegBuf ( char  Reg,
char *  Buf,
int  Size 
)

Returns the STATUS register and then read "n" registers.

Parameters:
RegRegister to read
BufPointer to a buffer
SizeBuffer Size
Returns:
STATUS Register
void NRF24L01_RF_TX ( void  )

Turn on transmitter, and transmits the data loaded into the buffer.

void NRF24L01_Set_Address_Width ( char  Width)

Select the address width.

Parameters:
Width= 3..5
void NRF24L01_Set_CH ( char  CH)

Select the radio channel.

Parameters:
CH= 0..125
void NRF24L01_Set_Device_Mode ( char  Device_Mode)

Select mode receiver or transmitter.

Parameters:
Device_Mode= _TX_MODE, _RX_MODE
See also:
_TX_MODE
_RX_MODE
void NRF24L01_Set_Power ( char  Mode)

Select power mode.

Parameters:
Mode= _POWER_DOWN, _POWER_UP
See also:
_POWER_DOWN
_POWER_UP
void NRF24L01_Set_RX_Pipe ( char  PipeNum,
char *  Address,
int  AddressSize,
char  PayloadSize 
)

Enables and configures the pipe receiving the data.

Parameters:
PipeNumNumber of pipe
AddressAddress
AddressSizeAddress size
PayloadSizeBuffer size, data receiver
void NRF24L01_Set_ShockBurst ( char  Mode)

Select Enhanced ShockBurst ON/OFF.

Disable this functionality to be compatible with nRF2401

Parameters:
Mode= _ShockBurst_ON, _ShockBurst_OFF
See also:
_ShockBurst_ON
_ShockBurst_OFF
void NRF24L01_Set_TX_Address ( char *  Address,
int  Size 
)

Sets the direction of transmission.

Parameters:
AddressAddress
SizeAddress size 3..5
void NRF24L01_Write_TX_Buf ( char *  Buf,
int  Size 
)

Writes the buffer of data transmission.

Parameters:
BufBuffer with data to send
SizeBuffer size
char NRF24L01_WriteReg ( char  Reg,
char  Value 
)

Returns the STATUS register and then modify a register.

Parameters:
RegRegister to change
ValueNew value
Returns:
STATUS Register
char NRF24L01_WriteRegBuf ( char  Reg,
char *  Buf,
int  Size 
)

Returns the STATUS register and then write "n" registers.

Parameters:
RegRegisters to change
BufPointer to a buffer
SizeBuffer Size
Returns:
STATUS Register
 All Files Functions Defines