API documentation

group gzll_api

Gazell Link Layer Application Programming Interface (API).

General API functions

bool nrf_gzll_init(nrf_gzll_mode_t mode)

Initialize Gazell.

Parameters:
  • mode – The mode to initialize Gazell in.

Return values:
  • true – if Gazell initialized.

  • false – if Gazell failed to initialize.

bool nrf_gzll_enable(void)

Enable Gazell.

When enabled the behaviour described for the current Gazell Link Layer mode will apply.

Return values:

false – if nrf_gzll_init has not previously been called or invalid address has been set - see Anomaly 107 at nRF52832 errata document.

void nrf_gzll_disable(void)

Disable Gazell.

When calling this function the Gazell Link Layer will begin disabling, and will be fully disabled when Gazell calls nrf_gzll_disabled(). If there are any pending notifications, or if any new notifications are being added to the internal notification queue while Gazell is disabling, these will be sent to the application before Gazell is fully disabled.

After Gazell has been fully disabled, no more notifications will be sent to the application.

bool nrf_gzll_is_enabled(void)

Check whether Gazell is enabled or disabled.

Return values:
  • true – If Gazell is enabled.

  • false – If Gazell is disabled.

Device mode callback functions

void nrf_gzll_device_tx_success(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)

ACK received callback (Device mode only).

This callback is made when the Device receives an ACK (acknowledgement) packet.

See also

nrf_gzll_ack_payload_received.

Parameters:
  • pipe – is the pipe on which an ACK packet was received.

  • tx_info – struct used to indicate whether a payload was received in the ack, as well as the number of TX attempts and channel switches required.

void nrf_gzll_device_tx_failed(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)

Transmission failed callback (Device mode only).

This callback is made when a packet does not receive an ACK after nrf_gzll_max_retries is reached. The packet is deleted by Gazell.

Parameters:
  • pipe – is the pipe on which the transmission failed.

  • tx_info – struct used to indicate whether a payload was received in the ack, as well as RSSI and the number of TX attempts and channel switches required.

Host mode callback functions

void nrf_gzll_host_rx_data_ready(uint32_t pipe, nrf_gzll_host_rx_info_t rx_info)

Data packet received callback (Host mode only).

This callback is made when a Host receives a data packet from a Device.

Parameters:
  • pipe – is the pipe on which the data packet was received.

  • rx_info – struct used to indicate whether a payload was removed from the pipe’s TX FIFO, as well as RSSI.

Callback functions for both Device and Host mode

void nrf_gzll_disabled(void)

Disabled callback.

This is called after Gazell enters the disabled state. There is no further CPU use by Gazell, the radio is disabled and the timer is powered down.

void nrf_gzll_mode_changed(void)

Mode changed callback.

This function is called after the Gazell mode has been changed. This function can only be called when Gazell is enabled.

Packet transmission and receiving functions

bool nrf_gzll_add_packet_to_tx_fifo(uint32_t pipe, uint8_t const *p_payload, uint32_t length)

Add a packet to the tail of the TX FIFO.

In Device mode, the packet will be added. In Host mode, the payload will be piggybacked onto an ACK.

Parameters:
  • pipe – Pipe to which to add the payload. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

  • p_payload – Pointer to the payload.

  • length – Number of bytes of the payload to transmit (0 to NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH).

Return values:
  • true – if the packet was successfully added to the TX FIFO.

  • false – if unsuccessful, check nrf_gzll_error_code_t for more information.

bool nrf_gzll_fetch_packet_from_rx_fifo(uint32_t pipe, uint8_t *p_payload, uint32_t *p_length)

Fetch a packet from the head of the RX FIFO.

Parameters:
  • pipe – Pipe from which to fetch the payload. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

  • p_payload – Pointer to copy the payload to.

  • p_length – Length must be at least as large as the number of bytes in the received payload length.

Return values:
  • true – If the fetch was successful.

  • false – If unsuccessful, check nrf_gzll_error_code_t for more information.

int32_t nrf_gzll_get_tx_fifo_packet_count(uint32_t pipe)

Get the number of packets in the TX FIFO on a specific pipe.

Parameters:
  • pipe – The pipe for which to check. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

Return values:
  • >=0 – The number of packets in the TX FIFO for the pipe.

  • -1 – If the pipe number is invalid.

int32_t nrf_gzll_get_rx_fifo_packet_count(uint32_t pipe)

Get the number of packets in the RX FIFO on a specific pipe.

Parameters:
  • pipe – The pipe for which to check. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

Return values:
  • >=0 – The number of packets in the RX FIFO for the pipe.

  • -1 – If the pipe number is invalid.

uint32_t nrf_gzll_get_total_allocated_packet_count(void)

Get the total number of packets residing in all TX and RX FIFOs.

Can be used to check against NRF_GZLL_CONST_MAX_TOTAL_PACKETS to determine if there is free space in the memory pool for more packets.

Returns:

The number of packets residing in all TX and RX FIFOs.

bool nrf_gzll_ok_to_add_packet_to_tx_fifo(uint32_t pipe)

Check if adding a packet to a pipe’s TX FIFO should be successful.

Checks if there is another space in the pipe’s TX and RX FIFOs as well as enough overall space in the packet pool.

Parameters:
  • pipe – The pip for which to check. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

Return values:
  • true – If there is another space.

  • false – If there is not enough space, or the pipe is invalid.

bool nrf_gzll_flush_tx_fifo(uint32_t pipe)

Flush the RX FIFO for a specific pipe.

Delete all the packets and free the memory of the TX FIFO for a specific pipe.

Note that it is not allowed to flush a TX FIFO when Gazell is enabled.

Parameters:
  • pipe – is the pipe for which to flush. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

Return values:
  • true – if the pipe was flushed.

  • false – if the pipe was not flushed.

bool nrf_gzll_flush_rx_fifo(uint32_t pipe)

Flush the RX FIFO for a specific pipe.

Delete all the packets and free the memory of the RX FIFO for a specific pipe.

Parameters:
  • pipe – is the pipe for which to flush. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

Return values:
  • true – if the pipe was flushed.

  • false – if the pipe was not flushed.

bool nrf_gzll_tx_statistics_enable(nrf_gzll_tx_statistics_t *p_statistics)

Function for enabling transmission statistics.

Parameters:
  • p_statistics – Pointer to the statistics structure.

Returns:

True if channel statistics has been enabled, false otherwise.

void nrf_gzll_tx_statistics_disable(void)

Function for disabling transmission statistics.

bool nrf_gzll_get_channel_timeouts(uint8_t channel_index, uint32_t *p_timeouts)

Function for obtaining number of transmission timeouts for specific channel.

Parameters:
  • channel_index[in] Channel index in channel table.

  • p_timeouts[out] Pointer for the result.

Returns:

True in case of success, false otherwise.

void nrf_gzll_reset_tx_statistics(void)

Function for clearing transmission statistic structure.

Configuration functions

Configuration ‘set’ functions may only be called while Gazell is disabled. The new parameter comes into effect when Gazell is enabled again.

Configuration ‘get’ functions may be called at any time.

void nrf_gzll_tx_timeout_callback_register(nrf_gzll_tx_timeout_callback callback)

Function for registering callback to be called on the transmission timeout.

void nrf_gzll_crc_failure_callback_register(nrf_gzll_crc_failure_callback callback)

Function for registering callback to be called on the packet CRC failure.

bool nrf_gzll_set_mode(nrf_gzll_mode_t mode)

Set the mode.

It is allowed to change mode when Gazell is enabled. If the mode is being changed while Gazell is enabled, the mode will not change right away. In this case the callback function nrf_gzll_mode_changed() will be called after the mode has changed.

Parameters:
  • mode – The mode to be used. See nrf_gzll_mode_t for a list of valid modes.

Return values:

true – If the parameter was set.

nrf_gzll_mode_t nrf_gzll_get_mode(void)

Get function counterpart to nrf_gzll_set_mode().

Returns:

The current mode.

bool nrf_gzll_set_base_address_0(uint32_t base_address)

Set the base address for pipe 0.

The full on-air address for each pipe is composed of a multi-byte base address prepended to a prefix byte.

For packets to be received correctly, the most significant byte of the base address should not be an alternating sequence of 0s and 1s i.e. it should not be 0x55 or 0xAA.

Note

Due to the nRF52 Anomaly 107, pipe 0 address should not have both prefix and two LSB of base address set to 0.

