#include "t_define.h" #include "t_bk3231sf.h" #include "t_icu.h" //#include "useruart.h" //#include "userpower.h" #include "t_gpio.h" // #include "useradc.h" static GPIO_INT_HANDLE_CB_PFN gpioIntHandleCbPfn = NULL; void GpioGenCfg(uint8 port, uint8 bitoffset, uint32 mode, uint32 io, uint32 pull) { uint32 *preg, regbitmask, temp; preg = (uint32 *)(REG_GPIO_BASE+(port<<3)); regbitmask = (BM_GPIO_MODE<> bitoffset >> BO_GPIO_IN_DATA; return (bool8)temp; } void GpioIntCfg(uint8 port, uint8 bitoffset, uint32 interruptenable, uint32 trigedge) { REG_GPIO0T3_INT_EN = SET_VALUE(REG_GPIO0T3_INT_EN, 1ul<<((port<<3)+bitoffset), interruptenable<<((port<<3)+bitoffset)); REG_GPIO0T3_INT_EDGE = SET_VALUE(REG_GPIO0T3_INT_EDGE, 1ul<<((port<<3)+bitoffset), trigedge<<((port<<3)+bitoffset)); } void GpioIntEnCfg(uint8 port, uint8 bitoffset, uint32 interruptenable) { REG_GPIO0T3_INT_EN = SET_VALUE(REG_GPIO0T3_INT_EN, 1ul<<((port<<3)+bitoffset), interruptenable<<((port<<3)+bitoffset)); } void GpioInTrigedgeCfg(uint8 port, uint8 bitoffset, uint32 trigedge) { REG_GPIO0T3_INT_EDGE = SET_VALUE(REG_GPIO0T3_INT_EDGE, 1ul<<((port<<3)+bitoffset), trigedge<<((port<<3)+bitoffset)); } void GpioDeepWakeupCfg(uint8 port, uint8 bitoffset, uint32 wakeupenable) { REG_ICU_GPIO0T3_DEEP_WAKEUP_EN = SET_VALUE(REG_ICU_GPIO0T3_DEEP_WAKEUP_EN, (1ul<<((port<<3))<