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

📄 wmcounters.h

📁 pxa270平台 windows mobile 5.2 wm9713 触摸屏+音频驱动
💻 H
字号:
/*-----------------------------------------------------------------------------
 * 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: WMCounters.h 2326 2005-10-20 08:40:38Z ib $
 *
 * Global data for Wolfson drivers.
 *
 * Warning:
 *  This driver is specifically written for Wolfson Codecs. It is not a 
 *  general CODEC device driver.
 *
 *---------------------------------------------------------------------------*/
#ifndef __WMCOUNTERS_H__
#define __WMCOUNTERS_H__

#include "WMCommon.h"

/*
 * The bank of counters.  This gets included in the driver globals area.
 */
typedef WMAtomic_t WMCounter_t;
typedef struct  tagWMCounters
{
    WMCounter_t TouchPenDowns;
    WMCounter_t TouchPenUps;
    WMCounter_t TouchReadings;
    WMCounter_t TouchErrors;
    WMCounter_t LinkLockCount;
    WMCounter_t GlobalLockCount;
#if APITEST
    WMCounter_t TestCounter1;
    WMCounter_t TestCounter2;
#endif /* APITEST */
} WMCounters;

/*
 * Macros to manage the counters.
 */
/* 
 * WM_COUNTER relies on the caller checking that the global data
 * is valid.
 */
#define WM_COUNTER( _hDevice, _c )                                              \
            WMHANDLE_TO_DEVICE( hDevice )->v_pWMData->Counters._c               
#define WM_INCREMENT_COUNTER( _hDevice, _c ) (                                  \
            ( NULL != WMHANDLE_TO_DEVICE( hDevice )->v_pWMData ) ?              \
            WMAtomicIncrement( _hDevice, &WM_COUNTER( _hDevice, _c ) ) :        \
            0 )
#define WM_DECREMENT_COUNTER( _hDevice, _c ) (                                  \
            ( NULL != WMHANDLE_TO_DEVICE( hDevice )->v_pWMData ) ?              \
            WMAtomicDecrement( _hDevice, &WM_COUNTER( _hDevice, _c ) ) :        \
            0 )
#define WM_RESET_COUNTER( _hDevice, _c ) (                                      \
            ( NULL != WMHANDLE_TO_DEVICE( hDevice )->v_pWMData ) &&             \
            WM_COUNTER( _hDevice, _c ) = 0                                      \
            )
#define WM_RESET_ALL_COUNTERS( _hDevice ) (                                     \
            ( NULL != WMHANDLE_TO_DEVICE( hDevice )->v_pWMData ) &&             \
            memset( (void *)&WMHANDLE_TO_DEVICE( hDevice )->v_pWMData->Counters,\
                    0,                                                          \
                    sizeof( WMHANDLE_TO_DEVICE( hDevice )->v_pWMData->Counters )\
                  )                                                             \
            )
#define WM_TRACE_COUNTER( _hDevice, _c ) (                                      \
            ( NULL != WMHANDLE_TO_DEVICE( hDevice )->v_pWMData ) &&             \
            WM_TRACE( _hDevice,                                                 \
                      ( "WM counter %s: %d",                                    \
                        #_c,                                                    \
                        WM_COUNTER( _hDevice, _c )                              \
                    ))                                                          \
            )

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

⌨️ 快捷键说明

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