ccrf 2.0.0.0
Public function

Functions

void ccrf_cfg_setup (ccrf_cfg_t *cfg)
 Config Object Initialization function.
 
err_t ccrf_init (ccrf_t *ctx, ccrf_cfg_t *cfg)
 Initialization function.
 
void ccrf_default_cfg (ccrf_t *ctx)
 Click Default Configuration function.
 
uint8_t ccrf_get_start (ccrf_t *ctx)
 Get state of GD0 pin function.
 
void ccrf_write_byte (ccrf_t *ctx, uint8_t reg_address, uint8_t write_data)
 Write the byte of data to the 8-bit register address function.
 
void ccrf_write_bytes (ccrf_t *ctx, uint8_t reg_address, uint8_t *write_data, uint8_t n_bytes)
 Sequential write function.
 
void ccrf_write_strobe (ccrf_t *ctx, uint8_t strobe)
 Write a strobe command function.
 
uint8_t ccrf_read_byte (ccrf_t *ctx, uint8_t reg_address)
 Read the byte of data from the 8-bit register address function.
 
uint8_t ccrf_read_byte_status (ccrf_t *ctx, uint8_t reg_address)
 Read the byte of data from the 8-bit status register address function.
 
void ccrf_read_bytes (ccrf_t *ctx, uint8_t reg_address, uint8_t *read_data, uint8_t n_bytes)
 Sequential read function.
 
void ccrf_sw_reset (ccrf_t *ctx)
 Softwere reset function.
 
void ccrf_hw_reset (ccrf_t *ctx)
 Hardware reset function.
 
void ccrf_transmit_packet (ccrf_t *ctx, uint8_t *tx_buffer, uint8_t n_bytes)
 Transmit packet data function.
 
uint8_t ccrf_receive_packet (ccrf_t *ctx, uint8_t *rx_buffer, uint8_t *length_buff)
 Receive packet data function.
 
uint8_t ccrf_transmit_packet_with_address (ccrf_t *ctx, uint8_t *tx_buffer, uint8_t n_bytes, uint8_t *attempts)
 Transmit packet data with address function.
 
void ccrf_set_gd2_active_low (ccrf_t *ctx)
 GD2 select active low function.
 
void ccrf_set_gd2_active_high (ccrf_t *ctx)
 GD2 select active high function.
 
void ccrf_set_gd0_active_low (ccrf_t *ctx)
 GD0 select active low function.
 
void ccrf_set_gd0_active_high (ccrf_t *ctx)
 GD0 select active high function.
 
void ccrf_enable_temperature_sensor (ccrf_t *ctx)
 Enable analog temperature sensor function.
 
void ccrf_disable_temperature_sensor (ccrf_t *ctx)
 Disable analog temperature sensor function.
 
void ccrf_set_fifo_threshold (ccrf_t *ctx, uint8_t threshold_rx_tx)
 Set the threshold for the TX FIFO and RX FIFO function.
 
void ccrf_set_max_length_packets (ccrf_t *ctx, uint8_t max_length)
 Set maximum length packets allowed function.
 
void ccrf_turn_data_whitening_on (ccrf_t *ctx)
 Turn data whitening on function.
 
void ccrf_turn_data_whitening_off (ccrf_t *ctx)
 Turn data whitening off function.
 
void ccrf_format_rx_tx_data (ccrf_t *ctx, uint8_t rx_tx_data_format)
 Set format of RX and TX data function.
 
void ccrf_set_device_address (ccrf_t *ctx, uint8_t dev_addr)
 Set device address function.
 
void ccrf_set_channel_number (ccrf_t *ctx, uint8_t ch_num)
 Set channel number function.
 
void ccrf_set_if_frequency (ccrf_t *ctx, uint8_t if_freq)
 Set desired IF frequency function.
 
void ccrf_set_frequency_offset (ccrf_t *ctx, uint8_t freq_offset)
 Set frequency offset function.
 
void ccrf_disable_dc_blocking_filter (ccrf_t *ctx)
 Disable digital DC blocking filter function.
 
void ccrf_enable_dc_blocking_filter (ccrf_t *ctx)
 Enable digital DC blocking filter function.
 
void ccrf_set_modulation (ccrf_t *ctx, uint8_t rf_modulation)
 Set the modulation format of the radio signal function.
 
void ccrf_enable_manchester_encoding (ccrf_t *ctx)
 Enable Manchester encoding function.
 
void ccrf_disable_manchester_encoding (ccrf_t *ctx)
 Disable Manchester encoding function.
 
void ccrf_set_sync_word_qualifier_mode (ccrf_t *ctx, uint8_t q_mode)
 Set sync-word qualifier mode function.
 
void ccrf_disable_fec (ccrf_t *ctx)
 Disable forward error correction function.
 
void ccrf_enable_fec (ccrf_t *ctx)
 Enable forward error correction function.
 
void ccrf_set_min_num_preamble (ccrf_t *ctx, uint8_t p_num)
 Set the minimum number of preamble bytes to be transmitted function.
 
void ccrf_set_cca_mode (ccrf_t *ctx, uint8_t cca_mode)
 Set CCA mode function.
 
void ccrf_set_state_packet_recived (ccrf_t *ctx, uint8_t pr_state)
 Set state after finishing packet reception function.
 
