BowlerKernel
|
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) |
This class wraps ports 0,1, and 2 as an SPI interface.
Definition at line 21 of file SPIChannel.java.
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().
com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.SPIChannel | ( | DyIO | d | ) |
Constructor for an SPI channel.
d | the d |
Definition at line 41 of file SPIChannel.java.
References com.neuronrobotics.sdk.dyio.DyIOChannel.addChannelEventListener(), com.neuronrobotics.sdk.dyio.DyIO.getChannel(), com.neuronrobotics.sdk.dyio.DyIO.setMode(), and com.neuronrobotics.sdk.dyio.DyIOChannelMode.SPI_CLOCK.
void com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.onChannelEvent | ( | DyIOChannelEvent | e | ) |
On channel event.
e | the 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().
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.
ss | the index of the DyIO channel to use as a slave select pin for the SPI |
numBytes | the number of bytes to read |
Definition at line 67 of file SPIChannel.java.
References com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.write().
|
private |
THis method sends a byte array our the SPI peripheral. It uses another DyIO channel as its slave select pin.
ss | the index of the DyIO channel to use as a slave select pin for the SPI |
stream | the Bytes to be sent out |
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().
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.
ss | the index of the DyIO channel to use as a slave select pin for the SPI |
stream | the Bytes to be sent out |
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().