MWU HAL

group nrf_mwu_hal

Hardware access layer for managing the Memory Watch Unit (MWU) peripheral.

Enums

enum nrf_mwu_event_t

MWU events.

Values:

enumerator NRF_MWU_EVENT_REGION0_WRITE

Write access to region 0 detected.

enumerator NRF_MWU_EVENT_REGION0_READ

Read access to region 0 detected.

enumerator NRF_MWU_EVENT_REGION1_WRITE

Write access to region 1 detected.

enumerator NRF_MWU_EVENT_REGION1_READ

Read access to region 1 detected.

enumerator NRF_MWU_EVENT_REGION2_WRITE

Write access to region 2 detected.

enumerator NRF_MWU_EVENT_REGION2_READ

Read access to region 2 detected.

enumerator NRF_MWU_EVENT_REGION3_WRITE

Write access to region 3 detected.

enumerator NRF_MWU_EVENT_REGION3_READ

Read access to region 3 detected.

enumerator NRF_MWU_EVENT_PREGION0_WRITE

Write access to peripheral region 0 detected.

enumerator NRF_MWU_EVENT_PREGION0_READ

Read access to peripheral region 0 detected.

enumerator NRF_MWU_EVENT_PREGION1_WRITE

Write access to peripheral region 1 detected.

enumerator NRF_MWU_EVENT_PREGION1_READ

Read access to peripheral region 1 detected.

enum nrf_mwu_int_mask_t

MWU interrupt masks.

Values:

enumerator NRF_MWU_INT_REGION0_WRITE_MASK

Interrupt on REGION[0].WA event.

enumerator NRF_MWU_INT_REGION0_READ_MASK

Interrupt on REGION[0].RA event.

enumerator NRF_MWU_INT_REGION1_WRITE_MASK

Interrupt on REGION[1].WA event.

enumerator NRF_MWU_INT_REGION1_READ_MASK

Interrupt on REGION[1].RA event.

enumerator NRF_MWU_INT_REGION2_WRITE_MASK

Interrupt on REGION[2].WA event.

enumerator NRF_MWU_INT_REGION2_READ_MASK

Interrupt on REGION[2].RA event.

enumerator NRF_MWU_INT_REGION3_WRITE_MASK

Interrupt on REGION[3].WA event.

enumerator NRF_MWU_INT_REGION3_READ_MASK

Interrupt on REGION[3].RA event.

enumerator NRF_MWU_INT_PREGION0_WRITE_MASK

Interrupt on PREGION[0].WA event.

enumerator NRF_MWU_INT_PREGION0_READ_MASK

Interrupt on PREGION[0].RA event.

enumerator NRF_MWU_INT_PREGION1_WRITE_MASK

Interrupt on PREGION[1].WA event.

enumerator NRF_MWU_INT_PREGION1_READ_MASK

Interrupt on PREGION[1].RA event.

enum nrf_mwu_region_watch_t

MWU region watch masks.

Values:

enumerator NRF_MWU_WATCH_REGION0_WRITE

Region 0 write access watch mask.

enumerator NRF_MWU_WATCH_REGION0_READ

Region 0 read access watch mask.

enumerator NRF_MWU_WATCH_REGION1_WRITE

Region 1 write access watch mask.

enumerator NRF_MWU_WATCH_REGION1_READ

Region 1 read access watch mask.

enumerator NRF_MWU_WATCH_REGION2_WRITE

Region 2 write access watch mask.

enumerator NRF_MWU_WATCH_REGION2_READ

Region 2 read access watch mask.

enumerator NRF_MWU_WATCH_REGION3_WRITE

Region 3 write access watch mask.

enumerator NRF_MWU_WATCH_REGION3_READ

Region 3 read access watch mask.

enumerator NRF_MWU_WATCH_PREGION0_WRITE

Peripheral region 0 write access watch mask.

enumerator NRF_MWU_WATCH_PREGION0_READ

Peripheral region 0 read access watch mask.

enumerator NRF_MWU_WATCH_PREGION1_WRITE

Peripheral region 1 write access watch mask.

enumerator NRF_MWU_WATCH_PREGION1_READ

Peripheral region 1 read access watch mask.

Functions

NRF_STATIC_INLINE bool nrf_mwu_event_check(NRF_MWU_Type const *p_reg, nrf_mwu_event_t event)

Function for retrieving the state of the MWU 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_mwu_event_clear(NRF_MWU_Type *p_reg, nrf_mwu_event_t event)

Function for clearing a specific MWU event.

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

  • event[in] Event to clear.

NRF_STATIC_INLINE uint32_t nrf_mwu_event_address_get(NRF_MWU_Type const *p_reg, nrf_mwu_event_t event)

Function for getting the address of a specific MWU event register.

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

  • event[in] Requested event.

Returns:

Address of the specified event register.

