The RP2040 DMA provides two system IRQs with separate masking and status registers (e. g., INTE0, INTE1). Any combination of channel interrupt requests can be routed to either of the system IRQs:
First explain the key terms in this passage, then connect them with examples:
System IRQs :can be analogized to the two "general customer service hotlines"(IRQ0 and IRQ1, corresponding to INTE0 and INTE1 respectively), through which all the "completion notifications"(interrupt requests) from the DMA messengers are routed to the boss (the kernel).
Mask Register: Here, "mask" means to block or mute. This register acts as the mute switch for hotlines — for example, you can configure it to "block notifications from Staff 1 from reaching Hotline 0", or "mute Hotline 1 temporarily and route all notifications to Hotline 0", so as to prevent non-essential notifications from disturbing the supervisor.
Status Register: It is equivalent to a "call log" for the hotline, which records entries such as "Notification from Staff 3 is incoming" and "Task from Staff 7 has been completed". When the manager checks this log, he will know which staff's follow-up tasks need to be handled.
Routing refers to "allocating and directing" — you can freely assign which courier's notification goes through which dedicated line.
The DMA of the RP2040 has 12 channels (12 little helpers), but only 2 customer service hotlines (two system IRQs) are reserved. You can configure it as follows:
Route the notifications from Operator 1 (sensor data handling) and Operator 2 (UART data transmission) to Hotline 0 (INTE0);
Route the notifications from Agent 3 (memory copy) and Agent 4 (SPI data transmission) to Hotline 1 (INTE1);
You can even route all notifications for a specific courier to the same hotline, or have notifications from certain couriers sent to two hotlines simultaneously.
If you consider the task of Worker 3 unimportant, you can also use the mask register to block Worker 3's notifications. Even after he finishes the task, he will not be able to get through to the hotline, and the boss will not receive any notification from him.
The advantage of this design is that: it enables flexible management of interrupts from multiple DMA channels to avoid interrupt signal confusion, and meanwhile allows the kernel to process different types of DMA tasks according to the priority of the hotline (for instance, routing urgent tasks to hotlines with higher priorities).