nrfx 2.5
Enumerations | Functions
USBREG HAL

Hardware access layer for managing the USB regulator peripheral. More...

Enumerations

enum  nrf_usbreg_event_t {
  NRF_USBREG_EVENT_USBDETECTED = offsetof(NRF_USBREG_Type, EVENTS_USBDETECTED),
  NRF_USBREG_EVENT_USBREMOVED = offsetof(NRF_USBREG_Type, EVENTS_USBREMOVED),
  NRF_USBREG_EVENT_USBPWRRDY = offsetof(NRF_USBREG_Type, EVENTS_USBPWRRDY)
}
 USBREG events. More...
 
enum  nrf_usbreg_int_mask_t {
  NRF_USBREG_INT_USBDETECTED = USBREG_INTEN_USBDETECTED_Msk,
  NRF_USBREG_INT_USBREMOVED = USBREG_INTEN_USBREMOVED_Msk,
  NRF_USBREG_INT_USBPWRRDY = USBREG_INTEN_USBPWRRDY_Msk
}
 USBREG interrupts. More...
 
enum  nrf_usbreg_status_mask_t {
  NRF_USBREG_STATUS_VBUSDETECT_MASK = USBREG_USBREGSTATUS_VBUSDETECT_Msk,
  NRF_USBREG_STATUS_OUTPUTRDY_MASK = USBREG_USBREGSTATUS_OUTPUTRDY_Msk
}
 USBREGSTATUS register bit masks. More...
 

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. More...
 
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. More...
 
NRF_STATIC_INLINE void nrf_usbreg_int_enable (NRF_USBREG_Type *p_reg, uint32_t mask)
 Function for enabling specified interrupts. More...
 
NRF_STATIC_INLINE void nrf_usbreg_int_disable (NRF_USBREG_Type *p_reg, uint32_t mask)
 Function for disabling specified interrupts. More...
 
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. More...
 
NRF_STATIC_INLINE uint32_t nrf_usbreg_status_get (NRF_USBREG_Type const *p_reg)
 Function for getting the whole USBREGSTATUS register. More...
 

Detailed Description

Hardware access layer for managing the USB regulator peripheral.

Enumeration Type Documentation

◆ nrf_usbreg_event_t

USBREG events.

Enumerator
NRF_USBREG_EVENT_USBDETECTED 

Voltage supply detected on VBUS.

NRF_USBREG_EVENT_USBREMOVED 

Voltage supply removed from VBUS.

NRF_USBREG_EVENT_USBPWRRDY 

USB 3.3 V supply ready.

◆ nrf_usbreg_int_mask_t

USBREG interrupts.

Enumerator
NRF_USBREG_INT_USBDETECTED 

Interrupt on USBDETECTED.

NRF_USBREG_INT_USBREMOVED 

Interrupt on USBREMOVED.

NRF_USBREG_INT_USBPWRRDY 

Interrupt on USBPWRRDY.

◆ nrf_usbreg_status_mask_t

USBREGSTATUS register bit masks.

Enumerator
NRF_USBREG_STATUS_VBUSDETECT_MASK 

USB detected or removed.

NRF_USBREG_STATUS_OUTPUTRDY_MASK 

USB 3.3 V supply ready.

Function Documentation

◆ nrf_usbreg_event_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrf_usbreg_event_clear()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be cleared.

◆ nrf_usbreg_int_disable()

NRF_STATIC_INLINE void nrf_usbreg_int_disable ( NRF_USBREG_Type *  p_reg,
uint32_t  mask 
)

Function for disabling specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled.

◆ nrf_usbreg_int_enable()

NRF_STATIC_INLINE void nrf_usbreg_int_enable ( NRF_USBREG_Type *  p_reg,
uint32_t  mask 
)

Function for enabling specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled.

◆ nrf_usbreg_int_enable_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked.
Returns
Mask of enabled interrupts.

◆ nrf_usbreg_status_get()

NRF_STATIC_INLINE uint32_t nrf_usbreg_status_get ( NRF_USBREG_Type const *  p_reg)

Function for getting the whole USBREGSTATUS register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
The USBREGSTATUS register value. Use nrf_usbreg_status_mask_t values for bit masking.

Documentation feedback | Developer Zone | Subscribe | Updated