sr_api.h

Radio level application programming interface.

Copyright

Copyright (C) 2020-2021 SPARK Microsystems International Inc. All rights reserved.

License

This source code is proprietary and subject to the SPARK Microsystems Software EULA found in this package in file EULA.txt.

Author

SPARK FW Team.

Defines

CLOCK_FACTOR 1000

Symbol Clock factor for fixed point operation

CRYSTAL_CLOCK_PERIOD 32768

Radio crystal clock frequency

SYMBOL_CLOCK_PERIOD 20480

Symbol clock frequency

SET_RADIO_ACTIONS(...) OR(__VA_ARGS__)

Register 1F(Radio actions) setter for the SR1000 API

SET_INT_FLAG_CFG(...) OR(__VA_ARGS__)

Register 0(Radio flags) setter for the SR1000 API

SET_TIMER_CFG(...) OR(__VA_ARGS__)

Register 04(Sleep configuration) setter for the SR1000 API

SET_PACKET_CFG(...) OR(__VA_ARGS__)

Register 3F(Packet configuration) setter for the SR1000 API

SET_MAIN_MODEM_FEAT(...) OR(__VA_ARGS__)

Register 2C(Main modem features) setter for the SR1000 API

SET_DLLTUNING(...) OR(__VA_ARGS__)

Register 1D(DLL tuning) setter for the SR1000 API

SET_CTRL_PERIPH(...) OR(__VA_ARGS__)

Register 0E(Disable peripherals) setter for the SR1000 API

SET_TX_PARAMS(...) OR(__VA_ARGS__)

Register 1C(TX parameters) setter for the SR1000 API

Typedefs

typedef uint32_t int_flag_cfg_t

Register 00(Radio events) type for SR1000 API

typedef uint16_t tmr_slp_config_t

Register 04(Sleep configuration) type for SR1000 API

typedef uint16_t radio_actions_t

Register 1F(Radio actions) type for SR1000 API

typedef uint16_t main_modem_feat_t

Register 2C(Main modem features) type for SR1000 API

typedef uint16_t peripherals_ctrl_t

Register 0E(Disable peripherals) type for SR1000 API

typedef uint16_t dll_tuning_t

Register 1D(DLL tuning) type for SR1000 API

typedef uint16_t clear_to_send_t

Register 2D(Clear to send) type for SR1000 API

typedef uint16_t packet_cfg_t

Register 3F(Packet configuration) type for SR1000 API

typedef uint16_t radio_timer_config_t

Register 05(Timer configuration) type for SR1000 API

typedef uint16_t tx_params_t

Register 1C(TX parameters) type for SR1000 API

typedef struct shadow_register radio_shadow_reg_t

API shadow register.

Note

This is use by a couple of api function when a register has been changed but not written to yet.

typedef struct radio radio_t

Radio instance.

typedef struct rx_timeout rx_timeout_t

Receiver timeout and power-up duration instance.

typedef struct read_reg_16 read_reg_16_t

The 16-bit read register split in two 8-bit registers.

typedef struct rx_wait_time rx_wait_time_t

Receiver wait time reception buffer instance.

typedef struct last_addr last_addr_t

Last received address instance.

typedef struct syncword_cfg syncword_cfg_t

Synchronization word configuration.

typedef struct phase_info phase_info_t

Phases value, last received preamble phase correlation data.

Functions

static inline uint8_t pll_startup_us_to_clock_register(uint32_t pll_startup_us)

Convert given PLL startup time (us) to the equivalent register value.

Parameters

pll_startup_us – [in] PLL startup time, in us.

Returns

Equivalent 8-bit register value.

static inline uint16_t rx_timeout_us_to_register(uint32_t rx_period_us)

Convert given RX timeout (us) to the equivalent register value.

Parameters

rx_period_us – [in] RX timeout period, in us.

Returns

Equivalent 16-bit register value.

static inline uint8_t rx_pwr_up_delay_ns_to_register(uint16_t rx_power_up_delay_ns)

