| java.lang.Object | |
| ↳ | com.digi.android.spi.SPIConfig |
The SPIConfig class encapsulates the configuration parameters of an
SPI device.
See also:
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
SPIConfig with the specified configuration. | |||||||||||
Creates a new
SPIConfig with the specified configuration. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the configured bit ordering.
| |||||||||||
Gets the configured chip select active level.
| |||||||||||
Gets the clock frequency in Hz.
| |||||||||||
Gets the configured clock mode.
| |||||||||||
Gets the word length.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||
Creates a new SPIConfig with the specified configuration.
| Parameters | |
|---|---|
clockMode |
SPIClockMode: The clock mode, one of SPIClockMode.CPOL_0_CPHA_0,
SPIClockMode.CPOL_0_CPHA_1,
SPIClockMode.CPOL_1_CPHA_0, or
SPIClockMode.CPOL_1_CPHA_1. |
clockFrequency |
int: The clock frequency in Hz. |
wordLength |
int: The word length. |
| Throws | |
|---|---|
IllegalArgumentException |
If clockFrequency < 1 or
if wordLength < 1. |
NullPointerException |
If clockMode == null. |
See also:
Creates a new SPIConfig with the specified configuration.
| Parameters | |
|---|---|
clockMode |
SPIClockMode: The clock mode, one of SPIClockMode.CPOL_0_CPHA_0,
SPIClockMode.CPOL_0_CPHA_1,
SPIClockMode.CPOL_1_CPHA_0, or
SPIClockMode.CPOL_1_CPHA_1. |
chipSelect |
SPIChipSelect: The chip select active level, one of
SPIChipSelect.ACTIVE_HIGH,
SPIChipSelect.ACTIVE_LOW, or
SPIChipSelect.NOT_CONTROLLED. |
bitOrder |
SPIBitOrder: The bit ordering, one of SPIBitOrder.MSB_FIRST or
SPIBitOrder.LSB_FIRST. |
clockFrequency |
int: The clock frequency in Hz. |
wordLength |
int: The word length. |
| Throws | |
|---|---|
IllegalArgumentException |
If clockFrequency < 1 or
if wordLength < 1. |
NullPointerException |
If clockMode == null or
if chipSelect == null or
if bitOrder == null. |
See also:
Gets the configured bit ordering.
| Returns | |
|---|---|
SPIBitOrder |
The bit ordering, one of SPIBitOrder.MSB_FIRST or
SPIBitOrder.LSB_FIRST. |
See also:
Gets the configured chip select active level.
| Returns | |
|---|---|
SPIChipSelect |
The chip select active level, one of
SPIChipSelect.ACTIVE_HIGH,
SPIChipSelect.ACTIVE_LOW, or
SPIChipSelect.NOT_CONTROLLED. |
See also:
Gets the clock frequency in Hz.
| Returns | |
|---|---|
int |
The clock frequency in Hz. |
Gets the configured clock mode.
| Returns | |
|---|---|
SPIClockMode |
The clock mode, one of SPIClockMode.CPOL_0_CPHA_0,
SPIClockMode.CPOL_0_CPHA_1,
SPIClockMode.CPOL_1_CPHA_0, or
SPIClockMode.CPOL_1_CPHA_1. |
See also:
Gets the word length.
| Returns | |
|---|---|
int |
The word length. |