void ccrf_set_state_packet_sent (ccrf_t *ctx, uint8_t ps_state)
 Set state when a packet has been sent function.
 
void ccrf_set_auto_calibrate_mode (ccrf_t *ctx, uint8_t ac_mode)
 Set automatically calibrate function.
 
void ccrf_set_freq_loop_gain_bs (ccrf_t *ctx, uint8_t fcl_gain)
 Set frequency compensation loop gain before a sync function.
 
void ccrf_set_freq_loop_gain_as (ccrf_t *ctx, uint8_t fcl_gain)
 Set frequency compensation loop gain after a sync function.
 
void ccrf_set_bit_sync_config (ccrf_t *ctx, uint8_t bs_config)
 Set bit synchronization configuration function.
 
void ccrf_set_dvga_gain (ccrf_t *ctx, uint8_t dvga_gain)
 Set the maximum allowable DVGA gain function.
 
void ccrf_set_lna_gain (ccrf_t *ctx, uint8_t lna_gain)
 Set the maximum allowable LNA gain function.
 
void ccrf_set_amplitude_ch_filter (ccrf_t *ctx, uint8_t ach_filter)
 Set the target amplitude from channel filter function.
 
void ccrf_set_lna_strategies (ccrf_t *ctx, uint8_t lna_strat)
 Set the LNA strategies function.
 
void ccrf_set_relative_rssi_threshold (ccrf_t *ctx, uint8_t rssi_threshold)
 Set the relative change threshold for asserting carrier sense function.
 
void ccrf_set_absolute_rssi_threshold (ccrf_t *ctx, uint8_t rssi_threshold)
 Set the rabsolute RSSI threshold for asserting carrier sense function.
 
void ccrf_set_hysteresis_lvl (ccrf_t *ctx, uint8_t hyst_lvl)
 Set the level of hysteresis on the magnitude deviation function.
 
void ccrf_set_num_ch_filter (ccrf_t *ctx, uint8_t num_ch_filter)
 Set the number of channel filter samples function.
 
void ccrf_set_agc_gain (ccrf_t *ctx, uint8_t agc_gain)
 Set the AGC gain function.
 
void ccrf_set_avr_len_ampitude (ccrf_t *ctx, uint8_t al_amp)
 Set the averaging length for the amplitude from the channel filter function.
 
void ccrf_set_auto_initial_calibration (ccrf_t *ctx)
 Set automatic initial calibration function.
 
void ccrf_set_timeout_reg_block (ccrf_t *ctx, uint8_t timeout)
 Set the averaging length for the amplitude from the channel filter function.
 
void ccrf_disable_osc_rc (ccrf_t *ctx)
 Disables the RC oscillator calibration function.
 
void ccrf_enable_osc_rc (ccrf_t *ctx)
 Enable the RC oscillator calibration function.
 
void ccrf_set_timeout_wor (ccrf_t *ctx, uint8_t timeout)
 Set the maximum timeout of the WOR module function.
 
uint8_t ccrf_get_chip_part_number (ccrf_t *ctx)
 Get chip part number function.
 
uint8_t ccrf_get_chip_version_number (ccrf_t *ctx)
 Get chip version number function.
 
uint8_t ccrf_get_rssi (ccrf_t *ctx)
 Get received signal strength indication function.
 
uint8_t ccrf_get_mrc_state (ccrf_t *ctx)
 Get main radio control state machine state function.
 
uint8_t ccrf_get_gd0_and_packet_state (ccrf_t *ctx)
 Get current GDO status and packet status function.
 
uint8_t ccrf_get_underflow_rx_fifo (ccrf_t *ctx)
 Get underflow RX FIFO status function.
 
uint8_t ccrf_get_rx_fifo_num_bytes (ccrf_t *ctx)
 Get number of bytes in RX FIFO function.
 
uint8_t ccrf_get_rc_osc_cal_result (ccrf_t *ctx)
 Get RC oscillator calibration result function.
 

Detailed Description

Function Documentation

◆ ccrf_cfg_setup()

