USBREG HAL

group nrf_usbreg_hal

Hardware access layer for managing the USB regulator peripheral.

Enums

enum nrf_usbreg_event_t

USBREG events.

Values:

enumerator NRF_USBREG_EVENT_USBDETECTED

Voltage supply detected on VBUS.

enumerator NRF_USBREG_EVENT_USBREMOVED

Voltage supply removed from VBUS.

enumerator NRF_USBREG_EVENT_USBPWRRDY

USB 3.3V supply ready.

enum nrf_usbreg_int_mask_t

USBREG interrupts.

Values:

enumerator NRF_USBREG_INT_USBDETECTED

Interrupt on USBDETECTED.

enumerator NRF_USBREG_INT_USBREMOVED

Interrupt on USBREMOVED.

enumerator NRF_USBREG_INT_USBPWRRDY

Interrupt on USBPWRRDY.

enum nrf_usbreg_status_mask_t

USBREGSTATUS register bit masks.

Values:

enumerator NRF_USBREG_STATUS_VBUSDETECT_MASK

USB detected or removed.

enumerator NRF_USBREG_STATUS_OUTPUTRDY_MASK

USB 3.3V supply ready.

Functions

NRF_STATIC_INLINE void nrf_usbreg_event_clear(NRF_USBREG_Type *p_reg, nrf_usbreg_event_t event)

Function for clearing the specified USBREG 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_usbreg_event_check(NRF_USBREG_Type const *p_reg, nrf_usbreg_event_t event)

Function for retrieving the state of the USBREG 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_usbreg_int_enable(NRF_USBREG_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.

NRF_STATIC_INLINE void nrf_usbreg_int_disable(NRF_USBREG_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.

NRF_STATIC_INLINE uint32_t nrf_usbreg_int_enable_check(NRF_USBREG_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.

Returns

Mask of enabled interrupts.

NRF_STATIC_INLINE uint32_t nrf_usbreg_status_get(NRF_USBREG_Type const *p_reg)

Function for getting the whole USBREGSTATUS register.

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

Returns

The USBREGSTATUS register value. Use nrf_usbreg_status_mask_t values for bit masking.