Skip to content

Commit 825b0ca

Browse files
authored
Merge pull request #4456 from JiangYangJie/master
[ab32vg1] add GET_PIN(PORTx,PIN)
2 parents ca867e8 + 137bcdd commit 825b0ca

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

bsp/bluetrum/libraries/hal_drivers/drv_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
#include <rthw.h>
1616
#include <rtdevice.h>
1717

18+
#define GET_PIN(PORTx,PIN) (uint8_t)__AB32_GET_PIN_##PORTx(PIN)
19+
1820
#endif // DRV_COMMON_H__

bsp/bluetrum/libraries/hal_drivers/drv_gpio.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#include "board.h"
1616

1717
#define __AB32_PORT(port) GPIO##port
18+
#define __AB32_GET_PIN_A(PIN) PIN
19+
#define __AB32_GET_PIN_B(PIN) 8 + PIN
20+
#define __AB32_GET_PIN_E(PIN) 13 + PIN
21+
#define __AB32_GET_PIN_F(PIN) 21 + PIN
1822

1923
int rt_hw_pin_init(void);
2024

0 commit comments

Comments
 (0)