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

📄 wmconfig.h

📁 WM9713 audio codec driver for WinCE 5.0
💻 H
📖 第 1 页 / 共 2 页
字号:
/*-----------------------------------------------------------------------------
 * 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: WMConfig.h 2578 2006-01-17 10:16:38Z ian $
 *
 * Header file containing configuration options for the Wolfson Device Control
 * Library.
 *
 * These configuration options take the form of preprocessor symbols which
 * are generally either TRUE or FALSE.  They can either be defined to the
 * appropriate value in this file, or can be defined in the build (e.g. in
 * the make file or on the build command line).
 *
 * Warning:
 *  This driver is specifically written for Wolfson Codecs. It is not a 
 *  general CODEC device driver.
 *
 *---------------------------------------------------------------------------*/
#ifndef __WMCONFIG_H__
#define __WMCONFIG_H__

/*
 * Include files.
 */
#include "WMGPIODefs.h"

/*
 * This file controls how the Wolfson drivers behave.  You should review
 * all of these settings and make sure they are appropriate for your system.
 * 
 * It is worth spending some time on this.  Getting the right set of options
 * and disabling features you do not need will improve performance and reduce
 * memory overhead.  If the options are wrong, your system may not work.
 * 
 * You also need to review and update the settings in the file
 * Platform\WMPlatformConfig.h
 */
#ifndef WM_INTERNAL_BUILD
    /*
     * Remove the next line when satisfied with your configuration
     *  - see comment above.
     */
#   error Please review and update WMConfig.h.
#endif

/*
 * Which chips are supported. Define the chip name as TRUE 
 * for chips which are to be included in the build.
 */
#ifndef WM9703
#   define WM9703                                   FALSE
#endif
#ifndef WM9705
#   define WM9705                                   TRUE
#endif
#ifndef WM9707
#   define WM9707                                   TRUE
#endif
#ifndef WM9708
#   define WM9708                                   FALSE
#endif
#ifndef WM9710
#   define WM9710                                   TRUE
#endif
#ifndef WM9711
#   define WM9711                                   TRUE
#endif
#ifndef WM9712
#   define WM9712                                   TRUE
#endif
#ifndef WM9713
#   define WM9713                                   TRUE
#endif
#ifndef WM9714
#   define WM9714                                   TRUE
#endif
#ifndef WM9717
#   define WM9717                                   FALSE
#endif
#ifndef WMI2S_GENERIC
#   define WMI2S_GENERIC                            FALSE
#endif
#ifndef WM8731
#   define WM8731                                   TRUE
#endif
#ifndef WM8734
#   define WM8734                                   FALSE
#endif
#ifndef WM8753
#   define WM8753                                   TRUE
#endif


/******************************************************************************
 * The features to build.  Comment these out to exclude them from the build
 * and save space.
 */
 
/*
 * General DAC support - if the device had any DACs.
 */
#ifndef WM_DAC
#   define WM_DAC                                   TRUE
#endif
 
/*
 * General ADC support - if the device had any ADCs.
 */
#ifndef WM_ADC
#   define WM_ADC                                   TRUE
#endif
 
/*
 * Auxiliary ADC support - if provided by the codec.
 */
#ifndef WM_AUXADC
#   define WM_AUXADC                                TRUE
#endif

/*
 * Touch-screen support - if provided by the codec.
 */
#ifndef WM_TOUCH
#   define WM_TOUCH                                 TRUE
#endif

/*
 * Audio support.
 */
#ifndef WM_AUDIO
#   define WM_AUDIO                                 TRUE
#   define WM_AUDIO_STREAM                          TRUE
#endif

/*
 * Waveform generation
 */
#ifndef WM_AUDIO_WAVEGEN
#   define WM_AUDIO_WAVEGEN                         TRUE
#endif

/*
 * GPIO control & monitoring - if provided by the codec.
 */
#ifndef WM_GPIO_CONTROL
#   define WM_GPIO_CONTROL                          TRUE
#endif

