Microchip® Advanced Software Framework

at86rf215/src/tal_pwr_mgmt.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include "pal.h"
#include "return_val.h"
#include "ieee_const.h"
#include "tal.h"
#include "tal_config.h"
#include "tal_internal.h"
#include "tal_pib.h"

Functions

retval_t tal_trx_sleep (trx_id_t trx_id)
 Sets the transceiver to SLEEP. More...
 
retval_t tal_trx_wakeup (trx_id_t trx_id)
 Wakes up the transceiver from SLEEP. More...
 

retval_t tal_trx_sleep ( trx_id_t  trx_id)

Sets the transceiver to SLEEP.

Sets the transceiver to sleep.

This function sets the entire device to state DEEP_SLEEP.

Parameters
trx_idTransceiver identifier
modeDefines sleep mode of transceiver (Not used for 215 trx)
Returns

References Assert, MAC_SUCCESS, NULL, NUM_TRX, RF09, RF24, RF_BASE_ADDR_OFFSET, RF_SLEEP, RF_TRXOFF, RG_RF09_CMD, TAL_BB_IRQ_CLR_ALL, tal_buf_shortage, TAL_BUSY, TAL_IDLE, TAL_RF_IRQ_CLR_ALL, tal_rx_buffer, TAL_SLEEP, tal_state, TAL_TRX_ASLEEP, and trx_state.

retval_t tal_trx_wakeup ( trx_id_t  trx_id)

Wakes up the transceiver from SLEEP.

Wakes up the transceiver from sleep.

This function awakes the transceiver from state SLEEP.

Parameters
trx_idTransceiver identifier
Returns
  • TAL_TRX_AWAKE - The transceiver is already awake
  • MAC_SUCCESS - The transceiver is woken up from sleep
  • FAILURE - The transceiver did not wake-up from sleep

References Assert, config_phy(), FAILURE, MAC_SUCCESS, NULL, NUM_TRX, pal_get_current_time(), pal_sub_time_us(), RF09, RF24, RF_BASE_ADDR_OFFSET, RF_IRQ_WAKEUP, RF_TRXOFF, RG_RF09_CMD, start_time, TAL_IDLE, TAL_RF_IRQ_CLR, TAL_RF_IS_IRQ_SET, tal_rx_buffer, TAL_SLEEP, tal_state, TAL_TRX_AWAKE, TAL_WAKING_UP, trx_config(), trx_state, and write_all_tal_pib_to_trx().