Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
spi_config Struct Reference

SPI controller configuration structure. More...

#include <spi.h>

Data Fields

uint32_t frequency
 Bus frequency in Hertz.
 
spi_operation_t operation
 Operation flags.
 
uint16_t slave
 Slave number from 0 to host controller slave limit.
 
struct spi_cs_control cs
 GPIO chip-select line (optional, must be initialized to zero if not used).
 

Detailed Description

SPI controller configuration structure.

Field Documentation

◆ cs

struct spi_cs_control spi_config::cs

GPIO chip-select line (optional, must be initialized to zero if not used).

◆ frequency

uint32_t spi_config::frequency

Bus frequency in Hertz.

◆ operation

spi_operation_t spi_config::operation

Operation flags.

It is a bit field with the following parts:

  • 0: Master or slave.
  • 1..3: Polarity, phase and loop mode.
  • 4: LSB or MSB first.
  • 5..10: Size of a data frame (word) in bits.
  • 11: Full/half duplex.
  • 12: Hold on the CS line if possible.
  • 13: Keep resource locked for the caller.
  • 14: Active high CS logic.
  • 15: Motorola or TI frame format (optional).

If

CONFIG_SPI_EXTENDED_MODES 

is enabled:

  • 16..17: MISO lines (Single/Dual/Quad/Octal).
  • 18..31: Reserved for future use.

◆ slave

uint16_t spi_config::slave

Slave number from 0 to host controller slave limit.


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