/*
 * Voice DAC path - if provided by the codec.
 */
#ifndef WM_VOICE
#   define WM_VOICE									TRUE
#endif

/*
 * Mono DAC path - if provided by the codec.
 */
#ifndef WM_MONODAC
#   define WM_MONODAC								TRUE
#endif

/*
 * Whether to build test code.  See the Testing section further down the
 * file for more options to configure what is tested and how.
 */
#ifndef WM_TESTING
#   define WM_TESTING                               FALSE
#endif


/******************************************************************************
 * Audio configuration.
 */

/*
 * Whether to enable zero-cross on outputs when setting the volume.
 * Zero-cross is a feature which reduces pops and clicks by waiting until
 * the signal is at 0 before changing the signal level.
 */
#define WM_AUDIO_USE_ZERO_CROSS                     TRUE

/*
 * The maximum audio buffer size, in bytes.
 * 
 * Ideally this should be the size of the buffers the system passes in.
 * For a Windows CE WAVEDEV driver, this is controlled by the software mixer.
 * To change the buffer size used by the software mixer, add or update the
 * following section in FILES\Platform.reg:
 *
 *   [HKEY_LOCAL_MACHINE\Audio\SoftwareMixer]
 *      "Buffers"=dword:4
 *      "BufferSize"=dword:1000
 * 
 * Note: the buffer size in the registry is specified in hexadecimal.
 * In this example it is set to 0x1000.
 */
#define WMAUDIO_MAX_BUFFER_SIZE                     0x1000

/*
 * The maximum duration in an audio record buffer, in milliseconds.
 * This reduces the buffer size for low-latency streaming.  The buffer size
 * used is the smaller of WMAUDIO_MAX_BUFFER_SIZE and the buffer size this
 * specifies.
 *
 * For example, 8kHz sampling for 20ms gives a buffer size of 160 samples.
 */
#define WMAUDIO_MAX_RECORD_BUFFER_DURATION          20

/*
 * The maximum duration in an audio playback buffer, in milliseconds.
 * This reduces the buffer size for low-latency streaming.  The buffer size
 * used is the smaller of WMAUDIO_MAX_BUFFER_SIZE and the buffer size this
 * specifies.
 *
 * For example, 8kHz sampling for 20ms gives a buffer size of 160 samples.
 * 
 * IMPORTANT:
 * Make sure the software mixer is set up for the same buffer size
 *  - see comment on WMAUDIO_MAX_BUFFER_SIZE for details.
 */
#define WMAUDIO_MAX_PLAYBACK_BUFFER_DURATION        1000 /* 1 second is bigger than MAX_BUFFER_SIZE */

/*
 * Default record paths for WMXxxxConfigurePath.  These can be overridden
 * by calling the appropriate set and clear RecPath functions.
 * For stereo ADCS both signals can be independantly setup so the 
 * left and right signals need to be provided a parameters regardless
 * of wether the input is a mono or stereo source
 * Options are all recordable signals in WMAudio.h e.g.:
 *      WM_AUDIO_LINEIN             Line in
 *      WM_AUDIO_MIC                Microphone
 *      WM_AUDIO_IGNORE             Do not change
 */
#define WM_AUDIO_DEFAULT_RECORD_LEFT_PATH           WM_AUDIO_LINEIN
#define WM_AUDIO_DEFAULT_RECORD_RIGHT_PATH          WM_AUDIO_LINEIN

/*
 * Whether to enable ALC (Auto Level Control) in record profiles.
 * ALC controls the level of the input signal and tries to keep
 * it at a constant level.
 */
#define WM_ENABLE_ALC                               FALSE

 /*
 * Whether to enable side tone in record profiles.  Side tone allows the
 * recorded signal to be heard on the analogue outputs as well.
 */
#define WM_ENABLE_SIDETONE                          TRUE

/******************************************************************************
 * Power configuration.
 */

/*
 * Should we cache the power state or not.
 * Only define this as TRUE if all users of the device are going through the 
 * Wolfson library - otherwise you may find the library turns off the device when 
 * something else is using it.
 */
