nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ mpsl_fem_nrf2220_temperature_changed_update_request()

int32_t mpsl_fem_nrf2220_temperature_changed_update_request ( mpsl_fem_nrf2220_temperature_update_callback_t p_callback)

#include <mpsl/fem/nrf2220/include/protocol/mpsl_fem_nrf2220_protocol_api.h>

Requests an update of temperature-related registers of nRF2220.

This function is to be called when mpsl_fem_nrf2220_temperature_changed returned true and you use a protocol that relies on the MPSL scheduler. This function uses asynchronous TWI writes provided through mpsl_fem_twi_if_t interface.

Prior calling this function you must:

  • Acquire an exclusive access to the TWI peripheral.
  • Ensure that the TWI IRQ priority is high enough so that any interrupts from the TWI do not get delayed. Consider boosting the TWI IRQ priority for the time of the operation.

The function starts a procedure consisting of:

  • request an MPSL timeslot
  • when an MPSL timeslot is granted, it switches the nRF2220 into bypass state
  • perform I2C writes to the nRF2220 to registers calculated by the recent call to mpsl_fem_nrf2220_temperature_changed
  • switch the nRF2220 back into standby state
  • release the MPSL timeslot

The end of the operation is notified by a call to the callback function provided by p_callback pointer. The callback is called from low priority signalling context.

After calling this function with non-success result or after the p_callback is called you must:

  • Restore previous TWI IRQ priority if has been boosted for the time of the operation.
  • Release the exclusive access to the TWI peripheral.
See also
mpsl_fem_nrf2220_temperature_changed_update_now, mpsl_fem_nrf2220_temperature_changed
Parameters
[in]p_callbackThe callback function that will be called to signal the end of the operation. The callback is called from low priority signalling context.
Return values
0In case of success, the p_callback. The p_callback will be called.
-NRF_EINVALNothing to write, the p_callback will not be called.