#include <stdbool.h>
#include "phy.h"
#include "sal.h"
#include "trx_access.h"
#include "delay.h"
#include "at86rf233.h"
Macros | |
#define | PHY_CRC_SIZE 2 |
Functions | |
void | PHY_DataReq (uint8_t *data) |
int8_t | PHY_EdReq (void) |
void | PHY_EncryptReq (uint8_t *text, uint8_t *key) |
void | PHY_Init (void) |
uint16_t | PHY_RandomReq (void) |
void | PHY_SetChannel (uint8_t channel) |
void | PHY_SetIEEEAddr (uint8_t *ieee_addr) |
void | PHY_SetPanId (uint16_t panId) |
void | PHY_SetRxState (bool rx) |
void | PHY_SetShortAddr (uint16_t addr) |
void | PHY_SetTxPower (uint8_t txPower) |
void | PHY_Sleep (void) |
void | PHY_TaskHandler (void) |
void | PHY_Wakeup (void) |
static uint8_t | phyReadRegister (uint8_t reg) |
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 | 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 | ) |
References IRQ_STATUS_REG, PHY_STATE_TX_WAIT_END, phyReadRegister(), phyState, phyTrxSetState(), and TRX_CMD_TX_ARET_ON.
int8_t PHY_EdReq | ( | void | ) |
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 | ) |
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_SetChannel | ( | uint8_t | channel | ) |
References PHY_CC_CCA_REG, phyReadRegister(), and phyWriteRegister().
void PHY_SetIEEEAddr | ( | uint8_t * | ieee_addr | ) |
References i, and IEEE_ADDR_0_REG.
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_SetTxPower | ( | uint8_t | txPower | ) |
References PHY_TX_PWR_REG, phyReadRegister(), and phyWriteRegister().
void PHY_Sleep | ( | void | ) |
References PHY_STATE_SLEEP, phyState, phyTrxSetState(), and TRX_CMD_TRX_OFF.
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_RSSI_BASE_VAL, 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(), phyRxBuffer, phySetRxState(), phyState, phyWaitState(), PHY_DataInd_t::rssi, PHY_DataInd_t::size, TRAC_STATUS, TRAC_STATUS_CHANNEL_ACCESS_FAILURE, TRAC_STATUS_NO_ACK, TRAC_STATUS_SUCCESS, TRX_END, TRX_STATE_REG, and TRX_STATUS_RX_AACK_ON.
void PHY_Wakeup | ( | void | ) |
References PHY_STATE_IDLE, phySetRxState(), and phyState.
|
static |
Referenced by PHY_DataReq(), PHY_EdReq(), PHY_Init(), PHY_RandomReq(), PHY_SetChannel(), PHY_SetTxPower(), PHY_TaskHandler(), phySetRxState(), phyTrxSetState(), and phyWaitState().
|
static |
References IRQ_STATUS_REG, phyReadRegister(), phyRxState, phyTrxSetState(), TRX_CMD_RX_AACK_ON, and TRX_CMD_TRX_OFF.
Referenced by PHY_EdReq(), 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_EdReq(), PHY_RandomReq(), PHY_Sleep(), and phySetRxState().
|
static |
References phyReadRegister(), TRX_STATUS_MASK, and TRX_STATUS_REG.
Referenced by PHY_TaskHandler().
|
static |
Referenced by PHY_EdReq(), PHY_Init(), PHY_SetChannel(), PHY_SetPanId(), PHY_SetShortAddr(), PHY_SetTxPower(), and phyTrxSetState().
|
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().