void ccrf_cfg_setup ( ccrf_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ ccrf_default_cfg()

void ccrf_default_cfg ( ccrf_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for ccRF click.

◆ ccrf_disable_dc_blocking_filter()

void ccrf_disable_dc_blocking_filter ( ccrf_t * ctx)

Disable digital DC blocking filter function.

Parameters
ctxClick object.

Function disable digital DC blocking filter by sets to '1' states of [ bit 7 ] of the CCRF_MDMCFG2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

Note
Only for data rates < 250 kBaud

◆ ccrf_disable_fec()

void ccrf_disable_fec ( ccrf_t * ctx)

Disable forward error correction function.

Parameters
ctxClick object.

Function disable the forward error correction by cleared to '0' states of [ bit 7 ] of the CCRF_MDMCFG1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_disable_manchester_encoding()

void ccrf_disable_manchester_encoding ( ccrf_t * ctx)

Disable Manchester encoding function.

Parameters
ctxClick object.

Function disable Manchester encoding by cleared to '0' states of [ bit 3 ] of the CCRF_MDMCFG2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_disable_osc_rc()

void ccrf_disable_osc_rc ( ccrf_t * ctx)

Disables the RC oscillator calibration function.

Parameters
ctxClick object.

Function disables the RC oscillator calibration by cleared to '0' states of [ bit 3 ] of the CCRF_WORCTRL register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_disable_temperature_sensor()

void ccrf_disable_temperature_sensor ( ccrf_t * ctx)

Disable analog temperature sensor function.

Parameters
ctxClick object.

Function enable analog temperature sensor by sets to '1' states of [ bit 7 ] of the CCRF_IOCFG0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_enable_dc_blocking_filter()

void ccrf_enable_dc_blocking_filter ( ccrf_t * ctx)

Enable digital DC blocking filter function.

Parameters
ctxClick object.

Function enable ( better sensitivity ) digital DC blocking filter by cleared to '0' states of [ bit 7 ] of the CCRF_MDMCFG2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_enable_fec()

void ccrf_enable_fec ( ccrf_t * ctx)

Enable forward error correction function.

Parameters
ctxClick object.

Function enable the forward error correction by sets to '1' states of [ bit 7 ] of the CCRF_MDMCFG1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_enable_manchester_encoding()

void ccrf_enable_manchester_encoding ( ccrf_t * ctx)

Enable Manchester encoding function.

Parameters
ctxClick object.

Function enable Manchester encoding by sets to '1' states of [ bit 3 ] of the CCRF_MDMCFG2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_enable_osc_rc()

void ccrf_enable_osc_rc ( ccrf_t * ctx)

Enable the RC oscillator calibration function.

Parameters
ctxClick object.

Function enable the RC oscillator calibration by sets to '1' states of [ bit 3 ] of the CCRF_WORCTRL register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_enable_temperature_sensor()

void ccrf_enable_temperature_sensor ( ccrf_t * ctx)

Enable analog temperature sensor function.

Parameters
ctxClick object.

Function enable analog temperature sensor by clearde to '0' states of [ bit 7 ] of the CCRF_IOCFG0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

Note
Write '0' in all other register bits when using temperature sensor.

◆ ccrf_format_rx_tx_data()

void ccrf_format_rx_tx_data ( ccrf_t * ctx,
uint8_t rx_tx_data_format )

Set format of RX and TX data function.

Parameters
ctxClick object.
rx_tx_data_format:
 - 0 : Normal mode, use FIFOs for RX and TX;
 - 1 : Synchronous serial mode, used for backwards
       compatibility. Data in on GD0 ( RST ) pin;
 - 2 : Random TX mode; sends random data. Used for test.
       Works as normal mode, setting in RX;
 - 3 : Asynchronous serial mode. Data in on GD0 ( RST ) and
       data out on either of the GD0 ( RST ) pin;

Function sets the format of RX and TX data to the CCRF_PKTCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_chip_part_number()

uint8_t ccrf_get_chip_part_number ( ccrf_t * ctx)

Get chip part number function.

Parameters
ctxClick object.
Returns
8-bit chip part number value

Function get chip part number by read chip part number value from the CCRF_PARTNUM register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_chip_version_number()

uint8_t ccrf_get_chip_version_number ( ccrf_t * ctx)

Get chip version number function.

Parameters
ctxClick object.
Returns
8-bit chip version number value

Function get chip version number by read chip version number value from the CCRF_VERSION register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_gd0_and_packet_state()

uint8_t ccrf_get_gd0_and_packet_state ( ccrf_t * ctx)

Get current GDO status and packet status function.

Parameters
ctxClick object.
Returns
Freq. compensation loop gain before sync word :
- [ bit 7 ] : The last CRC comparison matched. Cleared when entering/restarting RX mode;
- [ bit 6 ] : Carrier sense;
- [ bit 5 ] : Preamble Quality reached;
- [ bit 4 ] : Channel is clear;
- [ bit 3 ] : Sync word found;
- [ bit 2 ] : Current GDO2 value;
- [ bit 1 ] : Reserved;
- [ bit 0 ] : Current GDO0 value;

Function get current GDO status and packet status by read status value from the CCRF_PKTSTATUS register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_mrc_state()

uint8_t ccrf_get_mrc_state ( ccrf_t * ctx)

Get main radio control state machine state function.

Parameters
ctxClick object.
Returns
Main Radio Control FSM State
- [ bit 7:5 ] : Reserved;
- [ bit 4:0 ] :      State name       | State :
     -  0 ( 0x00 ) : SLEEP            | SLEEP;
     -  1 ( 0x01 ) : IDLE             | IDLE;
     -  2 ( 0x02 ) : XOFF             | XOFF;
     -  3 ( 0x03 ) : VCOON_MC         | MANCAL;
     -  4 ( 0x04 ) : REGON_MC         | MANCAL;
     -  5 ( 0x05 ) : MANCAL           | MANCAL;
     -  6 ( 0x06 ) : VCOON            | FS_WAKEUP;
     -  7 ( 0x07 ) : REGON            | FS_WAKEUP;
     -  8 ( 0x08 ) : STARTCAL         | CALIBRATE;
     -  9 ( 0x09 ) : BWBOOST          | SETTLING;
     - 10 ( 0x0A ) : FS_LOCK          | SETTLING;
     - 11 ( 0x0B ) : IFADCON          | SETTLING;
     - 12 ( 0x0C ) : ENDCAL           | CALIBRATE;
     - 13 ( 0x0D ) : RX               | RX;
     - 14 ( 0x0E ) : RX_END           | RX;
     - 15 ( 0x0F ) : RX_RST           | RX;
     - 16 ( 0x10 ) : TXRX_SWITCH      | TXRX_SETTLING3Kp;
     - 17 ( 0x11 ) : RXFIFO_OVERFLOW  | RXFIFO_OVERFLOW;
     - 18 ( 0x12 ) : FSTXON           | FSTXON;
     - 19 ( 0x13 ) : TX               | TX;
     - 20 ( 0x14 ) : TX_END           | TX;
     - 21 ( 0x15 ) : RXTX_SWITCH      | RXTX_SETTLING;
     - 22 ( 0x16 ) : TXFIFO_UNDERFLOW | TXFIFO_UNDERFLOW;

Function get main radio control state machine state by RSSI status value from the CCRF_MARCSTATE register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_rc_osc_cal_result()

uint8_t ccrf_get_rc_osc_cal_result ( ccrf_t * ctx)

Get RC oscillator calibration result function.

Parameters
ctxClick object.
Returns
RC oscillator calibration result ( max. 128 )

Function get RC oscillator calibration result by read RC osc. result from the CCRF_RCCTRL1_STATUS register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_rssi()

uint8_t ccrf_get_rssi ( ccrf_t * ctx)

Get received signal strength indication function.

Parameters
ctxClick object.
Returns
8-bit RSSI value

Function get creceived signal strength indication by RSSI value from the CCRF_RSSI register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_rx_fifo_num_bytes()

uint8_t ccrf_get_rx_fifo_num_bytes ( ccrf_t * ctx)

Get number of bytes in RX FIFO function.

Parameters
ctxClick object.
Returns
number of bytes in RX FIFO ( max. 128 )

Function get underflow RX FIFO status by read value number of bytes in RX FIFO from the CCRF_RXBYTES register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_get_start()

uint8_t ccrf_get_start ( ccrf_t * ctx)

Get state of GD0 pin function.

Parameters
ctxClick object.

Function for getting state of GD0 pin function

◆ ccrf_get_underflow_rx_fifo()

uint8_t ccrf_get_underflow_rx_fifo ( ccrf_t * ctx)

Get underflow RX FIFO status function.

Parameters
ctxClick object.
Returns
0 - ok; 1 - underflow;

Function get underflow RX FIFO status by read status of underflow from the CCRF_RXBYTES register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_hw_reset()

void ccrf_hw_reset ( ccrf_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

The function Hardware reset - resets the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

Note
Delay aprox. 3 ms.

◆ ccrf_init()

err_t ccrf_init ( ccrf_t * ctx,
ccrf_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ ccrf_read_byte()

uint8_t ccrf_read_byte ( ccrf_t * ctx,
uint8_t reg_address )

Read the byte of data from the 8-bit register address function.

Parameters
ctxClick object.
reg_address8-bit register address
Returns
8-bit read data

Function reads the byte of data from the targeted 8-bit register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_read_byte_status()

uint8_t ccrf_read_byte_status ( ccrf_t * ctx,
uint8_t reg_address )

Read the byte of data from the 8-bit status register address function.

Parameters
ctxClick object.
reg_address8-bit status register address
Returns
8-bit read data

Function reads the byte of data from the targeted 8-bit status register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_read_bytes()

void ccrf_read_bytes ( ccrf_t * ctx,
uint8_t reg_address,
uint8_t * read_data,
uint8_t n_bytes )

Sequential read function.

Parameters
ctxClick object.
reg_address8-bit register address
read_datapointer to the memory location where data be stored
n_bytesnumber of bytes to be read

Function read a sequential data ( burst read ) starting from the targeted 8-bit register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_receive_packet()

uint8_t ccrf_receive_packet ( ccrf_t * ctx,
uint8_t * rx_buffer,
uint8_t * length_buff )

Receive packet data function.

Parameters
ctxClick object.
rx_bufferPointer to a buffer containing the data that are going to be received
length_buffPointer to a variable containing the data length that are going to be received

Function receive a packet of variable packet length from the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

Note
 
 To use this function, GD0 must be configured to be asserted when sync word is sent and
 de-asserted at the end of the packet.
 Also, CCRF_APPEND_STATUS in the CCRF_PKTCTRL1 register must be enabled.
 The function implements polling of GD0. First it waits for GD0 to be set and then it waits
 for it to be cleared.
 After the GD0 pin has been de-asserted, the CCRF_RXBYTES register is read to make sure that there
 are bytes in the FIFO. This is because the GDO signal will indicate sync received even if the
 FIFO is flushed due to address filtering, CRC filtering, or packet length filtering.

◆ ccrf_set_absolute_rssi_threshold()

void ccrf_set_absolute_rssi_threshold ( ccrf_t * ctx,
uint8_t rssi_threshold )

Set the rabsolute RSSI threshold for asserting carrier sense function.

Parameters
ctxClick object.
rssi_threshold
   
Carrier sense absolute threshold :
     - -8 : Absolute carrier sense threshold disabled;
     - -7 : 7 dB below MAGN_TARGET setting;
     - -6 : 6 dB below MAGN_TARGET setting;
     - -5 : 5 dB below MAGN_TARGET setting;
     - -4 : 4 dB below MAGN_TARGET setting;
     - -3 : 3 dB below MAGN_TARGET setting;
     - -2 : 2 dB below MAGN_TARGET setting;
     - -1 : 1 dB below MAGN_TARGET setting;
     -  0 : At MAGN_TARGET setting;
     -  1 : 1 dB above MAGN_TARGET setting;
     -  2 : 2 dB above MAGN_TARGET setting;
     -  3 : 3 dB above MAGN_TARGET setting;
     -  4 : 4 dB above MAGN_TARGET setting;
     -  5 : 5 dB above MAGN_TARGET setting;
     -  6 : 6 dB above MAGN_TARGET setting;
     -  7 : 7 dB above MAGN_TARGET setting;

Function sets the rabsolute RSSI threshold for asserting carrier sense by vrite rssi_threshold value to the CCRF_AGCCTRL2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_agc_gain()

void ccrf_set_agc_gain ( ccrf_t * ctx,
uint8_t agc_gain )

Set the AGC gain function.

Parameters
ctxClick object.
agc_gain
   
- 0 : Normal operation. Always adjust gain when required;
- 1 : The gain setting is frozen when a sync word has been found;
- 2 : Manually freezes the analog gain setting and continue to adjust the digital gain;
- 3 : Manually freezes both the analog and the digital gain settings. Used for manually overriding the gain;

Function sets the AGC gain by vrite agc_gain value to the CCRF_AGCCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_amplitude_ch_filter()

void ccrf_set_amplitude_ch_filter ( ccrf_t * ctx,
uint8_t ach_filter )

Set the target amplitude from channel filter function.

Parameters
ctxClick object.
ach_filter
 
Maximum allowable LNA + LNA 2 gain :
     - 0 : 24 dB;
     - 1 : 27 dB;
     - 2 : 30 dB;
     - 3 : 33 dB;
     - 4 : 36 dB;
     - 5 : 38 dB;
     - 6 : 40 dB;
     - 7 : 42 dB;

Function sets the target amplitude from channel filter by vrite ach_filter value to the CCRF_AGCCTRL2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_auto_calibrate_mode()

void ccrf_set_auto_calibrate_mode ( ccrf_t * ctx,
uint8_t ac_mode )

Set automatically calibrate function.

Parameters
ctxClick object.
ac_mode
 
When to perform automatic calibration :
     - 0 : Never (manually calibrate using SCAL strobe);
     - 1 : When going from IDLE to RX or TX (or FSTXON);
     - 2 : When going from RX or TX back to IDLE automatically;
     - 3 : Every 4th time when going from RX or TX to IDLE automatically;

Function sets the automatically calibrate by vrite ac_mode value to the CCRF_MCSM0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_auto_initial_calibration()

void ccrf_set_auto_initial_calibration ( ccrf_t * ctx)

Set automatic initial calibration function.

Parameters
ctxClick object.

Function sets the automatic initial calibration by cleared to '0' states of [ bit 7 ] of the CCRF_WORCTRL register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_avr_len_ampitude()

void ccrf_set_avr_len_ampitude ( ccrf_t * ctx,
uint8_t al_amp )

Set the averaging length for the amplitude from the channel filter function.

Parameters
ctxClick object.
al_amp
   
Channel filter samples | OOK decision :
- 0 :  8 |  4 dB;
- 1 : 16 |  8 dB;
- 2 : 32 | 12 dB;
- 3 : 64 | 16 dB;

Function sets the averaging length for the amplitude from the channel filter by vrite numChFilter value to the CCRF_AGCCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_bit_sync_config()

void ccrf_set_bit_sync_config ( ccrf_t * ctx,
uint8_t bs_config )

Set bit synchronization configuration function.

Parameters
ctxClick object.
bsConfig
  
Freq. compensation loop gain before sync word :
 - [ bit 7:6 ] : Clock recovery loop integral gain before sync word:
      - 0 : 1Ki;
      - 1 : 2Ki;
      - 2 : 3Ki;
      - 3 : 4Ki;
 - [ bit 5:4 ] : Clock recovery loop proportional gain before sync word:
      - 0 : 1Kp;
      - 1 : 2Kp;
      - 2 : 3Kp;
      - 3 : 4Kp;
 - [ bit 3 ]   : Clock recovery loop integral gain after sync word:
      - 0 : Same as BS_PRE_KI;
      - 1 : Ki/2;
 - [ bit 2 ]   : Clock recovery loop proportional gain after sync word:
      - 0 : Same as BS_PRE_KP;
      - 1 : Kp;
 - [ bit 1:0 ] : Data rate offset saturation (max data rate difference):
      - 0 : �0 (No data rate offset compensation performed);
      - 1 : �3.125% data rate offset;
      - 2 : �6.25% data rate offset;
      - 3 : �12.5% data rate offset;

Function sets the bit synchronization configuration by vrite bsConfig value to the CCRF_BSCFG register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_cca_mode()

void ccrf_set_cca_mode ( ccrf_t * ctx,
uint8_t cca_mode )

Set CCA mode function.

Parameters
ctxClick object.
cca_mode
 
Clear channel indication :
   - 0 : Always;
   - 1 : If RSSI below threshold;
   - 2 : Unless currently receiving a packet;
   - 3 : If RSSI below threshold unless currently receiving a packet;

Function sets the clear channel indication by vrite ccaMode value to the CCRF_MDMCFG1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_channel_number()

void ccrf_set_channel_number ( ccrf_t * ctx,
uint8_t ch_num )

Set channel number function.

Parameters
ctxClick object.
ch_num8-bit channel number

Function sets the channel number which is multiplied by the channel spacing setting and added to the base frequency to the CCRF_CHANNR register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_device_address()

void ccrf_set_device_address ( ccrf_t * ctx,
uint8_t dev_addr )

Set device address function.

Parameters
ctxClick object.
dev_addr8-bit address used for packet filtration

Function sets the device address ( optional broadcast addresses are 0 (0x00) and 255 (0xFF) ) to the CCRF_ADDR register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_dvga_gain()

void ccrf_set_dvga_gain ( ccrf_t * ctx,
uint8_t dvga_gain )

Set the maximum allowable DVGA gain function.

Parameters
ctxClick object.
dvga_gain
Allowable DVGA settings :
     - 0 : All gain settings can be used;
     - 1 : The highest gain setting can not be used;
     - 2 : The 2 highest gain settings can not be used;
     - 3 : The 3 highest gain settings can not be used;

Function sets the maximum allowable DVGA gain by vrite dvgaGain value to the CCRF_MCSM0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_fifo_threshold()

void ccrf_set_fifo_threshold ( ccrf_t * ctx,
uint8_t threshold_rx_tx )

Set the threshold for the TX FIFO and RX FIFO function.

Parameters
ctxClick object.
threshold_rx_tx
  number of bytes in the FIFO :
     -  0 : TX = 61, RX =  4;
     -  1 : TX = 57, RX =  8;
     -  2 : TX = 53, RX = 12;
     -  3 : TX = 49, RX = 16;
     -  4 : TX = 45, RX = 20;
     -  5 : TX = 41, RX = 24;
     -  6 : TX = 37, RX = 28;
     -  7 : TX = 33, RX = 32;
     -  8 : TX = 29, RX = 36;
     -  9 : TX = 25, RX = 40;
     - 10 : TX = 21, RX = 44;
     - 11 : TX = 17, RX = 48;
     - 12 : TX = 13, RX = 52;
     - 13 : TX =  9, RX = 56;
     - 14 : TX =  5, RX = 60;
     - 15 : TX =  1, RX = 64;

Function sets the threshold for the TX FIFO and RX FIFO to the CCRF_FIFOTHR register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_freq_loop_gain_as()

void ccrf_set_freq_loop_gain_as ( ccrf_t * ctx,
uint8_t fcl_gain )

Set frequency compensation loop gain after a sync function.

Parameters
ctxClick object.
fcl_gain
  
Freq. compensation loop gain after sync word :
- 0 : Same as FOC_PRE_K;
- 1 : K/2;

Function sets the frequency compensation loop gain after a sync by vrite fcl_gain value to the CCRF_FOCCFG register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_freq_loop_gain_bs()

void ccrf_set_freq_loop_gain_bs ( ccrf_t * ctx,
uint8_t fcl_gain )

Set frequency compensation loop gain before a sync function.

Parameters
ctxClick object.
fcl_gain
 
Freq. compensation loop gain before sync word :
- 0 : 1K;
- 1 : 2K;
- 2 : 3K;
- 3 : 4K;

Function sets the frequency compensation loop gain before a sync by vrite fcl_gain value to the CCRF_FOCCFG register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_frequency_offset()

void ccrf_set_frequency_offset ( ccrf_t * ctx,
uint8_t freq_offset )

Set frequency offset function.

Parameters
ctxClick object.
freq_offset8-bit frequency before being used by the FS

Function sets the frequency offset by vrite freqOffset value to the CCRF_FSCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_gd0_active_high()

void ccrf_set_gd0_active_high ( ccrf_t * ctx)

GD0 select active high function.

Parameters
ctxClick object.

Function GD0 pin ( PWM ) select active high by clearde to '0' states of [ bit 6 ] of the CCRF_IOCFG0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_gd0_active_low()

void ccrf_set_gd0_active_low ( ccrf_t * ctx)

GD0 select active low function.

Parameters
ctxClick object.

Function GD0 pin ( PWM ) select active low by set to '1' states of [ bit 6 ] of the CCRF_IOCFG0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_gd2_active_high()

void ccrf_set_gd2_active_high ( ccrf_t * ctx)

GD2 select active high function.

Parameters
ctxClick object.

Function GD2 pin ( PWM ) select active high by clearde to '0' states of [ bit 6 ] of the CCRF_IOCFG2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_gd2_active_low()

void ccrf_set_gd2_active_low ( ccrf_t * ctx)

GD2 select active low function.

Parameters
ctxClick object.

Function GD2 pin ( PWM ) select active low by set to '1' states of [ bit 6 ] of the CCRF_IOCFG2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_hysteresis_lvl()

void ccrf_set_hysteresis_lvl ( ccrf_t * ctx,
uint8_t hyst_lvl )

Set the level of hysteresis on the magnitude deviation function.

Parameters
ctxClick object.
hyst_lvl
   
Hysteresis on the magnitude deviation :
     - 0 : No hysteresis, small symmetric dead zone, high gain;
     - 1 : Low hysteresis, small asymmetric dead zone, medium gain;
     - 2 : Medium hysteresis, medium asymmetric dead zone, medium gain;
     - 3 : Large hysteresis, large asymmetric dead zone, low gain;

Function sets the level of hysteresis on the magnitude deviation by vrite hyst_lvl value to the CCRF_AGCCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_if_frequency()

void ccrf_set_if_frequency ( ccrf_t * ctx,
uint8_t if_freq )

Set desired IF frequency function.

Parameters
ctxClick object.
if_freq8-bit desired IF frequency to employ in RX

Function sets the desired IF frequency by vrite ifFreq value to the CCRF_FSCTRL1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_lna_gain()

void ccrf_set_lna_gain ( ccrf_t * ctx,
uint8_t lna_gain )

Set the maximum allowable LNA gain function.

Parameters
ctxClick object.
lna_gain
 
Maximum allowable LNA + LNA 2 gain :
     - 0 : Maximum possible LNA + LNA 2 gain;
     - 1 : Approx. 2.6 dB below maximum possible gain;
     - 2 : Approx. 6.1 dB below maximum possible gain;
     - 3 : Approx. 7.4 dB below maximum possible gain;
     - 4 : Approx. 9.2 dB below maximum possible gain;
     - 5 : Approx. 11.5 dB below maximum possible gain;
     - 6 : Approx. 14.6 dB below maximum possible gain;
     - 7 : Approx. 17.1 dB below maximum possible gain;

Function sets the maximum allowable LNA + LNA 2 gain by vrite lnaGain value to the CCRF_AGCCTRL2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_lna_strategies()

void ccrf_set_lna_strategies ( ccrf_t * ctx,
uint8_t lna_strat )

Set the LNA strategies function.

Parameters
ctxClick object.
lna_strat
  
     - 0 : LNA2 gain is decreased to minimum beforedecreasing LNA gain;
     - 1 : LNA gain is decreased first.;

Function sets the tLNA strategies by vrite lna_strat value to the CCRF_AGCCTRL1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_max_length_packets()

void ccrf_set_max_length_packets ( ccrf_t * ctx,
uint8_t max_length )

Set maximum length packets allowed function.

Parameters
ctxClick object.
max_length8-bit max length value

Function sets the maximum length packets allowed when fixed packet length is enabled by write maxLength to the CCRF_FIFOTHR register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

Note
If variable length packets are used, this value indicates the maximum length packets allowed.

◆ ccrf_set_min_num_preamble()

void ccrf_set_min_num_preamble ( ccrf_t * ctx,
uint8_t p_num )

Set the minimum number of preamble bytes to be transmitted function.

Parameters
ctxClick object.
p_num
Number of preamble bytes :
   - 0 : 2;
   - 1 : 3;
   - 2 : 4;
   - 3 : 6;
   - 4 : 6;
   - 5 : 12;
   - 6 : 16;
   - 7 : 24;

Function sets the the minimum number of preamble bytes to be transmitted by vrite p_num value to the CCRF_MDMCFG1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_modulation()

void ccrf_set_modulation ( ccrf_t * ctx,
uint8_t rf_modulation )

Set the modulation format of the radio signal function.

Parameters
ctxClick object.
rf_modulation
Modulation format of the radio signal :
- 0 : 2-FSK;
- 1 : GFSK;
- 2 : OOK;
- 3 : MSK;

Function sets the modulation format of the radio signal by vrite rfModulation value to the CCRF_FSCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_num_ch_filter()

void ccrf_set_num_ch_filter ( ccrf_t * ctx,
uint8_t num_ch_filter )

Set the number of channel filter samples function.

Parameters
ctxClick object.
num_ch_filter
  
Channel filter samples :
- 0 :  8;
- 1 : 16;
- 2 : 24;
- 3 : 32;

Function sets the number of channel filter samples by vrite numChFilter value to the CCRF_AGCCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_relative_rssi_threshold()

void ccrf_set_relative_rssi_threshold ( ccrf_t * ctx,
uint8_t rssi_threshold )

Set the relative change threshold for asserting carrier sense function.

Parameters
ctxClick object.
rssi_threshold
  
Carrier sense relative threshold :
     - 0 : Relative carrier sense threshold disabled;
     - 1 : 6 dB increase in RSSI value;
     - 2 : 10 dB increase in RSSI value;
     - 3 : 14 dB increase in RSSI value;

Function sets the relative change threshold for asserting carrier sense by vrite rssi_threshold value to the CCRF_AGCCTRL1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_state_packet_recived()

void ccrf_set_state_packet_recived ( ccrf_t * ctx,
uint8_t pr_state )

Set state after finishing packet reception function.

Parameters
ctxClick object.
pr_state
Next state after finishing packet reception :
     - 0 : IDLE;
     - 1 : FSTXON;
     - 2 : TX;
     - 3 : Stay in RX;

Function sets the state after finishing packet reception by vrite prState value to the CCRF_MDMCFG1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_state_packet_sent()

void ccrf_set_state_packet_sent ( ccrf_t * ctx,
uint8_t ps_state )

Set state when a packet has been sent function.

Parameters
ctxClick object.
ps_state
 
Next state after finishing packet transmission :
     - 0 : IDLE;
     - 1 : FSTXON;
     - 2 : Stay in TX (start sending preamble);
     - 3 : RX;

Function sets the state when a packet has been sent by vrite ps_state value to the CCRF_MDMCFG1 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_sync_word_qualifier_mode()

void ccrf_set_sync_word_qualifier_mode ( ccrf_t * ctx,
uint8_t q_mode )

Set sync-word qualifier mode function.

Parameters
ctxClick object.
q_mode
Sync-word qualifier mode :
- 0 : No preamble/sync;
- 1 : 15/16 sync word bits detected;
- 2 : 16/16 sync word bits detected;
- 3 : 30/32 sync word bits detected;
- 4 : No preamble/sync, carrier-sense above threshold;
- 5 : 15/16 + carrier-sense above threshold;
- 6 : 16/16 + carrier-sense above threshold;
- 7 : 30/32 + carrier-sense above threshold;

Function sets the sync-word qualifier mode by vrite qMode value to the CCRF_MDMCFG2 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_timeout_reg_block()

void ccrf_set_timeout_reg_block ( ccrf_t * ctx,
uint8_t timeout )

Set the averaging length for the amplitude from the channel filter function.

Parameters
ctxClick object.
timeout
t_event1 :
     - 0 :  4 ( 0.111 � 0.115 ms );
     - 1 :  6 ( 0.167 � 0.173 ms );
     - 2 :  8 ( 0.222 � 0.230 ms );
     - 3 : 12 ( 0.333 � 0.346 ms );
     - 4 : 16 ( 0.444 � 0.462 ms );
     - 5 : 24 ( 0.667 � 0.692 ms );
     - 6 : 32 ( 0.889 � 0.923 ms );
     - 7 : 48 ( 1.333 � 1.385 ms );

Function sets the averaging length for the amplitude from the channel filter by vrite timeout value to the CCRF_WORCTRL register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_set_timeout_wor()

void ccrf_set_timeout_wor ( ccrf_t * ctx,
uint8_t timeout )

Set the maximum timeout of the WOR module function.

Parameters
ctxClick object.
timeout
Resolution  | Max timeout :
     - 0 : 1    period  ( 28    � 29    �s ) |   1.8 �  1.9 seconds;
     - 1 : 2^5  periods (  0.89 �  0.92 ms ) |  58   � 61   seconds;
     - 2 : 2^10 periods ( 28    � 30    ms ) |  31   � 32    minutes;
     - 3 : 2^15 periods (  0.91 �  0.94 s)   |  16.5 � 17.2  hours;

Function sets the maximum timeout of the WOR module by vrite timeout value to the CCRF_WORCTRL register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_sw_reset()

void ccrf_sw_reset ( ccrf_t * ctx)

Softwere reset function.

Parameters
ctxClick object.

The function Softwere reset - resets the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board by write CCRF_SRES, a strobe command.

◆ ccrf_transmit_packet()

void ccrf_transmit_packet ( ccrf_t * ctx,
uint8_t * tx_buffer,
uint8_t n_bytes )

Transmit packet data function.

Parameters
ctxClick object.
tx_bufferpointer to a buffer containing the data that are going to be transmitted
n_bytesnumber of bytes that are going to be transmitted

Function transmit a packet with packet length up to 63 bytes to the targeted 8-bit register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

Note
 To use this function, GD0 pin must be configured to be asserted when sync word is sent and
 de-asserted at the end of the packet.
 The function implements polling of GD0 pin. First it waits for GD0 to be set and then it waits
 for it to be cleared.

◆ ccrf_transmit_packet_with_address()

uint8_t ccrf_transmit_packet_with_address ( ccrf_t * ctx,
uint8_t * tx_buffer,
uint8_t n_bytes,
uint8_t * attempts )

Transmit packet data with address function.

Parameters
ctxClick object.
tx_bufferPointer to a buffer containing the data that are going to be transmitted
n_bytesNumber of bytes that are going to be transmitted
attemptsPointer to a buffer containing the attempts data

Function transmit a packet with packet length up to 63 bytes to the targeted 8-bit register attempts address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_turn_data_whitening_off()

void ccrf_turn_data_whitening_off ( ccrf_t * ctx)

Turn data whitening off function.

Parameters
ctxClick object.

Function turn data whitening ON by cleared to '0' states of [ bit 6 ] of the CCRF_PKTCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_turn_data_whitening_on()

void ccrf_turn_data_whitening_on ( ccrf_t * ctx)

Turn data whitening on function.

Parameters
ctxClick object.

Function turn data whitening ON by sets to '1' states of [ bit 6 ] of the CCRF_PKTCTRL0 register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_write_byte()

void ccrf_write_byte ( ccrf_t * ctx,
uint8_t reg_address,
uint8_t write_data )

Write the byte of data to the 8-bit register address function.

Parameters
ctxClick object.
reg_address8-bit register address
write_dataByte of data to write

Function writes the byte of data to the targeted 8-bit register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_write_bytes()

void ccrf_write_bytes ( ccrf_t * ctx,
uint8_t reg_address,
uint8_t * write_data,
uint8_t n_bytes )

Sequential write function.

Parameters
ctxClick object.
reg_address8-bit register address
write_datapointer to the data to be written
n_bytesnumber of bytes to be written

Function writes a sequential data starting to the targeted 8-bit register address of the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.

◆ ccrf_write_strobe()

void ccrf_write_strobe ( ccrf_t * ctx,
uint8_t strobe )

Write a strobe command function.

Parameters
ctxClick object.
strobe8-bit strobe command

Function writes a strobe command to the CC2500 Low-Power 2.4 GHz RF transceiver on the ccRF Click board.