TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SPIClass Class Reference

#include <EmulationIDF.h>

Public Member Functions

 SPIClass ()=default
 
 SPIClass (spi_host_device_t host)
 
bool begin (int sckPin, int misoPin=-1, int mosiPin=-1, int ssPin=-1)
 
void beginTransaction (SPISettings settings)
 
void endTransaction ()
 
uint8_t transfer (uint8_t data)
 
void transfer (void *buf, size_t count)
 

Detailed Description

ESP-IDF driver/spi_master.h-backed stand-in for Arduino's SPIClass, covering exactly what this library's SPI-based display/touch drivers call: beginTransaction()/endTransaction() and both transfer() overloads (single byte, and in-place full-duplex buffer). Chip select is NOT driven by this class - callers here always toggle their own CS pin via digitalWrite() around each transfer, the same division of responsibility Arduino's own SPIClass uses - so the underlying esp_lcd/spi_master device is configured with no CS pin of its own (spics_io_num = -1).

Constructor & Destructor Documentation

◆ SPIClass() [1/2]

SPIClass ( )
default

◆ SPIClass() [2/2]

SPIClass ( spi_host_device_t  host)
inlineexplicit

Member Function Documentation

◆ begin()

bool begin ( int  sckPin,
int  misoPin = -1,
int  mosiPin = -1,
int  ssPin = -1 
)
inline

Initializes the SPI bus pins. Matches arduino-esp32's SPIClass::begin(sck, miso, mosi, ss) - ss is accepted for signature compatibility but unused (see class comment: CS is always caller-driven here). Safe to call more than once.

◆ beginTransaction()

void beginTransaction ( SPISettings  settings)
inline

Attaches (or reattaches, if the settings changed) an SPI device with the given clock/mode and begins a transaction. Every transfer() in this library happens between a beginTransaction()/endTransaction() pair, matching the real SPIClass contract.

◆ endTransaction()

void endTransaction ( )
inline

No-op: the underlying device stays attached for reuse across transactions (see beginTransaction()) - nothing needs releasing per transaction with the spi_master driver.

◆ transfer() [1/2]

uint8_t transfer ( uint8_t  data)
inline

Full-duplex single-byte transfer, matching Arduino's SPIClass::transfer(uint8_t).

◆ transfer() [2/2]

void transfer ( void *  buf,
size_t  count 
)
inline

In-place full-duplex bulk transfer, matching Arduino's SPIClass::transfer(void*, size_t) - buf is both the data sent and (overwritten with) the data received.


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