Interface: moteiv.tos.lib.CC2420Radio.CC2420Control

interface CC2420Control

CC2420 Radio Control interface. Interface for CC2420 specific controls and signals

Author:
Joe Polastre, Moteiv Corporation <info@moteiv.com>

Commands
command result_t disableAddrDecode(uint8_t rh) Disables address decoding on the CC2420
command result_t disableAutoAck(uint8_t rh) Disables auto ack on the CC2420
command result_t enableAddrDecode(uint8_t rh) Enables address decoding on the CC2420
command result_t enableAutoAck(uint8_t rh) Enables auto ack on the CC2420
command uint16_t GetFrequency() Get the current frequency of the radio
command uint8_t GetPreset() Get the current channel of the radio WARNING: If running the CC2420 on a non-standard IEEE 802.15.4 frequency, this function will return the closest possible valid IEEE 802.15.4 channel even if the current frequency in use is not a valid IEEE 802.15.4 frequency
command uint8_t GetRFPower() Get the present RF power index.
command result_t OscillatorOff(uint8_t rh) Turn off the crystal oscillator.
command result_t OscillatorOn(uint8_t rh) Turn on the crystal oscillator.
command result_t RxMode(uint8_t rh) Shift the CC2420 Radio in receive mode.
command result_t SetRFPower(uint8_t rh, uint8_t power) Set the transmit RF power value.
command result_t setShortAddress(uint8_t rh, uint16_t addr) Set the 16-bit short address of the mote
command result_t TuneManual(uint8_t rh, uint16_t freq) Tune the radio to a given frequency.
command result_t TunePreset(uint8_t rh, uint8_t channel) Tune the radio to one of the 802.15.4 present channels.
command result_t TxMode(uint8_t rh) Shift the CC2420 Radio into transmit mode.
command result_t TxModeOnCCA(uint8_t rh) Shift the CC2420 Radio into transmit mode when the next clear channel is detected.
command result_t VREFOff() Turns off the 1.8V references on the CC2420.
command result_t VREFOn() Turns on the 1.8V references on the CC2420.

Commands - Details

disableAddrDecode

command result_t disableAddrDecode(uint8_t rh)

Disables address decoding on the CC2420

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the mode of the CC2420 was successfully changed

disableAutoAck

command result_t disableAutoAck(uint8_t rh)

Disables auto ack on the CC2420

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the mode of the CC2420 was successfully changed

enableAddrDecode

command result_t enableAddrDecode(uint8_t rh)

Enables address decoding on the CC2420

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the mode of the CC2420 was successfully changed

enableAutoAck

command result_t enableAutoAck(uint8_t rh)

Enables auto ack on the CC2420

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the mode of the CC2420 was successfully changed

GetFrequency

command uint16_t GetFrequency()

Get the current frequency of the radio

Returns:
The current CC2420 frequency in MHz

GetPreset

command uint8_t GetPreset()

Get the current channel of the radio WARNING: If running the CC2420 on a non-standard IEEE 802.15.4 frequency, this function will return the closest possible valid IEEE 802.15.4 channel even if the current frequency in use is not a valid IEEE 802.15.4 frequency

Returns:
The current CC2420 channel (k=11..26)

GetRFPower

command uint8_t GetRFPower()

Get the present RF power index.

Returns:
The power index value.

OscillatorOff

command result_t OscillatorOff(uint8_t rh)

Turn off the crystal oscillator.

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS when the oscillator has started up

OscillatorOn

command result_t OscillatorOn(uint8_t rh)

Turn on the crystal oscillator.

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the request for the crystal to start has been accepted

RxMode

command result_t RxMode(uint8_t rh)

Shift the CC2420 Radio in receive mode.

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the radio was successfully switched to RX mode.

SetRFPower

command result_t SetRFPower(uint8_t rh, uint8_t power)

Set the transmit RF power value. The input value is simply an arbitrary index that is programmed into the CC2420 registers. The output power is set by programming the power amplifier. Valid values are 1 through 31 with power of 1 equal to -25dBm and 31 equal to max power (0dBm)

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
power - A power index between 1 and 31
Returns:
SUCCESS if the radio power was adequately set.

setShortAddress

command result_t setShortAddress(uint8_t rh, uint16_t addr)

Set the 16-bit short address of the mote

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
addr - 16-bit address
Returns:
SUCCESS if the request to set the address is being processed

TuneManual

command result_t TuneManual(uint8_t rh, uint16_t freq)

Tune the radio to a given frequency. Frequencies may be set in 1 MHz steps between 2400 MHz and 2483 MHz

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
freq - The desired channel frequency, in MHz.
Returns:
Status of the tune operation

TunePreset

command result_t TunePreset(uint8_t rh, uint8_t channel)

Tune the radio to one of the 802.15.4 present channels. Valid channel values are 11 through 26. The channels are calculated by: Freq = 2405 + 5(k-11) MHz for k = 11,12,...,26

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
freq - requested 802.15.4 channel
Returns:
Status of the tune operation

TxMode

command result_t TxMode(uint8_t rh)

Shift the CC2420 Radio into transmit mode.

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the radio was successfully switched to TX mode.

TxModeOnCCA

command result_t TxModeOnCCA(uint8_t rh)

Shift the CC2420 Radio into transmit mode when the next clear channel is detected.

Parameters:
rh - either RESOURCE_NONE for automatic resource scheduling or a resource handle acquired by CC2420ResourceC
Returns:
SUCCESS if the transmit request has been accepted

VREFOff

command result_t VREFOff()

Turns off the 1.8V references on the CC2420.

Returns:
SUCCESS if the VREF has been turned on

VREFOn

command result_t VREFOn()

Turns on the 1.8V references on the CC2420.

Returns:
SUCCESS if the VREF has been turned on