arduino-audio-driver
Loading...
Searching...
No Matches
PinsGmicHaToyMdClass Class Reference

Pins for the GMIC HA-TOYMD audio module (ESP32-S3 + ES8311). More...

#include <GmicHaToyMd.h>

Inheritance diagram for PinsGmicHaToyMdClass:
DriverDeviceInfo IDriverDeviceInfo

Public Member Functions

 PinsGmicHaToyMdClass ()
bool addI2C (InfoI2C pin)
bool addI2C (PinFunction function, GpioPin scl, GpioPin sda, int port=-1, uint32_t frequency=100000, i2c_bus_handle_t wire=DEFAULT_WIRE, bool active=true)
bool addI2S (InfoI2S pin)
bool addI2S (PinFunction function, GpioPin mclk, GpioPin bck, GpioPin ws, GpioPin data_out, GpioPin data_in=-1, int port=0)
bool addPin (InfoGPIO pin)
bool addPin (PinFunction function, GpioPin pinNo, PinLogic logic, int index=0)
bool addSPI (InfoSPI pin)
bool addSPI (PinFunction function, GpioPin clk, GpioPin miso, GpioPin mosi, GpioPin cs, SPIClass &spi)
virtual bool begin ()
 Sets up all pins e.g. by calling pinMode().
void end ()
API_GPIO & getGPIO ()
audio_driver_local::Optional< InfoI2C > getI2CPins (PinFunction function) override
 Finds the I2C pin info with the help of the function.
audio_driver_local::Optional< InfoI2S > getI2SPins (int port)
 Finds the I2S pin info with the help of the port.
audio_driver_local::Optional< InfoI2S > getI2SPins (PinFunction function=PinFunction::CODEC)
 Finds the I2S pin info with the help of the function.
audio_driver_local::Optional< InfoGPIO > getPin (GpioPin pinId)
 Get pin information by pin ID.
audio_driver_local::Optional< InfoGPIO > getPin (PinFunction function, int pos=0)
 Get pin information by function.
GpioPin getPinID (PinFunction function, int pos=0)
PinLogic getPinLogic (PinFunction function, int pos=0)
audio_driver_local::Optional< InfoSPI > getSPIPins (PinFunction function)
 Finds the SPI pin info with the help of the function.
bool hasPins ()
 Returns true if some function pins have been defined.
virtual bool isKeyPressed (uint8_t key)
 returns true if pressed
bool isSDMMCActive ()
 Check if SDMMC has been activated.
bool isSPIActiveForSD ()
 Check if SPI for SD should be started automatically.
bool setI2C (InfoI2C pin)
 Updates the I2C pin information using the function as key.
bool setI2S (InfoI2S pin)
 Updates the I2S pin information using the function as key.
bool setPin (InfoGPIO updatedPin)
 Updates an existing pin information using the function and index as key.
bool setPinActive (int gpioPin, bool active)
 Updates an existing pin active flag for the indicated gpio.
bool setPinActive (PinFunction func, int idx, bool active)
 Updates an existing pin active flag for the indicated gpio.
void setSDMMCActive (bool active)
 Defines if SPI for SD should be started (by default true).
bool setSPI (InfoSPI pin)
 Updates the SPI pin information using the function as key.
void setSPIActiveForSD (bool active)
 Defines if SPI for SD should be started (by default true).

Protected Member Functions

template<typename T>
T * getPtr (PinFunction function, audio_driver_local::Vector< T > &vect)
bool hasConflict (int pin)
bool hasI2CConflict (int pin)
bool hasSPIConflict (int pin)
template<typename T>
bool set (T pin, audio_driver_local::Vector< T > &vect)
void setupPinMode ()

Protected Attributes

GPIOExt gpio
audio_driver_local::Vector< InfoI2C > i2c {0}
audio_driver_local::Vector< InfoI2S > i2s {0}
audio_driver_local::Vector< InfoGPIO > pins {0}
bool sd_active = false
bool sdmmc_active = false
audio_driver_local::Vector< InfoSPI > spi {0}

Detailed Description

Pins for the GMIC HA-TOYMD audio module (ESP32-S3 + ES8311).

A bare production audio module: one codec, one microphone, one speaker, no screen and no display bus. The vendor does not publish a pin map; these values were recovered by reading the GPIO matrix routing registers off the running chip over its built-in USB-JTAG port, then confirmed by bringing the codec up from scratch.

Hardware: ESP32-S3 (QFN56) - 4 MB flash - 2 MB quad PSRAM - ES8311 codec at 0x18 - Wi-Fi 2.4 GHz only - native USB serial/JTAG (VID 303A / PID 1001).

Author
Fanyao Zeng

Constructor & Destructor Documentation

◆ PinsGmicHaToyMdClass()

PinsGmicHaToyMdClass ( )
inline

Member Function Documentation

◆ addI2C() [1/2]

bool addI2C ( InfoI2C pin)
inlineinherited

◆ addI2C() [2/2]

bool addI2C ( PinFunction function,
GpioPin scl,
GpioPin sda,
int port = -1,
uint32_t frequency = 100000,
i2c_bus_handle_t wire = DEFAULT_WIRE,
bool active = true )
inlineinherited

◆ addI2S() [1/2]

bool addI2S ( InfoI2S pin)
inlineinherited

◆ addI2S() [2/2]

