ESPHome  2022.9.2
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_byte16 (uint16_t data)
 
void write_array16 (const uint16_t *data, size_t length)
 
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 246 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 249 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 263 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 261 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 267 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 271 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 265 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 252 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 251 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 254 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 301 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 305 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 297 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 289 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 293 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 295 of file spi.h.

◆ write_array16()

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_array16 ( const uint16_t *  data,
size_t  length 
)
inline

Definition at line 285 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 277 of file spi.h.

◆ write_byte16()

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_byte16 ( uint16_t  data)
inline

Definition at line 281 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 309 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 308 of file spi.h.


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