gpioreg.h

来自「windows mobile 6.13 dnldr下载源码」· C头文件 代码 · 共 71 行

H
71
字号
/*******************************************************************************
 * Copyright:   Copyright (c) 2007. Hisilicon Technologies, CO., LTD. 
 * Version:     V300R001B01
 * Filename:    usp_gpio.h
 * Description: Defines the GPIO register layout and associated types and constants.
 * History:
                1.Created by SunShaojie on 2007/08/31
*******************************************************************************/

#ifndef __GPIO_REG_H_
#define __GPIO_REG_H_

//------------------------------------------------------------------------------
// GPIO group define
//------------------------------------------------------------------------------
#define GPIO_GROUP0     0x00
#define GPIO_GROUP1     0x10
#define GPIO_GROUP2     0x20
#define GPIO_GROUP3     0x30
#define GPIO_GROUP4     0x40
#define GPIO_GROUP5     0x50
#define GPIO_GROUP6     0x60
#define GPIO_GROUP7     0x70
#define GPIO_GROUP8     0x80
#define GPIO_GROUP9     0x90
#define GPIO_GROUP10    0xA0
#define GPIO_GROUP11    0xB0
#define GPIO_GROUP12    0xC0
#define GPIO_GROUP13    0xD0

// GPIO Group bit mask
#define GPIO_GROUP_MASK 0xf0
#define GPIO_GROUP_BIT_POS  4

// The max number of GPIO group
#define GPIO_GROUP_MAX  14

// The number of GPIO interrupt group
#define GPIO_INTR_GROUP_NUM     14

//------------------------------------------------------------------------------
// GPIO Function Select. Please notice that GPIO17~GPIO29 
// belong to one function select group, and GPIO30~GPIO45 belong 
// to another group, and GPIO46~GPIO52 belong to third group. 
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// GPIO address define
//------------------------------------------------------------------------------

//#define BASE_ADDR_GPIO(i)      (BASE_ADDR_GPIO_GROUP##i)

//------------------------------------------------------------------------------
// The struct defined for GPIO register.
//------------------------------------------------------------------------------
typedef struct {
    ULONG DATA;                    // GPIO data
    ULONG DIR;                     // GPIO direction: 0-input, 1-output
    ULONG INTSENSE;                // interrupt sense: 0-edge, 1-level
    ULONG INTEDGE;                 // interrupt sense: 0-single edge, 1-double edge
    ULONG INTEVENT;                // interrupt event: 0-down edge(low level), 1-up edge(high level)
    ULONG INTMASK;                 // interrupt mask: 0-mask interrupt
    ULONG INTRAWSTATUS;            // raw interrupt status: 1-have interrupt
    ULONG INTMASKEDSTATUS;         // masked interrupt status: 1-have interrupt
    ULONG INTCLEAR;                // clear interrupt: set 1 to clear
    ULONG MODE;                    // GPIO mode control select: 0-software, 1-hardware
} USP_GPIO_REG, *PUSP_GPIO_REG;

#endif

⌨️ 快捷键说明

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