Provides APIs for SPI (Serial Peripheral Interface)
More...
Provides APIs for SPI (Serial Peripheral Interface)
Pointer definition to the internal struct _iotbus_spi_s.
Definition at line 65 of file iotbus_spi.h.
Enumeration of SPI mode.
Enumeration Details:
IOTBUS_SPI_MODE0
IOTBUS_SPI_MODE1
IOTBUS_SPI_MODE2
IOTBUS_SPI_MODE3
Definition at line 45 of file iotbus_spi.h.
closes spi_context.
- Parameters
-
| [in] | hnd | handle of spi_context |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
initializes spi_context.
- Parameters
-
| [in] | bus | spi bus number |
| [in] | config | spi config
- config->bits_per_word : bits per word
- config->lsb : 0 is MSB, 1 is LSB
- config->chip_select : chip select number
- config->frequency : frequency in Hz
- config->mode : spi mode
|
- Returns
- On success, handle of spi_context is returned. On failure, NULL is returned.
- Since
- Tizen RT v1.0
reads data over spi bus.
- Parameters
-
| [in] | hnd | handle of spi_context |
| [in] | rxbuf | the pointer of rx data buffer |
| [in] | length | size to read |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
| int iotbus_spi_transfer_buf |
( |
iotbus_spi_context_h |
hnd, |
|
|
uint8_t * |
txbuf, |
|
|
uint8_t * |
rxbuf, |
|
|
int |
length |
|
) |
| |
transfers rx and tx data over spi bus.
- Parameters
-
| [in] | hnd | handle of spi_context |
| [in] | txbuf | the pointer of tx data buffer |
| [in] | rxbuf | the pointer of rx data buffer |
| [in] | length | size to transfer |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
writes data over spi bus.
- Parameters
-
| [in] | hnd | handle of spi_context |
| [in] | txbuf | the pointer of tx data buffer |
| [in] | length | size to write |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0