On the other hand, shared interrupts can have multiple peripherals triggering them, with multiple ISRs being called when one of the peripherals attached signals an interrupt. The simplest ones are non-shared interrupts: a separate interrupt is allocated per esp_intr_alloc() call and this interrupt is solely used for the peripheral attached to it, with only one ISR that will get called. This code presents two different types of interrupts, handled differently: shared interrupts and non-shared interrupts. The interrupt allocation code will then find an applicable interrupt, use the interrupt mux to hook it up to the peripheral, and install the given interrupt handler and ISR to it. It can use the flags passed to this function to set the type of interrupt allocated, specifying a particular level or trigger method. The esp_intr_alloc() abstraction exists to hide all these implementation details.Ī driver can allocate an interrupt for a certain peripheral by calling esp_intr_alloc() (or esp_intr_alloc_intrstatus()). Each interrupt has a certain priority level, most (but not all) interrupts are connected to the interrupt mux.īecause there are more interrupt sources than interrupts, sometimes it makes sense to share an interrupt in multiple drivers. The ESP32 has two cores, with 32 interrupts each.
0 Comments
Leave a Reply. |