Defines | Enumerations | Functions

gazell/common/gzll.c File Reference

Gazell Link Layer implementation. More...

#include "gzll.h"
#include <string.h>
#include "hal_delay.h"

Go to the source code of this file.

Defines

#define GZLL_PULSE_FIX
#define GZLL_BIT(_var, _bitnum)   static xdata bool volatile _var
#define GZLL_INTERRUPTS_DISABLE()
#define GZLL_INTERRUPTS_ENABLE()
#define GZLL_RFCK_ENABLE()
#define GZLL_RFCK_DISABLE()
#define GZLL_RFCE_PULSE()
#define GZLL_RFCE_HIGH()
#define GZLL_RFCE_LOW()
#define GZLL_UPLOAD_PAYLOAD_TO_RADIO()   hal_nrf_write_tx_payload(src, length)

Enumerations

enum  gzll_new_tx_ch_t { GZLL_CHANNEL_PREVIOUS_SUCCESS, GZLL_CHANNEL_RANDOM, GZLL_CHANNEL_ESTIMATED, GZLL_CHANNEL_NEXT_INDEX }

Functions

void gzll_delay_50us (uint8_t n)
void gzll_init (void)
void gzll_set_param (gzll_dyn_params_t param, uint16_t val)
uint16_t gzll_get_param_max (gzll_dyn_params_t param)
uint16_t gzll_get_param (gzll_dyn_params_t param)
uint8_t gzll_get_channel_tab_size ()
void gzll_get_channels (uint8_t *channels)
void gzll_set_channels (uint8_t *channels, uint8_t channel_tab_size)
void gzll_set_address (hal_nrf_address_t pipe, const uint8_t *address)
void gzll_get_address (uint8_t pipe, uint8_t *address)
void gzll_rx_start ()
_Bool gzll_ack_payload_write (const uint8_t *src, uint8_t length, uint8_t pipe)
_Bool gzll_tx_data (const uint8_t *src, uint8_t length, uint8_t pipe)
_Bool gzll_dev_mode2_rx_channel_match ()
_Bool gzll_tx_success (void)
uint16_t gzll_get_tx_attempts (void)
uint16_t gzll_get_tx_channel_switches (void)
void gzll_tx_fifo_flush (void)
gzll_states_t gzll_get_state (void)
_Bool gzll_radio_active ()
uint8_t gzll_get_rx_data_ready_pipe_number ()
_Bool gzll_rx_data_ready (uint8_t pipe)
_Bool gzll_rx_fifo_read (uint8_t *dst, uint8_t *length, uint8_t *pipe)
_Bool gzll_rx_power_high ()
void gzll_rx_fifo_flush (void)
void gzll_goto_idle ()
void gzll_radio_isr_function (void)
void gzll_timer_isr_function (void)

Detailed Description

Gazell Link Layer implementation.

Definition in file gzll.c.


Define Documentation

#define GZLL_PULSE_FIX

Definition at line 29 of file gzll.c.

#define GZLL_BIT (   _var,
  _bitnum 
)    static xdata bool volatile _var

Definition at line 236 of file gzll.c.

#define GZLL_INTERRUPTS_DISABLE (  )
Value:
do{ \
  RFEN = 0;                           \
  TIMEREN = 0;                        \
}while(0)

Definition at line 296 of file gzll.c.

#define GZLL_INTERRUPTS_ENABLE (  )
Value:
do{  \
  RFEN = 1;                           \
  TIMEREN = 1;                        \
}while(0)

Definition at line 301 of file gzll.c.

#define GZLL_RFCK_ENABLE (  )
Value:
do{ \
  gzll_claim_rfck_en = 1;      \
  RFCKEN = 1;                  \
} while(0)

Definition at line 307 of file gzll.c.

#define GZLL_RFCK_DISABLE (  )
Value:
do{ \
  gzll_claim_rfck_en = 0;       \
  RFCKEN = b_rfce; \
} while(0)

Definition at line 312 of file gzll.c.

#define GZLL_RFCE_PULSE (  )
Value:
do{ \
  RFCKEN = 1;                \
  RFCE = 1;                  \
  b_rfce = true; \
  delay_us(10); \
  RFCE = 0; \
} while(false)

Definition at line 317 of file gzll.c.

#define GZLL_RFCE_HIGH (  )
Value:
do{ \
  RFCKEN = 1;                \
  RFCE = 1;                  \
  b_rfce = true; \
} while(false)

Definition at line 325 of file gzll.c.

#define GZLL_RFCE_LOW (  )
Value:
do{ \
  RFCE = 0;                       \
  RFCKEN = gzll_claim_rfck_en;    \
  b_rfce = false; \
} while(0)

Definition at line 331 of file gzll.c.

#define GZLL_UPLOAD_PAYLOAD_TO_RADIO (  )    hal_nrf_write_tx_payload(src, length)

Definition at line 677 of file gzll.c.


Enumeration Type Documentation

Definition of the possible ways of selecting initial channel for a transmission.

Enumerator:
GZLL_CHANNEL_PREVIOUS_SUCCESS 
GZLL_CHANNEL_RANDOM 
GZLL_CHANNEL_ESTIMATED 
GZLL_CHANNEL_NEXT_INDEX 

Definition at line 59 of file gzll.c.


Function Documentation

void gzll_delay_50us ( uint8_t  n )

Delay function. Gives a delay of ~(n * 50us) with 16 MHz system clock.

Definition at line 1061 of file gzll.c.

{
  uint16_t c;

  while(n-- > 0)
  {
      c = 45;
      while(c-- > 0)
      ;
  }
}