Production Test Program (PTP) for the LPC4088 Experiment Base Board

Dependencies:   EALib I2S LM75B SDFileSystem mbed

TestAudio.cpp

Committer:
embeddedartists
Date:
2014-08-28
Revision:
2:2f4b7535ceb3
Child:
3:7ef908e84ae1

File content as of revision 2:2f4b7535ceb3:

/*
 *  Copyright 2013 Embedded Artists AB
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

/******************************************************************************
 * Includes
 *****************************************************************************/

#include "mbed.h"
#include "TestAudio.h"
#include "WM8731.h"

/******************************************************************************
 * Defines and typedefs
 *****************************************************************************/

/******************************************************************************
 * Public Functions
 *****************************************************************************/

/*
   Prerequisites:
 
   - For this test to work jumpers JP8 and JP9 on the LPC4088 Experiment Base Board
     must both be in positions 1-2
     
   - MIC cable, Line OUT, Headphone...
*/

bool TestAudio::runTest() {
    printf("Testing audio...\n");
    WM8731 audio(P0_27, P0_28);
    if (!audio.writeCmd(WM8731::REG_R15_RESET, 0x0000)) {
        printf("Failed to send command to audio codec\n");
        return false;
    }
    return true;
}