USBHS HAL

group nrf_usbhs_hal

Hardware access layer for managing the Universal Serial Bus High Speed (USBHS) peripheral.

Enums

enum nrf_usbhs_task_t

USBHS tasks.

Values:

enumerator NRF_USBHS_TASK_START

Start the USB peripheral.

enum nrf_usbhs_event_t

USBHS events.

Values:

enumerator NRF_USBHS_EVENT_CORE

Signal that the USB reset condition is detected on the USB lines.

enum nrf_usbhs_int_mask_t

USBHS interrupts.

Values:

enumerator NRF_USBHS_INT_USBCORE_MASK

Interrupt on the USBCORE event.

Functions

NRF_STATIC_INLINE void nrf_usbhs_task_trigger(NRF_USBHS_Type *p_reg, nrf_usbhs_task_t task)

Function for activating the specified USBHS 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_usbhs_task_address_get(NRF_USBHS_Type const *p_reg, nrf_usbhs_task_t task)

Function for returning the address of the specified USBHS task register.

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

  • task[in] The specified task.

Returns:

Task address.

NRF_STATIC_INLINE void nrf_usbhs_event_clear(NRF_USBHS_Type *p_reg, nrf_usbhs_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_usbhs_event_check(NRF_USBHS_Type const *p_reg, nrf_usbhs_event_t event)

Function for retrieving the state of the USBHS 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 bool nrf_usbhs_event_get_and_clear(NRF_USBHS_Type *p_reg, nrf_usbhs_event_t event)

Function for getting and clearing the state of the specified event.

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

  • event[in] Event to be cleared.

Return values:
  • true – The event was set.

  • false – The event was not set.

NRF_STATIC_INLINE uint32_t nrf_usbhs_event_address_get(NRF_USBHS_Type const *p_reg, nrf_usbhs_event_t event)

Function for returning the address of the specified USBHS event register.

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

  • event[in] The specified event.

Returns:

Address of the event specified as a function parameter.

NRF_STATIC_INLINE void nrf_usbhs_int_enable(NRF_USBHS_Type *p_reg, uint32_t mask)

Function for enabling the selected interrupts.

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

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

NRF_STATIC_INLINE uint32_t nrf_usbhs_int_enable_check(NRF_USBHS_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_usbhs_int_mask_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRF_STATIC_INLINE uint32_t nrf_usbhs_int_enable_get(NRF_USBHS_Type const *p_reg)

Function for retrieving the information about the enabled interrupts.

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

Returns:

The flags of the enabled interrupts.

NRF_STATIC_INLINE void nrf_usbhs_int_disable(NRF_USBHS_Type *p_reg, uint32_t mask)

Function for disabling the selected interrupts.

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

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

NRF_STATIC_INLINE void nrf_usbhs_enable(NRF_USBHS_Type *p_reg)

Function for enabling the USBHS.

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

NRF_STATIC_INLINE void nrf_usbhs_disable(NRF_USBHS_Type *p_reg)

Function for disabling the USBHS.

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