Skip to content

Commit 0e18f24

Browse files
committed
nrf/i2s: allow master mode without MCK pin
Outputting the generated master clock is optional as per Nordic docs: "The MCK signal can be routed to an output pin (specified in PSEL.MCK) to supply external I2S devices that require the MCK to be supplied from the outside." [1] Some I2S DACs, such as MAX98357A, don't require a master clock input so it can be left disconnected. nRF Connect SDK supports this. [1] https://docs.nordicsemi.com/bundle/ps_nrf52833/page/i2s.html [2] https://www.analog.com/media/en/technical-documentation/data-sheets/max98357a-max98357b.pdf
1 parent ff42c61 commit 0e18f24

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

embassy-nrf/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- bugfix: Do not write to UICR from non-secure code on nrf53
2424
- bugfix: Add delay to uart init anomaly fix
2525
- changed: `BufferedUarte::read_ready` now uses the same definition for 'empty' so following read calls will not block when true is returned
26+
- changed: allow configuring I2S in master mode without master clock output pin
2627

2728
## 0.8.0 - 2025-09-30
2829

embassy-nrf/src/i2s.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl<'d> I2S<'d> {
422422
pub fn new_master<T: Instance>(
423423
_i2s: Peri<'d, T>,
424424
_irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
425-
mck: Peri<'d, impl GpioPin>,
425+
mck: Option<Peri<'d, impl GpioPin>>,
426426
sck: Peri<'d, impl GpioPin>,
427427
lrck: Peri<'d, impl GpioPin>,
428428
master_clock: MasterClock,
@@ -434,7 +434,7 @@ impl<'d> I2S<'d> {
434434
Self {
435435
r: T::regs(),
436436
state: T::state(),
437-
mck: Some(mck.into()),
437+
mck: mck.map(|mck| mck.into()),
438438
sck: sck.into(),
439439
lrck: lrck.into(),
440440
sdin: None,

0 commit comments

Comments
 (0)