API documentation

Multiprotocol Service Layer interface

group mpsl

The main APIs needed to configure, enable, and use the MPSL.

Defines

MPSL_HIGH_IRQ_PRIORITY

High IRQ priority.

High IRQ priority is used for realtime scheduling. It should not be used except when inside radio timeslot by the owner of the timeslot

MPSL_BUILD_REVISION_SIZE

Size of build revision array in bytes.

Typedefs

typedef void (*mpsl_assert_handler_t)(const char *const file, const uint32_t line)

Function prototype for the assert handler.

Note

If an internal assert occurs this function is called. It is supposed to log the assert and stop execution.

Parameters
  • [in] file: The filename where the assertion occurred.

  • [in] line: The line number where the assertion occurred.

Functions

int32_t mpsl_init(mpsl_clock_lfclk_cfg_t const *p_clock_config, IRQn_Type low_prio_irq, mpsl_assert_handler_t p_assert_handler)

MPSL initialization.

Parameters
  • [in] p_clock_config: Clock configuration. If NULL the LF clock will be configured as an RC source with rc_ctiv = MPSL_RECOMMENDED_RC_CTIV, .rc_temp_ctiv = MPSL_RECOMMENDED_RC_TEMP_CTIV, and .accuracy_ppm = MPSL_DEFAULT_CLOCK_ACCURACY_PPM.

  • [in] low_prio_irq: IRQ to pend when low priority processing should be executed. The application shall call mpsl_low_priority_process after this IRQ has occurred.

  • [in] p_assert_handler: Pointer to MPSL assert handler.

Return Value
  • 0: MPSL is successfully initialized.

  • -NRF_EPERM: MPSL is already initialized.

  • -NRF_EINVAL: Invalid parameters supplied.

void mpsl_uninit(void)

Uninitialize MPSL. Stops clocks and scheduler. This will release all peripherals and reduce power usage.

Note

This function assumes no protocol stacks are running, and no timeslots are requested. All initialized protocol stacks need to be stopped before calling this function. Failing to do so will lead to undefined behavior.

bool mpsl_is_initialized(void)

Returns true if MPSL is already initialized, false otherwise.

int32_t mpsl_build_revision_get(uint8_t *p_build_revision)

Obtain build revision.

The application must provide a buffer that is at least MPSL_BUILD_REVISION_SIZE bytes long. MPSL will copy the build revision to the provided buffer.

Parameters
  • [inout] p_build_revision: Build revision.

Return Value
  • 0: Success

  • -NRF_EINVAL: Invalid argument provided

void MPSL_IRQ_RADIO_Handler(void)

RADIO interrupt handler.

Note

This handler should be placed in the interrupt vector table. The interrupt priority level should be priority 0.

void MPSL_IRQ_RTC0_Handler(void)

RTC0 interrupt handler.

Note

This handler should be placed in the interrupt vector table. The interrupt priority level should be priority 0

void MPSL_IRQ_TIMER0_Handler(void)

TIMER0 interrupt handler.

Note

This handler should be placed in the interrupt vector table. The interrupt priority level should be priority 0

void MPSL_IRQ_CLOCK_Handler(void)

POWER_CLOCK interrupt handler.

Note

This handler should be placed in the interrupt vector table. The interrupt priority level should be lower than priority 0.

void mpsl_low_priority_process(void)

MPSL low priority processing handler.

Note

This handler should be called when MPSL signals low priority processing should be executed (via low_prio_irq provided to mpsl_init) within reasonable time (a at least a few 100 ms). The caller is responsible to ensure this function is not called concurrently with any other low priority MPSL API functions, for more information see thread safety in the MPSL documentation.

MPSL Clock

group mpsl_clock

The MPSL clock interface provides APIs for controlling the clocks.

Defines

Recommended RC clock calibration timer interval.

Recommended RC clock calibration timer interval for temperature changes.

MPSL_DEFAULT_CLOCK_ACCURACY_PPM

Default LF clock accuracy in parts per million (ppm).

Typedefs

typedef void (*mpsl_clock_hfclk_callback_t)(void)

High frequency clock callback.

This callback will be called when the high frequency clock is started. It will be executed in the same execution priority as mpsl_low_priority_process.

Enums

enum MPSL_CLOCK_LF_SRC

Low frequency clock source.

Values:

MPSL_CLOCK_LF_SRC_RC = 0

LFCLK RC oscillator.

MPSL_CLOCK_LF_SRC_XTAL = 1

LFCLK crystal oscillator.