Convert given RX power-up delay (ns) to the equivalent register value.

Parameters

rx_power_up_delay_ns – [in] RX power-up delay, in ns.

Returns

Equivalent 4-bit register value.

static inline uint8_t rx_pause_time_pll_cycles_to_register(uint32_t rx_pause_time_pll_cycles)

Convert given RX pause time (us) to the equivalent register value.

Parameters

rx_pause_time_pll_cycles – [in] Receiver pause time, in us.

Returns

Equivalent 8-bit register value.

static inline uint8_t pwr_up_delay_ns_to_register(uint32_t pwr_up_delay_ns)

Convert given power-up delay (ns) to the equivalent register value.

Parameters

pwr_up_delay_ns – [in] Power-up delay, in ns.

Returns

Equivalent 8-bit register value.

static inline uint8_t clamp_8_bit_value(int16_t value)

Clamp 8-bit max and min to the given value.

Parameters

value – [in] Value to be clamped.

Returns

Clamped value, if necessary.

static inline void uwb_reset(radio_t *radio, uint8_t delay_ms)

Reset the radio.

Parameters
  • radio – [in] Radio’s instance.

  • delay_ms – [in] Delay in milliseconds before releasing the reset pin. Radio is kept IDLE after reset for the same amount of time.

static inline void uwb_set_shadow_reg(radio_t *radio)

Reset the shadow register values to the internal radio values.

Parameters

radio – [in] Radio instance.

static inline void uwb_control_peripherals(radio_t *radio, peripherals_ctrl_t periph_ctrl)

Control the radio peripherals.

Parameters
  • radio – [in] Radio instance.

  • periph_ctrl – [in] Peripherals control instance.

static inline void uwb_transfer_blocking(radio_t *radio)

Initiate a transfer in blocking mode using all the appended sequence.

Parameters

radio – [in] Radio instance.

static inline void uwb_transfer_non_blocking(radio_t *radio)

Initiate a transfer in non blocking mode using all the appended sequence.

Parameters

radio – [in] Radio instance.

static inline void uwb_init(radio_t *radio, radio_hal_t *radio_hal, uint8_t *app_spi_rx_buffer, uint8_t *app_spi_tx_buffer, uint8_t app_spi_buffer_size, sr_api_error_t *error)

Initialize the api .

Parameters
  • radio – [out] Radio instance.

  • radio_hal – [in] Radio HAL instance.

  • app_spi_rx_buffer – [in] Application buffer for SPI reception.

  • app_spi_tx_buffer – [in] Application buffer for SPI transmission.

  • app_spi_buffer_size – [in] Application buffer size.

  • error – [out] API error instance.

static inline void uwb_set_destination_address(radio_t *radio, uint16_t address, address_length_t address_size)

Set the radio destination address.

Parameters
  • radio – [in] Radio instance.

  • address – [in] Destination address.

  • address_size – [in] ADDRESS_LENGTH_8 for 8-bit address, ADDRESS_LENGTH_16 for 16-bit address.

static inline void uwb_set_local_address(radio_t *radio, uint16_t address, address_length_t address_size)

Set the radio local address.

Parameters
  • radio – [in] Radio instance.

  • address – [in] Local address.

  • address_size – [in] ADDRESS_LENGTH_8 for 8-bit address, ADDRESS_LENGTH_16 for 16-bit address.

static inline void uwb_enable_modem_wakeup_timer(radio_t *radio)

Enable the radio sleep timer.

Parameters

radio – [in] Radio instance.

static inline void uwb_disable_modem_wakeup_timer(radio_t *radio)

Disable the radio sleep timer.

Parameters

radio – [in] Radio instance.

static inline void uwb_set_rx_pause_time(radio_t *radio, uint16_t rx_pause_time)

Set the radio off time interval.

Parameters
  • radio – [in] Radio instance.

  • rx_pause_time – [in] Receiver off time interval, in pll cycles.

static inline void uwb_set_timer_config(radio_t *radio, radio_timer_config_t timer_config)