NRF_STATIC_INLINE void nrf_mwu_int_enable(NRF_MWU_Type *p_reg, uint32_t mask)

Function for enabling specified interrupts.

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

  • mask[in] Mask of interrupts to be enabled. Use nrf_mwu_int_mask_t values for bit masking.

NRF_STATIC_INLINE uint32_t nrf_mwu_int_enable_check(NRF_MWU_Type const *p_reg, uint32_t mask)

Function for checking if the specified interrupts are enabled.

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

  • mask[in] Mask of interrupts to be checked. Use nrf_mwu_int_mask_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRF_STATIC_INLINE void nrf_mwu_int_disable(NRF_MWU_Type *p_reg, uint32_t mask)

Function for disabling specified interrupts.

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

  • mask[in] Mask of interrupts to be disabled. Use nrf_mwu_int_mask_t values for bit masking.

NRF_STATIC_INLINE void nrf_mwu_nmi_enable(NRF_MWU_Type *p_reg, uint32_t mask)

Function for enabling specified non-maskable interrupts.

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

  • mask[in] Mask of interrupts to be enabled.

NRF_STATIC_INLINE uint32_t nrf_mwu_nmi_enable_check(NRF_MWU_Type const *p_reg, uint32_t mask)

Function for checking if the specified non-maskable interrupts are enabled.

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

  • mask[in] Mask of interrupts to be checked.

Returns:

Mask of enabled interrupts.

NRF_STATIC_INLINE void nrf_mwu_nmi_disable(NRF_MWU_Type *p_reg, uint32_t mask)

Function for disabling specified non-maskable interrupts.

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

  • mask[in] Mask of interrupts to be disabled.

NRF_STATIC_INLINE void nrf_mwu_user_region_range_set(NRF_MWU_Type *p_reg, uint8_t region_idx, uint32_t start_addr, uint32_t end_addr)

Function for setting address range of the specified user region.

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

  • region_idx[in] Region number to configure.

  • start_addr[in] Memory address defining the beginning of the region.

  • end_addr[in] Memory address defining the end of the region.

NRF_STATIC_INLINE void nrf_mwu_region_watch_enable(NRF_MWU_Type *p_reg, uint32_t reg_watch_mask)

Function for enabling memory access watch mechanism.

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

  • reg_watch_mask[in] Mask that defines regions and access types to watch. Compose this mask from nrf_mwu_region_watch_t values.

NRF_STATIC_INLINE void nrf_mwu_region_watch_disable(NRF_MWU_Type *p_reg, uint32_t reg_watch_mask)

Function for disabling memory access watch mechanism.

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

  • reg_watch_mask[in] Mask that defines regions and access types to stop watching. Compose this mask from nrf_mwu_region_watch_t values.

NRF_STATIC_INLINE uint32_t nrf_mwu_region_watch_get(NRF_MWU_Type const *p_reg)

Function for getting memory access watch configuration mask.

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

Returns:

Mask that defines regions and access types being watched.

NRF_STATIC_INLINE void nrf_mwu_subregions_configure(NRF_MWU_Type *p_reg, uint8_t per_reg_idx, uint32_t subregion_mask)

Function for configuring peripheral subregions for watching.

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

  • per_reg_idx[in] Peripheral region containing specified subregions.

  • subregion_mask[in] Mask that defines subregions to include into the specified peripheral region.

NRF_STATIC_INLINE uint32_t nrf_mwu_subregions_write_accesses_get(NRF_MWU_Type const *p_reg, uint8_t per_reg_idx)

Function for getting the mask of the write access flags of peripheral subregions.

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

  • per_reg_idx[in] Peripheral region containing subregions to be checked.

Returns:

Mask specifying subregions that were write accessed.

NRF_STATIC_INLINE void nrf_mwu_subregions_write_accesses_clear(NRF_MWU_Type *p_reg, uint8_t per_reg_idx, uint32_t subregion_mask)

Function for clearing write access flags of peripheral subregions.

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

  • per_reg_idx[in] Peripheral region containing subregion accesses to clear.

  • subregion_mask[in] Mask that defines subregion write accesses to clear.

NRF_STATIC_INLINE uint32_t nrf_mwu_subregions_read_accesses_get(NRF_MWU_Type const *p_reg, uint8_t per_reg_idx)

Function for getting the mask of the read access flags of peripheral subregions.

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

  • per_reg_idx[in] Peripheral region containing subregions to be checked.

Returns:

Mask specifying subregions that were read accessed.

NRF_STATIC_INLINE void nrf_mwu_subregions_read_accesses_clear(NRF_MWU_Type *p_reg, uint8_t per_reg_idx, uint32_t subregion_mask)

Function for clearing read access flags of peripheral subregions.

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

  • per_reg_idx[in] Peripheral region containing subregion accesses to clear.

  • subregion_mask[in] Mask that defines subregion read accesses to clear.