MPSL_CLOCK_LF_SRC_SYNTH = 2

LFCLK Synthesized from HFCLK.

Functions

int32_t mpsl_clock_hfclk_request(mpsl_clock_hfclk_callback_t hfclk_started_callback)

Request the high frequency crystal oscillator.

Will start the high frequency crystal oscillator, the startup time of the crystal varies and the mpsl_clock_hfclk_is_running function can be polled to check if it has started.

See

mpsl_clock_hfclk_is_running

See

mpsl_clock_hfclk_release

Parameters
  • [in] hfclk_started_callback: Function to be called when the high frequency clock is started. The callback will be executed in the context as mpsl_low_priority_process.

Return Value
  • 0: Success

int32_t mpsl_clock_hfclk_release(void)

Releases the high frequency crystal oscillator.

Indicates that the high frequency crystal oscillator is not needed by the application. MPSL may continue to use the high frequency clock if it is requested by protocol stacks. MPSL will automatically turn it off when it is no longer needed.

See

mpsl_clock_hfclk_is_running

See

mpsl_clock_hfclk_request

Return Value
  • 0: Success

int32_t mpsl_clock_hfclk_is_running(uint32_t *p_is_running)

Checks if the high frequency crystal oscillator is running.

See

mpsl_clock_hfclk_request

See

mpsl_clock_hfclk_release

Parameters
  • [out] p_is_running: 1 if the external crystal oscillator is running, 0 if not.

Return Value
  • 0: Success

struct mpsl_clock_lfclk_cfg_t
#include <mpsl_clock.h>

Type representing LFCLK oscillator source.

Public Members

uint8_t source

LF oscillator clock source, see MPSL_CLOCK_LF_SRC.

uint8_t rc_ctiv

Only for MPSL_CLOCK_LF_SRC_RC. Calibration timer interval in 1/4 second units.

Note

To avoid excessive clock drift, 0.5 degrees Celsius is the maximum temperature change allowed in one calibration timer interval. The interval should be selected to ensure this.

Note

Must be 0 if source is not MPSL_CLOCK_LF_SRC_RC.

uint8_t rc_temp_ctiv

Only for MPSL_CLOCK_LF_SRC_RC: How often (in number of calibration intervals) the RC oscillator shall be calibrated if the temperature hasn’t changed. 0: Always calibrate even if the temperature hasn’t changed. 2-33: Check the temperature and only calibrate if it has changed, however calibration will take place every rc_temp_ctiv intervals in any case.

Note

Must be 0 if source is not MPSL_CLOCK_LF_SRC_RC.

Note

The application must ensure calibration at least once every 8 seconds to ensure +/-500 ppm clock stability. The recommended configuration for MPSL_CLOCK_LF_SRC_RC is given by MPSL_RECOMMENDED_RC_CTIV and MPSL_RECOMMENDED_RC_TEMP_CTIV. This sets the calibration interval to 4 seconds and guarantees clock calibration every second calibration interval. That is, the clock will be calibrated every 8 seconds. If the temperature changes more that 0.5 every 4 seconds, the clock will be calibrated every 4 seconds. See the Product Specification for more information.

uint16_t accuracy_ppm

Accuracy of the low frequency clock in parts per million (ppm). Default value is MPSL_DEFAULT_CLOCK_ACCURACY_PPM.

MPSL Timeslot

group mpsl_timeslot

The Timeslot interface allows the application to run another radio protocol concurrently with BLE activity. When a timeslot is granted, the application has exclusive access to the normally blocked RADIO, TIMER0, CCM, and AAR peripherals. The application can use the peripherals freely for the duration of the timeslot.

Defines

MPSL_TIMESLOT_LENGTH_MIN_US

The shortest allowed timeslot event in microseconds.

MPSL_TIMESLOT_LENGTH_MAX_US

The longest allowed timeslot event in microseconds.

MPSL_TIMESLOT_DISTANCE_MAX_US

The longest timeslot distance in microseconds allowed for the distance parameter see mpsl_timeslot_request_normal_t.

MPSL_TIMESLOT_EARLIEST_TIMEOUT_MAX_US

The longest timeout in microseconds allowed when requesting the earliest possible timeslot.

MPSL_TIMESLOT_START_JITTER_US

The maximum jitter in MPSL_TIMESLOT_SIGNAL_START relative to the requested start time.

MPSL_TIMESLOT_EXTENSION_TIME_MIN_US

The minimum allowed timeslot extension time.

MPSL_TIMESLOT_EXTENSION_PROCESSING_TIME_MAX_US

The maximum processing time to handle a timeslot extension.

MPSL_TIMESLOT_EXTENSION_MARGIN_MIN_US

The latest time before the end of a timeslot when timeslot can be extended.

MPSL_TIMESLOT_CONTEXT_SIZE

Size of a single timeslot context.

MPSL_TIMESLOT_CONTEXT_COUNT_MAX

Maximum number of timeslot sessions.

Typedefs

typedef uint8_t mpsl_timeslot_session_id_t

The timeslot session id type.

typedef mpsl_timeslot_signal_return_param_t *(*mpsl_timeslot_callback_t)(mpsl_timeslot_session_id_t session_id, uint32_t signal)

The timeslot signal callback type.

Note

In case of invalid return parameters, the timeslot will automatically end immediately after returning from the signal callback and the MPSL_TIMESLOT_SIGNAL_INVALID_RETURN event will be sent.

Note

The returned struct pointer must remain valid after the signal callback function returns. For instance, this means that it must not point to a stack variable.

Return

Pointer to structure containing action requested by the application.

Parameters
  • [in] session_id: Session id as returned by mpsl_timeslot_session_open.

  • [in] signal: Type of signal, see MPSL_TIMESLOT_SIGNAL.

Enums

enum MPSL_TIMESLOT_SIGNAL

The timeslot signal types.

Values:

MPSL_TIMESLOT_SIGNAL_START = 0

This signal indicates the start of the timeslot. The signal will be executed in the same context as MPSL_IRQ_TIMER0_Handler.

MPSL_TIMESLOT_SIGNAL_TIMER0 = 1

This signal indicates the TIMER0 interrupt. The signal will be executed in the same context as MPSL_IRQ_TIMER0_Handler.

MPSL_TIMESLOT_SIGNAL_RADIO = 2

This signal indicates the RADIO interrupt. The signal will be executed in the same context as MPSL_IRQ_RADIO_Handler.

MPSL_TIMESLOT_SIGNAL_EXTEND_FAILED = 3

This signal indicates extend action failed. The signal will be executed in the same context as the previous signal.

MPSL_TIMESLOT_SIGNAL_EXTEND_SUCCEEDED = 4

This signal indicates extend action succeeded. The signal will be executed in the same context as the previous signal.

MPSL_TIMESLOT_SIGNAL_BLOCKED = 5

The previous request was blocked. The signal will be executed in the same context as mpsl_low_priority_process.

MPSL_TIMESLOT_SIGNAL_CANCELLED = 6

The previous request was cancelled. The signal will be executed in the same context as mpsl_low_priority_process.

MPSL_TIMESLOT_SIGNAL_SESSION_IDLE = 7

The timeslot session has no more pending requests. The signal will be executed in the same context as mpsl_low_priority_process.

MPSL_TIMESLOT_SIGNAL_INVALID_RETURN = 8

The previous timeslot callback return value was invalid. The signal will be executed in the same context as the previous signal which had an invalid return value. The application should avoid to continuously provide invalid return values. Doing so, will lead to an infinite loop.

MPSL_TIMESLOT_SIGNAL_SESSION_CLOSED = 9

The session has been closed.

enum MPSL_TIMESLOT_SIGNAL_ACTION

The actions requested by the signal callback.

This code gives instructions about what action to take when the signal callback has returned.

Note

For signals executed in low priority returning any action other than MPSL_TIMESLOT_SIGNAL_ACTION_NONE will result in an assert.

Values:

MPSL_TIMESLOT_SIGNAL_ACTION_NONE = 0

Return without action.

MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND = 1

Request an extension of the current timeslot event. Maximum execution time for this action: MPSL_TIMESLOT_EXTENSION_PROCESSING_TIME_MAX_US. This action must be started at least MPSL_TIMESLOT_EXTENSION_MARGIN_MIN_US before the end of a timeslot event.

Note

This signal action may only be used from within a timeslot event.

MPSL_TIMESLOT_SIGNAL_ACTION_END = 2

End the current timeslot event.

Note

This signal action may only be called from within a timeslot event.

MPSL_TIMESLOT_SIGNAL_ACTION_REQUEST = 3

Request a new timeslot event.

Note

If this signal action is used from within a timeslot, the current timeslot event is closed.

enum MPSL_TIMESLOT_HFCLK_CFG

Timeslot high frequency clock source configuration.

Values:

MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED = 0

The high frequency clock source is the external crystal for the whole duration of the timeslot. This should be the preferred option for events that use the radio or require high timing accuracy.

