USBREG driver

group nrfx_usbreg

USB regulators (USBREG) peripheral driver.

Typedefs

typedef void (*nrfx_usbreg_event_handler_t)(nrfx_usbreg_evt_t event)

Event handler for the USB-related power events.

Param event:

Event type

Enums

enum nrfx_usbreg_evt_t

Events from USB power system.

Values:

enumerator NRFX_USBREG_EVT_DETECTED

USB power detected on the connector (plugged in).

enumerator NRFX_USBREG_EVT_REMOVED

USB power removed from the connector.

enumerator NRFX_USBREG_EVT_READY

USB power regulator ready.

enum nrfx_usbreg_state_t

USB power state.

The single enumerator that holds all data about current state of USB related POWER.

Organized this way that higher power state has higher numeric value

Values:

enumerator NRFX_USBREG_STATE_DISCONNECTED

No power on USB lines detected.

enumerator NRFX_USBREG_STATE_CONNECTED

The USB power is detected, but USB power regulator is not ready.

enumerator NRFX_USBREG_STATE_READY

From the power viewpoint, USB is ready for working.

Functions

nrfx_usbreg_event_handler_t nrfx_usbreg_handler_get(void)

Function for getting the USBREG handler.

Returns:

Handler of the USB power.

void nrfx_usbreg_init(nrfx_usbreg_config_t const *p_config)

Function for initializing the processing of USBREG events.

Configures and sets up the USB power event processing.

Parameters:
  • p_config[in] Configuration structure. Must not be NULL.

void nrfx_usbreg_enable(void)

Function for enabling the processing of USBREG events.

void nrfx_usbreg_disable(void)

Function for disabling the processing of USBREG events.

void nrfx_usbreg_uninit(void)

Function for uninitalizing the processing of USBREG events.

See also

nrfx_usbreg_init

NRFX_STATIC_INLINE nrfx_usbreg_state_t nrfx_usbreg_usbstatus_get(void)

Function for getting the status of USBREG.

Returns:

Current USB power status.

struct nrfx_usbreg_config_t
#include <nrfx_usbreg.h>

The configuration of the USB-related power events.

Configuration used to enable and configure USB power event handling.

Public Members

nrfx_usbreg_event_handler_t handler

Event processing.

uint8_t irq_priority

Priority of the USBREG interrupt.