Defines | Enumerations

gazell/common/gzll.h File Reference

Gazell Link Layer header file. More...

#include <stdint.h>
#include <stdbool.h>
#include "gzll_macros.h"
#include "gzll_params.h"
#include "hal_nrf.h"
#include "assertions.h"

Go to the source code of this file.

Defines

#define GZLL_TYP_TX_PAYLOAD_LENGTH   15
#define GZLL_TYP_TX_PERIOD   (130+((GZLL_CONST_BYTES_PR_PACKET+GZLL_TYP_TX_PAYLOAD_LENGTH) * GZLL_US_PR_BYTE) + GZLL_AUTO_RETR_DELAY)
#define GZLL_PARAMS_MAX   {4, 0xffff, 0xffff, 0xffff, 1, 0x3f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x3f, 0x03, 1, 0xffff, 0xffff}
#define GZLL_DR_1MBPS   0
#define GZLL_DR_2MBPS   1
#define GZLL_DR_250KBPS   2
#define GZLL_CRC   HAL_NRF_CRC_16BIT
#define GZLL_ADDRESS_WIDTH   HAL_NRF_AW_5BYTES
#define GZLL_CONST_BYTES_PR_PACKET   (1 + 2 + 5 + 1)
#define GZLL_CRYPT_PAYLOAD_OVERHEAD   5
#define GZLL_MAX_INTERNAL_PAYLOAD_LENGTH   32
#define GZLL_MAX_CRYPT_PAYLOAD_LENGTH   (GZLL_MAX_INTERNAL_PAYLOAD_LENGTH - GZLL_CRYPT_PAYLOAD_OVERHEAD)
#define GZLL_MAX_PAYLOAD_LENGTH   GZLL_MAX_ACK_PAYLOAD_LENGTH
#define GZLL_INTERNAL_FW_PAYLOAD_LENGTH   GZLL_MAX_FW_PAYLOAD_LENGTH
#define GZLL_INTERNAL_ACK_PAYLOAD_LENGTH   GZLL_MAX_ACK_PAYLOAD_LENGTH
#define GZLL_MAX_CRYPT_PIPES_VAL   0x00
#define GZLL_INTERNAL_PAYLOAD_LENGTH   GZLL_INTERNAL_ACK_PAYLOAD_LENGTH
#define GZLL_US_PR_BYTE   8
#define GZLL_HAL_DATARATE   HAL_NRF_1MBPS
#define GZLL_HOST_CE_LOW_IDLE_DELAY   14
#define GZLL_AUTO_RETR_DELAY   250

Enumerations

enum  gzll_dyn_params_t {
  GZLL_PARAM_DEVICE_MODE, GZLL_PARAM_TX_TIMEOUT, GZLL_PARAM_TX_ATTEMPTS_PR_CHANNEL_WHEN_SYNC_ON, GZLL_PARAM_TX_ATTEMPTS_PR_CHANNEL_WHEN_SYNC_OFF,
  GZLL_PARAM_HOST_MODE, GZLL_PARAM_RX_PIPES, GZLL_PARAM_RX_TIMEOUT, GZLL_PARAM_HOST_MODE_1_CYCLE_PERIOD,
  GZLL_PARAM_RX_PERIOD, GZLL_PARAM_RX_PERIOD_MODIFIER, GZLL_PARAM_RX_CHANNEL_HOLD_PERIODS, GZLL_PARAM_CRYPT_PIPES,
  GZLL_PARAM_OUTPUT_POWER, GZLL_PARAM_POWER_DOWN_IDLE_ENABLE, GZLL_PARAM_MAX_SYNC_PERIOD, GZLL_PARAM_COLLISION_CHANNEL_SWITCH_LIMIT,
  GZLL_DYN_PARAM_SIZE
}
enum  gzll_states_t { GZLL_IDLE, GZLL_DEVICE_ACTIVE, GZLL_HOST_ACTIVE }
enum  gzll_rx_modes_t { GZLL_HOST_MODE_0, GZLL_HOST_MODE_1 }
enum  gzll_device_modes_t {
  GZLL_DEVICE_MODE_0, GZLL_DEVICE_MODE_1, GZLL_DEVICE_MODE_2, GZLL_DEVICE_MODE_3,
  GZLL_DEVICE_MODE_4
}

Functions

General functions

These functions are useful on both the Host and Device side.

