Driver for AT86RF230B transceiver.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | TAL_MAIN_STATE_MASK (0x0F) |
#define | TAL_TX_SUB_STATE_MASK (0xF0) |
Functions | |
static void | handle_received_frame_irq (void) |
Handle received frame interrupt. More... | |
void | handle_tal_state (void) |
Handles the transceiver state. More... | |
static void | handle_tx_end_irq (void) |
Handles interrupts issued due to end of transmission. More... | |
static trx_retval_t | internal_tal_reset (void) |
Internal TAL reset function. More... | |
static tal_trx_status_t | set_trx_state (trx_cmd_t trx_cmd) |
Sets transceiver state. More... | |
static void | switch_pll_on (void) |
Switches the PLL on. More... | |
trx_retval_t | tal_init (void) |
Initializes the TAL. More... | |
static void | trx_config (void) |
Configures the transceiver. More... | |
static trx_retval_t | trx_init (void) |
Initializes the transceiver. More... | |
void | trx_irq_handler_cb (void) |
Transceiver interrupt handler. More... | |
static trx_retval_t | trx_reset (void) |
Reset transceiver. More... | |
static void | tx_end_handling (void) |
Implements the handling of the transmission end. More... | |
void | tx_frame_config (void) |
Configures the transceiver for frame transmission. More... | |
Variables | |
static tal_state_t | tal_state |
Current state of the TAL state machine. More... | |
static tal_trx_status_t | tal_trx_status |
Current state of the transceiver. More... | |
static uint8_t | trx_trac_status |
Keep track of transceiver status. More... | |
#define TAL_MAIN_STATE_MASK (0x0F) |
#define TAL_TX_SUB_STATE_MASK (0xF0) |
|
static |
Handle received frame interrupt.
This function handles transceiver interrupts for received frames and uploads the frames from the trx.
References at86rfx_frame_rx, at86rfx_rx_buffer, CMD_RX_ON, CRC16_NOT_VALID, LENGTH_FIELD_LEN, pal_trx_bit_read(), pal_trx_frame_read(), PHY_MAX_LENGTH, set_trx_state(), and SR_RX_CRC_VALID.
Referenced by trx_irq_handler_cb().
|
static |
Handles interrupts issued due to end of transmission.
References CMD_RX_ON, set_trx_state(), tal_state, and TAL_TX_END.
Referenced by trx_irq_handler_cb().
|
static |
Internal TAL reset function.
References TAL_IDLE, tal_state, trx_config(), TRX_FAILURE, trx_reset(), and TRX_SUCCESS.
Referenced by tal_init().
|
static |
Sets transceiver state.
trx_cmd | needs to be one of the trx commands |
References Assert, CMD_PLL_ON, CMD_RX_ON, pal_trx_bit_read(), pal_trx_reg_write(), PAL_WAIT_1_US, PLL_ON, RG_TRX_STATE, RX_ON, SR_TRX_STATUS, STATE_TRANSITION_IN_PROGRESS, switch_pll_on(), tal_trx_status, and TRX_OFF.
Referenced by handle_received_frame_irq(), handle_tx_end_irq(), tal_init(), and tx_frame_config().
|
static |
Switches the PLL on.
References Assert, CLEAR_TRX_IRQ, CMD_PLL_ON, DISABLE_TRX_IRQ, pal_trx_bit_read(), pal_trx_reg_read(), pal_trx_reg_write(), RG_IRQ_MASK, RG_IRQ_STATUS, RG_TRX_STATE, SR_TRX_STATUS, TRX_IRQ_DEFAULT, TRX_IRQ_PLL_LOCK, and TRX_OFF.
Referenced by set_trx_state().
|
static |
Configures the transceiver.
This function is called to configure the transceiver after reset.
References CLKM_1MHz, CLKM_2mA, pal_trx_bit_write(), pal_trx_reg_write(), PD_ACK_BIT_SET_ENABLE, RG_CSMA_SEED_0, RG_IRQ_MASK, RG_TRX_CTRL_0, SR_AACK_SET_PD, SR_CSMA_SEED_1, SR_TX_AUTO_CRC_ON, TRX_IRQ_DEFAULT, and TX_AUTO_CRC_ENABLE.
Referenced by internal_tal_reset().
|
static |
Initializes the transceiver.
This function is called to initialize the transceiver.
References AT86RF230, AT86RF230_REV_B, CMD_TRX_OFF, DELAY_US, P_ON_TO_CLKM_AVAILABLE, pal_trx_bit_read(), pal_trx_reg_read(), pal_trx_reg_write(), RG_PART_NUM, RG_TRX_STATE, RG_VERSION_NUM, RST_HIGH, RST_LOW, RST_PULSE_WIDTH_US, SLP_TR_LOW, SR_TRX_STATUS, tal_trx_status, TRX_FAILURE, TRX_OFF, and TRX_SUCCESS.
Referenced by tal_init().
|
static |
Reset transceiver.
References DELAY_US, pal_trx_bit_read(), RST_HIGH, RST_LOW, RST_PULSE_WIDTH_US, SLEEP_TO_TRX_OFF_US, SLP_TR_LOW, SR_TRX_STATUS, tal_trx_status, TRX_FAILURE, TRX_OFF, and TRX_SUCCESS.
Referenced by internal_tal_reset().
|
static |
Implements the handling of the transmission end.
This function handles the callback for the transmission end.
References Assert, AT86RFX_CHANNEL_ACCESS_FAILURE, AT86RFX_FAILURE, AT86RFX_SUCCESS, AT86RFX_TX_STATUS_NOTIFY, TAL_IDLE, tal_state, TRAC_CHANNEL_ACCESS_FAILURE, TRAC_INVALID, TRAC_SUCCESS, and trx_trac_status.
Referenced by handle_tal_state().
|
static |
Current state of the TAL state machine.
Referenced by handle_tal_state(), handle_tx_end_irq(), internal_tal_reset(), trx_irq_handler_cb(), tx_end_handling(), and tx_frame_config().
|
static |
Current state of the transceiver.
Referenced by set_trx_state(), trx_init(), and trx_reset().
|
static |
Keep track of transceiver status.
Referenced by tx_end_handling().