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

📄 enchw.h

📁 freescale i.mx31 BSP CE5.0全部源码
💻 H
字号:
/*------------------------------------------------------------------------------
--                                                                            --
--       This software is confidential and proprietary and may be used        --
--        only as expressly authorized by a licensing agreement from          --
--                                                                            --
--                            Hantro Products Oy.                             --
--                                                                            --
--      In the event of publication, the following notice is applicable:      --
--                                                                            --
--                   (C) COPYRIGHT 2005 HANTRO PRODUCTS OY                    --
--                            ALL RIGHTS RESERVED                             --
--                                                                            --
--          The entire notice above must be reproduced on all copies.         --
--                                                                            --
--------------------------------------------------------------------------------
--
--  Project  : 1200s
--
--  Abstract : Header for encoder HW registers access module
--
-------------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------

    Table of context

    1. Include headers
    2. Module defines
    3. Function prototypes

------------------------------------------------------------------------------*/

#ifndef ENCHW_INCLUDED
#define ENCHW_INCLUDED

/*------------------------------------------------------------------------------
    1. Include headers
------------------------------------------------------------------------------*/

#include "basetype.h"

/*------------------------------------------------------------------------------
    2. Module defines
------------------------------------------------------------------------------*/

typedef struct
{
    PUCHAR  RegBase;   // virtual base address for HW registers
    u32     RegSize;   // size of HW registers mapping
    HANDLE  Mutex;     // mutex lock among users of enchw
} EncHw_t;

#define ENCHW_LOCK(eh,to)    ( WaitForSingleObject((eh)->Mutex, (to))==WAIT_OBJECT_0 )
#define ENCHW_UNLOCK(eh)     ReleaseMutex( (eh)->Mutex )

/*------------------------------------------------------------------------------
    3. Function prototypes
------------------------------------------------------------------------------*/

EncHw_t* EncHw_Init    ( void );
void     EncHw_Release ( EncHw_t* enchw );
void     EncHw_Reset   ( EncHw_t* enchw );
void     EncHw_WriteReg( EncHw_t* enchw, u32 offset, u32 val );
u32      EncHw_ReadReg ( EncHw_t* enchw, u32 offset );

#endif // ENCHW_INCLUDED

⌨️ 快捷键说明

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