📄 wmconfig.h
字号:
#define WM_TOUCH_COORD_VARIANCE 0x100
/*
* The number of points to use for smoothing.
* Maximum supported is 16.
*
* Note: this does _not_ affect the number of samples returned - the
* points are stored in a rolling buffer so a point can be returned
* for every sample read.
*/
#define WM_NUM_SAMPLES_PER_POINT 6
/*
* The number of points to reject when the pen first goes down.
*/
#define WM_TOUCH_NUM_REJECT 0
/*
* The number of milliseconds to allow after pen up before we decide it is
* a genuine pen up. This allows us to ignore bounces.
*/
#define WM_DEBOUNCE_TIME 20
/*
* Define these to invert the touch screen readings so
* that low and high are swapped.
*/
#ifndef WM_TOUCH_INVERT_X
# define WM_TOUCH_INVERT_X FALSE
#endif
#ifndef WM_TOUCH_INVERT_Y
# define WM_TOUCH_INVERT_Y FALSE
#endif
/*
* Touch screen type. Note these are mutually exclusive.
*/
#if !defined(WM_TOUCH_4WIRE) && !defined(WM_TOUCH_5WIRE)
# define WM_TOUCH_4WIRE TRUE
# define WM_TOUCH_5WIRE FALSE
#endif /* !WM_TOUCH_4WIRE && !WM_TOUCH_5WIRE */
/*
* Whether the PEN detect signal is inverted before reaching the controller.
* For reasons of reduced power consumption, Wolfson touch capable codecs are
* Active High for Pen Detect by default.
* On the 9713 We can invert the signal on the chip for all other touch capable
* codecs an external inverter must be used.
* Define WM_PENIRQ_INVERTED as TRUE to invert the signal.
*/
#ifndef WM_PENIRQ_INVERTED
# define WM_PENIRQ_INVERTED TRUE
#endif
/*
* The delay between requesting a touch panel reading and the reading
* being taken.
*
* This is required for the touch screen to allow the time to settle.
* If decoupling capacitors are used [for a 4-wire touchscreen] then
* a longer delay will have to be used.
*
* WM_TOUCHCTRL_DEL_0 => No delay - switch matrix always on
* WM_TOUCHCTRL_DEL_1 => 1 AC-Link frame
* WM_TOUCHCTRL_DEL_2 => 2 AC-Link frames
* WM_TOUCHCTRL_DEL_4 => 4 AC-Link frames
* WM_TOUCHCTRL_DEL_8 => 8 AC-Link frames
* WM_TOUCHCTRL_DEL_16 => 16 AC-Link frames
* WM_TOUCHCTRL_DEL_32 => 32 AC-Link frames
* WM_TOUCHCTRL_DEL_48 => 48 AC-Link frames
* WM_TOUCHCTRL_DEL_64 => 64 AC-Link frames
* WM_TOUCHCTRL_DEL_128 => 128 AC-Link frames
* WM_TOUCHCTRL_DEL_160 => 160 AC-Link frames
* WM_TOUCHCTRL_DEL_192 => 192 AC-Link frames
* WM_TOUCHCTRL_DEL_224 => 224 AC-Link frames
* WM_TOUCHCTRL_DEL_256 => 256 AC-Link frames
* WM_TOUCHCTRL_DEL_288 => 288 AC-Link frames
*/
#ifndef WM_TOUCH_SETTLE_DELAY
# if WM_TOUCH_CAPS
# define WM_TOUCH_SETTLE_DELAY WM_TOUCHCTRL_DEL_16
# else
# define WM_TOUCH_SETTLE_DELAY WM_TOUCHCTRL_DEL_1
# endif
#endif /* WM_TOUCH_SETTLE_DELAY */
/*
* Touchscreen and Voice DAC both use the GPIO 3 pin on the WM9713/14.
* An alternative is the use of GPIO 7 for PENDOWN. For some
* implementations it may be easier to always use GPIO 7 for PENDOWN.
*
* GPIO 3 will always be used if GPIO 7 is not supported.
* GPIO 7 will be used for PENDOWN on the WM9713/14 if WM_VOICE is defined.
*
* To force GPIO 7 to be used for PENDOWN on the WM9713/14
* define WM_USE_ALTERNATE_PENDOWN as TRUE.
*/
#ifndef WM_USE_ALTERNATE_PENDOWN
# define WM_USE_ALTERNATE_PENDOWN TRUE
#endif
/*
* Define WM_USE_IRQ_PIN as TRUE if you want to use the IRQ pin of the codec to
* signal that an interrupt has occured instead of using PENDOWN pin or bit 0
* of Slot 12. This requires virtual pendown.
*/
#ifndef WM_USE_CODEC_IRQ_PIN
# define WM_USE_CODEC_IRQ_PIN FALSE
#endif
/*
* Use virtual pendown instead of physical pendown pin on the device.
* NOTE: The code assumes that virtual PENDOWN is the only AC97
* GPIO that is going to cause an interrupt.
*/
#ifndef WM_USE_VIRTUAL_PENDOWN
# define WM_USE_VIRTUAL_PENDOWN WM_USE_CODEC_IRQ_PIN
#endif
/******************************************************************************
* Auxiliary ADC and battery configuration.
*/
/*
* WM_DIGITISER_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_DIGITISER_SAMPLE_RATE 25
/*
* The battery reading is divided by three in the hardware to enable it
* to go above VRef.
*
* Uncomment this definition to have the code automatically correct for
* this before returning the sampled value. NB This will mean you can
* get battery values greater than WM_MAX_DATA_VAL returned from
* WMSampleAuxADC.
*/
#ifndef WM_BATTERY_NORMALISE
# define WM_BATTERY_NORMALISE TRUE
#endif
/*
* The delay between requesting a non-touch panel ADC reading and the
* reading being taken.
*
* This may or may not be required, depending on what is connected to
* the ADC.
*
* Values are as WM_TOUCH_SETTLE_DELAY above.
*/
#define WM_AUXADC_SETTLE_DELAY WM_TOUCHCTRL_DEL_1
/******************************************************************************
* Miscellaneous options.
*/
/*
* WM9713_AMR_CARD should be defined as TRUE if you have connected
* a Wolfson WM9713 AMR card to your system.
*/
#define WM9713_AMR_CARD FALSE
/******************************************************************************
* Testing options.
* Note: These will have no affect if WM_TESTING is not #defined
*/
/*
* The square wave generation uses a set of tables synthesised using the
* following formula:
*
* y = sin(1*x)/1 + sin(3*x)/3 + sin (5*x)/5 + ...
*
* The tables give increasingly better approximations to the square wave
* by including more of the partials, however the better approximations
* include higher frequency components. Since the maximum frequency for
* effective sampling is half the sample rate, the higher-order tables are
* increasingly limited in the frequencies they support.
*
* The maximum frequency for the different tables at 44.1kHz is:
*
* Table frequency formula
* 1 22050Hz sample_rate/2
* 2 7350Hz sample_rate/6
* 3 4410Hz sample_rate/10
* 4 3150Hz sample_rate/14
* 5 2450Hz sample_rate/18
* 6 2004Hz sample_rate/22
* 7 1696Hz sample_rate/26
* 8 1470Hz sample_rate/30
* 9 1297Hz sample_rate/34
* 10 1160Hz sample_rate/38
*
* Each table takes 258 bytes of space, so you can save some space by disabling
* some of the tables, using the following macros.
*/
#ifndef WM_SQUAREWAVE_PARTIAL2
# define WM_SQUAREWAVE_PARTIAL2 TRUE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL3
# define WM_SQUAREWAVE_PARTIAL3 TRUE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL4
# define WM_SQUAREWAVE_PARTIAL4 TRUE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL5
# define WM_SQUAREWAVE_PARTIAL5 FALSE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL6
# define WM_SQUAREWAVE_PARTIAL6 TRUE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL7
# define WM_SQUAREWAVE_PARTIAL7 TRUE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL8
# define WM_SQUAREWAVE_PARTIAL8 FALSE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL9
# define WM_SQUAREWAVE_PARTIAL9 FALSE
#endif
#ifndef WM_SQUAREWAVE_PARTIAL10
# define WM_SQUAREWAVE_PARTIAL10 TRUE
#endif
/******************************************************************************
* The following macros configure whether test code is built, how it behaves,
* and whether a basic set of tests should be run when the device is opened.
*/
/*
* How the test code should behave.
* Uncomment this to have tests ASSERT if they fail.
* Leave it commented out to have tests return a status if they fail.
*/
#ifndef WM_TESTING_ASSERT
# define WM_TESTING_ASSERT TRUE
#endif
/*
* Whether to run sanity tests when opening the device.
*/
#ifndef WM_AUTOTEST_BASIC
# define WM_AUTOTEST_BASIC TRUE
#endif
/*
* Whether to run audio tests.
*/
#ifndef WM_AUTOTEST_AUDIO
# define WM_AUTOTEST_AUDIO TRUE
#endif
/*
* Whether to run GPIO control tests.
*/
#if WM_GPIO_CONTROL
# ifndef WM_AUTOTEST_GPIO_CONTROL_BASIC
# define WM_AUTOTEST_GPIO_CONTROL_BASIC TRUE
# endif
/*
* For the advanced tests to pass on codecs that support GPIO,
* the GPIOs defined below as GPIO_TEST_1 & GPIO_TEST_2
* _MUST_ be connect together.
* If it is not possible for you to do this, do not
* run the GPIO control advanced tests.
*/
# ifndef WM_AUTOTEST_GPIO_CONTROL_ADVANCED
# define WM_AUTOTEST_GPIO_CONTROL_ADVANCED FALSE
# endif
# if WM_AUTOTEST_GPIO_CONTROL_ADVANCED
# define GPIO_TEST_1 WM_GPIO_2
# define GPIO_TEST_2 WM_GPIO_3
# endif
#else /* WM_GPIO_CONTROL */
# ifndef WM_AUTOTEST_GPIO_CONTROL_BASIC
# define WM_AUTOTEST_GPIO_CONTROL_BASIC FALSE
# endif
# ifndef WM_AUTOTEST_GPIO_CONTROL_ADVANCED
# define WM_AUTOTEST_GPIO_CONTROL_ADVANCED FALSE
# endif
#endif /* WM_GPIO_CONTROL */
/******************************************************************************
* Diagnostic configuration.
*/
/*
* Define WM_DEBUG_CHECK_CODEC_READY as TRUE to assert in debug builds
* if the CODEC READY bit is not seen in WM97PlatformWarmReset().
* This is an indication of a hardware problem.
*/
#ifndef WM_DEBUG_CHECK_CODEC_READY
# define WM_DEBUG_CHECK_CODEC_READY FALSE
#endif
/*
* To trace register reads and writes on the debug console, define
* WM_DEBUG_TRACE_REGISTERS to TRUE.
* Note : This adds a lot of debug overhead and will effect performance.
* You may find that the audio performance suffers when using the
* touch screen, for instance.
*/
#ifndef WM_DEBUG_TRACE_REGISTERS
# define WM_DEBUG_TRACE_REGISTERS FALSE
#endif
/*
* By default, if shadow registers are enabled, we don't do register writes
* if the value hasn't changed. To force register writes at all times, set
* WM_DEBUG_WRITE_THROUGH to TRUE.
*/
#ifndef WM_DEBUG_WRITE_THROUGH
# define WM_DEBUG_WRITE_THROUGH FALSE
#endif
/*
* WMDebugJacket allows you to perform register operations from within
* the symbolic debugger. It is built in debug mode, but does not break
* by default. To build it in release mode, or to force it to stop at
* a breakpoint when called, set WM_USE_DEBUG_JACKET to TRUE.
*/
#ifndef WM_USE_DEBUG_JACKET
# define WM_USE_DEBUG_JACKET FALSE
#endif
/*
* To help debug muxtex locking problems define
* WM_MUTEX_LOCK_DEBUG as TRUE.
*/
#ifndef WM_MUTEX_LOCK_DEBUG
# define WM_MUTEX_LOCK_DEBUG FALSE
#endif
/*
* This is the maximum number of recursive locks which are allowed in debug
* mode. If the entry count on a given lock goes above this number the
* WDCL will assert. If you do hit this assertion, it is probably an
* indication of a lock being taken and not unlocked.
*/
#ifndef WM_MAX_MUTEX_LOCK_DEPTH
# define WM_MAX_MUTEX_LOCK_DEPTH 10
#endif
/*
* This is the maximum number of recursive locks which are allowed in debug
* mode. If the entry count on a given lock goes above this number the
* WDCL will assert. If you do hit this assertion, it is probably an
* indication of a lock being taken and not unlocked.
*/
#ifndef WM_MAX_MUTEX_LOCK_DEPTH
# define WM_MAX_MUTEX_LOCK_DEPTH 10
#endif
/*
* For addition debugging information displayed on a platforms hex leds
* define WMDEBUG_HEX_LEDS as TRUE.
* See inc\WMDiagnostics.h for more details.
*/
#ifndef WMDEBUG_HEX_LEDS
# define WMDEBUG_HEX_LEDS FALSE
#endif
/******************************************************************************
* Platform and Device specific configuration.
*/
#include "WMPlatformConfig.h"
#include "WMConfigInternal.h"
#endif /* __WMCONFIG_H__ */
/*------------------------------ END OF FILE ---------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -