📄 hi_gpio.h
字号:
/****************************************************************************** Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : hi_gpio.h Version : Initial Draft Author : Hisilicon multimedia software group Created : 2004/05/26 Last Modified : Description : General purpose input and output driver header file Function List : History : 1.Date : 2004/05/26 Author : yuanyabin Modification: Created file******************************************************************************/#ifndef __HI_INC_GPIO_H__#define __HI_INC_GPIO_H__#ifdef __cplusplus#if __cplusplusextern "C"{#endif#endif /* __cplusplus *//* Base register description*//* It should be placed in the file of board config header file ECSBoard.h *//* #define GPIO_BASE 0x101E4000 *//* Register read macro definition */#ifndef GPIO_REG_READ#define GPIO_REG_READ(reg,result) ((result) = *(volatile UINT32 *)(reg))#endif /* Register write macro definition */#ifndef GPIO_REG_WRITE#define GPIO_REG_WRITE(reg,data) (*((volatile UINT32 *)(reg)) = (data))#endif typedef void (*T_GPIOInterruptHandler)();/* set the mode of the gpio path pins 1:hardware control; 0:software control,reset default.*//* set the mode of the gpio path pins 1:hardware control; 0:software control,reset default.*/HI_RET GPIO_ModeSet(HI_IN UINT8 u8GpioPathNum , HI_IN UINT8 u8Mode);/*Get the mode of the gpio path pins*/HI_RET GPIO_ModeGet(HI_IN UINT8 u8GpioPathNum ,HI_OUT UINT8 * pu8Mode );/* Set the direction of the single bit for the specific path *//* DirBit=1 means output; *//* DirBit=0 means input. */HI_RET GPIO_DirSetBit(HI_IN UINT8 u8GpioPathNum, HI_IN UINT8 u8Bitx, HI_IN UINT8 u8DirBit);/* Set the input or output direction for the total path */HI_RET GPIO_DirSetByte(HI_IN UINT8 u8GpioPathNum, HI_IN UINT8 u8DirByte);/* Get the input or output direction for a specific pin of a port */HI_RET GPIO_DirGetBit(HI_IN UINT8 u8GpioPathNum, HI_IN UINT8 u8Bitx , HI_OUT UINT8 *pu8DirBit);/* Get the input or output direction for the total path */HI_RET GPIO_DirGetByte(HI_IN UINT8 u8GpioPathNum ,HI_OUT UINT8 *pu8DirByte);/*Bit write the value from a specific bit of a gpio path*/HI_RET GPIO_WriteBit(HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 u8Bitx ,HI_IN UINT8 u8BitValue);/*Byte write the value of a specific gpio path*/HI_RET GPIO_WriteByte(HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 u8ByteValue);/*Bit read the value from a specific bit of a gpio path*/HI_RET GPIO_ReadBit(HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 u8Bitx ,HI_OUT UINT8 * pu8readBit);/*Byte read the value of a specific gpio path*/HI_RET GPIO_ReadByte (HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 * pu8readByte);/* Enable single interrupt bit*/HI_RET GPIO_InterruptEnable(HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 u8Bitx);/* Disable single interrupt bit*/HI_RET GPIO_InterruptDisable (HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 u8Bitx);/* Register an interrupt callback to a specific gpio pin .*/HI_RET GPIO_InterruptRegisterCallback(HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 u8Bitx, HI_IN T_GPIOInterruptHandler pcallback);/* UnRegister an interrupt callback to a specific gpio pin .*/HI_RET GPIO_InterruptUnRegisterCallback(HI_IN UINT8 u8GpioPathNum ,HI_IN UINT8 u8Bitx);/* Interrupt mode set:include BothnSingle,LevelnEdge,RisingnFalling. */HI_RET GPIO_InterruptSet( HI_IN UINT8 u8GpioPathNum , HI_IN UINT8 u8Bitx , HI_IN UINT8 u8BothnSingle, HI_IN UINT8 u8LevelnEdge, HI_IN UINT8 u8RisingnFalling );/* Individual port interrupt service routine */void GPIO_Interrupt0(void);void GPIO_Interrupt1(void);void GPIO_Interrupt2(void);void GPIO_Interrupt3(void);/* User defined gpio service routines *//* Here just one routine assigned to pin0 of port0,just as a demo *//* Also this routine can be defined in the app programm. */#ifdef __cplusplus#if __cplusplus}#endif#endif /* __cplusplus */#endif /* End of #ifndef __HI_INC_GPIO_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -