PebbleOS v4.48.0-75-g7416f78a1
Loading...
Searching...
No Matches
pbl_i2c_bus_ops Struct Reference

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.
 

Detailed Description

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().

Field Documentation

◆ abort

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.

◆ disable

void(* pbl_i2c_bus_ops::disable) (const struct pbl_i2c_bus *bus)

Power the controller down.

◆ enable

void(* pbl_i2c_bus_ops::enable) (const struct pbl_i2c_bus *bus)

Power the controller up.

◆ init

int(* pbl_i2c_bus_ops::init) (const struct pbl_i2c_bus *bus)

Configure the controller, leaving it disabled.

Returns 0 or a negative errno.

◆ start

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.


The documentation for this struct was generated from the following file: