ESPHome  1.15.3
Public Member Functions | Protected Attributes
esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE > Class Template Reference

#include <spi.h>

Public Member Functions

 SPIDevice ()=default
 
 SPIDevice (SPIComponent *parent, GPIOPin *cs)
 
void set_spi_parent (SPIComponent *parent)
 
void set_cs_pin (GPIOPin *cs)
 
void spi_setup ()
 
void enable ()
 
void disable ()
 
uint8_t read_byte ()
 
void read_array (uint8_t *data, size_t length)
 
template<size_t N>
std::array< uint8_t, N > read_array ()
 
void write_byte (uint8_t data)
 
void write_array (const uint8_t *data, size_t length)
 
template<size_t N>
void write_array (const std::array< uint8_t, N > &data)
 
void write_array (const std::vector< uint8_t > &data)
 
uint8_t transfer_byte (uint8_t data)
 
void transfer_array (uint8_t *data, size_t length)
 
template<size_t N>
void transfer_array (std::array< uint8_t, N > &data)
 

Protected Attributes

SPIComponentparent_ {nullptr}
 
GPIOPincs_ {nullptr}
 

Detailed Description

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
class esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >

Definition at line 172 of file spi.h.

Constructor & Destructor Documentation

◆ SPIDevice() [1/2]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::SPIDevice ( )
default

◆ SPIDevice() [2/2]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::SPIDevice ( SPIComponent parent,
GPIOPin cs 
)
inline

Definition at line 175 of file spi.h.

Member Function Documentation

◆ disable()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::disable ( )
inline

Definition at line 189 of file spi.h.

◆ enable()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::enable ( )
inline

Definition at line 187 of file spi.h.

◆ read_array() [1/2]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::read_array ( uint8_t *  data,
size_t  length 
)
inline

Definition at line 193 of file spi.h.

◆ read_array() [2/2]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
template<size_t N>
std::array<uint8_t, N> esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::read_array ( )
inline

Definition at line 197 of file spi.h.

◆ read_byte()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
uint8_t esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::read_byte ( )
inline

Definition at line 191 of file spi.h.

◆ set_cs_pin()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::set_cs_pin ( GPIOPin cs)
inline

Definition at line 178 of file spi.h.

◆ set_spi_parent()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::set_spi_parent ( SPIComponent parent)
inline

Definition at line 177 of file spi.h.

◆ spi_setup()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::spi_setup ( )
inline

Definition at line 180 of file spi.h.

◆ transfer_array() [1/2]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::transfer_array ( uint8_t *  data,
size_t  length 
)
inline

Definition at line 219 of file spi.h.

◆ transfer_array() [2/2]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
template<size_t N>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::transfer_array ( std::array< uint8_t, N > &  data)
inline

Definition at line 223 of file spi.h.

◆ transfer_byte()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
uint8_t esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::transfer_byte ( uint8_t  data)
inline

Definition at line 215 of file spi.h.

◆ write_array() [1/3]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::write_array ( const uint8_t *  data,
size_t  length 
)
inline

Definition at line 207 of file spi.h.

◆ write_array() [2/3]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
template<size_t N>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::write_array ( const std::array< uint8_t, N > &  data)
inline

Definition at line 211 of file spi.h.

◆ write_array() [3/3]

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::write_array ( const std::vector< uint8_t > &  data)
inline

Definition at line 213 of file spi.h.

◆ write_byte()

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::write_byte ( uint8_t  data)
inline

Definition at line 203 of file spi.h.

Field Documentation

◆ cs_

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
GPIOPin* esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::cs_ {nullptr}
protected

Definition at line 227 of file spi.h.

◆ parent_

template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
SPIComponent* esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::parent_ {nullptr}
protected

Definition at line 226 of file spi.h.


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