⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userprofiles.c

📁 WM9713 audio codec driver for WinCE 5.0
💻 C
字号:
/*-----------------------------------------------------------------------------
 * Copyright (c) Wolfson Microelectronics plc.  All rights reserved.
 *
 * This software as well as any related documentation is furnished under 
 * license and may only be used or copied in accordance with the terms of the 
 * license. The information in this file is furnished for informational use 
 * only, is subject to change without notice, and should not be construed as 
 * a commitment by Wolfson Microelectronics plc. Wolfson Microelectronics plc
 * assumes no responsibility or liability for any errors or inaccuracies that
 * may appear in this document or any software that may be provided in
 * association with this document. 
 *
 * Except as permitted by such license, no part of this document may be 
 * reproduced, stored in a retrieval system, or transmitted in any form or by 
 * any means without the express written consent of Wolfson Microelectronics plc. 
 *
 * $Id: UserProfiles.c 2054 2005-08-11 15:48:20Z ib $
 *
 * This file contains extra named profiles for the device.
 *
 * Warning:
 *  This driver is specifically written for Wolfson Codecs. It is not a 
 *  general CODEC device driver.
 *
 *---------------------------------------------------------------------------*/

/*
 * Include files
 */
#include "WMCommon.h"
#include "WMProfiles.h"
#include "WMRegisterDefs.h"

#ifndef WDCL_TEST

/*
 * We provide a standard set of profiles for each codec - these are defined
 * in the appropriate file in the ChipDefs directory.  You can use these in
 * your profiles using WMACT_LOAD_PROFILE, or you can override them by
 * declaring a profile with the same name.
 * 
 * There is more documentation on the profiles and actions which are available
 * in WMProfiles.h, and in the documentation WAS-0008 Using the Wolfson Device
 * Control Library, provided in the docs directory of the kit.
 * 
 * The tool MakeProfile.exe, provided in the Apps directory of the kit, can
 * take one or more files from the evaluation board software and convert
 * them into a form suitable for this file. 
 */

/*
 * Global definitions
 */

/*
 * Action tables for the profiles.
 */

/*
 * Demo profile
 * 
 * This is an example set of actions, showing how to write your own profiles.
 * 
 * This profile uses the standard WM8753 profiles to initiate voice record
 * and playback together with HiFi playback.
 */
static const WM_ACTION s_DemoProfileActions[] =
{
    /* Load Voice playback */
    WMACT_LOAD_PROFILE( "Voice playback" ),
    /* Load Voice from Mic1 */
    WMACT_LOAD_PROFILE( "Mic1 to Voice" ),
    /* Load HiFi playback */
    WMACT_LOAD_PROFILE( "HiFi playback" ),
};

/*
 * Demo profile 2
 * 
 * This is another demo profile which sets up the analogue path from LINE
 * to OUT1 on the WM8753.  It demonstrates bitfield operations.
 */
static const WM_ACTION s_DemoProfile2Actions[] =
{
    /* Select LINE at the muxes (instead of RX) */
    WMACT_SET_FIELD( WM8753_INPUT_CONTROL_1,
                     WM8753_LEFTMUXSEL_LINE1 | WM8753_RIGHTMUXSEL_LINE2,
                     WM8753_LEFTMUXSEL_MASK | WM8753_RIGHTMUXSEL_MASK
                   ),

    /* Route LM/RM to LOUT/ROUT at -3dbFS */
    WMACT_SET_FIELD( WM8753_LEFT_OUT_MIX_1,
                     WM8753_MIX2OUT | WM8753_MIXVOL_M3DB,
                     WM8753_MIX2OUT | WM8753_MIXVOL_MASK
                   ),
    WMACT_SET_FIELD( WM8753_RIGHT_OUT_MIX_1,
                     WM8753_MIX2OUT | WM8753_MIXVOL_M3DB,
                     WM8753_MIX2OUT | WM8753_MIXVOL_MASK
                   ),

    /* Enable LOUT1 and ROUT1 at +6dBFS */
    WMACT_WRITE( WM8753_LOUT1_VOLUME,
                 WM8753_OUTVOL_ZEROCROSS | WM8753_OUTVOL( 6 ) |
                 WM8753_VOLUME_UPDATE
               ),
    WMACT_WRITE( WM8753_ROUT1_VOLUME,
                 WM8753_OUTVOL_ZEROCROSS | WM8753_OUTVOL( 6 ) |
                 WM8753_VOLUME_UPDATE
               ),
    /* Power up mixers and outputs */
    WMACT_POWERUP( WM_POWER_OUTPUTS | WM_POWER_MIXERS ),
};

/*
 * This is the table which maps profile names to action arrays.
 */
static const WM_PROFILE s_UserProfiles[] = 
{
    WM_PROFILE_ENTRY( "Demo profile", WM_CHIP_WM8753, s_DemoProfileActions ),
    WM_PROFILE_ENTRY( "Demo profile 2", WM_CHIP_WM8753, s_DemoProfile2Actions ),
};

const WM_PROFILE *g_UserProfiles = s_UserProfiles;
unsigned int g_nUserProfiles = WM_ARRAY_COUNT( s_UserProfiles );

/*
 * Function prototypes
 */


#endif  /* !WDCL_TEST */

/*------------------------------ END OF FILE ---------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -