serio.h

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· C头文件 代码 · 共 104 行

H
104
字号
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995, 1996, 1997  Microsoft Corporation
Copyright (c) NEC Electronics Inc. 1998.

Module Name:

serio.h

Abstract:


Functions:


Notes:

  For VR4102 evaluation board Code

--*/
#ifndef __SERIO_H__
#define __SERIO_H__

#ifdef __cplusplus
extern "C" {
#endif

#ifdef DEF_ENTITY
#define EXT_EXT
#else
#define EXT_EXT extern
#endif /*DEF_ENTITY*/


/*
 *### misc tools
 */

#define InterlockedBitOff8(pb,b)    InterlockedAndOr8(pb, (BYTE)(~(b)), 0)
#define InterlockedBitOn8(pb,o)     InterlockedAndOr8(pb, 0xff, o)

#define READ_VALUE8(x, y)           ((x) = *((volatile UCHAR *)(y)))
#define WRITE_VALUE8(x, y)          (*((volatile UCHAR *)(x)) = (y))
#define DISABLE_BITS8(x, y)         InterlockedBitOff8((PBYTE)x, (BYTE)y)
#define ENABLE_BITS8(x, y)          InterlockedBitOn8((PBYTE)x, (BYTE)y)

#define InterlockedBitOff16(pw,b)   InterlockedAndOr16(pw, (WORD)(~(b)), 0)
#define InterlockedBitOn16(pw,o)    InterlockedAndOr16(pw, 0xffff, o)

#define READ_VALUE16(x, y)          ((x) = *((volatile USHORT *)(y)))
#define WRITE_VALUE16(x, y)         (*((volatile USHORT *)(x)) = (y))
#define DISABLE_BITS16(x, y)        InterlockedBitOff16((PWORD)x, (WORD)y)
#define ENABLE_BITS16(x, y)         InterlockedBitOn16((PWORD)x, (WORD)y)


typedef struct {
    ULONG       cmuclkmsk;
} CmuRegs;
EXT_EXT CmuRegs VRCmuRegs;


// General Purpose I/O Unit Registers

typedef struct {
    ULONG       giupiod;
    ULONG       giuintstat;
    ULONG       giuintalsell;
} GiuRegs;
EXT_EXT GiuRegs VRGiuRegs;


#define SIUIID_FC_MODE      FCR3

#define IRMSEL_TEMIC        IRMSEL0
#define IRMSEL_HP           IRMSEL1

#define SERIAL_FCR_MODE     ((UCHAR)0x08)


typedef struct {
    ULONG       siurb_th;
    ULONG       siuie;
    ULONG       siuiid_fc;
    ULONG       siulc;
    ULONG       siumc;
    ULONG       siuls;
    ULONG       siums;
    ULONG       siusc;
    ULONG       siuirsel;
    ULONG       siureset;
    ULONG       siucsel;
} SiuRegs;
EXT_EXT SiuRegs ASICSiuRegs;


#ifdef __cplusplus
}
#endif

#endif __SERIO_H__

⌨️ 快捷键说明

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