Class SpiDevice
java.lang.Object
com.codename1.hardware.SpiDevice
A device on an SPI bus, opened through
Hardware.openSpi(int, int, int, int, int).-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases the device.intgetBus()The SPI controller number.intThe chip-select line.byte[]transfer(byte[] tx) Clockstxout and returns the bytes clocked in at the same time.voidtransfer(byte[] tx, byte[] rx) Clockstxout while fillingrx; both must be the same length, and may be the same array.
-
Method Details
-
getBus
public int getBus()The SPI controller number. -
getChipSelect
public int getChipSelect()The chip-select line. -
transfer
Clocks
txout and returns the bytes clocked in at the same time.Throws
HardwareException: when the transfer fails or the device is closed
- Throws:
HardwareException
-
transfer
Clocks
txout while fillingrx; both must be the same length, and may be the same array.Throws
HardwareException: when the transfer fails or the device is closed
- Throws:
HardwareException
-
close
public void close()Releases the device. Closing twice is harmless.
-