EXTICR on stm32g0 is in exti registers range. Previous chips used to have that gpio port exti mux configuration accessible via AFIO_EXTICR or SYSCFG_EXTICR. Also, the new chip now use 8 bits coded value instead of previously 4 for the extcr mux selection value (see AFIO/SYSCFG/EXTI_EXTICR_FIELDSIZE) Let's define two helpers: EXTICR_SELECTION_REG (to get proper AFIO/SYSCFG/ EXTI_EXTICR register) and EXTICR_SELECTION_FIELDSIZE (to get proper AFIO/SYSCFG/ EXTI_EXTICR_FIELDSIZE value), and use it them exti_select_source to determine exticr mux selection bits shift and mask.
3.7 KiB
3.7 KiB