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