ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::spi::ZephyrSPIDelegate Class Reference

#include <spi_zephyr.h>

Inheritance diagram for esphome::spi::ZephyrSPIDelegate:
esphome::spi::SPIDelegate

Public Member Functions

 ZephyrSPIDelegate (ZephyrSPIBus *bus, uint32_t data_rate, SPIBitOrder bit_order, SPIMode mode, GPIOPin *cs_pin)
 
 ~ZephyrSPIDelegate () override
 
void begin_transaction () override
 
uint8_t transfer (uint8_t data) override
 
void transfer (const uint8_t *txbuf, uint8_t *rxbuf, size_t length) override
 
void write_array (const uint8_t *ptr, size_t length) override
 
void write_array16 (const uint16_t *data, size_t length) override
 
void read_array (uint8_t *ptr, size_t length) override
 
- Public Member Functions inherited from esphome::spi::SPIDelegate
 SPIDelegate ()=default
 
 SPIDelegate (uint32_t data_rate, SPIBitOrder bit_order, SPIMode mode, GPIOPin *cs_pin)
 
virtual ~SPIDelegate ()
 
virtual void end_transaction ()
 
virtual void transfer (uint8_t *ptr, size_t length)
 
virtual void write (uint16_t data, size_t num_bits)
 write a variable length data item, up to 16 bits.
 
virtual void write_cmd_addr_data (size_t cmd_bits, uint32_t cmd, size_t addr_bits, uint32_t address, const uint8_t *data, size_t length, uint8_t bus_width)
 
virtual void write16 (uint16_t data)
 
virtual bool is_ready ()
 
void set_psram_dma (bool enable)
 

Protected Member Functions

void transceive_ (const uint8_t *tx, uint8_t *rx, size_t length)
 One spi_transceive; rx (if given) is zeroed when the transfer fails.
 

Protected Attributes

ZephyrSPIBus * bus_
 
spi_config cfg_ {}
 
- Protected Attributes inherited from esphome::spi::SPIDelegate
SPIBitOrder bit_order_ {BIT_ORDER_MSB_FIRST}
 
uint32_t data_rate_ {1000000}
 
SPIMode mode_ {MODE0}
 
GPIOPin * cs_pin_ {NullPin::NULL_PIN}
 
bool psram_dma_ {false}
 

Additional Inherited Members

- Static Protected Attributes inherited from esphome::spi::SPIDelegate
static SPIDelegate *const NULL_DELEGATE
 

Detailed Description

Definition at line 37 of file spi_zephyr.h.

Constructor & Destructor Documentation

◆ ZephyrSPIDelegate()

esphome::spi::ZephyrSPIDelegate::ZephyrSPIDelegate ( ZephyrSPIBus * bus,
uint32_t data_rate,
SPIBitOrder bit_order,
SPIMode mode,
GPIOPin * cs_pin )

Definition at line 34 of file spi_zephyr.cpp.

◆ ~ZephyrSPIDelegate()

esphome::spi::ZephyrSPIDelegate::~ZephyrSPIDelegate ( )
override

Definition at line 43 of file spi_zephyr.cpp.

Member Function Documentation

◆ begin_transaction()

void esphome::spi::ZephyrSPIDelegate::begin_transaction ( )
overridevirtual

Reimplemented from esphome::spi::SPIDelegate.

Definition at line 52 of file spi_zephyr.cpp.

◆ read_array()

void esphome::spi::ZephyrSPIDelegate::read_array ( uint8_t * ptr,
size_t length )
overridevirtual

Reimplemented from esphome::spi::SPIDelegate.

Definition at line 110 of file spi_zephyr.cpp.

◆ transceive_()

void esphome::spi::ZephyrSPIDelegate::transceive_ ( const uint8_t * tx,
uint8_t * rx,
size_t length )
protected

One spi_transceive; rx (if given) is zeroed when the transfer fails.

Definition at line 66 of file spi_zephyr.cpp.

◆ transfer() [1/2]

void esphome::spi::ZephyrSPIDelegate::transfer ( const uint8_t * txbuf,
uint8_t * rxbuf,
size_t length )
overridevirtual

Reimplemented from esphome::spi::SPIDelegate.

Definition at line 88 of file spi_zephyr.cpp.

◆ transfer() [2/2]

uint8_t esphome::spi::ZephyrSPIDelegate::transfer ( uint8_t data)
overridevirtual

Implements esphome::spi::SPIDelegate.

Definition at line 82 of file spi_zephyr.cpp.

◆ write_array()

void esphome::spi::ZephyrSPIDelegate::write_array ( const uint8_t * ptr,
size_t length )
overridevirtual

Reimplemented from esphome::spi::SPIDelegate.

Definition at line 92 of file spi_zephyr.cpp.

◆ write_array16()

void esphome::spi::ZephyrSPIDelegate::write_array16 ( const uint16_t * data,
size_t length )
overridevirtual

Reimplemented from esphome::spi::SPIDelegate.

Definition at line 94 of file spi_zephyr.cpp.

Field Documentation

◆ bus_

ZephyrSPIBus* esphome::spi::ZephyrSPIDelegate::bus_
protected

Definition at line 54 of file spi_zephyr.h.

◆ cfg_

spi_config esphome::spi::ZephyrSPIDelegate::cfg_ {}
protected

Definition at line 57 of file spi_zephyr.h.


The documentation for this class was generated from the following files: