Board module¶
The board module is used to ensure the proper state of GPIO pins that are not configured by other modules in the application. Ensuring the proper state is done by setting the state of the mentioned pins on the system start and wake-up, and when the system enters the low-power mode.
Module events¶
Source Module |
Input Event |
This Module |
Output Event |
Sink Module |
---|---|---|---|---|
|
|
|||
|
||||
|
||||
|
Note
See the Overview: Firmware architecture for more information about the event-based communication in the nRF Desktop application and about how to read this table.
Configuration¶
The module uses Zephyr’s GPIO driver to set the pin state.
For this reason, set the CONFIG_GPIO
option.
For every configuration, you must define the port_state_def.h
file in the board-specific directory in the application configuration directory.
The port_state_def.h
file defines the states set to the GPIO ports by the following arrays:
port_state_on
- State set on the system start and wake-up.port_state_off
- State set when the system enters the low-power mode.
Every port_state
refers to a single GPIO port and contains the following information:
port_state.name
- GPIO device name (obtained from devicetree, for example withDT_LABEL(DT_NODELABEL(gpio0))
).port_state.ps
- Pointer to the array ofpin_state
.port_state.ps_count
- Size of the ps array.
Every pin_state
defines the state of a single GPIO pin:
pin_state.pin
- Pin number.pin_state.val
- Value set for the pin.