27.5.6 Events
The PORT allows up to four input events to control individual I/O pins. These input events are generated by the Event System (EVSYS) module and can originate from a different clock domain than the clock domain of the PORT module.
| User Name | Description | Input Detection | Channel Path Type | |
|---|---|---|---|---|
| Peripheral | Input | |||
| PORT | EV_n | PORT Event n Input | Level/Rising Edge | Asynchronous |
Writing a ‘1’ to an Event Input Enable bit in the Event Control register (EVCTRL.xxEI) enables the corresponding action on an input event. Writing a ‘0’ to this bit disables the corresponding action on input event.
The event users can trigger the following actions. Note that if connected to several events, the enabled action will be taken on any of the incoming events.
| Event Input | Event Action | Description | Input Detection | Async/Sync |
|---|---|---|---|---|
| EV_n | OUT | The Data Output Value bit of I/O pin PIDn will be set to the level of the event | Level | Asynchronous |
| SET | The Data Output Value bit of I/O pin PIDn will be set | Rising Edge | Up to three clock cycles after a rising edge. Not available in Standby sleep mode. | |
| CLR | The Data Output Value bit of I/O pin PIDn will be cleared | |||
| TGL | The Data Output Value bit of I/O pin PIDn will be toggled |
The event actions are configured in the Event n Action bit fields in the Event Control register (EVCTRL.EVACTn).
Each event input can address one I/O pin per PORT group. The selection of the pin is indicated by the Event n Pin Identifier bit fields in the EVCTRL register (EVCTRL.PIDn).
- When only SET actions are triggered simultaneously, a SET action is executed
- When only CLR actions are triggered simultaneously, a CLR action is executed
- If any other combinations of actions are triggered simultaneously, a TGL action is executed
Because events are received asynchronously, the I/O pin may have unpredictable levels, depending on the timing of when the events are received. When several events are output to the same pin, the lowest event line will have access and all other events will be ignored.
Refer to the EVSYS - Event System chapter for details on configuring the event system.
