ESPHome  2024.4.0
Data Structures | Typedefs | Enumerations | Variables
esphome::spi Namespace Reference

Data Structures

class  NullPin
 A pin to replace those that don't exist. More...
 
class  SPIBus
 
class  SPIClient
 Base class for SPIDevice, un-templated. More...
 
class  SPIComponent
 
class  SPIDelegate
 
class  SPIDelegateBitBash
 An implementation of SPI that relies only on software toggling of pins. More...
 
class  SPIDelegateDummy
 A dummy SPIDelegate that complains if it's used. More...
 
class  SPIDevice
 The SPIDevice is what components using the SPI will create. More...
 
class  Utility
 

Typedefs

using QuadSPIComponent = SPIComponent
 

Enumerations

enum  SPIBitOrder { BIT_ORDER_LSB_FIRST, BIT_ORDER_MSB_FIRST }
 The bit-order for SPI devices. This defines how the data read from and written to the device is interpreted. More...
 
enum  SPIClockPolarity { CLOCK_POLARITY_LOW = false, CLOCK_POLARITY_HIGH = true }
 The SPI clock signal polarity,. More...
 
enum  SPIClockPhase { CLOCK_PHASE_LEADING, CLOCK_PHASE_TRAILING }
 The SPI clock signal phase. More...
 
enum  SPIMode { MODE0 = 0, MODE1 = 1, MODE2 = 2, MODE3 = 3 }
 Modes mapping to clock phase and polarity. More...
 
enum  SPIDataRate : uint32_t {
  DATA_RATE_1KHZ = 1000, DATA_RATE_75KHZ = 75000, DATA_RATE_200KHZ = 200000, DATA_RATE_1MHZ = 1000000,
  DATA_RATE_2MHZ = 2000000, DATA_RATE_4MHZ = 4000000, DATA_RATE_5MHZ = 5000000, DATA_RATE_8MHZ = 8000000,
  DATA_RATE_10MHZ = 10000000, DATA_RATE_20MHZ = 20000000, DATA_RATE_40MHZ = 40000000, DATA_RATE_80MHZ = 80000000
}
 The SPI clock signal frequency, which determines the transfer bit rate/second. More...
 

Variables

const char *const TAG = "spi"
 

Typedef Documentation

◆ QuadSPIComponent

Definition at line 369 of file spi.h.

Enumeration Type Documentation

◆ SPIBitOrder

The bit-order for SPI devices. This defines how the data read from and written to the device is interpreted.

Enumerator
BIT_ORDER_LSB_FIRST 

The least significant bit is transmitted/received first.

BIT_ORDER_MSB_FIRST 

The most significant bit is transmitted/received first.

Definition at line 38 of file spi.h.

◆ SPIClockPhase

The SPI clock signal phase.

This defines when the data signals are sampled. Most SPI devices use the LEADING clock phase.

Enumerator
CLOCK_PHASE_LEADING 

The data is sampled on a leading clock edge. (CPHA=0)

CLOCK_PHASE_TRAILING 

The data is sampled on a trailing clock edge. (CPHA=1)

Definition at line 64 of file spi.h.

◆ SPIClockPolarity

The SPI clock signal polarity,.

This defines how the clock signal is used. Flipping this effectively inverts the clock signal.

Enumerator
CLOCK_POLARITY_LOW 

The clock signal idles on LOW.

(CPOL=0)

A rising edge means a leading edge for the clock.

CLOCK_POLARITY_HIGH 

The clock signal idles on HIGH.

(CPOL=1)

A falling edge means a trailing edge for the clock.

Definition at line 48 of file spi.h.

◆ SPIDataRate

enum esphome::spi::SPIDataRate : uint32_t

The SPI clock signal frequency, which determines the transfer bit rate/second.

Implementations can use the pre-defined constants here, or use an integer in the template definition to manually use a specific data rate.

Enumerator
DATA_RATE_1KHZ 
DATA_RATE_75KHZ 
DATA_RATE_200KHZ 
DATA_RATE_1MHZ 
DATA_RATE_2MHZ 
DATA_RATE_4MHZ 
DATA_RATE_5MHZ 
DATA_RATE_8MHZ 
DATA_RATE_10MHZ 
DATA_RATE_20MHZ 
DATA_RATE_40MHZ 
DATA_RATE_80MHZ 

Definition at line 87 of file spi.h.

◆ SPIMode

Modes mapping to clock phase and polarity.

Enumerator
MODE0 
MODE1 
MODE2 
MODE3 

Definition at line 76 of file spi.h.

Variable Documentation

◆ TAG

static const char *const esphome::spi::TAG = "spi"

Definition at line 8 of file spi.cpp.