How to use AUX output on nRF5340 Audio DK

Hi, I have an nRF5340 Audio DK. As the first step, I want to play a simple 1k Hz tone and output it via the AUX jack on the board.

Is there any related sample code for me to get started with?

Alternatively, I do have an external DAC module that takes in I2S data. Is there any example code that demonstrate how to use I2S feature in nRF Connect SDK?

Thank you!

Parents
No Data
Reply
  • I've been suffering the same beginner's growing pains as you; here's what I've learned so far...

    /modules/hal/cirrus-logic/cs47l63 contains the codec driver and its essential support functions defined in the various files from those subdirectories.

    /nrf/applications/nrf5340_audio/src/drivers/cs47l63_comm.c implements the driver communication in Zephyr using threads, mutexes, and semaphores for the SPI connection, interrupts, and callbacks.

    /nrf/applications/nrf5340_audio/src/drivers/cs47l63_reg_conf.h contains the necessary register data to setup and enable the sundry codec subsystems such as clocks, gpios, analog/digital inputs, I2S serial ports, headphone output, and the internal signal routing required for the nRF5340 Audio DK. The CS47L63 datasheet describes these in detail.

    /nrf/applications/nrf5340_audio/src/modules/hw_codec.c demonstrates how to combine these disparate files into working code that can be integrated within a larger multithreaded application using features such as ZBus, Shell, and KConfig options.

    Once all that infrastructure is in place, simply send data to the &i2s0 peripheral and it will be rendered by the codec's DAC output. Or, alternatively, modify the codec's internal routing so that its built-in test tone or white noise generators are sent to the DAC output instead.

Children
Related