Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
APIs to access RF module

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

at86rfx_retval_t at86rfx_init ( void  )

Initializes the transceiver interface.

This function initializes the transceiver interface.

References AT86RFX_FAILURE, AT86RFX_SUCCESS, CMD_RX_ON, CURRENT_CHANNEL_DEFAULT, ENABLE_TRX_IRQ, pal_trx_bit_write(), pal_trx_init(), pal_trx_reg_write(), RG_TRX_STATE, SR_CHANNEL, tal_init(), and TRX_SUCCESS.

Referenced by main().

void at86rfx_task ( void  )

RF task handling.

This function

  • Checks and calls back with received packet.
  • Processes the TAL incoming frame queue.
  • Calls the TAL state machine handling.

References at86rfx_frame_rx, at86rfx_rx_buffer, AT86RFX_RX_NOTIFY, and handle_tal_state().

Referenced by main().

void at86rfx_tx_frame ( uint8_t *  frame_tx)

Transmits the frame.

This function configures the transceiver in TX mode and transmits the frame

Parameters
[in]frame_txPointer to data to be transmitted

References DISABLE_TRX_IRQ, ENABLE_TRX_IRQ, LENGTH_FIELD_LEN, pal_trx_frame_write(), and tx_frame_config().

Referenced by app_task(), and at86rfx_tal_tx_status_cb().

uint8_t pal_trx_bit_read ( uint8_t  addr,
uint8_t  mask,
uint8_t  pos 
)

Subregister read.

Parameters
addrOffset of the register
maskBit mask of the subregister
posBit position of the subregister
Returns
Data Value of the read bit(s)

References pal_trx_reg_read().

Referenced by handle_received_frame_irq(), set_trx_state(), switch_pll_on(), trx_init(), and trx_reset().

void pal_trx_bit_write ( uint8_t  reg_addr,
uint8_t  mask,
uint8_t  pos,
uint8_t  new_value 
)

Subregister write.

Parameters
[in]reg_addrOffset of the register
[in]maskBit mask of the subregister
[in]posBit position of the subregister
[out]new_valueData, which is muxed into the register

References pal_trx_reg_read(), and pal_trx_reg_write().

Referenced by at86rfx_init(), tal_init(), and trx_config().

void pal_trx_frame_read ( uint8_t *  data,
uint8_t  length 
)

Reads frame buffer of the transceiver.

This function reads the frame buffer of the transceiver.

Parameters
[out]dataPointer to the location to store frame
[in]lengthNumber of bytes to be read from the frame buffer.

References AT86RFX_SPI, ENTER_CRITICAL_REGION, LEAVE_CRITICAL_REGION, spi_deselect_device(), spi_read_packet(), spi_select_device(), spi_write_packet(), and TRX_CMD_FR.

Referenced by handle_received_frame_irq().

void pal_trx_frame_write ( uint8_t *  data,
uint8_t  length 
)

Writes data into frame buffer of the transceiver.

This function writes data into the frame buffer of the transceiver

Parameters
[in]dataPointer to data to be written into frame buffer
[in]lengthNumber of bytes to be written into frame buffer

References AT86RFX_SPI, ENTER_CRITICAL_REGION, LEAVE_CRITICAL_REGION, spi_deselect_device(), spi_select_device(), spi_write_packet(), and TRX_CMD_FW.

Referenced by at86rfx_tx_frame().

void pal_trx_init ( void  )

Initializes the SPI and GPIO pins for transceiver access.

This function configures the SPI in master mode and interrupt capability of GPIO pin to handle the interrupts from transceiver

References AT86RFX_SPI, AT86RFX_SPI_BAUDRATE, EXT_INT, EXT_INT_ISR_PRIORITY, gpio_clear_pin_interrupt_flag(), gpio_configure_pin(), GPIO_DIR_OUTPUT, gpio_enable_pin_interrupt(), GPIO_INIT_HIGH, GPIO_RISING_EDGE, irq_register_handler, SLP_TR, spi_deselect_device(), spi_enable(), spi_master_init(), spi_master_setup_device(), SPI_MODE_0, and TRX_RST.

Referenced by at86rfx_init().

uint8_t pal_trx_reg_read ( uint8_t  addr)

Reads current value from a transceiver register.

This function reads the current value from a transceiver register.

Parameters
addrSpecifies the address of the trx register from which the data shall be read
Returns
value of the register read

References AT86RFX_SPI, ENTER_CRITICAL_REGION, LEAVE_CRITICAL_REGION, READ_ACCESS_COMMAND, spi_deselect_device(), spi_read_packet(), spi_select_device(), and spi_write_packet().

Referenced by pal_trx_bit_read(), pal_trx_bit_write(), switch_pll_on(), tal_init(), trx_init(), and trx_irq_handler_cb().

void pal_trx_reg_write ( uint8_t  addr,
uint8_t  data 
)

Writes data into a transceiver register.

This function writes a value into transceiver register.

Parameters
addrAddress of the trx register
dataData to be written to trx register

References AT86RFX_SPI, ENTER_CRITICAL_REGION, LEAVE_CRITICAL_REGION, spi_deselect_device(), spi_select_device(), spi_write_packet(), and WRITE_ACCESS_COMMAND.

Referenced by at86rfx_init(), pal_trx_bit_write(), set_trx_state(), switch_pll_on(), trx_config(), and trx_init().