Microchip® Advanced Software Framework

at86rfx_driver.h File Reference

AT86RFx driver.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"

Macros

#define CCA_MODE_DEFAULT   (0x01)
 Default value of CCA mode. More...
 
#define CLEAR_TRX_IRQ()
 Clear the transceiver interrupts. More...
 
#define DISABLE_TRX_IRQ()
 Disable the transceiver interrupts. More...
 
#define ENABLE_TRX_IRQ()
 Enables the transceiver interrupts. More...
 
#define FCS_LEN   (2)
 Length (in octets) of FCS. More...
 
#define FUNC_PTR   void *
 Definition of a function pointer. More...
 
#define LARGE_BUFFER_SIZE   (130)
 Size of the buffer allocated for transceiver reception. More...
 
#define LENGTH_FIELD_LEN   (1)
 Size of the length parameter. More...
 
#define MAX_CSMA_BACKOFFS_DEFAULT   (0x04)
 Default value of maximum csma ca backoffs. More...
 
#define MAXBE_DEFAULT   (0x05)
 Default value of maximum backoff exponent used while performing csma ca. More...
 
#define MINBE_DEFAULT   (0x03)
 Default value of minimum backoff exponent used while performing csma ca. More...
 
#define P_ON_TO_CLKM_ATTEMPTS
 Ratio between max time to transceiver poll delay. More...
 
#define PHY_MAX_LENGTH   (127)
 Maximum length of a phy packet. More...
 
#define PLL_LOCK_ATTEMPTS   (3)
 Value used for checking proper locking of PLL during switch from TRX_PFF to PLL_ON. More...
 
#define READ_ACCESS_COMMAND   (0x80)
 Read access command to the transceiver. More...
 
#define RST_HIGH()
 Reset pin high. More...
 
#define RST_LOW()
 Reset pin low. More...
 
#define SLEEP_TO_TRX_OFF_ATTEMPTS
 Ratio between max time to transceiver poll delay. More...
 
#define SLP_TR_HIGH()
 Sleep pin high. More...
 
#define SLP_TR_LOW()
 Sleep pin low. More...
 
#define TRX_CMD_FR   (0x20)
 Frame read command of transceiver. More...
 
#define TRX_CMD_FW   (0x60)
 Frame write command of transceiver. More...
 
#define TRX_CMD_SR   (0x00)
 SRAM read command of transceiver. More...
 
#define TRX_CMD_SW   (0x40)
 SRAM write command of transceiver. More...
 
#define TRX_IRQ_DEFAULT   TRX_IRQ_TRX_END
 Default interrupt configuration for transceiver. More...
 
#define TRX_POLL_WAIT_TIME_US   (100)
 Value in us used for delay between poll attempts for transceiver access. More...
 
#define WRITE_ACCESS_COMMAND   (0xC0)
 Write access command of the transceiver. More...
 

Typedefs

typedef enum at86rfx_retval_tag at86rfx_retval_t
 These are the return values of the RF API. More...
 

Enumerations

enum  at86rfx_retval_tag {
  AT86RFX_SUCCESS = 0x00,
  AT86RFX_FAILURE = 0x01,
  AT86RFX_CHANNEL_ACCESS_FAILURE = 0x02
}
 These are the return values of the RF API. More...
 

Functions

at86rfx_retval_t at86rfx_init (void)
 Initializes the transceiver interface. More...
 
void at86rfx_task (void)
 RF task handling. More...
 
void at86rfx_tx_frame (uint8_t *frame_tx)
 Transmits the frame. More...
 
uint8_t pal_trx_bit_read (uint8_t addr, uint8_t mask, uint8_t pos)
 Subregister read. More...
 
void pal_trx_bit_write (uint8_t reg_addr, uint8_t mask, uint8_t pos, uint8_t new_value)
 Subregister write. More...
 
void pal_trx_frame_read (uint8_t *data, uint8_t length)
 Reads frame buffer of the transceiver. More...
 
void pal_trx_frame_write (uint8_t *data, uint8_t length)
 Writes data into frame buffer of the transceiver. More...
 
void pal_trx_init (void)
 Initializes the SPI and GPIO pins for transceiver access. More...
 
uint8_t pal_trx_reg_read (uint8_t addr)
 Reads current value from a transceiver register. More...
 
void pal_trx_reg_write (uint8_t addr, uint8_t data)
 Writes data into a transceiver register. More...
 

Variables

uint8_t at86rfx_rx_buffer []
 Static receive buffer that can be used to upload a frame from the trx. More...