Note

The external crystal will automatically be turned on and off at the beginning and end of the timeslot.

MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE = 1

This configuration allows for earlier and tighter scheduling of timeslots. The RC oscillator may be the clock source in part or for the whole duration of the timeslot. The RC oscillator’s accuracy must therefore be taken into consideration.

Note

If the application will use the radio peripheral in timeslots with this configuration, it must ensure that the crystal is running and stable before starting the radio.

enum MPSL_TIMESLOT_PRIORITY

Timeslot event priorities.

Values:

MPSL_TIMESLOT_PRIORITY_HIGH = 0

High priority.

MPSL_TIMESLOT_PRIORITY_NORMAL = 1

Low priority.

enum MPSL_TIMESLOT_REQUEST_TYPE

Timeslot request type.

Values:

MPSL_TIMESLOT_REQ_TYPE_EARLIEST = 0

Request timeslot as early as possible. This should always be used for the first request in a session.

Note

It is not permitted to request an earliest timeslot from within a timeslot.

MPSL_TIMESLOT_REQ_TYPE_NORMAL = 1

Normal timeslot request.

Functions

int32_t mpsl_timeslot_session_count_set(void *p_mem, uint8_t n_sessions)

Set or update the MPSL timeslot configuration.

void* p_mem; Pointer to a memory location for timeslot sessions. The size of the memory block needs to be at least n_sessions * MPSL_TIMESLOT_CONTEXT_SIZE bytes. The memory needs to reside in RAM. The pointer needs to be aligned to a 4-byte boundary. uint8_t n_sessions Number of timeslot sessions. Maximum number of supported timeslot sessions is

MPSL_TIMESLOT_CONTEXT_COUNT_MAX.
Note

Resource configuration can only be performed when all timeslots are closed.

Return Value
  • 0: The configuration was applied successfully.

  • -NRF_EPERM: Timeslots need to be configured when no timeslots are open.

  • -NRF_EINVAL: Invalid argument provided.

  • -NRF_EFAULT: The memory is not aligned to a 4-byte boundary.

int32_t mpsl_timeslot_session_open(mpsl_timeslot_callback_t mpsl_timeslot_signal_callback, mpsl_timeslot_session_id_t *p_session_id)

Opens a session for timeslot requests.

Note

Only one session can be open at a time.

Note

mpsl_timeslot_signal_callback(MPSL_TIMESLOT_SIGNAL_START) will be called when the timeslot starts. From this point the RADIO, TIMER0, AAR, and CCM peripherals can be freely accessed by the application.

Note

mpsl_timeslot_signal_callback(MPSL_TIMESLOT_SIGNAL_TIMER0) is called whenever the TIMER0 interrupt occurs.

Note

mpsl_timeslot_signal_callback(MPSL_TIMESLOT_SIGNAL_RADIO) is called whenever the RADIO interrupt occurs.

Parameters
  • [in] mpsl_timeslot_signal_callback: The signal callback.

  • [out] p_session_id: Pointer to the id of the session that was opened.

Return Value
  • 0: Request was successful.

  • -NRF_ENOMEM: All sessions are already open.

int32_t mpsl_timeslot_session_close(mpsl_timeslot_session_id_t session_id)

Closes a session for timeslot requests.

Note

Any current timeslot will be finished before the session is closed.

Note

If a timeslot is scheduled when the session is closed, it will be canceled.

Parameters
  • [in] session_id: The session identifier as returned by mpsl_timeslot_session_open.

Return Value
  • 0: Success

  • -NRF_EAGAIN: Session already closed

int32_t mpsl_timeslot_request(mpsl_timeslot_session_id_t session_id, mpsl_timeslot_request_t const *p_request)

Requests a timeslot.

Note

The first request in a session must always be of type MPSL_TIMESLOT_REQ_TYPE_EARLIEST.

Note

Successful requests will result in mpsl_timeslot_signal_callback_t(MPSL_TIMESLOT_SIGNAL_START). Unsuccessful requests will result in a MPSL_TIMESLOT_SIGNAL_BLOCKED event.

Note

The jitter in the start time of the timeslots is +/- MPSL_TIMESLOT_START_JITTER_US us.

Note

The mpsl_timeslot_signal_callback_t(MPSL_TIMESLOT_SIGNAL_START) call has a latency relative to the specified timeslot start, but this does not affect the actual start time of the timeslot.

Note

TIMER0 is reset at the start of the timeslot, and is clocked at 1MHz from the high frequency (16 MHz) clock source

Note

