Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
spi_config Struct Reference

SPI controller configuration structure. More...

#include <spi.h>

Data Fields

uint32_t frequency
 
uint16_t operation
 
uint16_t slave
 
const struct spi_cs_controlcs
 

Detailed Description

SPI controller configuration structure.

Parameters
frequencyis the bus frequency in Hertz
operationis a bit field with the following parts:
operational mode    [ 0 ]       - master or slave.
mode                [ 1 : 3 ]   - Polarity, phase and loop mode.
transfer            [ 4 ]       - LSB or MSB first.
word_size           [ 5 : 10 ]  - Size of a data frame in bits.
lines               [ 11 : 12 ] - MISO lines: Single/Dual/Quad/Octal.
cs_hold             [ 13 ]      - Hold on the CS line if possible.
lock_on             [ 14 ]      - Keep resource locked for the caller.
cs_active_high      [ 15 ]      - Active high CS logic.
slaveis the slave number from 0 to host controller slave limit.
csis a valid pointer on a struct spi_cs_control is CS line is emulated through a gpio line, or NULL otherwise.
Note
Only cs_hold and lock_on can be changed between consecutive transceive call. Rest of the attributes are not meant to be tweaked.
Warning
Most drivers use pointer comparison to determine whether a passed configuration is different from one used in a previous transaction. Changes to fields in the structure may not be detected.

Field Documentation

◆ cs

const struct spi_cs_control* spi_config::cs

◆ frequency

uint32_t spi_config::frequency

◆ operation

uint16_t spi_config::operation

◆ slave

uint16_t spi_config::slave

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