This is the documentation for the latest (main) development branch of HPM SDK. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

6.15.2. I2S DMA

6.15.2.1. Overview

The audio_codec example shows how to use codec component to play audio information. MCU send back the received data to codec component, then codec component decodes and plays the audio data.

6.15.2.2. Project Configuration

  • In the file cmakelists.txt, set a matched audio codec type according to the development board schematic,e.g. “set(CONFIG_CODEC “sgtl5000”)”

6.15.2.3. Board Setting

  • Connect headphone to the headphone interface on the audio codec chip.

6.15.2.4. Running the example

When the example runs successfully, the headset will play the sound of a sine wave with a frequency of 1KHZ. The 1KHZ sine wave can be obtained by measuring the left channel or the right channel with an oscilloscope, and the following message is displayed in the terminal:


> I2S DMA example
> Test Codec playback