PebbleOS v4.43.0-108-gde23235b2
Loading...
Searching...
No Matches
pbl_spi_bus_ops Struct Reference

Bus driver operations. More...

#include <spi.h>

Data Fields

int(* init )(const struct pbl_spi_bus *bus)
 Configure the controller, leaving it disabled.
 
int(* configure )(const struct pbl_spi_bus *bus, const struct pbl_spi_dev *dev)
 Set the controller up for dev: the highest supported clock frequency up to dev->max_hz and the mode.
 
void(* enable )(const struct pbl_spi_bus *bus)
 Power the controller up.
 
void(* disable )(const struct pbl_spi_bus *bus)
 Power the controller down.
 
int(* start )(const struct pbl_spi_bus *bus, const struct pbl_spi_xfer *xfer)
 Start a transfer.
 

Detailed Description

Bus driver operations.

Called with the bus lock held. The class layer owns locking, power, chip selects and the sequence of transfers; the driver moves one transfer over the wire and reports its outcome with pbl_spi_bus_complete().

Field Documentation

◆ configure

int(* pbl_spi_bus_ops::configure) (const struct pbl_spi_bus *bus, const struct pbl_spi_dev *dev)

Set the controller up for dev: the highest supported clock frequency up to dev->max_hz and the mode.

Called before enable(). Returns 0 or a negative errno.

◆ disable

void(* pbl_spi_bus_ops::disable) (const struct pbl_spi_bus *bus)

Power the controller down.

May be called from the controller's interrupt.

◆ enable

void(* pbl_spi_bus_ops::enable) (const struct pbl_spi_bus *bus)

Power the controller up.

◆ init

int(* pbl_spi_bus_ops::init) (const struct pbl_spi_bus *bus)

Configure the controller, leaving it disabled.

Returns 0 or a negative errno.

◆ start

int(* pbl_spi_bus_ops::start) (const struct pbl_spi_bus *bus, const struct pbl_spi_xfer *xfer)

Start a transfer.

Returns 0 if pbl_spi_bus_complete() will be called, or a negative errno. May be called from the controller's interrupt.


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