diff --git a/epicardium/epicardium.h b/epicardium/epicardium.h index 3d5eb7682306be7d605756f6b0d45823f493e4e8..c6286111d8d5732a3c61df824dd59ee16883fd74 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));