nrfxlib API 2.7.99
Loading...
Searching...
No Matches
mpsl_clock.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
17#ifndef MPSL_CLOCK_H__
18#define MPSL_CLOCK_H__
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <stdint.h>
25#include <stdbool.h>
26#include "nrf.h"
27#include "nrf_errno.h"
28
31{
35#if defined(NRF52_SERIES)
36 MPSL_CLOCK_LF_SRC_EXT_LOW_SWING = 3,
38 MPSL_CLOCK_LF_SRC_EXT_FULL_SWING = 4,
41#endif
42};
43
45#define MPSL_RECOMMENDED_RC_CTIV 16
46
48#define MPSL_RECOMMENDED_RC_TEMP_CTIV 2
49
51#define MPSL_DEFAULT_CLOCK_ACCURACY_PPM 250
52
54#define MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED false
55
57typedef struct
58{
60 uint8_t source;
61
71 uint8_t rc_ctiv;
72
94 uint8_t rc_temp_ctiv;
95
99 uint16_t accuracy_ppm;
100
115
116/* @brief Available options for informing MPSL of the true high-frequency oscillator ramp-up time, in microseconds. */
117typedef enum
118{
123
129typedef void (*mpsl_clock_hfclk_callback_t)(void);
130
149
166
176int32_t mpsl_clock_hfclk_is_running(uint32_t * p_is_running);
177
186int32_t mpsl_clock_hfclk_latency_set(uint16_t hfclk_rampup_time_us);
187
195
196#ifdef __cplusplus
197}
198#endif
199
200#endif // MPSL_CLOCK_H__
201
void mpsl_clock_task_trigger_on_rtc_start_set(uint32_t task_address)
Trigger a task upon start of the RTC.
MPSL_CLOCK_LF_SRC
Low frequency clock source.
Definition: mpsl_clock.h:31
@ MPSL_CLOCK_LF_SRC_XTAL
Definition: mpsl_clock.h:33
@ MPSL_CLOCK_LF_SRC_RC
Definition: mpsl_clock.h:32
@ MPSL_CLOCK_LF_SRC_SYNTH
Definition: mpsl_clock.h:34
void(* mpsl_clock_hfclk_callback_t)(void)
High frequency clock callback.
Definition: mpsl_clock.h:129
int32_t mpsl_clock_hfclk_latency_set(uint16_t hfclk_rampup_time_us)
Informs MPSL about the actual ramp-up time of the high-frequency crystal oscillator.
int32_t mpsl_clock_hfclk_request(mpsl_clock_hfclk_callback_t hfclk_started_callback)
Request the high frequency crystal oscillator.
mpsl_clock_hfclk_latency_config_t
Definition: mpsl_clock.h:118
@ MPSL_CLOCK_HF_LATENCY_WORST_CASE
Definition: mpsl_clock.h:121
@ MPSL_CLOCK_HF_LATENCY_BEST
Definition: mpsl_clock.h:119
@ MPSL_CLOCK_HF_LATENCY_TYPICAL
Definition: mpsl_clock.h:120
int32_t mpsl_clock_hfclk_is_running(uint32_t *p_is_running)
Checks if the high frequency crystal oscillator is running.
int32_t mpsl_clock_hfclk_release(void)
Releases the high frequency crystal oscillator.
uint8_t rc_temp_ctiv
Definition: mpsl_clock.h:94
uint8_t source
Definition: mpsl_clock.h:60
uint16_t accuracy_ppm
Definition: mpsl_clock.h:99
uint8_t rc_ctiv
Definition: mpsl_clock.h:71
bool skip_wait_lfclk_started
Definition: mpsl_clock.h:113
Type representing LFCLK oscillator source.
Definition: mpsl_clock.h:58