Interface: tos.chips.atm128.spi.Atm128Spi

interface Atm128Spi

Commands
command void enableInterrupt(bool enabled)
command void enableSpi(bool busOn)
command uint8_t getClock()
command bool getClockPhase()
command bool getClockPolarity()
command bool hasWriteCollided()
command void initMaster() Initialize the ATmega128 SPI bus into master mode.
command void initSlave() Initialize the ATmega128 SPI bus into slave mode.
command bool isInterruptEnabled()
command bool isInterruptPending()
command bool isMasterBitSet()
command bool isMasterDoubleSpeed()
command bool isOrderLsbFirst()
command bool isSpiEnabled()
command uint8_t read() Read the SPI data register
command void setClock(uint8_t speed)
command void setClockPhase(bool sampleOnTrailing)
command void setClockPolarity(bool highWhenIdle)
command void setDataOrder(bool lsbFirst)
command void setMasterBit(bool isMaster)
command void setMasterDoubleSpeed(bool on)
command void sleep() Disable and sleep the ATmega128 SPI bus.
command void write(uint8_t data) Write the SPI data register

Events
event void dataReady(uint8_t data) Interrupt signalling SPI data cycle is complete.

Commands - Details

enableInterrupt

command void enableInterrupt(bool enabled)

enableSpi

command void enableSpi(bool busOn)

getClock

command uint8_t getClock()

getClockPhase

command bool getClockPhase()

getClockPolarity

command bool getClockPolarity()

hasWriteCollided

command bool hasWriteCollided()

initMaster

command void initMaster()

Initialize the ATmega128 SPI bus into master mode. *

initSlave

command void initSlave()

Initialize the ATmega128 SPI bus into slave mode. *

isInterruptEnabled

command bool isInterruptEnabled()

isInterruptPending

command bool isInterruptPending()

isMasterBitSet

command bool isMasterBitSet()

isMasterDoubleSpeed

command bool isMasterDoubleSpeed()

isOrderLsbFirst

command bool isOrderLsbFirst()

isSpiEnabled

command bool isSpiEnabled()

read

command uint8_t read()

Read the SPI data register

Returns:
last data byte

setClock

command void setClock(uint8_t speed)

setClockPhase

command void setClockPhase(bool sampleOnTrailing)

setClockPolarity

command void setClockPolarity(bool highWhenIdle)

setDataOrder

command void setDataOrder(bool lsbFirst)

setMasterBit

command void setMasterBit(bool isMaster)

setMasterDoubleSpeed

command void setMasterDoubleSpeed(bool on)

sleep

command void sleep()

Disable and sleep the ATmega128 SPI bus. *

write

command void write(uint8_t data)

Write the SPI data register

Parameters:
data - next data byte

Events - Details

dataReady

event void dataReady(uint8_t data)

Interrupt signalling SPI data cycle is complete.

Parameters:
data - data byte from data register