Atmel Software Framework

trx_access.h File Reference

HAL related APIs for externally plugged transceivers.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. The name of Atmel may not be used to endorse or promote products derived from this software without specific prior written permission.
4. This software may only be redistributed and used in connection with an Atmel microcontroller product.

THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "compiler.h"
#include "conf_trx_access.h"
#include "ioport.h"
#include "board.h"

Macros

#define ENTER_TRX_CRITICAL_REGION()

#define IRQ_PINGET()   ioport_get_pin_level(AT86RFX_IRQ_PIN)

#define LEAVE_TRX_CRITICAL_REGION()   cpu_irq_restore(flags); }

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)
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...

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)

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_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_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...