Microchip® Advanced Software Framework

Quick start guide for the SAM WM8904 module

This is the quick start guide for the WM8904 Audio Codec, with step-by-step instructions on how to configure and use the driver in a selection of use cases.

The use cases contain several code fragments. The code fragments in the steps for setup can be copied into a custom initialization function, while the steps for usage can be copied into, e.g., the main application function.

WM8904 use cases

Basic use case - Configurate the WM8904 to LINEIN

and Headphone out mode In this use case, the WM8904 module is configured to analog LINEIN to ADC with I2S audio output. I2S audio input to DAC with headphone analog output.

Setup

Prerequisites

  1. PIO Driver (pio)

Workflow

The following function needs to be added to the user application

  1. Initialize the TWI interface.
  2. reset the WM8904.
    if(data != 0x8904) {
    printf("WM8904 not found!\n\r");
    while(1);
    }
  3. Configure the WM8904 codec.