Parameters:
  • base_address – The 4 byte base address. All bytes are used.

Return values:

true – If the parameter was set.

Returns:

false If Gazell was enabled.

uint32_t nrf_gzll_get_base_address_0(void)

Get function counterpart to nrf_gzll_set_base_address_0().

Returns:

Base address 0.

bool nrf_gzll_set_base_address_1(uint32_t base_address)

Set the base address for pipes 1-7.

Pipes 1 through 7 share base_address_1.

Parameters:
  • base_address – The 4 byte base address.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled.

uint32_t nrf_gzll_get_base_address_1(void)

Get function counterpart to nrf_gzll_set_base_address_1().

Returns:

Base address 1.

bool nrf_gzll_set_address_prefix_byte(uint32_t pipe, uint8_t address_prefix_byte)

Set the address prefix byte for a specific pipe.

Each pipe should have its own unique prefix byte.

Note

Due to the Anomaly 107, pipe 0 address should not have both prefix and two LSB of base address set to 0.

Parameters:
  • pipe – The pipe that the address should apply to. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

  • address_prefix_byte – The address prefix byte.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled, or if the pipe was invalid.

bool nrf_gzll_get_address_prefix_byte(uint32_t pipe, uint8_t *p_out_address_prefix_byte)

Get function counterpart to nrf_gzll_set_address_prefix_byte().

Parameters:
  • pipe – The pipe for which to get the address. This value must be < NRF_GZLL_CONST_PIPE_COUNT.

  • p_out_address_prefix_byte – The pointer in which to return the address prefix byte.

Return values:
  • true – If the parameter was returned.

  • false – If Gazell was enabled, the pipe was invalid or out_address was a NULL pointer.

bool nrf_gzll_set_rx_pipes_enabled(uint32_t pipes)

Set which pipes shall listen for packets in Host mode.

This value is a bitmap, and each bit corresponds to a given pipe number. Bit 0 set to “1” enables pipes 0, bit 1 set to “1” enables pipe 1 and so forth. The maximum number of pipes is defined by NRF_GZLL_CONST_PIPE_COUNT.

Parameters:
  • pipes – A bitmap specifying which pipes to monitor.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled.

uint32_t nrf_gzll_get_rx_pipes_enabled(void)

Get function counterpart to nrf_gzll_set_rx_pipes_enabled().

Returns:

Bitmap holding the current enabled pipes.

bool nrf_gzll_set_timeslot_period(uint32_t period_us)

Set the timeslot period.

The length in microseconds of a Gazell link layer timeslot.

