11#ifndef SPI_INTERFACE_ESP_SYNC_HPP
12#define SPI_INTERFACE_ESP_SYNC_HPP
16#include "driver/spi_master.h"
17#include "freertos/semphr.h"
An abstract base class for SPI communication.
A driver for (synchronous) SPI communication on ESP platforms.
void transmit(SPITransactionFrame *frame) override
Write (and read) a frame to the SPI bus.
bool init()
Initialize the SPI device.
bool success
The status of the current transaction.
void deinit()
Deinitialize the SPI device.
bool end_transaction() override
End the transaction. This function returns the status since the last end_transaction().
virtual ~SPIInterfaceESP()
Destructor of a SPI device on an ESP platform.
const SemaphoreHandle_t spiMutex
A mutex to prevent concurrent access to the SPI bus.
bool initialized
The status of the device.
spi_device_handle_t spiDevice
A handle to the SPI device.
SPIInterfaceESP(const spi_device_interface_config_t *deviceConfig, const spi_host_device_t hostDevice)
Constructor of a SPI device on an ESP platform.
const spi_device_interface_config_t * deviceConfig
The configuration of the SPI device.
static constexpr std::uint32_t MAX_TIME_TO_WAIT
timeout of 5 seconds for spi related calls, mostly arbitrary.
const spi_host_device_t hostDevice
The host spi device.
A class containing the data for a single SPI transaction.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...
A base class for SPI communication between hardware devices. Can be derived into your platform's requ...