OpenWSN Firmware
Radio

Cross-platform declaration "radio" bsp module. More...

Macros

#define LENGTH_CRC   2
 

Enumerations

enum  radio_state_t {
  RADIOSTATE_STOPPED = 0x00, RADIOSTATE_RFOFF = 0x01, RADIOSTATE_SETTING_FREQUENCY = 0x02, RADIOSTATE_FREQUENCY_SET = 0x03,
  RADIOSTATE_LOADING_PACKET = 0x04, RADIOSTATE_PACKET_LOADED = 0x05, RADIOSTATE_ENABLING_TX = 0x06, RADIOSTATE_TX_ENABLED = 0x07,
  RADIOSTATE_TRANSMITTING = 0x08, RADIOSTATE_ENABLING_RX = 0x09, RADIOSTATE_LISTENING = 0x0a, RADIOSTATE_RECEIVING = 0x0b,
  RADIOSTATE_TXRX_DONE = 0x0c, RADIOSTATE_TURNING_OFF = 0x0d
}
 Current state of the radio. More...
 

Functions

void radio_init (void)
 
void radio_setOverflowCb (radiotimer_compare_cbt cb)
 
void radio_setCompareCb (radiotimer_compare_cbt cb)
 
void radio_setStartFrameCb (radiotimer_capture_cbt cb)
 
void radio_setEndFrameCb (radiotimer_capture_cbt cb)
 
void radio_reset (void)
 
void radio_startTimer (PORT_TIMER_WIDTH period)
 
PORT_TIMER_WIDTH radio_getTimerValue (void)
 
void radio_setTimerPeriod (PORT_TIMER_WIDTH period)
 
PORT_TIMER_WIDTH radio_getTimerPeriod (void)
 
void radio_setFrequency (uint8_t frequency)
 
void radio_rfOn (void)
 
void radio_rfOff (void)
 
void radio_loadPacket (uint8_t *packet, uint8_t len)
 
void radio_txEnable (void)
 
void radio_txNow (void)
 
void radio_rxEnable (void)
 
void radio_rxNow (void)
 
void radio_getReceivedFrame (uint8_t *bufRead, uint8_t *lenRead, uint8_t maxBufLen, int8_t *rssi, uint8_t *lqi, bool *crc)
 
kick_scheduler_t radio_isr (void)
 

Detailed Description

Cross-platform declaration "radio" bsp module.

Author
Thomas Watteyne watte.nosp@m.yne@.nosp@m.eecs..nosp@m.berk.nosp@m.eley..nosp@m.edu, February 2012.

Macro Definition Documentation

#define LENGTH_CRC   2

Enumeration Type Documentation

Current state of the radio.

Note
This radio driver is very minimal in that it does not follow a state machine. It is up to the MAC layer to ensure that the different radio operations are called in the righr order. The radio keeps a state for debugging purposes only.
Enumerator
RADIOSTATE_STOPPED 

Completely stopped.

RADIOSTATE_RFOFF 

Listening for commands, but RF chain is off.

RADIOSTATE_SETTING_FREQUENCY 

Configuring the frequency.

RADIOSTATE_FREQUENCY_SET 

Done configuring the frequency.

RADIOSTATE_LOADING_PACKET 

Loading packet into the radio's TX buffer.

RADIOSTATE_PACKET_LOADED 

Packet is fully loaded in the radio's TX buffer.

RADIOSTATE_ENABLING_TX 

The RF TX chaing is being enabled (includes locking the PLL).

RADIOSTATE_TX_ENABLED 

Radio ready to transmit.

RADIOSTATE_TRANSMITTING 

Busy transmitting bytes.

RADIOSTATE_ENABLING_RX 

The RF RX chain is being enabled (includes locking the PLL).

RADIOSTATE_LISTENING 

RF chain is on, listening, but no packet received yet.

RADIOSTATE_RECEIVING 

Busy receiving bytes.

RADIOSTATE_TXRX_DONE 

Frame has been sent/received completely.

RADIOSTATE_TURNING_OFF 

Turning the RF chain off.

Function Documentation

void radio_getReceivedFrame ( uint8_t *  bufRead,
uint8_t *  lenRead,
uint8_t  maxBufLen,
int8_t *  rssi,
uint8_t *  lqi,
bool *  crc 
)
PORT_TIMER_WIDTH radio_getTimerPeriod ( void  )
PORT_TIMER_WIDTH radio_getTimerValue ( void  )
void radio_init ( void  )
kick_scheduler_t radio_isr ( void  )
void radio_loadPacket ( uint8_t *  packet,
uint8_t  len 
)
void radio_reset ( void  )
void radio_rfOff ( void  )
void radio_rfOn ( void  )
void radio_rxEnable ( void  )
void radio_rxNow ( void  )
void radio_setCompareCb ( radiotimer_compare_cbt  cb)
void radio_setEndFrameCb ( radiotimer_capture_cbt  cb)
void radio_setFrequency ( uint8_t  frequency)
void radio_setOverflowCb ( radiotimer_compare_cbt  cb)
void radio_setStartFrameCb ( radiotimer_capture_cbt  cb)
void radio_setTimerPeriod ( PORT_TIMER_WIDTH  period)
void radio_startTimer ( PORT_TIMER_WIDTH  period)
void radio_txEnable ( void  )
void radio_txNow ( void  )