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

📄 wmconfiginternal.h

📁 pxa270平台 windows mobile 5.2 wm9713 触摸屏+音频驱动
💻 H
📖 第 1 页 / 共 2 页
字号:
 * If we're not doing audio, we're not going to to need any audio support.
 */
#if !WM_AUDIO
#   undef WM_VOICE
#   define WM_VOICE									FALSE
#	undef WM_AUDIO_STREAM
#	define WM_AUDIO_STREAM							FALSE
#endif

/*
 * Whether it's AC'97.
 */
#if WM_AC97
#   define WM_IS_AC97( _hDevice ) ( IS_WM9705_FAMILY( _hDevice ) || \
									IS_WM9707_FAMILY( _hDevice ) || \
									IS_WM9712_FAMILY( _hDevice ) || \
									IS_WM9713_FAMILY( _hDevice )    \
								  )

#   define WM_IS_AC97_DEVICE_ID( _ID )  WM_CHIP_IS_AC97( WM_DEV_GET_CHIP( _ID ) )
#   define WM_IS_AC97_GENERIC_ID( _ID ) ( WM_DEV_AC97 == WM_DEV_GET_CHIP( _ID ) )
#else
#	define WM_IS_AC97( _hDevice )					FALSE
#	define WM_IS_AC97_DEVICE_ID( _ID )				FALSE
#   define WM_IS_AC97_GENERIC_ID( _ID )             FALSE
#endif /* WM_AC97 */

/*
 * Whether it's I2S.
 */
#if WM_I2S
#   define WM_IS_I2S( _hDevice ) ( IS_WMI2S_GENERIC_FAMILY( _hDevice ) || \
                                   IS_WM8731_FAMILY( _hDevice )   || \
                                   IS_WM8753_FAMILY( _hDevice )      \
                                 )

#   define WM_IS_I2S_DEVICE_ID( _ID )                               \
                     ( WM_DEV_I2S == WM_DEV_GET_CHIP( _ID )      || \
                       IS_WMI2S_GENERIC_FAMILY_ID(_ID)           || \
                       IS_WM8731_FAMILY_ID(_ID)                  || \
                       IS_WM8753_FAMILY_ID(_ID)                     \
                     )

#   define WM_IS_I2S_GENERIC_ID( _ID )                              \
                     ( IS_WMI2S_GENERIC_FAMILY_ID(_ID) )
#else
   #define WM_IS_I2S( _hDevice )                    FALSE
   #define WM_IS_I2S_DEVICE_ID( _ID )               FALSE
   #define WM_IS_I2S_GENERIC_ID( _ID )              FALSE
#endif /* WM_I2S */

#define WM_IS_GENERIC_FAMILY( _hDevice )  ( IS_WMI2S_GENERIC_FAMILY(_hDevice) )

#define WM_IS_GENERIC_ID( _ID )  ( WM_IS_I2S_GENERIC_ID(_ID) ||  \
								   WM_IS_AC97_GENERIC_ID(_ID)    \
								 )

/*
 * Whether it's supported at all.
 */
#define WM_IS_DEVICE_SUPPORTED( _ID )   ( WM_IS_AC97_DEVICE_ID( _ID ) || \
                                          WM_IS_I2S_DEVICE_ID( _ID ) )

/*
 * The products which have DAC support.
 */

#define WM_DAC_DEVICES	( WM9703 ||           \
						  WM9705 || WM9707 || \
						  WM9708 || WM9710 || \
						  WM9712 || WM9713 || \
						  WM9714 || WM9717 || \
						  WMI2S_GENERIC    || \
                          WM8711 || WM8721 || \
						  WM8731 || WM8734 || \
                          WM8753 )

