Architecture

Asset Tracker Template

tags
Asset Tracker Template

The module has no state machine and exposes no zbus channel. It runs a single low-priority thread (uart_power_control_thread) that:

  1. Waits on a semaphore released from the NRF_MODEM_LIB_ON_INIT callback. This sequencing prevents UART contention while the modem library initializes the trace UART.
  2. Registers a callback with the nPM1300 MFD driver for the NPM13XX_EVENT_VBUS_DETECTED and NPM13XX_EVENT_VBUS_REMOVED events.
  3. Reads the current VBUS state once and applies the matching UART action.

Subsequent VBUS transitions are handled directly in the callback, which calls pm_device_action_run() with PM_DEVICE_ACTION_SUSPEND or PM_DEVICE_ACTION_RESUME on each UART device.