Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
PRU Multi Profile

The PRU Multi Profile project demonstrates how to integrate an application profile (or "app_profile") with the PRU Wireless Power Transfer (WPT) profile, enabling single chip product solutions with support for wireless charging. In this project, the Heart Rate Sensor Peripheral example from the nRF SDK is integrated with the WPT profile into an application. The two profiles are non-concurrent. i.e. The application profile must be stopped and the WPT profile started when charging) The switching between profiles is handled by the Multi Profile example application. This project includes the standard Heart Rate Sensor example from the nRF SDK and the changes required for it to be compatible with the Multi Profile API.

For a profile to be supported by the PRU Multi Profile project, it needs to implement the app_profile.h interface:

  • app_profile_init
    Is invoked once upon initialization of the program. The framework ensures that the SoftDevice is properly initialized before this function is invoked.
  • app_profile_on_ble_evt
    Is invoked on every BLE event generated by the SoftDevice when the app profile is active.
  • app_profile_on_sys_evt
    Is invoked on every SYS event generated by the SoftDevice when the app profile is active.
  • app_profile_start
    Is invoked every time this profile is started. The framework ensures that the SoftDevice with the BLE extension is enabled before this function is invoked.
  • app_profile_stop
    Is invoked every time the active profile will change from this to PRU. The framework ensures that the SoftDevice with the BLE extension is disabled after this function is invoked.

As seen in the list above, the application profile never needs to initialize/enable/disable the SoftDevice, simplifying its functionality. When converting examples from the nRF SDK to the "app_profile" format, the following steps are usually required (in addition to implementing the app_profile.h interface):

  1. Remove all SoftDevice initialization.
  2. Remove all assert/error callbacks.
  3. Remove timer initialization (APP_TIMER:INIT).
  4. Replace "main" function with proper functions from app_profile.h interface.