Audio System + Drivers (#562)

This commit is contained in:
Shadowtrance
2026-07-14 16:34:29 +10:00
committed by GitHub
parent fa4a6e255c
commit 955416dac8
137 changed files with 8847 additions and 387 deletions
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <tactility/bindings/bindings.h>
#include <drivers/dummy_i2s_amp.h>
#ifdef __cplusplus
extern "C" {
#endif
// One DEFINE_DEVICETREE per compatible string -- the devicetree compiler derives the
// expected config typedef name from the compatible string's suffix (e.g. "maxim,max98357a"
// -> max98357a_config_dt), not from a name we choose, so each supported chip needs its own
// typedef even though they all share the same underlying config layout.
DEFINE_DEVICETREE(max98357a, struct DummyI2sAmpConfig)
DEFINE_DEVICETREE(ns4168, struct DummyI2sAmpConfig)
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,32 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <tactility/error.h>
#include <tactility/drivers/audio_codec.h>
#include <tactility/drivers/gpio.h>
struct Device;
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Dummy class-D amplifier configuration.
*
* Covers any speaker amp with no I2C/register interface -- just I2S data in plus an
* optional GPIO enable (SD) pin -- e.g. MAX98357A, NS4168. There is no I2C parent; the
* device sits standalone in the devicetree and only references the I2S controller by name.
*/
struct DummyI2sAmpConfig {
/** I2S controller device that carries audio data */
struct Device* i2s_device;
/** Optional amplifier enable pin (SD pin). GPIO_PIN_SPEC_NONE if not wired. */
struct GpioPinSpec enable_pin;
};
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <tactility/module.h>
#ifdef __cplusplus
extern "C" {
#endif
extern struct Module dummy_i2s_amp_module;
#ifdef __cplusplus
}
#endif