#if WM_DAC_DEVICES
#   if WM_DAC
#       define WM_IS_DAC_SUPPORTED( _hDevice )  \
             ( IS_WM9705_FAMILY( _hDevice ) || IS_WM9707_FAMILY( _hDevice )  || \
			   IS_WM9712_FAMILY( _hDevice ) || IS_WM9713_FAMILY( _hDevice )  || \
			   IS_WMI2S_GENERIC_FAMILY( _hDevice )                                || \
			   IS_WM8731_FAMILY( _hDevice ) || IS_WM8753_FAMILY( _hDevice ) )
#   else
#       define WM_IS_DAC_SUPPORTED( _hDevice )   FALSE
#   endif
#else
#   define WM_IS_DAC_SUPPORTED( _hDevice )       FALSE
#   undef WM_DAC
#   define WM_DAC                                FALSE
#endif
 
/*
 * The products which have ADC support.
 */
#define WM_ADC_DEVICES	( WM9703 ||           \
						  WM9705 || WM9707 || \
						  WM9708 || WM9710 || \
						  WM9712 || WM9713 || \
						  WM9714 || WM9717 || \
                          WM8711 || WM8721 || \
						  WM8731 || WM8734 || \
                          WM8753 )

#if WM_ADC_DEVICES
#   if WM_ADC
#       define WM_IS_ADC_SUPPORTED( _hDevice )  \
             ( IS_WM9705_FAMILY( _hDevice ) || IS_WM9707_FAMILY( _hDevice )  || \
			   IS_WM9712_FAMILY( _hDevice ) || IS_WM9713_FAMILY( _hDevice )  || \
			   IS_WM8731_FAMILY( _hDevice ) || IS_WM8753_FAMILY( _hDevice ) )
#   else
#       define WM_IS_ADC_SUPPORTED( _hDevice )   FALSE
#   endif
#else
#   define WM_IS_ADC_SUPPORTED( _hDevice )       FALSE
#   undef WM_ADC
#   define WM_ADC                                FALSE
#endif

#if WM_AUDIO
#	if ( !WM_DAC ) && ( !WM_ADC )
#		error At least 1 of: WM_DAC and WM_ADC MUST be defined
#	endif
#endif
/*
 * Touch needs AuxADC.
 */
#if WM_TOUCH && !WM_AUXADC
#   undef WM_AUXADC
#   define WM_AUXADC                                TRUE
#endif

/*
 * The products which have touch-screen and AuxADC support.
 */
#if WM9705 || WM9712 || WM9713
#   if WM_TOUCH
#       define WM_IS_TOUCH_SUPPORTED( _hDevice )  \
             (IS_WM9705_FAMILY( _hDevice ) || IS_WM9712_FAMILY( _hDevice ) \
                                           || IS_WM9713_FAMILY( _hDevice ))
#   else
#       define WM_IS_TOUCH_SUPPORTED( _hDevice )    FALSE
#   endif
#   if WM_AUXADC
#       define WM_IS_AUXADC_SUPPORTED( _hDevice ) \
             (IS_WM9705_FAMILY( _hDevice ) || IS_WM9712_FAMILY( _hDevice ) \
                                           || IS_WM9713_FAMILY( _hDevice ))
#   else
#       define WM_IS_AUXADC_SUPPORTED( _hDevice )   FALSE
#   endif
#else
#   define WM_IS_TOUCH_SUPPORTED( _hDevice )        FALSE
#   define WM_IS_AUXADC_SUPPORTED( _hDevice )       FALSE
#   undef WM_TOUCH
#   define WM_TOUCH                                 FALSE
#   undef WM_AUXADC
#   define WM_AUXADC                                FALSE
#endif

/*
 * The products which have GPIO control and monitoring support.
 */
#if WM9712_FAMILY || WM9713_FAMILY || WM8753_FAMILY
#   if WM_GPIO_CONTROL
#       define WM_IS_GPIO_CONTROL_SUPPORTED( _hDevice )  \
             (IS_WM9712_FAMILY( _hDevice ) || \
              IS_WM9713_FAMILY( _hDevice ) || \
              IS_WM8753_FAMILY( _hDevice ))
