LCC Fusion Project 1.0
LCC Automation
Loading...
Searching...
No Matches
Sound Card Firmware

Firmware for the LCC Fusion Sound Card. More...

Classes

class  SoundCardPlayer
 Controls a DFPlayer Mini via SoftwareSerial, with save/restore functionality. More...
 

Macros

#define WEB_SSID   "LCC_Fusion_Sound_Card"
 Web Serial SSID used when Web Serial is enabled.
 
#define BT_DEVICE_NAME   "LCC Fusion Sound Card"
 Bluetooth device name used when Bluetooth serial is enabled.
 
#define PLAYER_RX_PIN_NUM   0
 Index into SW_SERIAL_PIN_SET for RX pin.
 
#define PLAYER_TX_PIN_NUM   1
 Index into SW_SERIAL_PIN_SET for TX pin.
 

Enumerations

enum  requestTypes {
  PLAY = 'P' , LOOP = 'L' , PAUSE = 'p' , RESET = 'R' ,
  NONE = ' '
}
 Request types for sound commands via serial/I2C. More...
 

Variables

static constexpr uint8_t I2C_ADDR_OFFSET_PIN_SET [3] = { 34, 35, 32 }
 GPIO pins used for I2C address selection DIP switches. More...
 
static constexpr uint8_t I2C_SDA_PIN = 21
 Default I2C SDA pin (ESP32 I2C bus 0).
 
static constexpr uint8_t I2C_SCL_PIN = 22
 Default I2C SCL pin (ESP32 I2C bus 0).
 
static const String SAVE_FILE_NAME = "/State_Player "
 SPIFFS file path prefix for saving player state.
 
static constexpr uint8_t SW_SERIAL_PIN_SET [NUM_PLAYERS_PER_CARD][2]
 SoftwareSerial pin mappings for each DFPlayer. More...
 
static uint8_t playerNum = 1
 Global counter to assign unique player numbers to each instance.
 

Detailed Description

Firmware for the LCC Fusion Sound Card.

High-level overview and links to the main entry points (setup/loop) and helper functions used by the Sound firmware.

Enumeration Type Documentation

◆ requestTypes

Request types for sound commands via serial/I2C.

Enumerator
PLAY 

Start playback of specified file.

LOOP 

Loop playback indefinitely.

PAUSE 

Pause current playback.

RESET 

Reset the DFPlayer device.

NONE 

No request.

Definition at line 106 of file config.h.

Variable Documentation

◆ I2C_ADDR_OFFSET_PIN_SET

constexpr uint8_t I2C_ADDR_OFFSET_PIN_SET[3] = { 34, 35, 32 }
staticconstexpr

GPIO pins used for I2C address selection DIP switches.

Each pin contributes a bit (pin1=+1, pin2=+2, pin3=+4) relative to base address. These pins must be configured with internal pull-ups; DIP switch grounds pin when closed.

Definition at line 67 of file config.h.

◆ SW_SERIAL_PIN_SET

constexpr uint8_t SW_SERIAL_PIN_SET[NUM_PLAYERS_PER_CARD][2]
staticconstexpr
Initial value:
= {
{ 22, 23 },
{ 21, 19 },
{ 17, 16 },
{ 2, 15 }
}

SoftwareSerial pin mappings for each DFPlayer.

For each entry [i], the first value is ESP32 RX pin (DFPlayer TX → ESP32), the second value is ESP32 TX pin (ESP32 → DFPlayer RX).

Definition at line 96 of file config.h.