Microchip® Advanced Software Framework

phy.c File Reference

AT86RF233 PHY implementation.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#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
 

Enumerations

enum  PhyState_t {
  PHY_STATE_INITIAL,
  PHY_STATE_IDLE,
  PHY_STATE_SLEEP,
  PHY_STATE_TX_WAIT_END
}
 

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
Enumerator
PHY_STATE_INITIAL 
PHY_STATE_IDLE 
PHY_STATE_SLEEP 
PHY_STATE_TX_WAIT_END 

void PHY_EncryptReq ( uint8_t *  text,
uint8_t *  key 
)
void PHY_SetChannel ( uint8_t  channel)
void PHY_SetIEEEAddr ( uint8_t *  ieee_addr)

References IEEE_ADDR_0_REG, and trx_reg_write().

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)
void PHY_SetTxPower ( uint8_t  txPower)
void PHY_Sleep ( void  )
void PHY_Wakeup ( void  )
static uint8_t phyReadRegister ( uint8_t  reg)
static
static void phyWaitState ( uint8_t  state)
static
static void phyWriteRegister ( uint8_t  reg,
uint8_t  value 
)
static

uint8_t phyRxBuffer[128]
static

Referenced by PHY_TaskHandler().

bool phyRxState
static