Microchip® Advanced Software Framework

trx_access_2.h File Reference

HAL related APIs for externally plugged transceivers.

Copyright (c) 2015-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   (0x0000)
 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_irq_flag_clr()   CLEAR_TRX_IRQ()
 Clears the transceiver main interrupt. More...
 
#define TRX_IRQ_GET()   IRQ_PINGET()
 
#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   (0x8000)
 Write access command of the transceiver. More...
 

Typedefs

typedef void(* irq_handler_t )(void)
 Transceiver ISR handler. More...
 

Functions

void PhyReset (void)
 Resets the TRX radio. More...
 
uint8_t trx_bit_read (uint16_t addr, uint8_t mask, uint8_t pos)
 Subregister read. More...
 
void trx_bit_write (uint16_t reg_addr, uint8_t mask, uint8_t pos, uint8_t new_value)
 Subregister write. More...
 
void trx_irq_init (FUNC_PTR trx_irq_cb)
 
void trx_read (uint16_t addr, uint8_t *data, uint16_t length)
 
uint8_t trx_reg_read (uint16_t addr)
 
void trx_reg_write (uint16_t addr, uint8_t data)
 Writes data into a transceiver register. More...
 
void trx_spi_done_cb_init (void *spi_done_cb)
 SPI done callback initialization. More...
 
void trx_spi_init (void)
 Initializes the SPI interface for communication with the transceiver. More...
 
void trx_write (uint16_t addr, uint8_t *data, uint16_t length)