Skip to content

Commit 39f3a62

Browse files
boostjwkartben
authored andcommitted
drivers: i2s: Added Apollo510 I2S driver.
I2S driver support standard format, short/long sync, left/right justified. Supporting 2 channels as a default. Signed-off-by: Lewis Lee <llee@ambiq.com>
1 parent 6d34549 commit 39f3a62

File tree

9 files changed

+714
-0
lines changed

9 files changed

+714
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,24 @@
272272
};
273273
};
274274

275+
i2s0_default: i2s0_default {
276+
group0 {
277+
pinmux = <I2S0_SDIN_P4>,
278+
<I2S0_CLK_P5>,
279+
<I2S0_SDOUT_P6>,
280+
<I2S0_WS_P7>;
281+
};
282+
};
283+
284+
i2s1_default: i2s1_default {
285+
group0 {
286+
pinmux = <I2S1_CLK_P16>,
287+
<I2S1_SDOUT_P17>,
288+
<I2S1_WS_P18>,
289+
<I2S1_SDIN_P19>;
290+
};
291+
};
292+
275293
mspi0_default: mspi0_default {
276294
group0 {
277295
pinmux = <MSPI0_0_P64>,

‎boards/ambiq/apollo510_evb/apollo510_evb.dts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,18 @@ zephyr_udc0: &usb {
211211
status = "disabled";
212212
};
213213

214+
&i2s0 {
215+
pinctrl-0 = <&i2s0_default>;
216+
pinctrl-names = "default";
217+
status = "disabled";
218+
};
219+
220+
&i2s1 {
221+
pinctrl-0 = <&i2s1_default>;
222+
pinctrl-names = "default";
223+
status = "disabled";
224+
};
225+
214226
&gpio0_31 {
215227
status = "okay";
216228
};

‎boards/ambiq/apollo510_evb/apollo510_evb.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ supported:
2020
- clock_control
2121
- usbd
2222
- pdm
23+
- i2s
2324
- mspi
2425
testing:
2526
ignore_tags:

‎drivers/i2s/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ zephyr_library_sources_ifdef(CONFIG_I2S_SILABS_SIWX91X i2s_silabs_siwx91x.c)
1818
zephyr_library_sources_ifdef(CONFIG_I2S_TEST i2s_test.c)
1919
zephyr_library_sources_ifdef(CONFIG_I2S_STM32_SAI i2s_stm32_sai.c)
2020
zephyr_library_sources_ifdef(CONFIG_I2S_RENESAS_RA_SSIE i2s_renesas_ra_ssie.c)
21+
zephyr_library_sources_ifdef(CONFIG_I2S_AMBIQ i2s_ambiq.c)

‎drivers/i2s/Kconfig.ambiq‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2025 Ambiq Micro Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config I2S_AMBIQ
5+
bool "Ambiq I2S driver"
6+
default y
7+
depends on DT_HAS_AMBIQ_I2S_ENABLED
8+
select AMBIQ_HAL
9+
select AMBIQ_HAL_USE_I2S
10+
select PINCTRL
11+
help
12+
Enable support for Ambiq I2S driver for Apollo 5 MCU.
13+
14+
if I2S_AMBIQ
15+
16+
config I2S_AMBIQ_HANDLE_CACHE
17+
bool "Turn on cache handling in I2S 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 I2S_AMBIQ_BUFFER_ALIGNMENT
24+
int "Set the I2S DMA TCB buffer alignment"
25+
default DCACHE_LINE_SIZE if DCACHE
26+
help
27+
I2S buffer should be 32bytes aligned when placed in cachable region.
28+
29+
config I2S_AMBIQ_RX_BLOCK_COUNT
30+
int "RX queue length"
31+
default 4
32+
33+
config I2S_AMBIQ_TX_BLOCK_COUNT
34+
int "TX queue length"
35+
default 4
36+
37+
endif # I2S_AMBIQ

0 commit comments

Comments
 (0)