public class SoftSPI
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
clk
SPI Clock pin number (wiringPi numbering scheme)
|
int |
cs
Clock Select pin number (wiringPi numbering scheme)
|
int |
miso
Master In Slave Out pin number (wiringPi numbering scheme)
|
int |
mosi
Master Out Slave In pin number (wiringPi numbering scheme)
|
long |
speed
Bus speed in bits per second
|
| Constructor and Description |
|---|
SoftSPI(int cs,
int miso,
int mosi,
int clk,
long speed)
Build a new SoftSPI object by specifying the pins to use (wiringPi scheme)
|
| Modifier and Type | Method and Description |
|---|---|
static void |
initialize(SoftSPI spi)
Initializes WiringPi and the GPIO for the SPI Device
|
static byte[] |
readWrite(SoftSPI spi,
byte[] data)
Initiate a read/write communication on the SPI port
|
public final int cs
public final int miso
public final int mosi
public final int clk
public final long speed
public SoftSPI(int cs,
int miso,
int mosi,
int clk,
long speed)
cs - Chip Select Pinmiso - Master In Slave Out Pinmosi - Master Out Slave In Pinclk - Clock Pinspeed - Speed of the SPI port in bits per second (b/s)public static void initialize(SoftSPI spi)
spi - SPI Pins Definitionpublic static byte[] readWrite(SoftSPI spi, byte[] data)
spi - SPI Pins Definitiondata - Data to write on the SPI port