Browse Source

Merge pull request #4456 from JiangYangJie/master

[ab32vg1] add GET_PIN(PORTx,PIN)
Bernard Xiong 4 years ago
parent
commit
825b0ca498

+ 2 - 0
bsp/bluetrum/libraries/hal_drivers/drv_common.h

@@ -15,4 +15,6 @@
 #include <rthw.h>
 #include <rthw.h>
 #include <rtdevice.h>
 #include <rtdevice.h>
 
 
+#define GET_PIN(PORTx,PIN) (uint8_t)__AB32_GET_PIN_##PORTx(PIN)
+
 #endif // DRV_COMMON_H__
 #endif // DRV_COMMON_H__

+ 4 - 0
bsp/bluetrum/libraries/hal_drivers/drv_gpio.h

@@ -15,6 +15,10 @@
 #include "board.h"
 #include "board.h"
 
 
 #define __AB32_PORT(port)   GPIO##port
 #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);
 int rt_hw_pin_init(void);