Microchip® Advanced Software Framework

trx_access.h File Reference

HAL related APIs for externally plugged transceivers.

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

#include "compiler.h"
#include "conf_trx_access.h"
#include "port.h"
#include "extint.h"
#include "board.h"

Macros

#define ENTER_TRX_CRITICAL_REGION()
 
#define IRQ_PINGET()   port_pin_get_input_level(AT86RFX_IRQ_PIN)
 
#define LEAVE_TRX_CRITICAL_REGION()   cpu_irq_restore(flags); }
 
#define READ_ACCESS_COMMAND   (0x80)
 Read access command to the tranceiver. More...
 
#define RST_HIGH()
 Set TRX GPIO pins. More...
 
#define RST_LOW()
 
#define SLP_TR_HIGH()
 
#define SLP_TR_LOW()
 
#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_flag_clr()   CLEAR_TRX_IRQ()
 Clears the transceiver main interrupt. More...
 
#define TRX_IRQ_HIGH()   IRQ_PINGET()
 Macro to get the transceiver's main IRQ status. More...
 
#define TRX_RST_HIGH()   RST_HIGH()
 Macro to set Reset pin to high. More...
 
#define TRX_RST_LOW()   RST_LOW()
 Macro to set Reset pin to low. More...
 
#define TRX_SLP_TR_HIGH()   SLP_TR_HIGH()
 Macro to set SLP_TR pin to high. More...
 
#define TRX_SLP_TR_LOW()   SLP_TR_LOW()
 Macro to set SLP_TR pin to low. More...
 
#define TRX_TRIG_DELAY()   {nop(); nop(); }
 
#define U16_TO_TARGET(x)   ((((x) << 8) & 0xFF00) | (((x) >> 8) & 0x00FF))
 This macro is used for handling endianness among the different CPUs. More...
 
#define WRITE_ACCESS_COMMAND   (0xC0)
 Write access command of the transceiver. More...
 

Typedefs

typedef void(* irq_handler_t )(void)
 

Functions

void PhyReset (void)
 Resets the TRX radio. More...
 
void trx_aes_wrrd (uint8_t addr, uint8_t *idata, uint8_t length)
 Writes and reads data into/from SRAM of the transceiver. More...
 
uint8_t trx_bit_read (uint8_t addr, uint8_t mask, uint8_t pos)
 Subregister read. More...
 
void trx_bit_write (uint8_t reg_addr, uint8_t mask, uint8_t pos, uint8_t new_value)
 Subregister write. More...
 
void trx_frame_read (uint8_t *data, uint8_t length)
 Reads frame buffer of the transceiver. More...
 
void trx_frame_write (uint8_t *data, uint8_t length)
 Writes data into frame buffer of the transceiver. More...
 
void trx_irq_init (FUNC_PTR trx_irq_cb)
 
uint8_t trx_reg_read (uint8_t addr)
 Reads current value from a transceiver register. More...
 
void trx_reg_write (uint8_t addr, uint8_t data)
 Writes data into a transceiver register. More...
 
void trx_spi_disable (void)
 Disables the SPI interface for communication with the transceiver. More...
 
void trx_spi_done_cb_init (void *spi_done_cb)
 SPI done callback initialization. More...
 
void trx_spi_enable (void)
 enables the SPI interface for communication with the transceiver More...
 
void trx_spi_init (void)
 Initializes the SPI interface for communication with the transceiver. More...
 
void trx_sram_read (uint8_t addr, uint8_t *data, uint8_t length)
 Reads data from SRAM of the transceiver. More...
 
void trx_sram_write (uint8_t addr, uint8_t *data, uint8_t length)
 Writes data into SRAM of the transceiver. More...