avrora.sim.radio
Class CC1000Radio.ATMegaController

java.lang.Object
  extended byavrora.sim.radio.CC1000Radio.ATMegaController
All Implemented Interfaces:
ADC.ADCInput, Radio.RadioController, SPIDevice
Enclosing class:
CC1000Radio

public class CC1000Radio.ATMegaController
extends java.lang.Object
implements Radio.RadioController, ADC.ADCInput, SPIDevice

A CC1000 Controller class for the ATMega microcontroller family. Installing an ATMega128 into this class connects the microcontroller to this radio. Data is communicated over the SPI interface, on which the CC1000 is the master. RSSI data from the CC1000 is available to the ATMega128 though the ADC (analog to digital converter).


Nested Class Summary
protected  class CC1000Radio.ATMegaController.Transmit
          Transmit is an event that transmits a packet of data after a one bit period delay.
 
Method Summary
 void connect(SPIDevice d)
          The connect() method connects this SPI device to the specified SPIDevice.
 void disable()
          Disable transfers.
 void enable()
          Enable transfers.
 int getLevel()
          Report the current voltage level of the input.
 void install(Microcontroller mcu)
          Installs this Controller into a microcontroller.
 void receiveFrame(SPI.Frame frame)
          receiveFrame receives an SPIFrame from a connected device.
 SPI.Frame transmitFrame()
          Transmits an SPIFrame to be received by the connected device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

enable

public void enable()
Description copied from interface: Radio.RadioController
Enable transfers.

Specified by:
enable in interface Radio.RadioController

disable

public void disable()
Description copied from interface: Radio.RadioController
Disable transfers.

Specified by:
disable in interface Radio.RadioController

receiveFrame

public void receiveFrame(SPI.Frame frame)
receiveFrame receives an SPIFrame from a connected device. If the radio is in a transmission state, this should be the next frame sent into the air.

Specified by:
receiveFrame in interface SPIDevice
Parameters:
frame - the frame to be received

transmitFrame

public SPI.Frame transmitFrame()
Transmits an SPIFrame to be received by the connected device. This frame is either the last byte of data received or a zero byte.

Specified by:
transmitFrame in interface SPIDevice
Returns:
the frame for transmission

connect

public void connect(SPIDevice d)
Description copied from interface: SPIDevice
The connect() method connects this SPI device to the specified SPIDevice.

Specified by:
connect in interface SPIDevice
Parameters:
d - the device to connect to.

getLevel

public int getLevel()
Description copied from interface: ADC.ADCInput
Report the current voltage level of the input.

Specified by:
getLevel in interface ADC.ADCInput
Returns:
an integer value representing the voltage level of the input

install

public void install(Microcontroller mcu)
Description copied from interface: Radio.RadioController
Installs this Controller into a microcontroller. This should setup the pins, IO registers in such a way that changes to CPU state will make corresponding changes to the RadioController state that will initiate sends and receives if necessary.

Specified by:
install in interface Radio.RadioController