Skip to content

Commit 0273537

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 0273537

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)