Product Specs

Table Of Contents
21 GPIOTE GPIO tasks and events
Page
157
Instance Number of GPIOTE channels
Priority Task
21 GPIOTE GPIO tasks and events
The GPIO tasks and events (GPIOTE) module provides functionality for accessing GPIO pins using tasks
and events. Each GPIOTE channel can be assigned to one pin.
A GPIOTE block enables GPIOs to generate events on pin state change which can be used to carry out
tasks through the PPI system. A GPIO can also be driven to change state on system events using the PPI
system. Low power detection of pin state changes is possible when in System ON or System OFF.
Table 30: GPIOTE properties
GPIOTE 8
Up to three tasks can be used in each GPIOTE channel for performing write operations to a pin. Two tasks
are fixed (SET and CLR), and one (OUT) is configurable to perform following operations:
Set
Clear
Toggle
An event can be generated in each GPIOTE channel from one of the following input conditions:
Rising edge
Falling edge
Any change
21.1 Pin events and tasks
The GPIOTE module has a number of tasks and events that can be configured to operate on individual
GPIO pins.
The tasks (SET[n], CLR[n] and OUT[n]) can be used for writing to individual pins, and the events (IN[n]) can
be generated from changes occurring at the inputs of individual pins.
The SET task will set the pin selected in CONFIG[n].PSEL to high.
The CLR task will set the pin low.
The effect of the OUT task on the pin is configurable in CONFIG[n].POLARITY , and can either set the pin
high, set it low, or toggle it.
The tasks and events are configured using the CONFIG[n] registers. Every set of SET, CLR and OUT[n]
tasks and IN[n] events has one CONFIG[n] register associated with it.
As long as a SET[n], CLR[n] and OUT[n] task or an IN[n] event is configured to control a pin n, the pin's
output value will only be updated by the GPIOTE module. The pin's output value as specified in the GPIO will
therefore be ignored as long as the pin is controlled by GPIOTE. Attempting to write a pin as a normal GPIO
pin will have no effect. When the GPIOTE is disconnected from a pin, see MODE field in CONFIG[n] register,
the associated pin will get the output and configuration values specified in the GPIO module.
When conflicting tasks are triggered simultaneously (i.e. during the same clock cycle) in one channel, the
precedence of the tasks will be as described in Table 31: Task priorities on page 157.
Table 31: Task priorities
1 OUT
2 CLR
3 SET