Configure the radio timer.

Parameters
  • radio – [in] Radio instance.

  • timer_config – [in] Timer configuration instance.

static inline void uwb_disable_timer_config(radio_t *radio)

Disable the radio timer.

Parameters

radio – [in] Radio instance.

static inline void uwb_set_int_flag(radio_t *radio, int_flag_cfg_t int_flag_cfg)

Set the main IRQ register flag.

Parameters
  • radio – [in] Radio instance.

  • int_flag_cfg – [in] Interrupt settings.

static inline void uwb_disable_irq(radio_t *radio)

Disable all the IRQs.

Parameters

radio – [in] Radio instance.

static inline void uwb_set_sleep_config(radio_t *radio, sleep_lvl_t level, sleep_events_t events)

Setup the radio sleep level and the sleep trigger event.

Parameters
  • radio – [in] Radio instance.

  • level – [in] Sleep level instance.

  • events – [in] Sleep event instance.

static inline void uwb_set_radio_actions(radio_t *radio, radio_actions_t target_radio_actions)

Sent specific commands to the radio.

Parameters
  • radio – [in] Radio instance.

  • target_radio_actions – [in] Radio actions instance.

static inline read_reg_16_t uwb_get_irq_flags(radio_t *radio)

Get main IRQ status flag.

Parameters

radio – [in] Radio instance.

Returns

Pointers containing the IRQ flag registers.

static inline void uwb_set_crc(radio_t *radio, uint16_t crc_polynomial)

Set the payload CRC polynomial.

Parameters
  • radio – [in] Radio instance.

  • crc_polynomial – [in] Target CRC polynomial.

static inline void uwb_set_main_modem_features(radio_t *radio, main_modem_feat_t main_modem_feat)

Set the radio main features.

Parameters
  • radio – [in] Radio instance.

  • main_modem_feat – [in] Radio main features instance.

static inline void uwb_set_const_gains(radio_t *radio, uint8_t const_gains)

Set the radio constant gains.

Parameters
  • radio – [in] Radio instance.

  • const_gains – [in] Constant gains value.

static inline void uwb_enable_phase_tracking(radio_t *radio)

Enable the radio phase tracking.

Parameters

radio – [in] Radio instance.

static inline void uwb_disable_phase_tracking(radio_t *radio)

Disable the radio phase tracking.

Parameters

radio – [in] Radio instance.

static inline void uwb_set_preamble_length(radio_t *radio, uint16_t preamble_size)

Configure the frame preamble length.

Parameters
  • radio – [in] Radio instance.

  • preamble_size – [in] Preamble size.

static inline void uwb_set_syncword_config(radio_t *radio, syncword_cfg_t *cfg)

Configure the frame syncword.

Parameters
  • radio – [in] Radio instance.

  • cfg – [in] Syncword configuration instance.

static inline void uwb_set_tx_packet_size(radio_t *radio, uint8_t packet_size)

Configure the TX payload size.

Note

Useless if BIT_SIZESRC of register REG_PACKETCFG(0x3E) is set.

Parameters
  • radio – [in] Radio instance.

  • packet_size – [in] TX payload size.

static inline void uwb_set_rx_waited_src(radio_t *radio, rx_wait_source_t rx_wait_src)

Configure the RX waited source.

Parameters
  • radio – [in] Radio instance.

  • rx_wait_src – [in] RX waited source.

static inline void uwb_set_rx_packet_size(radio_t *radio, uint8_t packet_size)

Configure the RX payload size.

Note

If BIT_SIZEHDRE of register REG_PACKETCFG(0x3E) is cleared and the user does not send a header in the payload, it’s the only way to tell what is the payload size.

Parameters
  • radio – [in] Radio instance.

  • packet_size – [in] RX payload size.

static inline void uwb_set_pll_startup(radio_t *radio, uint16_t pll_startup_us)

Configure the phase-locked loop power-up waiting time.

Note

The PLL startup time have a resolution of 30.51 us.

