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

📄 wmconfig.h

📁 pxa270平台 windows mobile 5.2 wm9713 触摸屏+音频驱动
💻 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 4546 2007-07-19 12:03:51Z 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"
#include "WMAudioDefs.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.
 */

/*
 * Delay gain changes until a zero-cross is detected, or after a time-out.
 */
#define WM_AUDIO_USE_ZERO_CROSS                     FALSE

/*
 * 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
 * This defaults to WM_AUDIO_MIC in order to pass the Audio tests in the CETK/LTK
 */
#define WM_AUDIO_DEFAULT_RECORD_LEFT_PATH           WM_AUDIO_MIC
#define WM_AUDIO_DEFAULT_RECORD_RIGHT_PATH          WM_AUDIO_MIC

/*
 * 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

/*
 * Pop reduction technique for Muting.
 * On unmuting a PGA this sets the gain to maximum attenuation.
 * It will then step the gain back to its original value. On mute it
 * will do the opposite.
 * Turn this off if you are concerned that all the additional writes
 * to the PGAs are causing a performance problem on your system.
 */
#define WM_OUTPUT_GAIN_RAMP                         TRUE

#ifdef WM_OUTPUT_GAIN_RAMP
/*
 * Sets the number of steps to jump each time when ramping the gain up.
 * This can be used to reduce the number of writes to a PGA
 * before it is back to it's original value.
 */
#   define WM_STEP_JUMP                             2
/*
 * Add a delay after every step. This may help reduce pops/clicks in
 * a system but will probably add or increase zipper noise.
 */
#   define WM_STEP_DELAY                            TRUE
#   ifdef WM_STEP_DELAY
 /*
  * The number of milliseconds to delay each step.
  * Note that this could have serious performance issues and large
  * delays should never be used. A delay of 0 milliseconds can
  * be used as it will cause a task switch which might be enough
  * of a delay in some systems.
  */
#       define WM_STEP_DELAY_MS                     0
#   endif

/*
 * For debug purposes trace the volume step changes in dB to 
 * the output console.
 */
 #  define WM_OUTPUT_GAIN_RAMP_DEBUG                FALSE
#endif 

/*
 * Limit the DAC to a set dB. The hardware default for the DAC is 0dB
 * To reduce pops/clicks and clipping it may be useful to reduce
 * this by a few dB.
 * Set WM_DAC_LIMITER to TRUE if you want to reduce the gain on
 * the DAC.
 * Note - To set the DAC to 0dB define WM_DAC_LIMITER_GAIN to WM_GAIN_0DB.
 */
#define WM_DAC_LIMITER                              TRUE
#ifdef WM_DAC_LIMITER
#   define WM_DAC_LIMITER_GAIN                      WM_GAIN_MINUS_6DB
#endif

/*
 * This can help reduce the number of pops/clicks that will be heard.
 * For example if two samples are played one after the other it would
 * prevent a mute and unmute between the tracks. It is also useful for
 * pause and fast-forward/rewind situations where the stream is stopped
 * for a small amount of time and there is no need to stop, mute, unmute
 * and restart the stream.
 * Note that the timer will reset if playback of a new sample starts before
 * the original timeout has occured.
 */
#define WM_OUTPUT_MUTE_DELAY                        TRUE
#ifdef WM_OUTPUT_MUTE_DELAY
/*
 * The amount of time to delay, in seconds, 
 * before applying mute to the outputs.
 */
#    define WM_OUTPUT_MUTE_DELAY_SECS               5
#endif
/******************************************************************************
 * 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.
 * 

⌨️ 快捷键说明

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