avrora.sim.mcu
Class SPI

java.lang.Object
  extended byavrora.sim.mcu.AtmelInternalDevice
      extended byavrora.sim.mcu.SPI
All Implemented Interfaces:
InterruptTable.Notification, SPIDevice

public class SPI
extends AtmelInternalDevice
implements SPIDevice, InterruptTable.Notification

Serial Peripheral Interface. Used on the Mica2 platform for radio communication.


Nested Class Summary
static class SPI.Frame
          A single byte data frame for the SPI.
protected  class SPI.SPCRReg
          SPI control register.
protected  class SPI.TransmitReceive
          The SPI transfer event.
 
Field Summary
static SPI.Frame FF_FRAME
           
protected  int period
           
static SPI.Frame ZERO_FRAME
           
 
Fields inherited from class avrora.sim.mcu.AtmelInternalDevice
devicePrinter, interpreter, mainClock, microcontroller, name, simulator
 
Constructor Summary
SPI(AtmelMicrocontroller m)
           
 
Method Summary
 void connect(SPIDevice d)
          The connect() method connects this SPI device to the specified SPIDevice.
 void force(int inum)
           
 void invoke(int inum)
           
static SPI.Frame newFrame(byte data)
           
 void receiveFrame(SPI.Frame frame)
          Receive a frame.
 SPI.Frame transmitFrame()
          Transmit a frame from this device.
 
Methods inherited from class avrora.sim.mcu.AtmelInternalDevice
getClock, getIORegs, installIOReg, read16, write16
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

period

protected int period

ZERO_FRAME

public static final SPI.Frame ZERO_FRAME

FF_FRAME

public static final SPI.Frame FF_FRAME
Constructor Detail

SPI

public SPI(AtmelMicrocontroller m)
Method Detail

newFrame

public static SPI.Frame newFrame(byte data)

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.

receiveFrame

public void receiveFrame(SPI.Frame frame)
Description copied from interface: SPIDevice
Receive a frame.

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

transmitFrame

public SPI.Frame transmitFrame()
Description copied from interface: SPIDevice
Transmit a frame from this device.

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

force

public void force(int inum)
Specified by:
force in interface InterruptTable.Notification

invoke

public void invoke(int inum)
Specified by:
invoke in interface InterruptTable.Notification