#   else
#       define WM_IS_GPIO_CONTROL_SUPPORTED( _hDevice )  FALSE
#   endif
#else
#   define WM_IS_GPIO_CONTROL_SUPPORTED( _hDevice )      FALSE
#   undef WM_GPIO_CONTROL
#   define WM_GPIO_CONTROL                               FALSE
#endif

#if WM8753_FAMILY
#   if WM_HEADPHONE_DETECT
#       define WM_IS_HEADPHONE_DETECT_SUPPORTED( _hDevice )  \
             (IS_WM8753_FAMILY( _hDevice ) )
#   else
#       define WM_IS_HEADPHONE_DETECT_SUPPORTED( _hDevice )  FALSE
#   endif
#else
#   define WM_IS_HEADPHONE_DETECT_SUPPORTED( _hDevice )      FALSE
#   undef WM_HEADPHONE_DETECT
#   define WM_HEADPHONE_DETECT                               FALSE
#endif
/*
 * The products which have I2S support.
 */
#if WMI2S_GENERIC_FAMILY || WM8731_FAMILY || WM8753_FAMILY
#   if WM_I2S
#       define WM_IS_I2S_SUPPORTED( _hDevice )   \
             ( IS_WMI2S_GENERIC_FAMILY( _hDevice ) || \
               IS_WM8731_FAMILY( _hDevice )   || \
               IS_WM8753_FAMILY( _hDevice ) )
#   else
#       define WM_IS_I2S_SUPPORTED( _hDevice )      FALSE
#   endif
#else
#   define WM_IS_I2S_SUPPORTED( _hDevice )          FALSE
#   undef WM_I2S
#   define WM_I2S                                   FALSE
#endif

/*
 * The products which have Voice DAC support.
 */
#if WM9713_FAMILY || WM8753_FAMILY
#   if WM_VOICE
#       define WM_IS_VOICE_SUPPORTED( _hDevice )  \
             ( IS_WM9713_FAMILY( _hDevice ) || IS_WM8753_FAMILY( _hDevice ) )
#   else
#       define WM_IS_VOICE_SUPPORTED( _hDevice )	FALSE
#   endif
#else
#   define WM_IS_VOICE_SUPPORTED( _hDevice )		FALSE
#   undef WM_VOICE
#   define WM_VOICE									FALSE
#endif

/*
 * The products which have Mono DAC support.
 */
#if WM9712_FAMILY || WM9713_FAMILY
#   if WM_MONODAC
#       define WM_IS_MONO_SUPPORTED( _hDevice )  \
             ( IS_WM9712_FAMILY( _hDevice ) || IS_WM9713_FAMILY( _hDevice ) )
#   else
#       define WM_IS_MONO_SUPPORTED( _hDevice )		FALSE
#   endif
#else
#   define WM_IS_MONO_SUPPORTED( _hDevice )         FALSE
#   undef WM_MONODAC
#   define WM_MONODAC								FALSE
#endif

/*
 * The products which use ADCSEL to control touch support.
 */
#define WM_USES_ADCSEL( _hDevice )          (IS_WM9713_FAMILY( _hDevice ))

/*
 * The products which have zero-cross.
 */
#define WM_HAS_ZERO_CROSS( _hDevice )       (( IS_WM8753_FAMILY( _hDevice ) \
                                            || IS_WM9712_FAMILY( _hDevice ) \
                                            || IS_WM9713_FAMILY( _hDevice )))
/*
 * The products which have mono DACs.
 */
#define WM_HAS_MONO_DAC( _hDevice )         ( WM_IS_MONO_SUPPORTED( _hDevice ) )

/*
 * The products which have voice DACs.
 */
#define WM_HAS_VOICE_DAC( _hDevice )	    ( WM_IS_VOICE_SUPPORTED( _hDevice ) )

/*
 * The products which have UPDATE bits.
 */
#define WM_HAS_UPDATE( _hDevice )           (( IS_WM8753_FAMILY( _hDevice ) ))