void gzll_init (void)
void gzll_set_address (hal_nrf_address_t pipe, const uint8_t *address)
void gzll_set_channels (uint8_t *channels, uint8_t size)
void gzll_set_param (gzll_dyn_params_t param, uint16_t value)
uint16_t gzll_get_param_max (gzll_dyn_params_t param)
uint16_t gzll_get_param (gzll_dyn_params_t param)
gzll_states_t gzll_get_state (void)
_Bool gzll_radio_active ()
void gzll_goto_idle (void)
_Bool gzll_rx_data_ready (uint8_t pipe)
uint8_t gzll_get_rx_data_ready_pipe_number (void)
_Bool gzll_rx_fifo_read (uint8_t *dst, uint8_t *length, uint8_t *pipe)
_Bool gzll_rx_power_high (void)
uint8_t gzll_get_channel_tab_size ()
void gzll_get_channels (uint8_t *channels)
void gzll_get_address (uint8_t pipe, uint8_t *address)
void gzll_tx_fifo_flush (void)
void gzll_rx_fifo_flush (void)
void gzll_set_crypt_key (uint8_t pipe, uint8_t *key128)
void gzll_get_crypt_key (uint8_t pipe, uint8_t *key128)
void gzll_radio_isr_function (void)
void gzll_timer_isr_function (void)
Device functions

These functions are only useful for a Device application.

_Bool gzll_dev_mode2_rx_channel_match (void)
_Bool gzll_tx_data (const uint8_t *src, uint8_t length, uint8_t pipe)
_Bool gzll_tx_success (void)
uint16_t gzll_get_tx_attempts (void)
uint16_t gzll_get_tx_channel_switches (void)
Hardware dependent functions

These functions must be customized for the MCU being used.

void gzll_set_timer_period (uint16_t period)

Host functions

These functions are only useful for a Host application.


#define gzll_rx_stop()   gzll_goto_idle()
void gzll_rx_start (void)
_Bool gzll_ack_payload_write (const uint8_t *src, uint8_t length, uint8_t pipe)

Detailed Description

Gazell Link Layer header file.

Definition in file gzll.h.


Define Documentation

#define GZLL_TYP_TX_PAYLOAD_LENGTH   15

Typical payload length. Used for calculating host mode 1 burst timing.

Definition at line 32 of file gzll.h.

#define GZLL_TYP_TX_PERIOD   (130+((GZLL_CONST_BYTES_PR_PACKET+GZLL_TYP_TX_PAYLOAD_LENGTH) * GZLL_US_PR_BYTE) + GZLL_AUTO_RETR_DELAY)

Typical transmit time including auto retry delay and 130 us radio startup. Used for calculating host mode 1 burst behavior.

Definition at line 38 of file gzll.h.

#define GZLL_PARAMS_MAX   {4, 0xffff, 0xffff, 0xffff, 1, 0x3f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x3f, 0x03, 1, 0xffff, 0xffff}

Maximum values for dynamic protocol parameters.

Definition at line 67 of file gzll.h.

#define GZLL_DR_1MBPS   0

Definition at line 101 of file gzll.h.

#define GZLL_DR_2MBPS   1

Definition at line 102 of file gzll.h.

#define GZLL_DR_250KBPS   2

Definition at line 103 of file gzll.h.

#define GZLL_CRC   HAL_NRF_CRC_16BIT

Definition at line 112 of file gzll.h.

#define GZLL_ADDRESS_WIDTH   HAL_NRF_AW_5BYTES

Definition at line 117 of file gzll.h.

#define GZLL_CONST_BYTES_PR_PACKET   (1 + 2 + 5 + 1)

Definition at line 123 of file gzll.h.


Enumeration Type Documentation

Dynamic protocol parameters.

Enumerator:
GZLL_PARAM_DEVICE_MODE 
GZLL_PARAM_TX_TIMEOUT 
GZLL_PARAM_TX_ATTEMPTS_PR_CHANNEL_WHEN_SYNC_ON 
GZLL_PARAM_TX_ATTEMPTS_PR_CHANNEL_WHEN_SYNC_OFF 
GZLL_PARAM_HOST_MODE 
GZLL_PARAM_RX_PIPES 
GZLL_PARAM_RX_TIMEOUT 
GZLL_PARAM_HOST_MODE_1_CYCLE_PERIOD 
GZLL_PARAM_RX_PERIOD 
GZLL_PARAM_RX_PERIOD_MODIFIER 
GZLL_PARAM_RX_CHANNEL_HOLD_PERIODS 
GZLL_PARAM_CRYPT_PIPES 
GZLL_PARAM_OUTPUT_POWER 
GZLL_PARAM_POWER_DOWN_IDLE_ENABLE 
GZLL_PARAM_MAX_SYNC_PERIOD 
GZLL_PARAM_COLLISION_CHANNEL_SWITCH_LIMIT 
GZLL_DYN_PARAM_SIZE 

Definition at line 43 of file gzll.h.

Protocol states.

Enumerator:
GZLL_IDLE 
GZLL_DEVICE_ACTIVE 
GZLL_HOST_ACTIVE 

Definition at line 72 of file gzll.h.

RX (host) modes.

Enumerator:
GZLL_HOST_MODE_0 
GZLL_HOST_MODE_1 

Definition at line 82 of file gzll.h.

TX (device) modes.

Enumerator:
GZLL_DEVICE_MODE_0 
GZLL_DEVICE_MODE_1 
GZLL_DEVICE_MODE_2 
GZLL_DEVICE_MODE_3 
GZLL_DEVICE_MODE_4 

Definition at line 91 of file gzll.h.