HSFLL HAL

group nrf_hsfll_hal

Hardware access layer for managing the High Speed Frequency Locked Loop (HSFLL).

Defines

NRF_HSFLL_HAS_DITHERING_INITVALUE

Symbol indicating whether initial value for clock dithering configuration is present.

NRF_HSFLL_HAS_DITHERINIT

Symbol indicating whether initial value for clock dithering seed configuration is present.

Enums

enum nrf_hsfll_task_t

HSFLL tasks.

Values:

enumerator NRF_HSFLL_TASK_START

Start the HSFLL.

enumerator NRF_HSFLL_TASK_STOP

Stop the HSFLL.

enumerator NRF_HSFLL_TASK_FREQ_MEAS

Start frequency measurement in software-controlled mode.

enumerator NRF_HSFLL_TASK_FREQ_CHANGE

Trigger frequency change.

enum nrf_hsfll_event_t

HSFLL events.

Values:

enumerator NRF_HSFLL_EVENT_STARTED

HSFLL started.

enumerator NRF_HSFLL_EVENT_STOPPED

HSFLL stopped.

enumerator NRF_HSFLL_EVENT_FREQM_DONE

HSFLL frequency measurement done.

enumerator NRF_HSFLL_EVENT_FREQ_CHANGED

HSFLL frequency change done.

enum nrf_hsfll_mode_status_t

HSFLL clock status operating modes.

Values:

enumerator NRF_HSFLL_MODE_STATUS_OPEN_LOOP

Open loop mode.

enumerator NRF_HSFLL_MODE_STATUS_CLOSED_LOOP

Closed loop mode.

enumerator NRF_HSFLL_MODE_STATUS_BYPASS

Bypass mode.

enum nrf_hsfll_mode_ctrl_t

HSFLL clock control operating mode settings.

Values:

enumerator NRF_HSFLL_MODE_CTRL_AUTO

The PCGC controls the mode automatically.

enumerator NRF_HSFLL_MODE_CTRL_OPEN_LOOP

Open loop mode.

enumerator NRF_HSFLL_MODE_CTRL_CLOSED_LOOP

Closed loop mode.

enumerator NRF_HSFLL_MODE_CTRL_BYPASS

Bypass mode.

Functions

NRF_STATIC_INLINE uint32_t nrf_hsfll_task_address_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_task_t task)

Function for getting the address of the specified task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] HSFLL task.

Returns:

Address of the requested task register.

NRF_STATIC_INLINE void nrf_hsfll_task_trigger(NRF_HSFLL_Type *p_reg, nrf_hsfll_task_t task)

Function for triggering the specified task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task to be activated.

NRF_STATIC_INLINE uint32_t nrf_hsfll_event_address_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_event_t event)

Function for retrieving the address of the specified event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] HSFLL event.

Returns:

Address of the specified event register.

NRF_STATIC_INLINE void nrf_hsfll_event_clear(NRF_HSFLL_Type *p_reg, nrf_hsfll_event_t event)

Function for clearing the specified event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event to be cleared.

NRF_STATIC_INLINE bool nrf_hsfll_event_check(NRF_HSFLL_Type const *p_reg, nrf_hsfll_event_t event)

Function for retrieving the state of the specified event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event to be checked.

Return values:
  • true – The event has been generated.

  • false – The event has not been generated.

NRF_STATIC_INLINE void nrf_hsfll_status_clk_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_status_clk_t *p_status)

Function for getting the HSFLL status.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_status[out] Pointer to the structure to be filled with the HSFLL status.

NRF_STATIC_INLINE bool nrf_hsfll_freqm_done_check(NRF_HSFLL_Type const *p_reg)

Function for checking whether the HSFLL frequency measurement is completed.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – The frequency measurement is completed.

  • false – The frequency measurement is in progress.

NRF_STATIC_INLINE void nrf_hsfll_freqm_error_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_freqm_error_t *p_error)

Function for getting HSFLL frequency measurement errors.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_error[out] Pointer to the structure to be filled with HSFLL frequency measurement errors.

NRF_STATIC_INLINE uint32_t nrf_hsfll_freqm_meas_get(NRF_HSFLL_Type const *p_reg)

Function for getting HSFLL frequency measurement.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

The last frequency measurement value. Measures the number of reference clock cycles.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_mode_set(NRF_HSFLL_Type *p_reg, nrf_hsfll_clkctrl_t const *p_clkctrl)

Function for setting HSFLL clock control mode settings.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_clkctrl[in] Pointer to the structure with new HSFLL clock control mode settings.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_mode_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_clkctrl_t *p_clkctrl)