No stack will neither access the RADIO peripheral nor the TIMER0 peripheral during the timeslot.

Parameters
  • [in] session_id: The session identifier as returned by mpsl_timeslot_session_open.

  • [in] p_request: Pointer to the request parameters.

Return Value
  • 0: Success

  • -NRF_EINVAL: The parameters of p_request are not valid

  • -NRF_ENOENT: The session is not open.

  • -NRF_EAGAIN: The session is not IDLE.

struct mpsl_timeslot_request_earliest_t
#include <mpsl_timeslot.h>

Parameters for a request for a timeslot as early as possible.

Public Members

uint8_t hfclk

High frequency clock source, see MPSL_TIMESLOT_HFCLK_CFG.

uint8_t priority

The timeslot priority, see MPSL_TIMESLOT_PRIORITY.

uint32_t length_us

The timeslot length,

See

MPSL_TIMESLOT_LENGTH_MIN_US,

See

MPSL_TIMESLOT_LENGTH_MAX_US.

uint32_t timeout_us

Longest acceptable delay until the start of the requested timeslot, up to MPSL_TIMESLOT_EARLIEST_TIMEOUT_MAX_US microseconds.

struct mpsl_timeslot_request_normal_t
#include <mpsl_timeslot.h>

Parameters for a normal timeslot request.

Public Members

uint8_t hfclk

High frequency clock source, see MPSL_TIMESLOT_HFCLK_CFG.

uint8_t priority

The timeslot priority, see MPSL_TIMESLOT_PRIORITY.

uint32_t distance_us

Distance from the start of the previous timeslot up to MPSL_TIMESLOT_DISTANCE_MAX_US microseconds.

uint32_t length_us

The timeslot length,

See

MPSL_TIMESLOT_LENGTH_MIN_US,

See

MPSL_TIMESLOT_LENGTH_MAX_US.

struct mpsl_timeslot_request_t
#include <mpsl_timeslot.h>

Timeslot request parameters.

Public Members

uint8_t request_type

Type of request, see MPSL_TIMESLOT_REQUEST_TYPE.

mpsl_timeslot_request_earliest_t earliest

Parameters for requesting a timeslot as early as possible.

mpsl_timeslot_request_normal_t normal

Parameters for requesting a normal timeslot.

union mpsl_timeslot_request_t::[anonymous] params

Union containing parameters for the request specified.

struct mpsl_timeslot_signal_return_param_t
#include <mpsl_timeslot.h>

Return parameters of the timeslot signal callback.

Public Members

uint8_t callback_action

The action requested by the application when returning from the signal callback, see MPSL_TIMESLOT_SIGNAL_ACTION.

mpsl_timeslot_request_t *p_next

The request parameters for the next timeslot.

struct mpsl_timeslot_signal_return_param_t::[anonymous]::[anonymous] request

Additional parameters for return_code MPSL_TIMESLOT_SIGNAL_ACTION_REQUEST.

uint32_t length_us

Requested extension of the timeslot duration. The minimum time is MPSL_TIMESLOT_EXTENSION_TIME_MIN_US).

struct mpsl_timeslot_signal_return_param_t::[anonymous]::[anonymous] extend

Additional parameters for return_code MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND.

union mpsl_timeslot_signal_return_param_t::[anonymous] params

Parameter union.

MPSL Radio Notification

group mpsl_radio_notification

The MPSL radio interface provides APIs for configuring radio notifications. When radio notifications are enabled, the application is notified when an MPSL timeslot starts or ends. By using radio notifications, the application is informed when a protocol uses the radio.

Defines

MPSL_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US

Guaranteed time for application to process radio inactive notification.

Enums

enum MPSL_RADIO_NOTIFICATION_DISTANCES

Radio notification distances.

Values:

MPSL_RADIO_NOTIFICATION_DISTANCE_NONE = 0

The event does not have a notification.

MPSL_RADIO_NOTIFICATION_DISTANCE_200US

The distance from the active notification to start of radio activity.

MPSL_RADIO_NOTIFICATION_DISTANCE_420US

The distance from the active notification to start of radio activity.

MPSL_RADIO_NOTIFICATION_DISTANCE_800US

The distance from the active notification to start of radio activity.

MPSL_RADIO_NOTIFICATION_DISTANCE_1740US

The distance from the active notification to start of radio activity.

MPSL_RADIO_NOTIFICATION_DISTANCE_2680US

The distance from the active notification to start of radio activity.

MPSL_RADIO_NOTIFICATION_DISTANCE_3620US

The distance from the active notification to start of radio activity.

MPSL_RADIO_NOTIFICATION_DISTANCE_4560US

The distance from the active notification to start of radio activity.

MPSL_RADIO_NOTIFICATION_DISTANCE_5500US

The distance from the active notification to start of radio activity.

enum MPSL_RADIO_NOTIFICATION_TYPES

Radio notification types.

Values:

MPSL_RADIO_NOTIFICATION_TYPE_NONE = 0

The event does not have a radio notification signal.

MPSL_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE

Using interrupt for notification when the radio will be enabled.

MPSL_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE

Using interrupt for notification when the radio has been disabled.

MPSL_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH

Using interrupt for notification both when the radio will be enabled and disabled.

Functions

int32_t mpsl_radio_notification_cfg_set(uint8_t type, uint8_t distance, IRQn_Type irq)

Configures the Radio Notification signal.

Note

  • The notification signal latency depends on the interrupt priority settings of IRQ used for notification signal.

  • To ensure that the radio notification signal behaves in a consistent way, the radio notifications must be configured when there is no protocol stack enabled. It is recommended that the radio notification signal is configured directly after the MPSL is enabled.

Parameters
  • [in] type: Type of notification signal, see MPSL_RADIO_NOTIFICATION_TYPES. MPSL_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio notification. Using MPSL_RADIO_NOTIFICATION_DISTANCE_NONE is recommended (but not required) to be used with MPSL_RADIO_NOTIFICATION_TYPE_NONE.

  • [in] distance: Distance between the notification signal and start of radio activity, see MPSL_RADIO_NOTIFICATION_DISTANCES. This parameter is ignored when MPSL_RADIO_NOTIFICATION_TYPE_NONE or MPSL_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used.

  • [in] irq: IRQ to pend as the radio notification signal, e.g SWI1_IRQn. If the application uses IRQs that are already in use, e.g, RADIO_IRQn, TIMER0_IQRn or similar, the behavior is undefined. The interrupt priority level should be lower than priority level 0, that is, a higher numerical priority value. The application is responsible for setting the interrupt priority.

Return Value
  • -NRF_EINVAL: Invalid parameters supplied.

  • -NRF_EAGAIN: A protocol stack or other SoftDevice is running. Stop all running activities and retry.

  • 0: Success

MPSL TX Power

group mpsl_tx_power

The MPSL TX Power interface provides APIs to set the maximum TX power per channel.

Defines

MPSL_TOTAL_NUM_OF_BLE_CHANNELS

The number of channels for BLE protocol.

MPSL_TOTAL_NUM_OF_802154_CHANNELS

The number of channels for 802.15.4 protocol.

Typedefs

typedef int8_t mpsl_tx_power_t

TX power, dBm.

Enums

enum mpsl_phy_t

PHYs supported for limiting channel TX power.

Values:

MPSL_PHY_BLE_1M
MPSL_PHY_BLE_2M
MPSL_PHY_BLE_LR125Kbit
MPSL_PHY_BLE_LR500Kbit
MPSL_PHY_Ieee802154_250Kbit

Functions

int32_t mpsl_tx_power_channel_map_set(const mpsl_tx_power_envelope_t *const p_envelope)

Sets maximum TX power envelope. If the PHY already has an envelope configured, it will be over-written.

Note

Calling this function while an envelope is being used to limit current TX Power may lead to undefined behavior.

Note

The memory for the provided envelope is not copied and must be valid until it is replaced with another envelope for the same PHY.

Parameters
  • [in] p_envelope: The pointer to an envelope, if NULL the envelopes for all PHYs are reset to maximum power possible.

Return Value
  • 0: TX power channel successfully set.

  • -NRF_EINVAL: Invalid parameter provided.

struct mpsl_tx_power_envelope_t
#include <mpsl_tx_power.h>

Max TX power envelope. It is up to the application to allocate memory for an envelope.

Public Members

mpsl_phy_t phy

The PHY that this envelope applies to.

union mpsl_tx_power_envelope_t::[anonymous] envelope

Array of maximum TX power value per channel. From 11 to 26 for 802.15.4 protocol. From 0 to 40 for BLE protocol.

MPSL Temp

group mpsl_temp

The MPSL temperature sensor interface provides APIs for measuring the chip temperature.

Functions

int32_t mpsl_temperature_get(void)

Get the temperature measured on the chip.

This function will block until the temperature measurement is done. It takes around 50 us from call to return.

Return

Result of temperature measurement. Die temperature in 0.25 degrees Celsius.