summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorJiangYangJie <[email protected]>2021-03-14 18:47:54 +0800
committerJiangYangJie <[email protected]>2021-03-14 18:47:54 +0800
commit137bcdd5b420060042285390fdeca39b1f72e7f5 (patch)
treeaac7b80e9755b2ff3dcefa2d9d87542900428ce2 /bsp
parentca867e8c0620af7e48f4bfa6ea82d4e271b5ce4a (diff)
add GET_PIN(PORTx,PIN)
Signed-off-by: JiangYangJie <[email protected]>
Diffstat (limited to 'bsp')
-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);