Feature #589

Enhanced I/O events

Added by Thomas Schöpping 7 months ago.

Status:NewStart date:2019-03-08
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-Estimated time:4.00 hours
Target version:-

Description

Currently I/O interrupts result in I/O events and propagate the causing EXTI line via event flags (e.g. EXTI #3 propagates (1 << 3) = 0x00000008). Since EXTI lines can aggregate multiple I/O pins (e.g. PA3 and PC3) this method can result in ambiguous events, because only the EXTI line but not the actual pin is specified.

To solve this issue, I/O events should not propagate plain eventflags_t data, but a struct like

struct {
  uint32_t flags : 24; // alternatively 28
  uint32_t pin   :  8; // alternatively  4
};
Since there is no EXTI hardware so far which provides more than 24 lines this solution is feasible. Alternatively the ratio can be set to 28:4 assuming that there will not be more than 2^4-1 pins aggregated in a single EXTI line. The -1 is important here, since the value of pin = 0 must be reserved to indicate ambiguity. This was the new method is compatible to plain eventflags_t and there might be cases where the exact pin can not be determined.
The determination can be realized within the ISR, which is called by the EXTI driver.

Also available in: Atom PDF