/*
 * The products which have BOTH bits.
 */
#define WM_HAS_BOTH( _hDevice )             (( IS_WM8731_FAMILY( _hDevice ) ))

/*
 * The products which have support for 12K and 24K sample rates.
 */
#define WM_HAS_EXTENDED_SAMPLE_RATES( _hDevice )  \
                                            (( IS_WM8753_FAMILY( _hDevice ) \
                                            || IS_WM9712_FAMILY( _hDevice ) \
                                            || IS_WM9713_FAMILY( _hDevice )))

/*
 * The products which have support for an extended ADC gain range.
 */
#define WM_HAS_EXTENDED_ADC_GAIN_RANGE( _hDevice ) \
                                            ((IS_WM9712_FAMILY( _hDevice ) \
                                            || IS_WM9713_FAMILY( _hDevice )))

/*
 * The choice of PENDOWN GPIO for the WM97xx depends on whether 
 * Voice DAC is supported or WM_USE_ALTERNATE_PENDOWN is defined.
 */
#define WM_PENDOWN_GPIO( _hDevice )         (WM_GPIO_PIN)WM_GPIO_PENDOWN 

#if WM9713_FAMILY
#   if WM_VOICE || WM_USE_ALTERNATE_PENDOWN
#       undef WM_PENDOWN_GPIO 
#       define WM_PENDOWN_GPIO( _hDevice )   \
            (IS_WM9713_FAMILY( _hDevice ) ? (WM_GPIO_PIN)WM_GPIO_SECONDARY_PENDOWN : \
                                            (WM_GPIO_PIN)WM_GPIO_PENDOWN )
#   endif
#endif

/*
 * We use virtual IRQs if we're using virtual GPIO and we're *not* using
 * the IRQ line, but are using slot 12 instead.
 */
#if WM_USE_VIRTUAL_PENDOWN && !WM_USE_CODEC_IRQ_PIN
#   define WM_USE_VIRTUAL_IRQ                   TRUE
#else
#   define WM_USE_VIRTUAL_IRQ                   FALSE
#endif

/******************************************************************************
 * How we set ourselves up for internal builds.
 */
#ifdef WM_INTERNAL_BUILD
#   undef  WM_TESTING    /* defined to FALSE in WMConfig.h if undefined */
#   define WM_TESTING                           TRUE
#   if WM_AC97
#       undef  WM_DEBUG_CHECK_CODEC_READY
#       define WM_DEBUG_CHECK_CODEC_READY       TRUE
#   endif   /* WM_AC97 */
#endif  /* WM_INTERNAL_BUILD */

/*
 * For testing: We find it benificial to use LineIn for recording.
 */
#if WM_TESTING
#    undef WM_AUDIO_DEFAULT_RECORD_LEFT_PATH
#    define WM_AUDIO_DEFAULT_RECORD_LEFT_PATH   WM_AUDIO_LINEIN
#    undef WM_AUDIO_DEFAULT_RECORD_RIGHT_PATH
#    define WM_AUDIO_DEFAULT_RECORD_RIGHT_PATH  WM_AUDIO_LINEIN
#endif /* WM_TESTING */

/******************************************************************************
 * Test code for chip support comparison macros.
#if WM9705
#   if WM9712
#       if !defined( WM_MULTIPLE_CHIP_SUPPORT ) || defined( WM_CHIP_FAMILY )
#           error Multidef
#       else
#           error Multidef correct
#       endif
#   else
#       if WM_HAS_OUT3( 0 )
#           error WM9705/OUT3
#       else
#           error WM9705 correct
#       endif
#   endif
#else
#   if !WM_HAS_OUT3( 0 )
#       error WM9712/OUT3
#   else
#       error WM9712 correct
#   endif
#endif
*/

#endif   /* __WMCONFIGINTERNAL_H__ */
/*------------------------------ END OF FILE ---------------------------------*/

⌨️ 快捷键说明

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