Parameters
  • radio – [in] Radio instance.

  • pll_startup_us – [in] PLL power-up waiting time, in us.

static inline void uwb_set_rx_timeout(radio_t *radio, rx_timeout_t *rx_timeout)

Configure the receiver timeout and the power-up duration.

Note

RX timeout is extended to 12-bit and the power-up duration is 4-bit long. The timeout have a resolution of 390.625025 ns per bit. Receiver power up delay have a resolution of 48.82815 ns per bit

Parameters
  • radio – [in] Radio instance.

  • rx_timeout – RX timeout and power-up duration instance.

static inline void uwb_set_dll_tuning(radio_t *radio, dll_tuning_t dll_tuning)

Set dll tuning.

Parameters
  • radio – [in] Radio instance.

  • dll_tuning – [in] DLL tuning value.

static inline void uwb_set_integgain(radio_t *radio, uint8_t integgain_value)

Set integgain.

Parameters
  • radio – [in] Radio instance.

  • integgain_value – [in] Integgain value.

static inline void uwb_fill_tx_fifo(radio_t *radio, uint8_t *tx_buffer, uint16_t size)

Fill the radio TX FIFO in BURST mode.

Parameters
  • radio – [in] Radio instance.

  • tx_buffer – [in] Buffer to transmit OTA.

  • size – [in] Size of the transmission.

static inline uint8_t *uwb_read(radio_t *radio, uint8_t size)

Read an packet from the radio’s RX FIFO in BURST mode.

Parameters
  • radio – [in] Radio instance.

  • size – [in] Reception size.

Returns

RX data pointer

static inline uint8_t *uwb_read_frame_size(radio_t *radio)

Read frame size from the radio’s RX FIFO.

Parameters

radio – [in] Radio instance.

Returns

RX frame sze data pointer

static inline void uwb_set_tx_buffer_load_irq_threshold(radio_t *radio, uint8_t threshold)

Configure the TX buffer load IRQ threshold.

Parameters
  • radio – [in] Radio instance.

  • threshold – [in] Buffer load threshold.

static inline void uwb_disable_tx_buffer_load_irq(radio_t *radio)

Disable the TX buffer load IRQ.

Parameters

radio – [in] Radio instance.

static inline void uwb_set_rx_buffer_load_irq_threshold(radio_t *radio, uint8_t threshold)

Configure the RX buffer load IRQ threshold.

Parameters
  • radio – [in] Radio instance.

  • threshold – [in] Buffer load threshold.

static inline void uwb_disable_rx_buffer_load_irq(radio_t *radio)

Disable the RX buffer load IRQ.

Parameters

radio – [in] Radio instance.

static inline void uwb_set_pwr_up_delay(radio_t *radio, uint32_t power_up_delay_ns)

Set the radio power up delay.

Note

The register have a resolution of approximately 195 ns per register increment.

Parameters
  • radio – [in] Radio instance.

  • power_up_delay_ns – [in] Power up delay, in ns.

static inline void uwb_set_rx_filters(radio_t *radio, uint8_t lna_peak, uint8_t rx_filters)

Set the register REG_RXFILTERS.

Parameters
  • radio – [in] Radio instance.

  • lna_peak – [in] Low noise amplifier peak value. BIT(7..5).

  • rx_filters – [in] RX filters frequency. BIT(4..0).

static inline void uwb_set_rx_filters_raw(radio_t *radio, uint8_t rx_filters)

Set the register REG_RXFILTERS.

Parameters
  • radio – [in] Radio instance.

  • rx_filters – [in] RX filters frequency and Low noise amplifier peak value. BIT(7..0).

static inline void uwb_set_cac(radio_t *radio, rx_idle_pwr_t rx_idle_pwr, uint8_t cac_thresh)

Set collision avoidance parameters.

Parameters
  • radio – [in] Radio instance.

  • rx_idle_pwr – [in] Receiver’s idle power consumption. BIT(7..6).

  • cac_thresh – [in] Collision-avoidance check threshold. BIT(5..0).

