Skip to content

Commit 6d34549

Browse files
boostjwkartben
authored andcommitted
drivers: audio: dmic: Add Apollo510 PDM driver for DMIC.
Add PDM driver for DMIC. This driver is compatible with samples/audio/dmic application. Signed-off-by: Lewis Lee <llee@ambiq.com>
1 parent 3d11c84 commit 6d34549

File tree

12 files changed

+450
-0
lines changed

12 files changed

+450
-0
lines changed

‎boards/ambiq/apollo510_evb/apollo510_evb-pinctrl.dtsi‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@
265265
};
266266
};
267267

268+
pdm0_default: pdm0_default {
269+
group0 {
270+
pinmux = <PDM0_CLK_P50>,
271+
<PDM0_DATA_P51>;
272+
};
273+
};
274+
268275
mspi0_default: mspi0_default {
269276
group0 {
270277
pinmux = <MSPI0_0_P64>,

‎boards/ambiq/apollo510_evb/apollo510_evb.dts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ zephyr_udc0: &usb {
205205
status = "okay";
206206
};
207207

208+
&pdm0 {
209+
pinctrl-0 = <&pdm0_default>;
210+
pinctrl-names = "default";
211+
status = "disabled";
212+
};
213+
208214
&gpio0_31 {
209215
status = "okay";
210216
};

‎boards/ambiq/apollo510_evb/apollo510_evb.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ supported:
1919
- hwinfo
2020
- clock_control
2121
- usbd
22+
- pdm
2223
- mspi
2324
testing:
2425
ignore_tags:

‎drivers/audio/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ zephyr_library_sources_ifdef(CONFIG_AUDIO_CODEC_WM8962 wm8962.c)
1515
zephyr_library_sources_ifdef(CONFIG_AUDIO_CODEC_CS43L22 cs43l22.c)
1616
zephyr_library_sources_ifdef(CONFIG_AUDIO_CODEC_PCM1681 pcm1681.c)
1717
zephyr_library_sources_ifdef(CONFIG_AUDIO_CODEC_MAX98091 max98091.c)
18+
zephyr_library_sources_ifdef(CONFIG_AUDIO_DMIC_AMBIQ_PDM dmic_ambiq_pdm.c)

‎drivers/audio/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ source "subsys/logging/Kconfig.template.log_config"
6666
source "drivers/audio/Kconfig.mpxxdtyy"
6767
source "drivers/audio/Kconfig.dmic_pdm_nrfx"
6868
source "drivers/audio/Kconfig.dmic_mcux"
69+
source "drivers/audio/Kconfig.dmic_ambiq_pdm"
6970

7071
endif # AUDIO_DMIC
7172

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2025 Ambiq Micro Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config AUDIO_DMIC_AMBIQ_PDM
5+
bool "Ambiq PDM driver"
6+
default y
7+
depends on DT_HAS_AMBIQ_PDM_ENABLED
8+
select AMBIQ_HAL
9+
select AMBIQ_HAL_USE_PDM
10+
select PINCTRL
11+
help
12+
Enable support for Ambiq PDM driver for Apollo 5 MCU.
13+
14+
if AUDIO_DMIC_AMBIQ_PDM
15+
16+
config PDM_AMBIQ_HANDLE_CACHE
17+
bool "Turn on cache handling in PDM driver"
18+
default y
19+
depends on CACHE_MANAGEMENT && DCACHE
20+
help
21+
Disable this if cache has been handled in upper layers.
22+
23+
config PDM_AMBIQ_BUFFER_ALIGNMENT
24+
int "Set the PDM DMA TCB buffer alignment"
25+
default DCACHE_LINE_SIZE if DCACHE
26+
help
27+
PDM buffer should be 32bytes aligned when placed in cachable region.
28+
29+
endif

0 commit comments

Comments
 (0)