13#if defined(__zephyr__)
14#include "IDriverDeviceInfoZephyr"
103 AD_LOGI(
"SPI, not active, MOSI, MISO, SCLK, SSEL not modified");
140 bool active =
true) {
159 return i2c_bus_create(
this) ==
RESULT_OK;
#define RESULT_OK
Definition DriverCommon.h:74
#define DEFAULT_WIRE
Definition DriverCommon.h:32
#define AD_LOGD(...)
Definition Logger.h:12
#define AD_LOGI(...)
Definition Logger.h:13
Definition IDriverDeviceInfo.h:171
virtual audio_driver_local::Optional< InfoI2C > getI2CPins(PinFunction function)=0
A simple optonal implementation.
Definition Optional.h:10
Namespace for audio driver components.
Definition AudioBoard.h:5
struct audio_driver::SPIClass SPI
int16_t GpioPin
Definition DriverCommon.h:153
PinLogic
Definition DriverCommon.h:328
PinFunction
Definition DriverCommon.h:344
static InfoSPI ESP32PinsSD
Default SPI pins for ESP32 Lyrat, AudioDriver etc CLK, MISO, MOSI, CS.
Definition IDriverDeviceInfo.h:120
void spi_bus_delete(spi_bus_handle_t bus)
Definition API_SPI.h:76
void * i2c_bus_handle_t
Definition DriverCommon.h:155
error_t spi_bus_create(struct SPIConfig *config)
Definition API_SPI.h:71
GpioPin scl
Definition API_I2C.h:30
int address
Definition API_I2C.h:27
i2c_bus_handle_t p_wire
Definition API_I2C.h:24
int port
Definition API_I2C.h:26
uint32_t frequency
Definition API_I2C.h:25
GpioPin sda
Definition API_I2C.h:31
Pins for LED, Buttons, AMP etc.
Definition IDriverDeviceInfo.h:24
bool active
Definition IDriverDeviceInfo.h:37
GpioPin pin
Definition IDriverDeviceInfo.h:34
InfoGPIO(PinFunction function, GpioPin pin, PinLogic logic, int index=0)
Definition IDriverDeviceInfo.h:26
int index
Definition IDriverDeviceInfo.h:35
PinLogic pin_logic
Definition IDriverDeviceInfo.h:36
PinFunction function
Definition IDriverDeviceInfo.h:33
I2C pins.
Definition IDriverDeviceInfo.h:127
InfoI2C()
Definition IDriverDeviceInfo.h:128
bool begin()
Definition IDriverDeviceInfo.h:156
void end()
Definition IDriverDeviceInfo.h:163
InfoI2C(PinFunction function, GpioPin scl, GpioPin sda, int address=-1, uint32_t frequency=100000, i2c_bus_handle_t wire=DEFAULT_WIRE, bool active=true)
Definition IDriverDeviceInfo.h:138
bool pinsAvailable()
Definition IDriverDeviceInfo.h:153
PinFunction function
Definition IDriverDeviceInfo.h:151
bool set_active
Definition IDriverDeviceInfo.h:152
I2S pins.
Definition IDriverDeviceInfo.h:47
GpioPin ws
Definition IDriverDeviceInfo.h:62
InfoI2S(PinFunction function, GpioPin mclk, GpioPin bck, GpioPin ws, GpioPin data_out, GpioPin data_in=-1, int port=0)
Definition IDriverDeviceInfo.h:49
int port
Definition IDriverDeviceInfo.h:65
GpioPin bck
Definition IDriverDeviceInfo.h:61
GpioPin data_out
Definition IDriverDeviceInfo.h:63
PinFunction function
Definition IDriverDeviceInfo.h:59
GpioPin mclk
Definition IDriverDeviceInfo.h:60
GpioPin data_in
Definition IDriverDeviceInfo.h:64
SPI pins: In Arduino we initialize the SPI, on other platform we just provide the pin information.
Definition IDriverDeviceInfo.h:76
InfoSPI()
Definition IDriverDeviceInfo.h:77
bool begin()
Definition IDriverDeviceInfo.h:98
void end()
Definition IDriverDeviceInfo.h:107
bool pinsAvailable()
Definition IDriverDeviceInfo.h:96
PinFunction function
Definition IDriverDeviceInfo.h:94
InfoSPI(PinFunction function, GpioPin clk, GpioPin miso, GpioPin mosi, GpioPin cs, SPIClass &spi=SPI)
Definition IDriverDeviceInfo.h:84
bool set_active
Definition IDriverDeviceInfo.h:95
spi_bus_handle_t p_spi
Definition API_SPI.h:19
GpioPin cs
Definition API_SPI.h:23
GpioPin miso
Definition API_SPI.h:21
GpioPin clk
Definition API_SPI.h:20
GpioPin mosi
Definition API_SPI.h:22