static inline void uwb_set_tx_params(radio_t *radio, tx_params_t tx_params)

Set the radio shared pulse parameters.

Parameters
  • radio – [in] Radio instance.

  • tx_params – [in] Shared pulse parameters structure.

static inline void uwb_set_packet_config(radio_t *radio, packet_cfg_t packet_cfg)

Setup the packet configuration(MAC layer).

Parameters
  • radio – [in] Radio instance.

  • packet_cfg – [in] Packet configuration struct.

static inline void uwb_select_channel(radio_t *radio, uint8_t *tx_pattern, uint8_t pulse_size)

Select the radio frequency channel to use in BURST mode.

Parameters
  • radio – [in] Radio instance.

  • tx_pattern – [in] 0x10 - 0x17 register pattern buffer.

  • pulse_size – [in] Pulse buffer size.

static inline uint8_t *uwb_get_phase_info(radio_t *radio)

Get radio phase information (4 phases) in BURST mode.

Parameters

radio – [in] Radio’s instance.

Returns

Pointer that will contains the received phase info.

static inline rx_wait_time_t uwb_get_rx_wait_time(radio_t *radio)

Get the content of the REG_RXWAITTIME1..0.

Parameters

radio – [in] Radio instance.

Returns

RX wait time structure

static inline uint8_t *uwb_get_rssi(radio_t *radio)

Get the last received signal strength indicator.

Parameters

radio – [in] Radio instance.

Returns

Last received frame RSSI.

static inline uint8_t *uwb_get_rnsi(radio_t *radio)

Get the last received noise strength indicator.

Parameters

radio – [in] Radio instance.

Returns

Last received frame RNSI.

static inline void uwb_fill_header_non_blocking(radio_t *radio, uint8_t *hdr_buffer, uint8_t hdr_size)

Fill the header field in the radio TX_FIFO.

This function do not work with any of the other append function. It should be call right before calling the fill_data function. It provided an optimized way to fill the TX FIFO using a header and a payload.

Note

The header field can be null. This function is required in conjunction with the fill_data function in order to achieve optimal filling of the radio TX FIFO.

Parameters
  • radio – [in] Radio instance.

  • hdr_buffer – [in] Header to transmit OTA.

  • hdr_size – [in] Size of the header.

static inline void uwb_fill_header_blocking(radio_t *radio, uint8_t *hdr_buffer, uint8_t hdr_size)

Fill the header field in the radio TX_FIFO in blocking mode.

This function do not work with any of the other append function. It should be call right before calling the fill_data function. It provided an optimized way to fill the TX FIFO using a header and a payload.

Note

The header field can be null. This function is required in conjunction with the fill_data function in order to achieve optimal filling of the radio TX FIFO.

Parameters
  • radio – [in] Radio instance.

  • hdr_buffer – [in] Header to transmit OTA.

  • hdr_size – [in] Size of the header.

static inline void uwb_fill_data_non_blocking(radio_t *radio, uint8_t *tx_buffer, uint16_t size)

Fill the radio TX FIFO in non-blocking mode.

This function do not work with any of the other append function. It should be call right after calling the fill_header function. It provided an optimized way to fill the TX FIFO using a header and a payload.

Parameters
  • radio – [in] Radio instance.

  • tx_buffer – [in] Buffer to transmit OTA.

  • size – [in] Size of the transmission.

static inline void uwb_fill_data_blocking(radio_t *radio, uint8_t *tx_buffer, uint16_t size)

Fill the radio TX FIFO in blocking mode.

This function do not work with any of the other append function. It should be call right after calling the fill_header function. It provided an optimized way to fill the TX FIFO using a header and a payload.

Parameters
  • radio – [in] Radio instance.

  • tx_buffer – [in] Buffer to transmit OTA.

  • size – [in] Size of the transmission.

static inline void uwb_fill_cut_through_data(radio_t *radio, uint8_t *buffer, uint8_t size)

Fill the radio TX FIFO for the specific cut through mode case.

