From 27b8d0f54e3b4ac7b54cb85fbf45673374e1e05f Mon Sep 17 00:00:00 2001 From: fleur <spacecarrot@fleurshax.net> Date: Thu, 15 Aug 2019 19:55:55 +0200 Subject: [PATCH] Made docs a bit more beginner friendly i actually managed to fuck up masking during testing even though i wrote it, so i figured this might be a nice addition. --- epicardium/epicardium.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epicardium/epicardium.h b/epicardium/epicardium.h index 3d5eb7682..c6286111d 100644 --- a/epicardium/epicardium.h +++ b/epicardium/epicardium.h @@ -126,9 +126,11 @@ API(API_INTERRUPT_DISABLE, int epic_interrupt_disable(api_int_id_t int_id)); #define EPIC_INT_UART_RX 2 /** RTC Alarm interrupt. See :c:func:`epic_isr_rtc_alarm` */ #define EPIC_INT_RTC_ALARM 3 +/** Button interrupt */ +#define EPIC_INT_BUTT 4 /* Number of defined interrupts. */ -#define EPIC_INT_NUM 4 +#define EPIC_INT_NUM 5 /* clang-format on */ API_ISR(EPIC_INT_RESET, epic_isr_reset); @@ -232,7 +234,7 @@ API_ISR(EPIC_INT_CTRL_C, epic_isr_ctrl_c); * * Always reads all buttons, use mask=15 for not wasting slow-ish API calls and extract values in pycardium. Note: The reset button cannot be unmapped from reset functionality afaik. * - * :param uint8_t mask: The first 4 LSBs enable readout from corresponding button. The zeroeth bit corresponds to bottom left pin, increasing counterclockwise. If buttons module is imported in micropython also the designators BOTTOM_LEFT, BOTTOM_RIGHT, TOP_RIGHT, TOP_LEFT and RESET can be used with the latter two being identical. + * :param uint8_t mask: The first 4 LSBs enable readout from corresponding button. The zeroeth bit corresponds to bottom left pin, increasing counterclockwise, i.e. mask values of 1, 2, 4, 8 read single buttons, others read combinations. If buttons module is imported in micropython also the designators BOTTOM_LEFT, BOTTOM_RIGHT, TOP_RIGHT, TOP_LEFT and RESET can be used with the latter two being identical. */ API(API_BUTTONS_READ, uint8_t epic_buttons_read(uint8_t mask)); -- GitLab