arduino-audio-driver
Loading...
Searching...
No Matches
ESP32S3HosyondDisplay.h
Go to the documentation of this file.
1#pragma once
16#include "AudioBoard.h"
17// need Arduino's SD_MMC.h, unavailable in a plain ESP-IDF build
18#if defined(ARDUINO)
19#include "SD_MMC.h"
20#endif
21
22#if !defined(IS_ZEPHYR)
23
24#define HOSYOND_SD_MMC_SCK 38
25#define HOSYOND_SD_MMC_CMD 40 // MOSI
26#define HOSYOND_SD_MMC_D0 39 // MISO
27#define HOSYOND_SD_MMC_D1 41
28#define HOSYOND_SD_MMC_D2 48
29#define HOSYOND_SD_MMC_D3 47 // CS
30#define HOSYOND_SD_CS HOSYOND_SD_MMC_D3
31#define HOSYOND_BOOT_BUTTON 0
32#define HOSYOND_RGB_LED 42
33
34#define HOSYOND_I2S_MCK 4
35#define HOSYOND_I2S_BCK 5
36#define HOSYOND_I2S_DOUT 8
37#define HOSYOND_I2S_DIN 6
38#define HOSYOND_I2S_WS 7
39
40#define HOSYOND_I2C_SCL 15 // GPIO number used for I2C master clock
41#define HOSYOND_I2C_SDA 16 // GPIO number used for I2C master data
42#define HOSYOND_I2C_NUM 0 // I2C master i2c port number, the number of i2c peripheral interfaces available will depend on the chip
43#define HOSYOND_I2C_SPEED 400000 // I2C master clock frequency
44
45#define HOSYOND_AUDIO_PA_ENABLE 1
46
47#define HOSYOND_BATTERY 9
48#define HOSYOND_UART0_RX 43
49#define HOSYOND_UART0_TX 44
50#define HOSYOND_GPIO_EXPANDER_1 2
51#define HOSYOND_GPIO_EXPANDER_2 14
52#define HOSYOND_GPIO_EXPANDER_3 14
53#define HOSYOND_GPIO_EXPANDER_4 21
54
55#endif
56
57namespace audio_driver
58{
65 {
66 public:
68 {
69 // add i2c codec pins: scl, sda, port, frequency
71
72 // add i2s pins: mclk, bck, ws,data_out, data_in ,(port)
74
75 // add other pins
76 addPin(PinFunction::PA, HOSYOND_AUDIO_PA_ENABLE, PinLogic::OutputActiveLow); // Audio output enable signal, low level enable, high level disable
78
79 // Additional GPIO Expansion Pins - can be used as a normal IO
84
85 // The following are here for definition purposes
86 // addPin(PinFunction::EXPANDER, HOSYOND_BATTERY, PinLogic::Input, 4); // Battery voltage ADC value acquisition input signal
87 // addPin(PinFunction::LED, HOSYOND_RGB_LED, PinLogic::Output, 1); // Single-line RGB three-color LED light, which can control the internal red, green, and blue three kinds of light beads separately according to different signals
88 }
89
90 bool begin() override
91 {
92 bool rc = DriverDeviceInfo::begin();
93
94 if (sdmmc_active) {
95 setSDMMCActive(true);
96#if defined(ARDUINO)
98 rc &= SD_MMC.begin();
99#else
100 AD_LOGE("SDMMC only supported in Arduino");
101 rc = false;
102#endif
103 }
104 return rc;
105 }
106 };
107
112} // namespace audio_driver$
#define HOSYOND_SD_MMC_D2
Definition ESP32S3HosyondDisplay.h:28
#define HOSYOND_I2S_BCK
Definition ESP32S3HosyondDisplay.h:35
#define HOSYOND_GPIO_EXPANDER_4
Definition ESP32S3HosyondDisplay.h:53
#define HOSYOND_GPIO_EXPANDER_3
Definition ESP32S3HosyondDisplay.h:52
#define HOSYOND_I2C_NUM
Definition ESP32S3HosyondDisplay.h:42
#define HOSYOND_SD_MMC_D1
Definition ESP32S3HosyondDisplay.h:27
#define HOSYOND_AUDIO_PA_ENABLE
Definition ESP32S3HosyondDisplay.h:45
#define HOSYOND_I2C_SDA
Definition ESP32S3HosyondDisplay.h:41
#define HOSYOND_SD_MMC_SCK
Definition ESP32S3HosyondDisplay.h:24
#define HOSYOND_GPIO_EXPANDER_2
Definition ESP32S3HosyondDisplay.h:51
#define HOSYOND_I2S_DIN
Definition ESP32S3HosyondDisplay.h:37
#define HOSYOND_GPIO_EXPANDER_1
Definition ESP32S3HosyondDisplay.h:50
#define HOSYOND_I2C_SCL
Definition ESP32S3HosyondDisplay.h:40
#define HOSYOND_SD_MMC_D0
Definition ESP32S3HosyondDisplay.h:26
#define HOSYOND_I2S_WS
Definition ESP32S3HosyondDisplay.h:38
#define HOSYOND_I2C_SPEED
Definition ESP32S3HosyondDisplay.h:43
#define HOSYOND_SD_MMC_CMD
Definition ESP32S3HosyondDisplay.h:25
#define HOSYOND_I2S_DOUT
Definition ESP32S3HosyondDisplay.h:36
#define HOSYOND_BOOT_BUTTON
Definition ESP32S3HosyondDisplay.h:31
#define HOSYOND_I2S_MCK
Definition ESP32S3HosyondDisplay.h:34
#define HOSYOND_SD_MMC_D3
Definition ESP32S3HosyondDisplay.h:29
#define AD_LOGE(...)
Definition Logger.h:15
Defitintion for audio board pins and an audio driver.
Definition AudioBoard.h:13
All pins for i2s, spi, i2c and other pins.
Definition DriverDeviceInfo.h:20
bool sdmmc_active
Definition DriverDeviceInfo.h:273
virtual bool begin()
Sets up all pins e.g. by calling pinMode()
Definition DriverDeviceInfo.h:193
bool addI2C(InfoI2C pin)
Definition DriverDeviceInfo.h:56
bool addI2S(InfoI2S pin)
Definition DriverDeviceInfo.h:26
void setSDMMCActive(bool active)
Defines if SPI for SD should be started (by default true)
Definition DriverDeviceInfo.h:243
bool addPin(InfoGPIO pin)
Definition DriverDeviceInfo.h:86
Pins definition for ESP32-S3 Hosyond Display with ES8311 AudioDriver & FM8002E Audio Amplifier.
Definition ESP32S3HosyondDisplay.h:65
bool begin() override
Sets up all pins e.g. by calling pinMode()
Definition ESP32S3HosyondDisplay.h:90
PinsESP32S3HosyondDisplayClass()
Definition ESP32S3HosyondDisplay.h:67
static AudioBoard ESP32S3HosyondDisplay
Definition ESP32S3HosyondDisplay.h:111
static AudioDriverES8311Class AudioDriverES8311
Definition AudioDriver.h:2162
static PinsESP32S3HosyondDisplayClass PinsESP32S3HosyondDisplay
Definition ESP32S3HosyondDisplay.h:109
Namespace for audio driver components.
Definition AudioBoard.h:5