Skip to content

Commit 878635e

Browse files
author
Nathan Seidle
committed
Add fastgpio_read to hal_gpio.
Available in v2.2 of SDK.
1 parent cb98ddf commit 878635e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_gpio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,7 @@ extern "C"
689689
// Note - these macros are most efficient if 'n' is a constant value, and
690690
// of course when compiled with -O3.
691691
//
692+
#define am_hal_gpio_fastgpio_read(n) ((APBDMA->BBINPUT >> (n & 0x7)) & 0x1)
692693
#define am_hal_gpio_fastgpio_set(n) (APBDMA->BBSETCLEAR = _VAL2FLD(APBDMA_BBSETCLEAR_SET, (1 << (n & 0x7))))
693694
#define am_hal_gpio_fastgpio_clr(n) (APBDMA->BBSETCLEAR = _VAL2FLD(APBDMA_BBSETCLEAR_CLEAR, (1 << (n & 0x7))))
694695
#define am_hal_gpio_fastgpio_setmsk(m) (APBDMA->BBSETCLEAR = _VAL2FLD(APBDMA_BBSETCLEAR_SET, m))

0 commit comments

Comments
 (0)