iPXE
Data Fields
spi_bus Struct Reference

An SPI bus. More...

#include <spi.h>

Data Fields

unsigned int mode
 SPI interface mode. More...
 
int(* rw )(struct spi_bus *bus, struct spi_device *device, unsigned int command, int address, const void *data_out, void *data_in, size_t len)
 Read/write data via SPI bus. More...
 

Detailed Description

An SPI bus.

This data structure represents an SPI bus controller capable of issuing commands to attached SPI devices.

Definition at line 126 of file spi.h.

Field Documentation

◆ mode

unsigned int spi_bus::mode

SPI interface mode.

This is the bitwise OR of zero or more of SPI_MODE_CPHA and SPI_MODE_CPOL. It is also the number conventionally used to describe the SPI interface mode. For example, SPI mode 1 is the mode in which CPOL=0 and CPHA=1, which therefore corresponds to a mode value of (0|SPI_MODE_CPHA) which, happily, equals 1.

Definition at line 136 of file spi.h.

Referenced by natsemi_init_eeprom(), realtek_init_eeprom(), and spi_bit_set_slave_select().

◆ rw

int( * spi_bus::rw) (struct spi_bus *bus, struct spi_device *device, unsigned int command, int address, const void *data_out, void *data_in, size_t len)

Read/write data via SPI bus.

Parameters
busSPI bus
deviceSPI device
commandCommand
addressAddress to read/write (<0 for no address)
data_outTX data buffer (or NULL)
data_inRX data buffer (or NULL)
lenLength of data buffer(s)

This issues the specified command and optional address to the SPI device, then reads and/or writes data to/from the data buffers.

Definition at line 152 of file spi.h.

Referenced by falcon_probe_spi(), and init_spi_bit_basher().


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