bool addI2S ( PinFunction function,
GpioPin mclk,
GpioPin bck,
GpioPin ws,
GpioPin data_out,
GpioPin data_in = -1,
int port = 0 )
inlineinherited

◆ addPin() [1/2]

bool addPin ( InfoGPIO pin)
inlineinherited

◆ addPin() [2/2]

bool addPin ( PinFunction function,
GpioPin pinNo,
PinLogic logic,
int index = 0 )
inlineinherited

◆ addSPI() [1/2]

bool addSPI ( InfoSPI pin)
inlineinherited

◆ addSPI() [2/2]

bool addSPI ( PinFunction function,
GpioPin clk,
GpioPin miso,
GpioPin mosi,
GpioPin cs,
SPIClass & spi )
inlineinherited

◆ begin()

virtual bool begin ( )
inlinevirtualinherited

Sets up all pins e.g. by calling pinMode().

Reimplemented in PinsESP32S3AISmartSpeakerClass, and PinsESP32S3HosyondDisplayClass.

◆ end()

void end ( )
inlineinherited

◆ getGPIO()

API_GPIO & getGPIO ( )
inlineinherited

◆ getI2CPins()

audio_driver_local::Optional< InfoI2C > getI2CPins ( PinFunction function)
inlineoverridevirtualinherited

Finds the I2C pin info with the help of the function.

Implements IDriverDeviceInfo.

◆ getI2SPins() [1/2]

audio_driver_local::Optional< InfoI2S > getI2SPins ( int port)
inlineinherited

Finds the I2S pin info with the help of the port.

◆ getI2SPins() [2/2]

audio_driver_local::Optional< InfoI2S > getI2SPins ( PinFunction function = PinFunction::CODEC)
inlineinherited

Finds the I2S pin info with the help of the function.

◆ getPin() [1/2]

audio_driver_local::Optional< InfoGPIO > getPin ( GpioPin pinId)
inlineinherited

Get pin information by pin ID.

◆ getPin() [2/2]

audio_driver_local::Optional< InfoGPIO > getPin ( PinFunction function,
int pos = 0 )
inlineinherited

Get pin information by function.

◆ getPinID()

GpioPin getPinID ( PinFunction function,
int pos = 0 )
inlineinherited

◆ getPinLogic()

PinLogic getPinLogic ( PinFunction function,
int pos = 0 )
inlineinherited

◆ getPtr()

template<typename T>
T * getPtr ( PinFunction function,
audio_driver_local::Vector< T > & vect )
inlineprotectedinherited

◆ getSPIPins()

audio_driver_local::Optional< InfoSPI > getSPIPins ( PinFunction function)
inlineinherited

Finds the SPI pin info with the help of the function.

◆ hasConflict()

bool hasConflict ( int pin)
inlineprotectedinherited

◆ hasI2CConflict()

bool hasI2CConflict ( int pin)
inlineprotectedinherited

◆ hasPins()

bool hasPins ( )
inlineinherited

Returns true if some function pins have been defined.

◆ hasSPIConflict()

bool hasSPIConflict ( int pin)
inlineprotectedinherited

◆ isKeyPressed()

virtual bool isKeyPressed ( uint8_t key)
inlinevirtualinherited

returns true if pressed

Reimplemented in PinsLyratMiniClass.

◆ isSDMMCActive()

bool isSDMMCActive ( )
inlineinherited

Check if SDMMC has been activated.

◆ isSPIActiveForSD()

bool isSPIActiveForSD ( )
inlineinherited

Check if SPI for SD should be started automatically.

◆ set()

template<typename T>
bool set ( T pin,
audio_driver_local::Vector< T > & vect )
inlineprotectedinherited

◆ setI2C()

bool setI2C ( InfoI2C pin)
inlineinherited

Updates the I2C pin information using the function as key.

◆ setI2S()

bool setI2S ( InfoI2S pin)
inlineinherited

Updates the I2S pin information using the function as key.

◆ setPin()

bool setPin ( InfoGPIO updatedPin)
inlineinherited

Updates an existing pin information using the function and index as key.

◆ setPinActive() [1/2]

bool setPinActive ( int gpioPin,
bool active )
inlineinherited

Updates an existing pin active flag for the indicated gpio.

◆ setPinActive() [2/2]

bool setPinActive ( PinFunction func,
int idx,
bool active )
inlineinherited

Updates an existing pin active flag for the indicated gpio.

◆ setSDMMCActive()

void setSDMMCActive ( bool active)
inlineinherited

Defines if SPI for SD should be started (by default true).

◆ setSPI()

bool setSPI ( InfoSPI pin)
inlineinherited

Updates the SPI pin information using the function as key.

◆ setSPIActiveForSD()

void setSPIActiveForSD ( bool active)
inlineinherited

Defines if SPI for SD should be started (by default true).

◆ setupPinMode()

void setupPinMode ( )
inlineprotectedinherited

Member Data Documentation

◆ gpio

GPIOExt gpio
protectedinherited

◆ i2c

audio_driver_local::Vector<InfoI2C> i2c {0}
protectedinherited

◆ i2s

audio_driver_local::Vector<InfoI2S> i2s {0}
protectedinherited

◆ pins

audio_driver_local::Vector<InfoGPIO> pins {0}
protectedinherited

◆ sd_active

bool sd_active = false
protectedinherited

◆ sdmmc_active

bool sdmmc_active = false
protectedinherited

◆ spi

audio_driver_local::Vector<InfoSPI> spi {0}
protectedinherited

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