BowlerKernel
Public Member Functions | Private Member Functions | List of all members
com.neuronrobotics.sdk.dyio.peripherals.SPIChannel Class Reference
Inheritance diagram for com.neuronrobotics.sdk.dyio.peripherals.SPIChannel:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.sdk.dyio.peripherals.SPIChannel:
Collaboration graph
[legend]

Public Member Functions

 SPIChannel ()
 
 SPIChannel (DyIO d)
 
byte[] read (int ss, int numBytes)
 
byte[] write (int ss, byte[] stream)
 
void onChannelEvent (DyIOChannelEvent e)
 

Private Member Functions

BowlerDatagram sendSPIStream (int ss, byte[] stream)
 

Detailed Description

This class wraps ports 0,1, and 2 as an SPI interface.

Author
Kevin Harrington

Definition at line 21 of file SPIChannel.java.

Constructor & Destructor Documentation

◆ SPIChannel() [1/2]

com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.SPIChannel ( )

Default constructor, assumes the DyIO regestry is being used.

Definition at line 32 of file SPIChannel.java.

References com.neuronrobotics.sdk.common.DeviceManager.getSpecificDevice().

Here is the call graph for this function:

◆ SPIChannel() [2/2]

com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.SPIChannel ( DyIO  d)

Member Function Documentation

◆ onChannelEvent()

void com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.onChannelEvent ( DyIOChannelEvent  e)

On channel event.

Parameters
ethe e

Implements com.neuronrobotics.sdk.dyio.IChannelEventListener.

Definition at line 109 of file SPIChannel.java.

References com.neuronrobotics.sdk.common.ByteList.getBytes(), and com.neuronrobotics.sdk.dyio.DyIOChannelEvent.getData().

Here is the call graph for this function:

◆ read()

byte [] com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.read ( int  ss,
int  numBytes 
)

This performs a dumb read. The data sent out by the host is junk data.

Parameters
ssthe index of the DyIO channel to use as a slave select pin for the SPI
numBytesthe number of bytes to read
Returns
the data received

Definition at line 67 of file SPIChannel.java.

References com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.write().

Here is the call graph for this function:

◆ sendSPIStream()

BowlerDatagram com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.sendSPIStream ( int  ss,
byte[]  stream 
)
private

THis method sends a byte array our the SPI peripheral. It uses another DyIO channel as its slave select pin.

Parameters
ssthe index of the DyIO channel to use as a slave select pin for the SPI
streamthe Bytes to be sent out
Returns
true if success

Definition at line 53 of file SPIChannel.java.

References com.neuronrobotics.sdk.common.ByteList.add(), and com.neuronrobotics.sdk.dyio.DyIO.send().

Referenced by com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.write().

Here is the call graph for this function:

◆ write()

byte [] com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.write ( int  ss,
byte[]  stream 
)

This performs a full read/write transaction. The data is sent down, and the corosponding data is read back in.

Parameters
ssthe index of the DyIO channel to use as a slave select pin for the SPI
streamthe Bytes to be sent out
Returns
the data received

Definition at line 80 of file SPIChannel.java.

References com.neuronrobotics.sdk.common.ByteList.getBytes(), com.neuronrobotics.sdk.common.BowlerDatagram.getData(), com.neuronrobotics.sdk.common.ByteList.insert(), com.neuronrobotics.sdk.dyio.DyIO.isLegacyParser(), com.neuronrobotics.sdk.common.BowlerMethod.POST, com.neuronrobotics.sdk.dyio.DyIO.send(), com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.sendSPIStream(), and com.neuronrobotics.sdk.util.ThreadUtil.wait().

Referenced by com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.read().

Here is the call graph for this function:

The documentation for this class was generated from the following file: