PL::Spi class
-
class Spi : public PL::Lockable
SPI class.
Public Functions
-
Spi(spi_host_device_t host, int mosiPin, int misoPin, int sclkPin)
Creates an SPI.
- Parameters:
host – SPI host (HSPI_HOST or VSPI_HOST)
mosiPin – MOSI pin
misoPin – MISO pin
sclkPin – SCLK pin
-
virtual esp_err_t Lock(TickType_t timeout = portMAX_DELAY) override
Locks the object.
- Parameters:
timeout – timeout in FreeRTOS ticks
- Returns:
error code
-
virtual esp_err_t Unlock() override
Unlocks the object.
- Returns:
error code
-
esp_err_t Initialize()
Initializes the SPI.
- Returns:
error code
-
esp_err_t SetMaxTransactionSize(int maxTransactionSize)
Sets the max transaction size (may be called only before Initialize)
- Parameters:
maxTransactionSize – max transaction size in bytes
- Returns:
error code
Public Static Attributes
-
static const int defaultMaxTransactionSize = 32
Default max transaction size in bytes.
-
Spi(spi_host_device_t host, int mosiPin, int misoPin, int sclkPin)