Provides APIs for SPI (Serial Peripheral Interface)
More...
Provides APIs for SPI (Serial Peripheral Interface)
◆ iotbus_spi_context_h
Pointer definition to the internal struct _iotbus_spi_s.
Definition at line 68 of file iotbus_spi.h.
◆ iotbus_spi_mode_e
Enumeration of SPI mode.
Enumeration Details:
IOTBUS_SPI_MODE0
IOTBUS_SPI_MODE1
IOTBUS_SPI_MODE2
IOTBUS_SPI_MODE3
Definition at line 46 of file iotbus_spi.h.
◆ iotbus_spi_close()
closes spi_context.
#include <iotbus/iotbus_spi.h>
- 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
◆ iotbus_spi_open()
initializes spi_context.
#include <iotbus/iotbus_spi.h>
- Parameters
-
[in] | bus | spi bus number |
[in] | config | spi config
- config->bits_per_word : bits per word
- 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
◆ iotbus_spi_recv()
reads data over spi bus.
#include <iotbus/iotbus_spi.h>
- 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
◆ iotbus_spi_transfer_buf()
int iotbus_spi_transfer_buf |
( |
iotbus_spi_context_h |
hnd, |
|
|
uint8_t * |
txbuf, |
|
|
uint8_t * |
rxbuf, |
|
|
size_t |
length |
|
) |
| |
transfers rx and tx data over spi bus.
#include <iotbus/iotbus_spi.h>
- 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
◆ iotbus_spi_write()
writes data over spi bus.
#include <iotbus/iotbus_spi.h>
- 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