AT86RF212B PHY interface.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdint.h>
#include <stdbool.h>
#define PHY_HAS_AES_MODULE |
#define PHY_HAS_RANDOM_NUMBER_GENERATOR |
#define PHY_RSSI_BASE_VAL_BPSK_20 (-100) |
Referenced by phyRssiBaseVal().
#define PHY_RSSI_BASE_VAL_BPSK_40 (-99) |
Referenced by phyRssiBaseVal().
#define PHY_RSSI_BASE_VAL_OQPSK_RC_250 (-97) |
Referenced by phyRssiBaseVal().
#define PHY_RSSI_BASE_VAL_OQPSK_SIN_250 (-98) |
Referenced by phyRssiBaseVal().
#define PHY_RSSI_BASE_VAL_OQPSK_SIN_RC_100 (-98) |
Referenced by phyRssiBaseVal().
typedef struct PHY_DataInd_t PHY_DataInd_t |
anonymous enum |
void PHY_DataConf | ( | uint8_t | status | ) |
References NwkIb_t::lock, NWK_TX_STATE_SENT, nwkIb, nwkTxConvertPhyStatus(), NwkFrame_t::state, and NwkFrame_t::tx.
Referenced by PHY_TaskHandler().
void PHY_DataInd | ( | PHY_DataInd_t * | ind | ) |
References PHY_DataInd_t::data, NwkFrame_t::data, PHY_DataInd_t::lqi, NWK_RX_STATE_RECEIVED, nwkFrameAlloc(), PHY_DataInd_t::rssi, NwkFrame_t::rx, PHY_DataInd_t::size, NwkFrame_t::size, and NwkFrame_t::state.
Referenced by PHY_TaskHandler().
void PHY_DataReq | ( | uint8_t * | data | ) |
References IRQ_STATUS_REG, PHY_STATE_TX_WAIT_END, phyReadRegister(), phyState, phyTrxSetState(), TRX_CMD_TX_ARET_ON, trx_frame_write(), TRX_SLP_TR_HIGH, TRX_SLP_TR_LOW, and TRX_TRIG_DELAY.
Referenced by nwkTxTaskHandler().
void PHY_EncryptReq | ( | uint8_t * | text, |
uint8_t * | key | ||
) |
References AES_DIR_ENCRYPT, AES_MODE_ECB, sal_aes_exec(), sal_aes_read(), sal_aes_setup(), and sal_aes_wrrd().
Referenced by SYS_EncryptReq().
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.
Referenced by SYS_Init().
uint16_t PHY_RandomReq | ( | void | ) |
References delay_us, PHY_RSSI_REG, phyReadRegister(), phySetRxState(), phyTrxSetState(), RANDOM_NUMBER_UPDATE_INTERVAL, RND_VALUE, and TRX_CMD_RX_ON.
Referenced by appInit().
void PHY_SetBand | ( | uint8_t | band | ) |
References phyBand, and phySetChannel().
Referenced by appInit().
void PHY_SetChannel | ( | uint8_t | channel | ) |
References phyChannel, and phySetChannel().
Referenced by appInit().
void PHY_SetIEEEAddr | ( | uint8_t * | ieee_addr | ) |
References IEEE_ADDR_0_REG, and trx_reg_write().
void PHY_SetModulation | ( | uint8_t | modulation | ) |
References phyModulation, and phySetChannel().
Referenced by appInit().
void PHY_SetPanId | ( | uint16_t | panId | ) |
References PAN_ID_0_REG, PAN_ID_1_REG, and phyWriteRegister().
Referenced by NWK_SetPanId().
void PHY_SetRxState | ( | bool | rx | ) |
References phyRxState, and phySetRxState().
Referenced by appInit().
void PHY_SetShortAddr | ( | uint16_t | addr | ) |
References CSMA_SEED_0_REG, phyWriteRegister(), SHORT_ADDR_0_REG, and SHORT_ADDR_1_REG.
Referenced by NWK_SetAddr().
void PHY_Sleep | ( | void | ) |
References PHY_STATE_SLEEP, phyState, phyTrxSetState(), TRX_CMD_TRX_OFF, and TRX_SLP_TR_HIGH.
Referenced by NWK_SleepReq().
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, 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.
Referenced by SYS_TaskHandler().
void PHY_Wakeup | ( | void | ) |
References PHY_STATE_IDLE, phySetRxState(), phyState, and TRX_SLP_TR_LOW.
Referenced by NWK_WakeupReq().