23 #include <sys/types.h>
125 SOL_ATTR_WARN_UNUSED_RESULT
143 SOL_ATTR_WARN_UNUSED_RESULT
163 SOL_ATTR_WARN_UNUSED_RESULT
375 struct sol_i2c_pending *
sol_i2c_read_register_multiple(
struct sol_i2c *i2c, uint8_t reg, uint8_t *values,
size_t count, uint8_t times,
void (*read_reg_multiple_cb)(
void *cb_data,
struct sol_i2c *i2c, uint8_t reg, uint8_t *data, ssize_t status),
const void *cb_data);
394 #ifdef SOL_PLATFORM_LINUX
415 int sol_i2c_create_device(
const char *
address,
const char *dev_name,
unsigned int dev_number,
struct sol_buffer *result_path);
struct sol_http_client_connection * pending
Definition: download.c:29
struct sol_i2c_pending * sol_i2c_read(struct sol_i2c *i2c, uint8_t *data, size_t count, void(*read_cb)(void *cb_data, struct sol_i2c *i2c, uint8_t *data, ssize_t status), const void *cb_data)
Perform successive asynchronous I2C byte read operations, with no specified register.
struct sol_i2c_pending * sol_i2c_read_register_multiple(struct sol_i2c *i2c, uint8_t reg, uint8_t *values, size_t count, uint8_t times, void(*read_reg_multiple_cb)(void *cb_data, struct sol_i2c *i2c, uint8_t reg, uint8_t *data, ssize_t status), const void *cb_data)
Asynchronous read of an arbitrary number of bytes from a register in repeated bursts of a given lengt...
struct sol_i2c_pending sol_i2c_pending
I2C pending operation handle structure.
Definition: sol-i2c.h:79
flag for low speed
Definition: sol-i2c.h:88
struct sol_i2c_pending * sol_i2c_write(struct sol_i2c *i2c, uint8_t *data, size_t count, void(*write_cb)(void *cb_data, struct sol_i2c *i2c, uint8_t *data, ssize_t status), const void *cb_data)
Perform successive asynchronous I2C byte write operations, with no specified register.
struct sol_i2c * sol_i2c_open(uint8_t bus, enum sol_i2c_speed speed)
Open an I2C bus.
void sol_i2c_close(struct sol_i2c *i2c)
Close an I2C bus.
void sol_i2c_dispatcher_remove_op_set(struct sol_i2c *i2c, struct sol_i2c_op_set_pending *pending)
Cancel the execution of the pending operation set.
uint8_t value
Operation data.
Definition: sol-i2c.h:452
Definition: sol-i2c.h:440
struct sol_i2c_pending * sol_i2c_write_register(struct sol_i2c *i2c, uint8_t reg, const uint8_t *data, size_t count, void(*write_reg_cb)(void *cb_data, struct sol_i2c *i2c, uint8_t reg, uint8_t *data, ssize_t status), const void *cb_data)
Perform an asynchronous I2C write operation on a given device register.
sol_i2c_speed
Enum for I2C bus speed.
Definition: sol-i2c.h:87
These are common Soletta macros.
uint8_t sol_i2c_get_slave_address(struct sol_i2c *i2c)
Get the (slave) device address set on an I2C bus (to deliver I2C commands to)
int sol_i2c_set_slave_address(struct sol_i2c *i2c, uint8_t slave_address)
Set a (slave) device address on a I2C bus to deliver commands to.
static struct sol_network_link_addr address
Definition: echo-client.c:44
These are routines that Soletta provides for its buffer implementation.
enum sol_i2c_op_type type
I2C Operation type.
Definition: sol-i2c.h:450
const char * sol_i2c_speed_to_str(enum sol_i2c_speed speed)
Converts sol_i2c_speed to a string name.
#define SOL_ATTR_WARN_UNUSED_RESULT
Causes a warning to be emitted if a caller of the function with this attribute does not use its retur...
Definition: sol-macros.h:187
struct sol_i2c * sol_i2c_open_raw(uint8_t bus, enum sol_i2c_speed speed)
Open an I2C bus.
Definition: sol-i2c.h:441
flag for normal speed
Definition: sol-i2c.h:89
struct sol_i2c_pending * sol_i2c_write_quick(struct sol_i2c *i2c, bool rw, void(*write_quick_cb)(void *cb_data, struct sol_i2c *i2c, ssize_t status), const void *cb_data)
Perform a I2C write quick operation.
sol_i2c_op_type
I²C operation dispatcher.
Definition: sol-i2c.h:439
Structure to describe an operation that should be executed by the I2C Dispatcher. ...
Definition: sol-i2c.h:449
enum sol_i2c_speed sol_i2c_speed_from_str(const char *speed)
Converts a string I2C speed to sol_i2c_speed.
uint8_t sol_i2c_get_bus(const struct sol_i2c *i2c)
Get the I2C bus ID.
void sol_i2c_pending_cancel(struct sol_i2c *i2c, struct sol_i2c_pending *pending)
Cancel a pending operation.
flag for fast speed
Definition: sol-i2c.h:90
struct sol_i2c_op_set_pending sol_i2c_op_set_pending
I2C Dispatcher pending operation set handle structure.
Definition: sol-i2c.h:460
struct sol_i2c_pending * sol_i2c_read_register(struct sol_i2c *i2c, uint8_t reg, uint8_t *data, size_t count, void(*read_reg_cb)(void *cb_data, struct sol_i2c *i2c, uint8_t reg, uint8_t *data, ssize_t status), const void *cb_data)
Perform an asynchronous I2C read operation on a given device register.
uint8_t reg
I2C register in the slave device.
Definition: sol-i2c.h:451
struct sol_i2c sol_i2c
I2C handle structure.
Definition: sol-i2c.h:64
flag for high speed
Definition: sol-i2c.h:92
Soletta vector is an array that grows dynamically.
Definition: sol-vector.h:58
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130
struct sol_i2c_op_set_pending * sol_i2c_dispatcher_add_op_set(struct sol_i2c *i2c, uint8_t addr, struct sol_vector *set, void(*cb)(void *cb_data, ssize_t status), void *cb_data, uint32_t delay)
Add an operation set in the dispatcher's queue of a given I2C bus.
flag for fast plus speed
Definition: sol-i2c.h:91