Performs initialization and reset functionalities of the transceiver.
Macros | |
#define | P_ON_TO_CLKM_ATTEMPTS |
#define | SLEEP_TO_TRX_OFF_ATTEMPTS |
#define | TRX_POLL_WAIT_TIME_US (100) |
Functions | |
static retval_t | internal_tal_reset (bool set_default_pib) |
Internal TAL reset function. More... | |
void | tal_generate_rand_seed (void) |
Generates a 16-bit random number used as initial seed for srand() More... | |
retval_t | tal_init (void) |
Initializes the TAL. More... | |
retval_t | tal_reset (bool set_default_pib) |
Resets TAL state machine and sets the default PIB values if requested. More... | |
static retval_t | tal_timer_init (void) |
Initializes all timers used by the TAL module by assigning id's to each of them. More... | |
static void | tal_timers_stop (void) |
Stops all initialized TAL timers. More... | |
static void | trx_config (void) |
Configures the transceiver. More... | |
static retval_t | trx_init (void) |
Initializes the transceiver. More... | |
static retval_t | trx_reset (void) |
Reset transceiver. More... | |
Variables | |
uint8_t | TAL_CSMA_BEACON_LOSS_TIMER |
uint8_t | TAL_CSMA_CCA |
#define P_ON_TO_CLKM_ATTEMPTS |
Referenced by trx_init().
#define SLEEP_TO_TRX_OFF_ATTEMPTS |
Referenced by trx_init(), and trx_reset().
#define TRX_POLL_WAIT_TIME_US (100) |
Referenced by trx_init(), and trx_reset().
Internal TAL reset function.
set_default_pib | Defines whether PIB values need to be set to its default values |
References CSMA_IDLE, FAILURE, init_tal_pib(), MAC_SUCCESS, tal_csma_state, tal_generate_rand_seed(), TAL_IDLE, tal_rx_on_required, tal_state, trx_config(), trx_reset(), and write_all_tal_pib_to_trx().
Referenced by tal_init(), and tal_reset().
void tal_generate_rand_seed | ( | void | ) |
Generates a 16-bit random number used as initial seed for srand()
This function generates a 16-bit random number by means of using the Random Number Generator from the transceiver. The Random Number Generator generates 2-bit random values. These 2-bit random values are concatenated to the required 16-bit random seed. The generated random 16-bit number is feed into function srand() as initial seed. The transceiver state is initally set to RX_ON. After the completion of the random seed generation, the trancseiver is set to TRX_OFF.
Referenced by internal_tal_reset().
retval_t tal_init | ( | void | ) |
Initializes the TAL.
This function is called to initialize the TAL. The transceiver is initialized, the TAL PIBs are set to their default values, and the TAL state machine is set to TAL_IDLE state.
Referenced by init_state_init(), and mac_init().
Resets TAL state machine and sets the default PIB values if requested.
set_default_pib | Defines whether PIB values need to be set to its default values |
Referenced by mac_reset(), set_transceiver_state(), and tfa_continuous_tx_stop().
|
static |
Initializes all timers used by the TAL module by assigning id's to each of them.
References FAILURE, MAC_SUCCESS, pal_timer_get_id(), TAL_CSMA_BEACON_LOSS_TIMER, and TAL_CSMA_CCA.
Referenced by tal_init().
|
static |
Stops all initialized TAL timers.
References pal_timer_stop(), TAL_CSMA_BEACON_LOSS_TIMER, and TAL_CSMA_CCA.
Referenced by tal_reset().
|
static |
Configures the transceiver.
This function is called to configure the transceiver after reset.
References ANT_DIV_ENABLE, ANT_EXT_SW_ENABLE, ANTENNA_DEFAULT, CLKM_1MHZ, CLKM_SHA_DISABLE, IRQ_MASK_MODE_ON, PA_EXT_ENABLE, PAD_CLKM_2_MA, PD_ACK_BIT_SET_ENABLE, RG_CSMA_SEED_0, RG_IRQ_MASK, RX_SAFE_MODE_ENABLE, SLEEP_MODE_1, SR_AACK_SET_PD, SR_ANT_CTRL, SR_ANT_DIV_EN, SR_ANT_EXT_SW_EN, SR_CCA_ED_THRES, SR_CLKM_CTRL, SR_CLKM_SHA_SEL, SR_CSMA_SEED_1, SR_IRQ_2_EXT_EN, SR_IRQ_MASK_MODE, SR_PA_EXT_EN, SR_PAD_IO_CLKM, SR_PDT_THRES, SR_RX_SAFE_MODE, tal_trx_sleep(), tal_trx_wakeup(), THRES_ANT_DIV_ENABLE, TIMESTAMPING_ENABLE, trx_bit_write(), TRX_IRQ_DEFAULT, and trx_reg_write().
Referenced by internal_tal_reset(), and set_trx_state().
|
static |
Initializes the transceiver.
This function is called to initialize the transceiver.
References Assert, AT86RF231_PART_NUM, AT86RF231_VERSION_NUM, CMD_TRX_OFF, FAILURE, MAC_SUCCESS, P_ON_TO_CLKM_ATTEMPTS, P_ON_TO_CLKM_AVAILABLE_TYP_US, pal_timer_delay, RG_PART_NUM, RG_TRX_STATE, RG_VERSION_NUM, RST_PULSE_WIDTH_US, SLEEP_TO_TRX_OFF_ATTEMPTS, SR_TRX_STATUS, tal_trx_status, trx_bit_read(), TRX_OFF, TRX_POLL_WAIT_TIME_US, trx_reg_read(), trx_reg_write(), TRX_RST_HIGH, TRX_RST_LOW, and TRX_SLP_TR_LOW.
Referenced by tal_init().
|
static |
Reset transceiver.
References Assert, FAILURE, MAC_SUCCESS, pal_timer_delay, RST_PULSE_WIDTH_US, SLEEP_TO_TRX_OFF_ATTEMPTS, SLEEP_TO_TRX_OFF_TYP_US, SR_TRX_STATUS, stb_restart(), tal_trx_status, trx_bit_read(), TRX_OFF, TRX_POLL_WAIT_TIME_US, TRX_RST_HIGH, TRX_RST_LOW, and TRX_SLP_TR_LOW.
Referenced by internal_tal_reset().
uint8_t TAL_CSMA_BEACON_LOSS_TIMER |
Referenced by slotted_csma_state_handling(), start_beacon_loss_timer(), tal_timer_init(), tal_timers_stop(), and tx_done().
uint8_t TAL_CSMA_CCA |
Referenced by csma_backoff_calculation(), tal_timer_init(), and tal_timers_stop().