enchw.h
来自「freescale i.mx31 BSP CE5.0全部源码」· C头文件 代码 · 共 68 行
H
68 行
/*------------------------------------------------------------------------------
-- --
-- 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 + =
减小字号Ctrl + -
显示快捷键?