The minimum value of the timeslot period is dependent of the radio data rate (

  • For NRF_GZLL_DATARATE_2MBIT the timeslot period must be >= 600 us.

  • For NRF_GZLL_DATARATE_1MBIT the timeslot period must be >= 900 us.

  • For NRF_GZLL_DATARATE_250KBIT the timeslot period must be >= 2700 us.

Parameters:
  • period_us – The timeslot period in microseconds.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled.

uint32_t nrf_gzll_get_timeslot_period(void)

Get function counterpart to nrf_gzll_get_timeslot_period().

Returns:

The current timeslot period.

bool nrf_gzll_set_device_channel_selection_policy(nrf_gzll_device_channel_selection_policy_t policy)

Set the Device channel selection policy.

The policy determines the initial channel when starting a new packet. transmission.

  • NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_SUCCESSFUL specifies that a new packet transmission always shall use the previous successful channel from the channel table. If Gazell is “in sync”, Gazell will wait until this channel is being monitored by the Host before starting the transmission.

  • NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT specifies that Gazell shall transmit on the channel that is currently being monitored by the Host. This parameter is only used when Gazell is “in sync”. When “out of” sync, Gazell will always start using the “previous successful” channel.

Parameters:
  • policy – The channel selection policy.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled or the policy was invalid.

nrf_gzll_device_channel_selection_policy_t nrf_gzll_get_device_channel_selection_policy(void)

Get function counterpart to nrf_gzll_set_device_channel_selection_policy().

Returns:

the Device channel selection policy.

bool nrf_gzll_set_timeslots_per_channel(uint32_t timeslots)

Set the number of timeslots that Gazell shall reside on a single channel before switching to another channel.

This parameter applies in Host mode and for a Device that is in the “in sync” state.

Since the Device and Host cannot be in perfect synchronization, a transmission should overlap to adjacent timeslots on the Host. Therefore, this value should be at least 2.

Parameters:
  • timeslots – The number of timeslots to reside on each channel before channel switch.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled.

uint32_t nrf_gzll_get_timeslots_per_channel(void)

Get function counterpart to nrf_gzll_set_timeslots_per_channel().

Returns:

The current number of timeslots.

bool nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync(uint32_t timeslots)

Set the number of timeslots that a Gazell shall reside on a single channel before switching to another channel when in the “out of sync” state.

This value should be set so that the Device transmits on one channel while the Host goes through a full channel rotation, i.e., channel_table_size*timeslots_per_channel. This ensures that the channels on the Device and Host will coincide at some point. Further increasing the value has been observed to provide better performance in the presence of interferers.

Parameters:
  • timeslots – The number of timeslots to reside on each channel before channel switch.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled.

uint32_t nrf_gzll_get_timeslots_per_channel_when_device_out_of_sync(void)

Get function counterpart to nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync().

Returns:

The current number of timeslots.

bool nrf_gzll_set_sync_lifetime(uint32_t lifetime)

Set the number of timeslots after a successful reception of a Device or Host packet that the Gazell Link Layer shall assume that the link is synchronized. A value of 0 implies that the link is always out of sync.

Parameters:
  • lifetime – The sync lifetime in number of timeslots.

Return values:
  • true – If the sync lifetime was set.

  • false – If Gazell was enabled.

uint32_t nrf_gzll_get_sync_lifetime(void)

Get function counterpart to nrf_gzll_set_sync_lifetime().

Returns:

The sync lifetime measured in number of timeslots.

void nrf_gzll_set_max_tx_attempts(uint16_t max_tx_attempts)

Set the maximum number of TX attempts that can be used for a single packet.

After the maximum number of attempts have been spent without receiving any ACK from the Host, the transmission will be terminated and the nrf_gzll_device_tx_failed() callback will be called. A zero value of the function parameter implies the infinite number of TX attempts.

Parameters:
  • max_tx_attempts – The maximum number of TX attempts.

uint16_t nrf_gzll_get_max_tx_attempts(void)

Get function counterpart to nrf_gzll_set_max_tx_attempts().

Returns:

The current max Device TX attempts.

bool nrf_gzll_set_channel_table(uint8_t *p_channel_table, uint32_t size)

Set the table of Radio Frequency (RF) channels.

The valid channels are in the range 0 <= channel <= 125, where the actual centre frequency is (2400 + channel) MHz. The maximum channel table size is defined by NRF_GZLL_CONST_MAX_CHANNEL_TABLE_SIZE.

Parameters:
  • p_channel_table – Pointer to the channel table.

  • size – The size of the channel table.

Return values:
  • true – If the channel table was set.

  • false – If Gazell was enabled, or the channel_table pointer was NULL, or the size was invalid.

bool nrf_gzll_get_channel_table(uint8_t *p_channel_table, uint32_t *p_size)

Get the table of Radio Frequency (RF) channels.

Parameters:
  • p_channel_table – Pointer to copy the channel table to.

  • p_size – Pointer to copy the size of the channel table to. The value already at size must be at least the size of the channel table.

Return values:
  • true – If the channel table was copied to channel_table.

  • false – If the channel_table pointer was NULL, or the size was not large enough.

uint32_t nrf_gzll_get_channel_table_size(void)

Get the current channel table size.

Returns:

The current channel table size.

bool nrf_gzll_set_tx_power(nrf_gzll_tx_power_t tx_power)

Set the radio TX power.

Parameters:
  • tx_power – TX power.

Return values:
  • true – If the parameter was set.

  • false – If the TX power was invalid.

nrf_gzll_tx_power_t nrf_gzll_get_tx_power(void)

Get function counterpart to nrf_gzll_set_tx_power().

Returns:

The current TX power.

bool nrf_gzll_set_datarate(nrf_gzll_datarate_t data_rate)

Set the radio datarate.

Parameters:
  • data_rate – Datarate.

Return values:
  • true – If the parameter was set.

  • false – If Gazell was enabled or the datarate was invalid.

nrf_gzll_datarate_t nrf_gzll_get_datarate(void)

Get function counterpart to nrf_gzll_set_datarate().

Returns:

The current datarate.

bool nrf_gzll_set_xosc_ctl(nrf_gzll_xosc_ctl_t xosc_ctl)

Set whether start/stop of external oscillator (XOSC) shall be handled automatically inside Gazell or manually by the application.

When controlling the XOSC manually from the application it is required that the XOSC is started before Gazell is enabled.

When start/stop of the XOSC is handled automatically by Gazell, the XOSC will only be running when needed, that is when the radio is being used or when Gazell needs to maintain synchronization.

It is required that the XOSC is started in order for the radio to be able to send or receive any packets.

Parameters:
  • xosc_ctl – setting for XOSC control.

Return values:
  • true – if the parameter was set.

  • false – if Gazell was enabled or the xosc_ctl value was invalid.

nrf_gzll_xosc_ctl_t nrf_gzll_get_xosc_ctl(void)

Get function counterpart for nrf_gzll_set_xosc_ctl();

Returns:

The XOSC control setting.

void nrf_gzll_set_auto_disable(uint32_t num_ticks)

Set Gazell to disable automatically after a certain number of timeslot ticks.

Parameters:
  • num_ticks – Number of timeslot ticks.

uint32_t nrf_gzll_get_tick_count(void)

Get the number of timeslot ticks that have occurred since nrf_gzll_init() was called.

Returns:

Number of timeslot ticks.

void nrf_gzll_clear_tick_count(void)

Clear the internal timeslot tick count variable that is read by nrf_gzll_get_tick_count().

bool nrf_gzll_set_tick_timer(uint32_t num_ticks, nrf_gzll_tick_timer_expired_callback callback)

Set a timeslot tick timer.

Parameters:
  • num_ticks – Number of timeslot ticks.

  • callback – Callback function when timer expires.

Return values:
  • true – If the timer was set.

  • false – If the number of ticks is not zero but the callback was NULL.

Error handling functions

nrf_gzll_error_code_t nrf_gzll_get_error_code(void)

Gets the Gazell error code.

Returns:

The current error code.

void nrf_gzll_reset_error_code(void)

Reset the Gazell error code.

The error code is reset to NRF_GZLL_ERROR_CODE_NO_ERRROR.

Typedefs

typedef void (*nrf_gzll_tx_timeout_callback)(uint32_t pipe, uint8_t rf_channel)

Transmission timeout callback function definition

typedef void (*nrf_gzll_crc_failure_callback)(uint32_t pipe, uint8_t rf_channel)

Transmission CRC failure callback function definition

typedef void (*nrf_gzll_tick_timer_expired_callback)(void)

Tick timer expired callback function definition

Enums

enum nrf_gzll_mode_t

Enumerator used for selecting Gazell mode.

Values:

enumerator NRF_GZLL_MODE_DEVICE

Device mode.

enumerator NRF_GZLL_MODE_HOST

Host mode.

enumerator NRF_GZLL_MODE_SUSPEND

Suspend mode (“disabled with timer running”)

enum nrf_gzll_device_channel_selection_policy_t

Enumerator used for selecting Gazell Device channel selection policy.

Values:

enumerator NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_SUCCESSFUL

Start on previous successful channel.

enumerator NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT

Start on channel currently monitored by Host.

enum nrf_gzll_tx_power_t

Enumerator used for selecting the transmit (TX) power.

Values:

enumerator NRF_GZLL_TX_POWER_8_DBM

8 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_7_DBM

7 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_6_DBM

6 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_5_DBM

5 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_4_DBM

4 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_3_DBM

3 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_2_DBM

2 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_0_DBM

0 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_N4_DBM

-4 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_N8_DBM

-8 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_N12_DBM

-12 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_N16_DBM

-16 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_N20_DBM

-20 dBm transmit power.

enumerator NRF_GZLL_TX_POWER_N40_DBM

-40 dBm transmit power.

enum nrf_gzll_datarate_t

Enumerator used for selecting the radio datarate.

Values:

enumerator NRF_GZLL_DATARATE_1MBIT

1 Mbps datarate.

enumerator NRF_GZLL_DATARATE_2MBIT

2 Mbps datarate.

enumerator NRF_GZLL_DATARATE_1MBIT_BLE

1 Mbps datarate. BLE.

enumerator NRF_GZLL_DATARATE_2MBIT_BLE

2 Mbps datarate. BLE.

enum nrf_gzll_xosc_ctl_t

Enumerator used for specifying whether switching the external high frequency oscillator on/off shall be handled automatically inside Gazell or manually by the application.

Values:

enumerator NRF_GZLL_XOSC_CTL_AUTO

Switch XOSC on/off automatically.

enumerator NRF_GZLL_XOSC_CTL_MANUAL

Switch XOSC on/off manually.

enum nrf_gzll_error_code_t

Enumerator used for error codes for Gazell API functions.

Values:

enumerator NRF_GZLL_ERROR_CODE_NO_ERROR

No error has been detected.

enumerator NRF_GZLL_ERROR_CODE_FAILED_TO_INITIALIZE

The function NRF_GZLL_init failed.

enumerator NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_CONFIGURE_WHEN_ENABLED

A call to a configuration ‘set’ function was made while Gazell was enabled.

enumerator NRF_GZLL_ERROR_CODE_POINTER_IS_NULL

A null pointer was given as an input to a function.

enumerator NRF_GZLL_ERROR_CODE_INVALID_PIPE

An invalid pipe number was given as an input to a function.

enumerator NRF_GZLL_ERROR_CODE_INVALID_MODE

An invalid value for the nrf_gzll_mode_t enumerator was given as input to a function.

enumerator NRF_GZLL_ERROR_CODE_INVALID_PAYLOAD_LENGTH

An invalid payload length was given as an input to a function.

enumerator NRF_GZLL_ERROR_CODE_INVALID_CHANNEL_TABLE_SIZE

An invalid channel table size was given as an input to a function.

enumerator NRF_GZLL_ERROR_CODE_INSUFFICIENT_PACKETS_AVAILABLE

There are insufficient packets in the Gazell memory pool to successfully execute the operation.

enumerator NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_ADD_TO_FULL_FIFO

There is insufficient space in the TX FIFO for the data packet.

enumerator NRF_GZLL_ERROR_CODE_NO_SPACE_IN_RX_FIFO_FOR_ACK

There is insufficient space in the RX FIFO for the ACK.

enumerator NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_FETCH_FROM_EMPTY_FIFO

Attempted to fetch a packet from an empty FIFO. Use the functions nrf_gzll_get_tx_fifo_packet_count() or nrf_gzll_get_rx_fifo_packet_count()

enumerator NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_FLUSH_WHEN_ENABLED

Attempted to fetch a packet from an empty FIFO. Use the functions nrf_gzll_get_tx_fifo_packet_count() or nrf_gzll_get_rx_fifo_packet_count()

enumerator NRF_GZLL_ERROR_CODE_INVALID_PARAMETER

Attempted to set a variable which was not valid.

enumerator NRF_GZLL_ERROR_CODE_INTERNAL_ASSERT_OCCURRED

An internal assert occurred.

enumerator NRF_GZLL_ERROR_CODE_CALLBACK_NOT_IMPLEMENTED

A callback was called but not implemented by the application.

enumerator NRF_GZLL_ERROR_CODE_INVALID_ADDRESS

Invalid pipe 0 address detected, see Anomaly 107 at nRF52832 errata document.

enumerator NRF_GZLL_ERROR_CODE_NUMBER_OF_ERROR_CODES

Number of possible error codes.

struct nrf_gzll_device_tx_info_t
#include <nrf_gzll.h>

Data structure containing information about the last packet transmission.

Public Members

bool payload_received_in_ack

A payload was received in the ACK.

uint16_t num_tx_attempts

Number of attempts used on previous Device packet transmission.

uint16_t num_channel_switches

Number of channel switches needed during previous packet transmission.

int8_t rssi

Received signal strength indicator in dBm.

See also

nrf_gzll_enable_rssi().

uint8_t rf_channel

Channel on which packet has been transmitted.

struct nrf_gzll_host_rx_info_t
#include <nrf_gzll.h>

Data structure containing information about the last packet received.

Public Members

bool packet_removed_from_tx_fifo

A payload was received in the ACK.

int8_t rssi

Received signal strength indicator in dBm.

See also

nrf_gzll_enable_rssi().

uint8_t rf_channel

Channel on which packet has been received.

struct nrf_gzll_tx_statistics_t
#include <nrf_gzll.h>

Public Members

uint32_t packets_num

Number of succesfully transmitted packets.

uint32_t timeouts_num

Total timeouts number.

uint32_t channel_timeouts[16]

Transmission timeouts per channel.

uint32_t channel_packets[16]

Succesfully transmitted packets per channel.

Constants

group gzll_constants

Hardware resources used by Gazell

NRF_GZLL_SWI_IRQn

Software interrupt # used for callback functions.

NRF_GZLL_SWI_IRQ_HANDLER

Software interrupt handler used for callback functions.

NRF_GZLL_TIMER

Timer to be used as flywheel timer.

NRF_GZLL_TIMER_IRQn

Interrupt # for the timer.

NRF_GZLL_TIMER_IRQ_HANDLER

Interrupt handler for the timer.

NRF_GZLL_PPI_EEP0

Gazell PPI event endpoint 0.

NRF_GZLL_PPI_TEP0

Gazell PPI task endpoint 0.

NRF_GZLL_PPI_EEP1

Gazell PPI event endpoint 1.

NRF_GZLL_PPI_TEP1

Gazell PPI task endpoint 1.

NRF_GZLL_PPI_EEP2

Gazell PPI event endpoint 2.

NRF_GZLL_PPI_TEP2

Gazell PPI task endpoint 2.

NRF_GZLL_PPI_CHEN_MSK_0_AND_1

Channel enable/disable mask for PPI endpoint 0 and 1.

NRF_GZLL_PPI_CHEN_MSK_2

Channel enable/disable mask for PPI endpoint 2.

NRF_GZLL_DPPI_CH0

Gazell DPPI channel 0.

NRF_GZLL_DPPI_CH1

Gazell DPPI channel 1.

NRF_GZLL_DPPI_CH2

Gazell DPPI channel 2.

NRF_GZLL_DPPI_CHEN_MSK_0_AND_1

Channel enable/disable mask for DPPI channel 0 and 1.

NRF_GZLL_DPPI_CHEN_MSK_2

Channel enable/disable mask for DPPI channel 2.

Constant pipe and FIFO configuration

NRF_GZLL_CONST_PIPE_COUNT

Number of TX pipes (at least one for each Device-Host pairs).

NRF_GZLL_CONST_FIFO_LENGTH

Maximum number of packets allowed in a TX or RX FIFO.

NRF_GZLL_CONST_MAX_TOTAL_PACKETS

Maximum number of packets available for reservation at any one time.

NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH

Maximum allowed payload length in bytes.

NRF_GZLL_CONST_CALLBACK_QUEUE_LENGTH

Maximum number of notifications allowed in the callback queue.

Default radio configuration

NRF_GZLL_DEFAULT_TX_POWER

Default TX power.

NRF_GZLL_DEFAULT_DATARATE

Default data rate.

NRF_GZLL_DEFAULT_CHANNEL_TABLE

Default channel table.

NRF_GZLL_DEFAULT_CHANNEL_TABLE_SIZE

Default channel table size.

NRF_GZLL_CONST_MAX_CHANNEL_TABLE_SIZE

Maximum channel table size allowed by Gazell.

Default Address configuration

NRF_GZLL_DEFAULT_FULL_ADDRESS_PIPE0

Corresponding legacy Gazell pipe 0 address.

NRF_GZLL_DEFAULT_BASE_ADDRESS_0

Default base address 0.

NRF_GZLL_DEFAULT_BASE_ADDRESS_1

Default base address 1.

NRF_GZLL_DEFAULT_PREFIX_BYTE_0

Default prefix address pipe 0.

NRF_GZLL_DEFAULT_PREFIX_BYTE_1

Default prefix address pipe 1.

NRF_GZLL_DEFAULT_PREFIX_BYTE_2

Default prefix address pipe 2.

NRF_GZLL_DEFAULT_PREFIX_BYTE_3

Default prefix address pipe 3.

NRF_GZLL_DEFAULT_PREFIX_BYTE_4

Default prefix address pipe 4.

NRF_GZLL_DEFAULT_PREFIX_BYTE_5

Default prefix address pipe 5.

NRF_GZLL_DEFAULT_PREFIX_BYTE_6

Default prefix address pipe 6.

NRF_GZLL_DEFAULT_PREFIX_BYTE_7

Default prefix address pipe 7.

NRF_GZLL_DEFAULT_BASE_ADDRESS_LENGTH

Default on-air base address length.

NRF_GZLL_DEFAULT_RX_PIPES_ENABLED

Enabled Rx pipes. See nrf_gzll_set_rx_pipes_enabled().

Default timeslot and synchronization configuration

NRF_GZLL_DEFAULT_TIMESLOT_PERIOD

Default timeslot period.

NRF_GZLL_DEFAULT_TIMESLOTS_PER_CHANNEL

Timeslots use by the Host and by the Device when communication is in sync.

NRF_GZLL_DEFAULT_DEVICE_CHANNEL_SELECTION_POLICY

Default channel Gazell Device channel selection policy.

NRF_GZLL_DEFAULT_MAX_TX_ATTEMPTS

Default maximum TX attempts for each packet. A value of zero implies the infinite number of TX attempts.

NRF_GZLL_DEFAULT_XOSC_CTL

Deafult setting for controlling the XOSC.

NRF_GZLL_DEFAULT_TIMESLOTS_PER_CHANNEL_WHEN_DEVICE_OUT_OF_SYNC

Timeslots use by the Device before communication is in sync.

NRF_GZLL_DEFAULT_SYNC_LIFETIME

Number of timeslots to keep the timer running so that communication remains synchronized.

Defines

NRF_GZLL_PA_LNA_MAX_RAMP_UP_TIME

Max external front end ramp up time [us].

NRF_GZLL_PA_LNA_PPI_CHANNELS_NUM

Number of PPI channels used for front end control.

Glue layer

group gzll_glue

Functions

void nrf_gzll_delay_us(uint32_t usec_to_wait)

Microseconds delay.

Parameters:
  • usec_to_wait – Number of microseconds to delay.

void nrf_gzll_request_xosc(void)

Request external oscillator (XOSC).

void nrf_gzll_release_xosc(void)

Release external oscillator (XOSC).

void nrf_gzll_radio_irq_handler(void)

Radio interrupt handler.

void nrf_gzll_timer_irq_handler(void)

Timer interrupt handler.

void nrf_gzll_swi_irq_handler(void)

Software interrupt handler.

Variables

NRF_TIMER_Type *const nrf_gzll_timer

Timer instance.

IRQn_Type const nrf_gzll_timer_irqn

Interrupt number for the timer.

IRQn_Type const nrf_gzll_swi_irqn

Interrupt number for the software interrupt.

uint32_t *nrf_gzll_ppi_eep0

Gazell PPI event endpoint 0 register address.

uint32_t *nrf_gzll_ppi_tep0

Gazell PPI task endpoint 0 register address.

uint32_t *nrf_gzll_ppi_eep1

Gazell PPI event endpoint 1 register address.

uint32_t *nrf_gzll_ppi_tep1

Gazell PPI task endpoint 1 register address.

uint32_t *nrf_gzll_ppi_eep2

Gazell PPI event endpoint 2 register address.

uint32_t *nrf_gzll_ppi_tep2

Gazell PPI task endpoint 2 register address.

uint32_t nrf_gzll_ppi_chen_msk_0_and_1

Channel enable/disable mask for PPI endpoint 0 and 1.

uint32_t nrf_gzll_ppi_chen_msk_2

Channel enable/disable mask for PPI endpoint 2.

uint8_t nrf_gzll_dppi_ch0

Gazell DPPI channel index 0.

uint8_t nrf_gzll_dppi_ch1

Gazell DPPI channel index 1.

uint8_t nrf_gzll_dppi_ch2

Gazell DPPI channel index 2.

uint32_t nrf_gzll_dppi_chen_msk_0_and_1

Channel enable/disable mask for DPPI channel 0 and 1.

uint32_t nrf_gzll_dppi_chen_msk_2

Channel enable/disable mask for DPPI channel 2.