add GET_PIN(PORTx,PIN)

Signed-off-by: JiangYangJie <JiangYangJie@126.com>
This commit is contained in:
JiangYangJie 2021-03-14 18:47:54 +08:00
parent ca867e8c06
commit 137bcdd5b4
2 changed files with 6 additions and 0 deletions

View File

@ -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__

View File

@ -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);