Parameters
  • radio – [in] Radio instance.

  • buffer – [in] Buffer to transmit OTA.

  • size – [in] Size of the transmission.

static inline void uwb_set_wake_sleep_raw(radio_t *radio, uint16_t sleep_time)

Send raw wake-sleep period to radio.

Parameters
  • radio – [in] Radio instance.

  • sleep_time – [in] Desired wake sleep period, in clock cycles.

static inline void uwb_set_pwr_up_delay_raw(radio_t *radio, int16_t pwr_up)

Send raw power-up delay to radio.

Note

The raw value will be divided by 4 as per the register conversion.

Parameters
  • radio – [in] Radio instance.

  • pwr_up – [in] Desired pwr-up delay, in clock cycles.

static inline void uwb_set_rx_timeout_raw(radio_t *radio, uint16_t rx_timeout, uint8_t rx_pwr_up_delay)

Send raw RX timeout to the radio.

Note

The raw RX timeout will be divided by 8 as per the register conversion. The Receiver power-up delay will be appended raw.

Parameters
  • radio – [in] Radio instance.

  • rx_timeout – Desired timeout, in clock cycles.

  • rx_pwr_up_delay – [in] Receiver power-up delay, in clock cycles (4-bit).

static inline void uwb_set_timer_cfg_burst(radio_t *radio, uint16_t sleep_time, uint16_t rx_timeout, uint8_t rx_pwr_up_delay, int16_t pwr_up)
static inline last_addr_t uwb_get_last_rcv_frame_addr(radio_t *radio)

Check last received frame address.

Parameters

radio – [in] Radio instance.

Returns

Last address instance.

static inline void uwb_set_resistune(radio_t *radio, uint8_t resistune_reg_value)

Set the raw value of register REG_RESISTUNE.

Parameters
  • radio – [in] Radio instance.

  • resistune_reg_value – [in] Resistune register raw value.

static inline bool uwb_is_spi_busy(radio_t *radio)

Check last received frame address.

Parameters

radio – [in] Radio instance.

Returns True

SPI is busy.

Returns False

SPI is not busy.

static inline void uwb_write_register_8(radio_t *radio, uint8_t target_reg, uint8_t value)

Append an 8-bit write command over the SPI The register address must be odd.

Parameters
  • radio – [in] Radio’s instance.

  • target_reg – [in] Target radio register.

  • value – [in] Value to write in register.

static inline void uwb_write_register(radio_t *radio, uint8_t target_reg, reg_16_bit_t value)

Append a write command over the SPI.

Parameters
  • radio – [in] Radio instance.

  • target_reg – [in] Target radio register.

  • value – [in] Value to write in register.

static inline void uwb_burst_write(radio_t *radio, uint8_t starting_reg, uint8_t *buffer, uint8_t buffer_size)

Append a burst write command over the SPI.

This should be the last command before using the uwb_transfer function.

Parameters
  • radio – [in] Radio instance.

  • starting_reg – [in] Starting radio register.

  • buffer – [in] Buffer to write in register.

  • buffer_size – [in] Buffer size to write in burst.

static inline uint8_t *uwb_read_register_8(radio_t *radio, uint8_t target_reg)

Append a read command over the SPI.

Parameters
  • radio – [in] Radio instance.

  • target_reg – [in] Target radio register.

Returns

Pointer to the read value.

static inline uint8_t *uwb_burst_read(radio_t *radio, uint8_t starting_reg, uint8_t read_size)

Append a burst read command over the SPI.

This should be the last command before using the uwb_transfer function.

Parameters
  • radio – [in] Radio instance.

  • starting_reg – [in] Starting radio register.

  • read_size – [in] Burst read size.

Returns

Pointer to the read buffer.

static inline void uwb_apply_saved_calibration(radio_t *radio)

Write the resistune register from the shadow copy.

Parameters

radio – [in] Radio instance.

Variables