#ifndef WM_CACHE_POWER_STATE
#   define WM_CACHE_POWER_STATE                     FALSE
#endif


/******************************************************************************
 * Shadow register configuration.
 */

/*
 * Should we cache the registers or not in our global memory area.  This
 * allows many register reads to be satisfied from memory, saving a slow
 * codec read operation and increasing performance.
 * 
 * Only define this to TRUE if all users of the device are going through the 
 * Wolfson library - otherwise you may find that the registers on the device
 * and what the library has cached are out of sync.
 * 
 * Note: codecs which do not support full register readback require shadow
 * registers to work.
 */
#ifndef WM_USE_SHADOW_REGISTERS
#   define WM_USE_SHADOW_REGISTERS                  TRUE
#endif


/******************************************************************************
 * Configuration common to both touch and AuxADC (digitiser).
 */

/*
 * The modes of operation to support.
 *
 * WM_STREAM_AUXADC == TRUE => polling and streaming mode
 * WM_STREAM_AUXADC == FALSE => polling mode only
 */
#ifndef WM_STREAM_AUXADC
#   define WM_STREAM_AUXADC                                 TRUE
#endif

/*
 * The AC-Link slot which ADC readings are sent across if using
 * continuous mode.
 *
 * May be any slot between 5 and 11 (assuming your controller
 * supports it).
 */
#if WM_STREAM_AUXADC
#   define WM97_AUXADC_SLOT                         WM97_TOUCHCTRL_SLT_5
#endif


/******************************************************************************
 * Touch screen configuration.
 */

/*
 * WM_TOUCH_SAMPLE_RATE is the constant that decides the sampling rate of
 * the touch controller's ADC, in points per second.  The device will be
 * configured to generate samples at this frequency or faster (depending
 * on the options on the given device).
 * 
 * The sample rate used in configuration will be the faster of
 * WM_TOUCH_SAMPLE_RATE and WM_DIGITISER_SAMPLE_RATE.
 */
#define WM_TOUCH_SAMPLE_RATE                      120

/*
 * Define WM_TOUCH_CAPS as TRUE  if using a 4-wire touch screen and there 
 * are decoupling capacitors - a longer delay is needed.
 * See Application Note: WAN0133 Touchscreen performance improvement Techniques
 */
#ifndef WM_TOUCH_CAPS
#   if WM_TOUCH_4WIRE
#       define WM_TOUCH_CAPS                       TRUE
#   else
        /* Capacitors are not need for a 5-wire touch screen */
#       define WM_TOUCH_CAPS                       FALSE
#   endif   /* WM_TOUCH_4WIRE */
#endif /* !WM_TOUCH_CAPS */

/*
 * WM_TOUCH_PEN_SENSITIVITY controls how hard the user has to press on the
 * touch panel before it registers as pen down.  You should set this to a
 * value which gives reasonable sensitivity, but be careful it is not too
 * sensitive.  If the pen detect is too sensitive, it may register points
 * when the touch panel is not getting a good enough contact to read accurately,
 * so if you are seeing strange points you should try increasing this value
 * to reduce the sensitivity.
 * 
 * The value is between 1 and 63, with 1 being most sensitive and 63 being
 * least sensitive.
 * 
 * Note: this does not affect the WM9705.
 */
#if WM_TOUCH_CAPS
#   define WM_TOUCH_PEN_SENSITIVITY               8
#else
#   define WM_TOUCH_PEN_SENSITIVITY               1
#endif

/*
 * A threshold to define whether the difference between two points is
 * acceptable.  Note this can be quite large because all we're concerned
 * about here is throwing out ridiculous points.  Minor jitter will be
 * cleaned up by the averaging.
 *
 * This value should be greater than the biggest difference you will
 * ever see between two points if the user is scribbling hard.  Maximum
 * is 0xFFF (but that's effectively accepting all points).
 */

⌨️ 快捷键说明

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