TizenRT Public API
v2.0 M2
|
Provides APIs for I2C (Inter Integrated Circuit) More...
![]() |
Files | |
file | iotbus_i2c.h |
Iotbus APIs for I2C. | |
Typedefs | |
typedef struct _iotbus_i2c_wrapper_s * | iotbus_i2c_context_h |
Pointer definition to the internal struct _iotbus_i2c_wrapper_s. More... | |
Enumerations |
Functions | |
iotbus_i2c_context_h | iotbus_i2c_init (int bus) |
initializes i2c_context. More... | |
int | iotbus_i2c_stop (iotbus_i2c_context_h hnd) |
closes i2c_context. More... | |
int | iotbus_i2c_set_frequency (iotbus_i2c_context_h hnd, iotbus_i2c_mode_e mode) |
sets the i2c frequency. More... | |
int | iotbus_i2c_set_address (iotbus_i2c_context_h hnd, uint8_t address) |
sets the i2c slave address. More... | |
int | iotbus_i2c_read (iotbus_i2c_context_h hnd, uint8_t *data, size_t length) |
reads from i2c device. More... | |
int | iotbus_i2c_write (iotbus_i2c_context_h hnd, const uint8_t *data, size_t length) |
writes to i2c device. More... | |
Provides APIs for I2C (Inter Integrated Circuit)
typedef struct _iotbus_i2c_wrapper_s* iotbus_i2c_context_h |
Pointer definition to the internal struct _iotbus_i2c_wrapper_s.
Definition at line 42 of file iotbus_i2c.h.
enum iotbus_i2c_mode_e |
Enumeration of I2C frequency mode.
Enumeration Details:
IOTBUS_I2C_STD = 0, < up to 100Khz
IOTBUS_I2C_FAST = 1, < up to 400Khz
IOTBUS_I2C_HIGH = 2, < up to 3.4Mhz
Enumerator | |
---|---|
IOTBUS_I2C_STD |
up to 100Khz |
IOTBUS_I2C_FAST |
up to 400Khz |
IOTBUS_I2C_HIGH |
up to 3.4Mhz |
Definition at line 52 of file iotbus_i2c.h.
iotbus_i2c_context_h iotbus_i2c_init | ( | int | bus | ) |
initializes i2c_context.
#include <iotbus/iotbus_i2c.h>
[in] | bus | i2c bus number |
int iotbus_i2c_read | ( | iotbus_i2c_context_h | hnd, |
uint8_t * | data, | ||
size_t | length | ||
) |
reads from i2c device.
#include <iotbus/iotbus_i2c.h>
[in] | hnd | handle of i2c_context |
[in] | data | the pointer of data buffer |
[in] | length | size to read |
int iotbus_i2c_set_address | ( | iotbus_i2c_context_h | hnd, |
uint8_t | address | ||
) |
sets the i2c slave address.
#include <iotbus/iotbus_i2c.h>
[in] | hnd | handle of i2c_context |
[in] | address | i2c address |
int iotbus_i2c_set_frequency | ( | iotbus_i2c_context_h | hnd, |
iotbus_i2c_mode_e | mode | ||
) |
sets the i2c frequency.
#include <iotbus/iotbus_i2c.h>
[in] | hnd | handle of i2c_context |
[in] | mode | i2c frequency mode |
int iotbus_i2c_stop | ( | iotbus_i2c_context_h | hnd | ) |
closes i2c_context.
#include <iotbus/iotbus_i2c.h>
[in] | hnd | handle of i2c_context |
int iotbus_i2c_write | ( | iotbus_i2c_context_h | hnd, |
const uint8_t * | data, | ||
size_t | length | ||
) |
writes to i2c device.
#include <iotbus/iotbus_i2c.h>
[in] | hnd | handle of i2c_context |
[in] | data | the pointer of data buffer |
[in] | length | size to write |