Function for getting HSFLL clock control mode settings.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_clkctrl[out] Pointer to the structure to be filled with HSFLL clock control settings.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_dithering_set(NRF_HSFLL_Type *p_reg, nrf_hsfll_dithering_t const *p_config)

Function for setting HSFLL clock dithering configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_config[in] Pointer to the structure with new HSFLL clock dithering configuration.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_dithering_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_dithering_t *p_config)

Function for getting HSFLL clock dithering configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_config[out] Pointer to the structure to be filled with HSFLL clock dithering configuration.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_mult_set(NRF_HSFLL_Type *p_reg, uint32_t multiplier)

Function for setting HSFLL frequency multiplier.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • multiplier[in] Value of new multiplier. Valid multiplier range is from 4 to 25.

NRF_STATIC_INLINE uint32_t nrf_hsfll_clkctrl_mult_get(NRF_HSFLL_Type const *p_reg)

Function for getting HSFLL frequency multiplier.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Current value of frequency multiplier used by HSFLL.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_sleep_set(NRF_HSFLL_Type *p_reg, nrf_hsfll_sleep_t const *p_config)

Function for setting HSFLL clock sleep configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_config[in] Pointer to the structure with new HSFLL clock sleep configuration.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_sleep_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_sleep_t *p_config)

Function for getting HSFLL clock sleep configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_config[out] Pointer to the structure to be filled with HSFLL clock sleep configuration.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_retainfinetrim_enable_set(NRF_HSFLL_Type *p_reg, bool retain)

Function for enabling or disabling the retention of HSFLL fine trim control.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • retain[in] True if the fine trim control is to be retained when HSFLL goes to open-loop mode, false otherwise.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_overridelocked_enable_set(NRF_HSFLL_Type *p_reg, bool override)

Function for enabling or disabling the override of the HSFLL LOCKED signal.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • override[in] True if the override is to be enabled, false otherwise.

NRF_STATIC_INLINE void nrf_hsfll_clkctrl_dither_init_set(NRF_HSFLL_Type *p_reg, uint32_t seed)

Function for setting the configurable seed of HSFLL clock dithering.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • seed[in] 32-bit initial value for the PRBS.

NRF_STATIC_INLINE void nrf_hsfll_mirror_lock_set(NRF_HSFLL_Type *p_reg, bool enable)

Function for enabling or disabling lock for mirrored registers.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if the lock is to be enabled, false otherwise.

NRF_STATIC_INLINE void nrf_hsfll_trim_set(NRF_HSFLL_Type *p_reg, nrf_hsfll_trim_t const *p_trim)

Function to setup trims configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_trim[in] Pointer to the structure with new HSFLL trim configuration.

NRF_STATIC_INLINE void nrf_hsfll_trim_get(NRF_HSFLL_Type const *p_reg, nrf_hsfll_trim_t *p_trim)

Function to getting trims configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_trim[in] Pointer to the structure to be filled with HSFLL trim configuration.

struct nrf_hsfll_status_clk_t
#include <nrf_hsfll.h>

HSFLL clock status.

Public Members

nrf_hsfll_mode_status_t mode

HSFLL operating mode.

bool override

HSFLL override mode is enabled.

bool accuracy

Clock accurracy is within 2%.

bool locked

HSFLL locked to reference clock.

struct nrf_hsfll_freqm_error_t
#include <nrf_hsfll.h>

HSFLL frequency measurements errors.

Public Members

bool error

Trim error status. True if outside limit, false if within.

bool trim_underflow

Underflow error status. True if outside limit, false if within.

bool trim_overflow

Overflow error status. True if outside limit, false if within.

struct nrf_hsfll_clkctrl_t
#include <nrf_hsfll.h>

HSFLL clock control.

Public Members

nrf_hsfll_mode_ctrl_t mode

HSFLL operating mode.

bool override

HSFLL override mode. True if enabled, false otherwise.

struct nrf_hsfll_dithering_t
#include <nrf_hsfll.h>

HSFLL clock dithering configuration.

Public Members

uint8_t cyclecount

Cycle count configuration for clock dithering.

uint8_t maxoffset

Maximum offset configuration for clock dithering.

uint16_t initvalue

Initial value for the clock dithering.

bool enable

Enable the clock dithering.

struct nrf_hsfll_sleep_t
#include <nrf_hsfll.h>

HSFLL clock sleep configuration.

Public Members

bool mode

Power down the HSFLL core. True if powered down, false if in normal mode.

bool retain

Retain all inputs while powered down. True if retention is enabled, false otherwise.

struct nrf_hsfll_trim_t
#include <nrf_hsfll.h>

HSFLL trims configuration.

Public Members

uint16_t coarse

Coarse frequance trimming.

uint16_t fine

Fine frequency trimming.

uint8_t vsup

Internal regulator voltage supply level trimming.