summaryrefslogtreecommitdiff
path: root/src/stm/ao_arch_funcs.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-04-02 19:30:57 -0700
committerKeith Packard <keithp@keithp.com>2017-04-02 19:30:57 -0700
commit09f8710eb320f37f20dda8c635497c2b505d25e2 (patch)
tree92b9c941da227b061df519a3caea09f39202e1d1 /src/stm/ao_arch_funcs.h
parent17ec1c510ccc42bbc387940b5805f452697f78d6 (diff)
altos: add button matrix driver
Scans the matrix once per clock tick queuing events for changed keys. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_arch_funcs.h')
-rw-r--r--src/stm/ao_arch_funcs.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h
index 88097406..b294c379 100644
--- a/src/stm/ao_arch_funcs.h
+++ b/src/stm/ao_arch_funcs.h
@@ -211,6 +211,12 @@ ao_spi_try_get_mask(struct stm_gpio *reg, uint16_t mask, uint8_t bus, uint32_t s
stm_moder_set(port, bit, STM_MODER_OUTPUT);\
} while (0)
+#define AO_OUTPUT_PUSH_PULL STM_OTYPER_PUSH_PULL
+#define AO_OUTPUT_OPEN_DRAIN STM_OTYPER_OPEN_DRAIN
+
+#define ao_gpio_set_output_mode(port,bit,pin,mode) \
+ stm_otyper_set(port, pin, mode)
+
#define ao_gpio_set_mode(port,bit,mode) do { \
if (mode == AO_EXTI_MODE_PULL_UP) \
stm_pupdr_set(port, bit, STM_PUPDR_PULL_UP); \
@@ -219,7 +225,7 @@ ao_spi_try_get_mask(struct stm_gpio *reg, uint16_t mask, uint8_t bus, uint32_t s
else \
stm_pupdr_set(port, bit, STM_PUPDR_NONE); \
} while (0)
-
+
#define ao_enable_input(port,bit,mode) do { \
ao_enable_port(port); \
stm_moder_set(port, bit, STM_MODER_INPUT); \