Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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.
duplex              [ 11 ]      - full/half duplex.
cs_hold             [ 12 ]      - Hold on the CS line if possible.
lock_on             [ 13 ]      - Keep resource locked for the caller.
cs_active_high      [ 14 ]      - Active high CS logic.
format              [ 15 ]      - Motorola or TI frame format (optional).
if
embed:rst:inline :kconfig:`CONFIG_SPI_EXTENDED_MODES` 
is defined: lines [ 16 : 17 ] - MISO lines: Single/Dual/Quad/Octal. reserved [ 18 : 31 ] - reserved for future use.
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.
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: