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 wakeup, and when the system enters the low-power mode.
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.
For every configuration, you must define the
port_state_def.h file in the board-specific directory in the application configuration directory.
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 wakeup.
port_state_off- State set when the system enters the low-power mode.
port_state refers to a single GPIO port and contains the following information:
port_state.name- GPIO device name (obtained from devicetree, for example with
port_state.ps- Pointer to the array of
port_state.ps_count- Size of the ps array.
pin_state defines the state of a single GPIO pin:
pin_state.pin- Pin number.
pin_state.val- Value set for the pin.
You can use the CONFIG_DESKTOP_BOARD_PM_EVENTS Kconfig option to enable or disable handling of the power management events, such as
The option is enabled by default and depends on the
CONFIG_CAF_PM_EVENTS Kconfig option.