#include <stdbool.h>
#include "phy.h"
#include "sal.h"
#include "trx_access.h"
#include "delay.h"
#include "at86rf212b.h"
Macros | |
#define | PHY_CRC_SIZE 2 |
Functions | |
void | PHY_DataReq (uint8_t *data) |
void | PHY_EncryptReq (uint8_t *text, uint8_t *key) |
void | PHY_Init (void) |
uint16_t | PHY_RandomReq (void) |
void | PHY_SetBand (uint8_t band) |
void | PHY_SetChannel (uint8_t channel) |
void | PHY_SetIEEEAddr (uint8_t *ieee_addr) |
void | PHY_SetModulation (uint8_t modulation) |
void | PHY_SetPanId (uint16_t panId) |
void | PHY_SetRxState (bool rx) |
void | PHY_SetShortAddr (uint16_t addr) |
void | PHY_Sleep (void) |
void | PHY_TaskHandler (void) |
void | PHY_Wakeup (void) |
static uint8_t | phyReadRegister (uint8_t reg) |
static int8_t | phyRssiBaseVal (void) |
static void | phySetChannel (void) |
static void | phySetRxState (void) |
static void | phyTrxSetState (uint8_t state) |
static void | phyWaitState (uint8_t state) |
static void | phyWriteRegister (uint8_t reg, uint8_t value) |
Variables | |
static uint8_t | phyBand |
static uint8_t | phyChannel |
static uint8_t | phyModulation |
static uint8_t | phyRxBuffer [128] |
static bool | phyRxState |
static PhyState_t | phyState = PHY_STATE_INITIAL |
#define PHY_CRC_SIZE 2 |
Referenced by PHY_TaskHandler().
enum PhyState_t |
void PHY_DataReq | ( | uint8_t * | data | ) |
void PHY_EncryptReq | ( | uint8_t * | text, |
uint8_t * | key | ||
) |
References AES_DIR_ENCRYPT, AES_MODE_ECB, NULL, sal_aes_exec(), sal_aes_read(), sal_aes_setup(), and sal_aes_wrrd().
void PHY_Init | ( | void | ) |
References IRQ_MASK_MODE, PHY_STATE_IDLE, PHY_TX_PWR_REG, phyBand, phyModulation, phyReadRegister(), PhyReset(), phyRxState, phyState, phyWriteRegister(), RF_CTRL_0_REG, RX_SAFE_MODE, SPI_CMD_MODE, TRX_CMD_TRX_OFF, TRX_CTRL_1_REG, TRX_CTRL_2_REG, trx_spi_init(), TRX_STATE_REG, TRX_STATUS_MASK, TRX_STATUS_REG, TRX_STATUS_TRX_OFF, and TX_AUTO_CRC_ON.
uint16_t PHY_RandomReq | ( | void | ) |
References delay_us, i, PHY_RSSI_REG, phyReadRegister(), phySetRxState(), phyTrxSetState(), RANDOM_NUMBER_UPDATE_INTERVAL, RND_VALUE, and TRX_CMD_RX_ON.
void PHY_SetBand | ( | uint8_t | band | ) |
Referenced by appInit().
void PHY_SetChannel | ( | uint8_t | channel | ) |
References phyChannel, and phySetChannel().
void PHY_SetIEEEAddr | ( | uint8_t * | ieee_addr | ) |
References i, IEEE_ADDR_0_REG, and trx_reg_write().
void PHY_SetModulation | ( | uint8_t | modulation | ) |
Referenced by appInit().
void PHY_SetPanId | ( | uint16_t | panId | ) |
References PAN_ID_0_REG, PAN_ID_1_REG, and phyWriteRegister().
void PHY_SetRxState | ( | bool | rx | ) |
References phyRxState, and phySetRxState().
void PHY_SetShortAddr | ( | uint16_t | addr | ) |
References CSMA_SEED_0_REG, phyWriteRegister(), SHORT_ADDR_0_REG, and SHORT_ADDR_1_REG.
void PHY_Sleep | ( | void | ) |
References PHY_STATE_SLEEP, phyState, phyTrxSetState(), TRX_CMD_TRX_OFF, and TRX_SLP_TR_HIGH.
void PHY_TaskHandler | ( | void | ) |
References PHY_DataInd_t::data, IRQ_STATUS_REG, PHY_DataInd_t::lqi, PHY_CRC_SIZE, PHY_DataConf(), PHY_DataInd(), PHY_ED_LEVEL_REG, PHY_STATE_IDLE, PHY_STATE_SLEEP, PHY_STATE_TX_WAIT_END, PHY_STATUS_CHANNEL_ACCESS_FAILURE, PHY_STATUS_ERROR, PHY_STATUS_NO_ACK, PHY_STATUS_SUCCESS, phyReadRegister(), phyRssiBaseVal(), phyRxBuffer, phySetRxState(), phyState, phyWaitState(), PHY_DataInd_t::rssi, PHY_DataInd_t::size, status, TRAC_STATUS, TRAC_STATUS_CHANNEL_ACCESS_FAILURE, TRAC_STATUS_NO_ACK, TRAC_STATUS_SUCCESS, TRX_END, trx_frame_read(), TRX_STATE_REG, and TRX_STATUS_RX_AACK_ON.
void PHY_Wakeup | ( | void | ) |
References PHY_STATE_IDLE, phySetRxState(), phyState, and TRX_SLP_TR_LOW.
|
static |
References trx_reg_read().
Referenced by PHY_DataReq(), PHY_Init(), PHY_RandomReq(), PHY_TaskHandler(), phySetChannel(), phySetRxState(), phyTrxSetState(), and phyWaitState().
|
static |
|
static |
References CC_CTRL_0_REG, CC_CTRL_1_REG, PHY_CC_CCA_REG, phyBand, phyChannel, phyModulation, phyReadRegister(), phyWriteRegister(), and TRX_CTRL_2_REG.
Referenced by PHY_SetBand(), PHY_SetChannel(), and PHY_SetModulation().
|
static |
References IRQ_STATUS_REG, phyReadRegister(), phyRxState, phyTrxSetState(), TRX_CMD_RX_AACK_ON, and TRX_CMD_TRX_OFF.
Referenced by PHY_RandomReq(), PHY_SetRxState(), PHY_TaskHandler(), and PHY_Wakeup().
|
static |
References phyReadRegister(), phyWriteRegister(), TRX_CMD_FORCE_TRX_OFF, TRX_STATE_REG, TRX_STATUS_MASK, TRX_STATUS_REG, and TRX_STATUS_TRX_OFF.
Referenced by PHY_DataReq(), PHY_RandomReq(), PHY_Sleep(), and phySetRxState().
|
static |
References phyReadRegister(), TRX_STATUS_MASK, and TRX_STATUS_REG.
Referenced by PHY_TaskHandler().
|
static |
References trx_reg_write().
Referenced by PHY_Init(), PHY_SetPanId(), PHY_SetShortAddr(), phySetChannel(), and phyTrxSetState().
|
static |
Referenced by PHY_Init(), PHY_SetBand(), and phySetChannel().
|
static |
Referenced by PHY_SetChannel(), and phySetChannel().
|
static |
Referenced by PHY_Init(), PHY_SetModulation(), phyRssiBaseVal(), and phySetChannel().
|
static |
Referenced by PHY_TaskHandler().
|
static |
Referenced by PHY_Init(), PHY_SetRxState(), and phySetRxState().
|
static |
Referenced by PHY_DataReq(), PHY_Init(), PHY_Sleep(), PHY_TaskHandler(), and PHY_Wakeup().