static const uint32_t sync_word_table[] = {0x08ecad3e, 0x09ae74e5, 0x0a2fb635, 0x0ade3365, 0x0b1ae937, 0x0cbad627, 0x0ce2a76d, 0x0e6ae45b, 0xe129ab17, 0xe126eac6, 0xe1225779, 0xe620a5db, 0xe92e8c4e, 0xe5a0af32, 0x0daf91ac, 0x0ca2fb72}
struct shadow_register
#include <sr_api.h>

API shadow register.

Note

This is use by a couple of api function when a register has been changed but not written to yet.

Public Members

reg_16_bit_t reg_int_flag_status

Current value in REG_IRQMASK1 & 2

uint8_t reg_slp_cfg

Current value in REG_SLEEPCONF

uint8_t radio_actions

Current value in REG_ACTIONS

uint8_t reg_sync_word_cfg

Current value in REG_SYNCWORDCFG

uint8_t reg_tx_params

Current value in REG_TXPARAMS

uint8_t reg_packet_cfg

Current value in REG_PACKETCFG

uint8_t reg_disables

Current value in REG_DISABLES

uint8_t reg_dll_tuning

Current value in REG_DLLTUNING

uint8_t reg_pll_startup

Current value in REG_PLLSTARTUP

uint8_t reg_modem_gain

Current value in REG_MODEMGAIN

uint8_t reg_main_modem

Current value in REG_MAINMODEM

uint8_t reg_resistune

Current value in REG_RESISTUNE

uint8_t reg_timer_cfg

Current value in REG_TIMERCONF

uint8_t tx_pulse_size

Current size of the TX pulse pattern

struct radio
#include <sr_api.h>

Radio instance.

Public Members

radio_hal_t *radio_hal

SR1000 radio HAL function pointer structure

irq_polarity_t irq_polarity

Interrupt polarity

access_sequence_instance_t access_sequence

Sequence to be written/read from the communication bus

radio_shadow_reg_t shadow_reg

Shadow register instance

bool std_spi

Standard SPI operations

uint8_t phy_version

Radio version

struct rx_timeout
#include <sr_api.h>

Receiver timeout and power-up duration instance.

Public Members

uint32_t rx_period_us

Receiver timeout, in us

uint16_t rx_power_up_delay_ns

Receiver power-up delay, in ns

struct read_reg_16
#include <sr_api.h>

The 16-bit read register split in two 8-bit registers.

Public Members

uint8_t *msb

MSB for register value read

uint8_t *lsb

LSB for register value read

struct rx_wait_time
#include <sr_api.h>

Receiver wait time reception buffer instance.

Public Members

uint8_t *rx_wait_time0

8-bit LSB value of the 16-bit register

uint8_t *rx_wait_time1

8-bit MSB value of the 16-bit register

struct last_addr
#include <sr_api.h>

Last received address instance.

Public Members

uint8_t *msb

8-bit LSB value of the 16-bit register

uint8_t *lsb

8-bit MSB value of the 16-bit register

struct syncword_cfg
#include <sr_api.h>

Synchronization word configuration.

Public Members

uint32_t syncword

Synchronization word, 16 or 32 bits.

uint8_t syncword_bit_cost

Synchronization word detection bit mismatch’s extra cost, 3 bits range value

uint8_t syncword_tolerance

Synchronization word detection tolerance, 5 bits range value

syncword_length_t syncword_length

Synchronization word length, either SYNCWORD_LENGTH_16 or SYNCWORD_LENGTH_32

struct phase_info
#include <sr_api.h>

Phases value, last received preamble phase correlation data.

Public Members

int8_t phase1

Phase information #1

int8_t phase2

Phase information #2

int8_t phase3

Phase information #3

int8_t phase4

Phase information #4

uint8_t rx_waited1

Receiver time waited (MSB)

uint8_t rx_waited0

Receiver time waited (LSB)

struct frame_cfg_t
#include <sr_api.h>

Frame configuration structure.

Note

Define the modulation, FEC and preamble len of the frame.

Public Members

modulation_t modulation

RF modulation

fec_level_t fec

Forward Error Correction level

uint8_t preamble_length

Preamble length in bits