summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bsp/bluetrum/libraries/hal_drivers/drv_common.h2
-rw-r--r--bsp/bluetrum/libraries/hal_drivers/drv_gpio.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_common.h b/bsp/bluetrum/libraries/hal_drivers/drv_common.h
index 0696bb17f3..3af014f49a 100644
--- a/bsp/bluetrum/libraries/hal_drivers/drv_common.h
+++ b/bsp/bluetrum/libraries/hal_drivers/drv_common.h
@@ -15,4 +15,6 @@
#include <rthw.h>
#include <rtdevice.h>
+#define GET_PIN(PORTx,PIN) (uint8_t)__AB32_GET_PIN_##PORTx(PIN)
+
#endif // DRV_COMMON_H__
diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h
index 7955a47d11..55cf2efc00 100644
--- a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h
+++ b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h
@@ -15,6 +15,10 @@
#include "board.h"
#define __AB32_PORT(port) GPIO##port
+#define __AB32_GET_PIN_A(PIN) PIN
+#define __AB32_GET_PIN_B(PIN) 8 + PIN
+#define __AB32_GET_PIN_E(PIN) 13 + PIN
+#define __AB32_GET_PIN_F(PIN) 21 + PIN
int rt_hw_pin_init(void);