mraa
2.0.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
This file defines the SPI interface for libmraa
Public Member Functions | |
synchronized void | delete () |
Spi (int bus) | |
Spi (int bus, int cs) | |
Result | mode (Spi_Mode mode) |
Result | frequency (int hz) |
int | writeByte (short data) |
int | writeWord (int data) |
byte[] | write (byte[] txBuf) |
Result | lsbmode (boolean lsb) |
Result | bitPerWord (long bits) |
Spi | ( | int | bus | ) |
Initialise SPI object using the board mapping to set muxes
bus | to use, as listed in the platform definition, normally 0 |
Spi | ( | int | bus, |
int | cs | ||
) |
Initialise SPI object using 'raw' mode. Mraa will go and grab the spidev device lablled /dev/spidev[bus].[cs]
bus | to use |
cs | to use |
Result bitPerWord | ( | long | bits | ) |
Set bits per mode on transaction, default is 8
bits | bits per word |
Result frequency | ( | int | hz | ) |
Set the SPI device operating clock frequency
hz | the frequency to set in hz |
Result lsbmode | ( | boolean | lsb | ) |
Change the SPI lsb mode
lsb | Use least significant bit transmission - 0 for msbi |
Set the SPI device mode. see spidev0-3
mode | the mode. See Linux spidev doc |
int writeByte | ( | short | data | ) |
Write single byte to the SPI device
data | the byte to send |
int writeWord | ( | int | data | ) |
Write single byte to the SPI device
data | the byte to send |