21 #ifndef PLUGINS_SPI_SPIWRITER_H_
22 #define PLUGINS_SPI_SPIWRITER_H_
25 #include <ola/thread/Mutex.h>
40 virtual std::string DevicePath()
const = 0;
41 virtual bool Init() = 0;
42 virtual bool WriteSPIData(
const uint8_t *data,
unsigned int length) = 0;
57 Options() : spi_speed(1000000), cs_enable_high(
false) {}
64 std::string DevicePath()
const {
return m_device_path; }
72 bool WriteSPIData(
const uint8_t *data,
unsigned int length);
75 const std::string m_device_path;
76 const uint32_t m_spi_speed;
77 const bool m_cs_enable_high;
82 static const uint8_t SPI_MODE;
83 static const uint8_t SPI_BITS_PER_WORD;
84 static const char SPI_DEVICE_KEY[];
85 static const char SPI_ERROR_VAR[];
86 static const char SPI_WRITE_VAR[];
91 #endif // PLUGINS_SPI_SPIWRITER_H_