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

📄 hwapi_gpio.h

📁 瑞星微公司RK27XX系列芯片的SDK开发包
💻 H
字号:
/******************************************************************/
/*   Copyright (C) 2007 ROCK-CHIPS FUZHOU . All Rights Reserved.  */
/*******************************************************************
File :  hwapi_gpio.h
Desc :  定义GPIO的寄存器结构体\接口函数

Author : huangxinyu
Date : 2007-06-02
Notes :

$Log: hwapi_gpio.h,v $
Revision 1.5  2007/11/26 14:39:02  Huangxinyu
增加GPIO_PullUpDown接口

Revision 1.4  2007/10/15 09:07:07  Huangxinyu
根据RK27提交修改driver

Revision 1.3  2007/10/08 02:38:42  Lingzhaojun
添加版本自动注释脚本

*********************************************************************/
#ifndef _HWAPI_GPIO_H
#define _HWAPI_GPIO_H


/********************************************************************
 GLOBAL MACROS DEFINE
********************************************************************/

/*********************************************************************
 ENUMERATIONS AND STRUCTURES
*********************************************************************/
typedef enum eGPIOPinLevel
{
    GPIO_LOW,
    GPIO_HIGH
}eGPIOPinLevel_t;

typedef enum eGPIOPinDirection
{
    GPIO_IN,
    GPIO_OUT
}eGPIOPinDirection_t;

// Constants for GPIO ports
typedef enum eGPIOPORT
{
    GPIOPortA,
    GPIOPortB,
    GPIOPortC,
    GPIOPortD,
    GPIOPortE,
    GPIOPortF,
    GPIOPORTLast        // for init config cycle num
}eGPIOPORT_t;

typedef enum eGPIOPinNum
{
    GPIOPortA_Pin0,
    GPIOPortA_Pin1,
    GPIOPortA_Pin2,
    GPIOPortA_Pin3,
    GPIOPortA_Pin4,
    GPIOPortA_Pin5,
    GPIOPortA_Pin6,
    GPIOPortA_Pin7,
    GPIOPortB_Pin0,
    GPIOPortB_Pin1,
    GPIOPortB_Pin2,
    GPIOPortB_Pin3,
    GPIOPortB_Pin4,
    GPIOPortB_Pin5,
    GPIOPortB_Pin6,
    GPIOPortB_Pin7,
    GPIOPortC_Pin0,
    GPIOPortC_Pin1,
    GPIOPortC_Pin2,
    GPIOPortC_Pin3,
    GPIOPortC_Pin4,
    GPIOPortC_Pin5,
    GPIOPortC_Pin6,
    GPIOPortC_Pin7,
    GPIOPortD_Pin0,
    GPIOPortD_Pin1,
    GPIOPortD_Pin2,
    GPIOPortD_Pin3,
    GPIOPortD_Pin4,
    GPIOPortD_Pin5,
    GPIOPortD_Pin6,
    GPIOPortD_Pin7,
    GPIOPortE_Pin0,
    GPIOPortE_Pin1,
    GPIOPortE_Pin2,
    GPIOPortE_Pin3,
    GPIOPortE_Pin4,
    GPIOPortE_Pin5,
    GPIOPortE_Pin6,
    GPIOPortE_Pin7,
    GPIOPortF_Pin0,
    GPIOPortF_Pin1,
    GPIOPortF_Pin2,
    GPIOPortF_Pin3,
    GPIOPortF_Pin4,
    GPIOPortF_Pin5,
    GPIOPortF_Pin6,
    GPIOPortF_Pin7,
    GPIOPinNumLast        // for init config cycle num
}eGPIOPinNum_t;

// Constants for gpio interrupt type definition
typedef enum GPIOIntrType
{
    IntrTypeRisingEdge,      // Rising edge triggered
    IntrTypeFallingEdge,      // Falling edge triggered
    IntrTypeHighLevel,         // Level high triggered
    IntrTypeLowLevel,         // Level low triggered
    IntrTypeBothEdge            // Both edge triggered
} GPIOIntrType_c;
/* GPIO E/F 内部上下拉不可配置 */
typedef enum GPIOPullType
{
    GPIOPortA_PullUp,
    GPIOPortB_PullUp,
    GPIOPortC_PullDown,
    GPIOPortD_PullUp,
    GPIOPort_NoPull
}eGPIOPullType_t;


/*********************************************************************
 FUNCTION PROTOTYPES
*********************************************************************/
void GPIO_PowerOnInit(void);
void GPIO_SetPinLevel(eGPIOPinNum_t GPIOPinNum, eGPIOPinLevel_t level);
UINT8 GPIO_GetPinLevel(eGPIOPinNum_t GPIOPinNum);
void GPIO_SetPinDirection(eGPIOPinNum_t GPIOPinNum, eGPIOPinDirection_t direction);
UINT8 GPIO_GetPinDirection(eGPIOPinNum_t GPIOPinNum);
void GPIO_EnableIntr(eGPIOPinNum_t GPIOPinNum);
void GPIO_DisableIntr(eGPIOPinNum_t GPIOPinNum);
void GPIO_SetIntrType(eGPIOPinNum_t GPIOPinNum, GPIOIntrType_c type);
UINT32 GPIO_GetIntrState(void);
void GPIO_ClearIntr(eGPIOPinNum_t GPIOPinNum);
void GPIO_IntrHandler(void);
void GPIO_PullUpDown(eGPIOPinNum_t GPIOPinNum, eGPIOPullType_t GPIOPullUpDown);

#endif /* _HWAPI_GPIO_H */

/*********************************************************************
 END OF FILE
*********************************************************************/

⌨️ 快捷键说明

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