|
PebbleOS v4.48.0-75-g7416f78a1
|
Bus driver operations. More...
#include <driver.h>
Data Fields | |
| int(* | init )(const struct pbl_i2c_bus *bus) |
| Configure the controller, leaving it disabled. | |
| void(* | enable )(const struct pbl_i2c_bus *bus) |
| Power the controller up. | |
| void(* | disable )(const struct pbl_i2c_bus *bus) |
| Power the controller down. | |
| int(* | start )(const struct pbl_i2c_bus *bus, uint16_t addr, struct pbl_i2c_msg *msgs, uint8_t num_msgs) |
Start a transfer of num_msgs validated messages to addr. | |
| void(* | abort )(const struct pbl_i2c_bus *bus) |
| Stop the transfer in flight, which then never completes, and reset the controller. | |
Bus driver operations.
Called with interrupts locked, possibly from an ISR, so they must not block. The class layer owns queueing, power and timeouts; the driver moves a transfer over the wire and reports its outcome with pbl_i2c_bus_complete().
| void(* pbl_i2c_bus_ops::abort) (const struct pbl_i2c_bus *bus) |
Stop the transfer in flight, which then never completes, and reset the controller.
| void(* pbl_i2c_bus_ops::disable) (const struct pbl_i2c_bus *bus) |
Power the controller down.
| void(* pbl_i2c_bus_ops::enable) (const struct pbl_i2c_bus *bus) |
Power the controller up.
| int(* pbl_i2c_bus_ops::init) (const struct pbl_i2c_bus *bus) |
Configure the controller, leaving it disabled.
Returns 0 or a negative errno.
| int(* pbl_i2c_bus_ops::start) (const struct pbl_i2c_bus *bus, uint16_t addr, struct pbl_i2c_msg *msgs, uint8_t num_msgs) |
Start a transfer of num_msgs validated messages to addr.
Returns 0 if pbl_i2c_bus_complete() will be called, or a negative errno, e.g. -ENOTSUP for a sequence the controller cannot issue.