nRF52840 only: Hardware access layer for Two Wire Interface Slave with EasyDMA (USBD) peripheral. More...
Enumerations |
|
| enum |
nrf_usbd_task_t
{
NRF_USBD_TASK_STARTEPIN0 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[0] ), NRF_USBD_TASK_STARTEPIN1 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[1] ), NRF_USBD_TASK_STARTEPIN2 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[2] ), NRF_USBD_TASK_STARTEPIN3 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[3] ), NRF_USBD_TASK_STARTEPIN4 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[4] ), NRF_USBD_TASK_STARTEPIN5 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[5] ), NRF_USBD_TASK_STARTEPIN6 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[6] ), NRF_USBD_TASK_STARTEPIN7 = offsetof(NRF_USBD_Type, TASKS_STARTEPIN[7] ), NRF_USBD_TASK_STARTISOIN = offsetof(NRF_USBD_Type, TASKS_STARTISOIN ), NRF_USBD_TASK_STARTEPOUT0 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[0]), NRF_USBD_TASK_STARTEPOUT1 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[1]), NRF_USBD_TASK_STARTEPOUT2 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[2]), NRF_USBD_TASK_STARTEPOUT3 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[3]), NRF_USBD_TASK_STARTEPOUT4 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[4]), NRF_USBD_TASK_STARTEPOUT5 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[5]), NRF_USBD_TASK_STARTEPOUT6 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[6]), NRF_USBD_TASK_STARTEPOUT7 = offsetof(NRF_USBD_Type, TASKS_STARTEPOUT[7]), NRF_USBD_TASK_STARTISOOUT = offsetof(NRF_USBD_Type, TASKS_STARTISOOUT ), NRF_USBD_TASK_EP0RCVOUT = offsetof(NRF_USBD_Type, TASKS_EP0RCVOUT ), NRF_USBD_TASK_EP0STATUS = offsetof(NRF_USBD_Type, TASKS_EP0STATUS ), NRF_USBD_TASK_EP0STALL = offsetof(NRF_USBD_Type, TASKS_EP0STALL ), NRF_USBD_TASK_DRIVEDPDM = offsetof(NRF_USBD_Type, TASKS_DPDMDRIVE ), NRF_USBD_TASK_NODRIVEDPDM = offsetof(NRF_USBD_Type, TASKS_DPDMNODRIVE ) } |
|
USBD tasks.
More...
|
|
| enum |
nrf_usbd_event_t
{
NRF_USBD_EVENT_USBRESET = offsetof(NRF_USBD_Type, EVENTS_USBRESET ), NRF_USBD_EVENT_STARTED = offsetof(NRF_USBD_Type, EVENTS_STARTED ), NRF_USBD_EVENT_ENDEPIN0 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[0] ), NRF_USBD_EVENT_ENDEPIN1 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[1] ), NRF_USBD_EVENT_ENDEPIN2 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[2] ), NRF_USBD_EVENT_ENDEPIN3 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[3] ), NRF_USBD_EVENT_ENDEPIN4 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[4] ), NRF_USBD_EVENT_ENDEPIN5 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[5] ), NRF_USBD_EVENT_ENDEPIN6 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[6] ), NRF_USBD_EVENT_ENDEPIN7 = offsetof(NRF_USBD_Type, EVENTS_ENDEPIN[7] ), NRF_USBD_EVENT_EP0DATADONE = offsetof(NRF_USBD_Type, EVENTS_EP0DATADONE), NRF_USBD_EVENT_ENDISOIN0 = offsetof(NRF_USBD_Type, EVENTS_ENDISOIN ), NRF_USBD_EVENT_ENDEPOUT0 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[0]), NRF_USBD_EVENT_ENDEPOUT1 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[1]), NRF_USBD_EVENT_ENDEPOUT2 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[2]), NRF_USBD_EVENT_ENDEPOUT3 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[3]), NRF_USBD_EVENT_ENDEPOUT4 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[4]), NRF_USBD_EVENT_ENDEPOUT5 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[5]), NRF_USBD_EVENT_ENDEPOUT6 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[6]), NRF_USBD_EVENT_ENDEPOUT7 = offsetof(NRF_USBD_Type, EVENTS_ENDEPOUT[7]), NRF_USBD_EVENT_ENDISOOUT0 = offsetof(NRF_USBD_Type, EVENTS_ENDISOOUT ), NRF_USBD_EVENT_SOF = offsetof(NRF_USBD_Type, EVENTS_SOF ), NRF_USBD_EVENT_USBEVENT = offsetof(NRF_USBD_Type, EVENTS_USBEVENT ), NRF_USBD_EVENT_EP0SETUP = offsetof(NRF_USBD_Type, EVENTS_EP0SETUP ), NRF_USBD_EVENT_DATAEP = offsetof(NRF_USBD_Type, EVENTS_EPDATA ), NRF_USBD_EVENT_ACCESSFAULT = offsetof(NRF_USBD_Type, EVENTS_ACCESSFAULT) } |
|
USBD events.
More...
|
|
| enum |
nrf_usbd_short_mask_t
{
NRF_USBD_SHORT_EP0DATADONE_STARTEPIN0_MASK = USBD_SHORTS_EP0DATADONE_STARTEPIN0_Msk, NRF_USBD_SHORT_EP0DATADONE_STARTEPOUT0_MASK = USBD_SHORTS_EP0DATADONE_STARTEPOUT0_Msk, NRF_USBD_SHORT_EP0DATADONE_EP0STATUS_MASK = USBD_SHORTS_EP0DATADONE_EP0STATUS_Msk, NRF_USBD_SHORT_ENDEPOUT0_EP0STATUS_MASK = USBD_SHORTS_ENDEPOUT0_EP0STATUS_Msk, NRF_USBD_SHORT_ENDEPOUT0_EP0RCVOUT_MASK = USBD_SHORTS_ENDEPOUT0_EP0RCVOUT_Msk } |
|
USBD shorts.
More...
|
|
| enum |
nrf_usbd_int_mask_t
{
NRF_USBD_INT_USBRESET_MASK = USBD_INTEN_USBRESET_Msk, NRF_USBD_INT_STARTED_MASK = USBD_INTEN_STARTED_Msk, NRF_USBD_INT_ENDEPIN0_MASK = USBD_INTEN_ENDEPIN0_Msk, NRF_USBD_INT_ENDEPIN1_MASK = USBD_INTEN_ENDEPIN1_Msk, NRF_USBD_INT_ENDEPIN2_MASK = USBD_INTEN_ENDEPIN2_Msk, NRF_USBD_INT_ENDEPIN3_MASK = USBD_INTEN_ENDEPIN3_Msk, NRF_USBD_INT_ENDEPIN4_MASK = USBD_INTEN_ENDEPIN4_Msk, NRF_USBD_INT_ENDEPIN5_MASK = USBD_INTEN_ENDEPIN5_Msk, NRF_USBD_INT_ENDEPIN6_MASK = USBD_INTEN_ENDEPIN6_Msk, NRF_USBD_INT_ENDEPIN7_MASK = USBD_INTEN_ENDEPIN7_Msk, NRF_USBD_INT_EP0DATADONE_MASK = USBD_INTEN_EP0DATADONE_Msk, NRF_USBD_INT_ENDISOIN0_MASK = USBD_INTEN_ENDISOIN_Msk, NRF_USBD_INT_ENDEPOUT0_MASK = USBD_INTEN_ENDEPOUT0_Msk, NRF_USBD_INT_ENDEPOUT1_MASK = USBD_INTEN_ENDEPOUT1_Msk, NRF_USBD_INT_ENDEPOUT2_MASK = USBD_INTEN_ENDEPOUT2_Msk, NRF_USBD_INT_ENDEPOUT3_MASK = USBD_INTEN_ENDEPOUT3_Msk, NRF_USBD_INT_ENDEPOUT4_MASK = USBD_INTEN_ENDEPOUT4_Msk, NRF_USBD_INT_ENDEPOUT5_MASK = USBD_INTEN_ENDEPOUT5_Msk, NRF_USBD_INT_ENDEPOUT6_MASK = USBD_INTEN_ENDEPOUT6_Msk, NRF_USBD_INT_ENDEPOUT7_MASK = USBD_INTEN_ENDEPOUT7_Msk, NRF_USBD_INT_ENDISOOUT0_MASK = USBD_INTEN_ENDISOOUT_Msk, NRF_USBD_INT_SOF_MASK = USBD_INTEN_SOF_Msk, NRF_USBD_INT_USBEVENT_MASK = USBD_INTEN_USBEVENT_Msk, NRF_USBD_INT_EP0SETUP_MASK = USBD_INTEN_EP0SETUP_Msk, NRF_USBD_INT_DATAEP_MASK = USBD_INTEN_EPDATA_Msk, NRF_USBD_INT_ACCESSFAULT_MASK = USBD_INTEN_ACCESSFAULT_Msk } |
|
USBD interrupts.
More...
|
|
Functions |
|
| __STATIC_INLINE void | nrf_usbd_task_trigger ( nrf_usbd_task_t task) |
|
Function for activating a specific USBD task.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_task_address_get ( nrf_usbd_task_t task) |
|
Function for returning the address of a specific USBD task register.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_event_clear ( nrf_usbd_event_t event) |
|
Function for clearing a specific event.
More...
|
|
| __STATIC_INLINE bool | nrf_usbd_event_check ( nrf_usbd_event_t event) |
|
Function for returning the state of a specific event.
More...
|
|
| __STATIC_INLINE bool | nrf_usbd_event_get_and_clear ( nrf_usbd_event_t event) |
|
Function for getting and clearing the state of specific event.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_event_address_get ( nrf_usbd_event_t event) |
|
Function for returning the address of a specific USBD event register.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_shorts_enable (uint32_t short_mask) |
|
Function for setting a shortcut.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_shorts_disable (uint32_t short_mask) |
|
Function for clearing shortcuts.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_shorts_get (void) |
|
Get the shorts mask.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_int_enable (uint32_t int_mask) |
|
Function for enabling selected interrupts.
More...
|
|
| __STATIC_INLINE bool | nrf_usbd_int_enable_check (uint32_t int_mask) |
|
Function for retrieving the state of selected interrupts.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_int_enable_get (void) |
|
Function for retrieving the information about enabled interrupts.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_int_disable (uint32_t int_mask) |
|
Function for disabling selected interrupts.
More...
|
|
| enum |
nrf_usbd_eventcause_mask_t
{
NRF_USBD_EVENTCAUSE_ISOOUTCRC_MASK = USBD_EVENTCAUSE_ISOOUTCRC_Msk, NRF_USBD_EVENTCAUSE_SUSPEND_MASK = USBD_EVENTCAUSE_SUSPEND_Msk, NRF_USBD_EVENTCAUSE_RESUME_MASK = USBD_EVENTCAUSE_RESUME_Msk, NRF_USBD_EVENTCAUSE_READY_MASK = USBD_EVENTCAUSE_READY_Msk } |
|
EVENTCAUSE register bit masks.
|
|
| enum |
nrf_usbd_busstate_t
{
NRF_USBD_BUSSTATE_DM_MASK = USBD_BUSSTATE_DM_Msk, NRF_USBD_BUSSTATE_DP_MASK = USBD_BUSSTATE_DP_Msk, NRF_USBD_BUSSTATE_DPDM_LL = (USBD_BUSSTATE_DM_Low << USBD_BUSSTATE_DM_Pos) | (USBD_BUSSTATE_DP_Low << USBD_BUSSTATE_DP_Pos), NRF_USBD_BUSSTATE_DPDM_HL = (USBD_BUSSTATE_DM_Low << USBD_BUSSTATE_DM_Pos) | (USBD_BUSSTATE_DP_High << USBD_BUSSTATE_DP_Pos), NRF_USBD_BUSSTATE_DPDM_LH = (USBD_BUSSTATE_DM_High << USBD_BUSSTATE_DM_Pos) | (USBD_BUSSTATE_DP_Low << USBD_BUSSTATE_DP_Pos), NRF_USBD_BUSSTATE_DPDM_HH = (USBD_BUSSTATE_DM_High << USBD_BUSSTATE_DM_Pos) | (USBD_BUSSTATE_DP_High << USBD_BUSSTATE_DP_Pos), NRF_USBD_BUSSTATE_J = NRF_USBD_BUSSTATE_DPDM_HL, NRF_USBD_BUSSTATE_K = NRF_USBD_BUSSTATE_DPDM_LH, NRF_USBD_BUSSTATE_SE0 = NRF_USBD_BUSSTATE_DPDM_LL, NRF_USBD_BUSSTATE_SE1 = NRF_USBD_BUSSTATE_DPDM_HH } |
|
BUSSTATE register bit masks.
|
|
| enum |
nrf_usbd_dpdmvalue_t
{
NRF_USBD_DPDMVALUE_RESUME = USBD_DPDMVALUE_STATE_Resume, NRF_USBD_DPDMVALUE_J = USBD_DPDMVALUE_STATE_J, NRF_USBD_DPMVALUE_K = USBD_DPDMVALUE_STATE_K } |
|
DPDMVALUE register.
|
|
| enum |
nrf_usbd_dtoggle_t
{
NRF_USBD_DTOGGLE_NOP = USBD_DTOGGLE_VALUE_Nop, NRF_USBD_DTOGGLE_DATA0 = USBD_DTOGGLE_VALUE_Data0, NRF_USBD_DTOGGLE_DATA1 = USBD_DTOGGLE_VALUE_Data1 } |
|
Dtoggle value or operation.
|
|
| enum |
nrf_usbd_epstatus_mask_t
{
NRF_USBD_EPSTATUS_EPIN0_MASK = USBD_EPSTATUS_EPIN0_Msk, NRF_USBD_EPSTATUS_EPIN1_MASK = USBD_EPSTATUS_EPIN1_Msk, NRF_USBD_EPSTATUS_EPIN2_MASK = USBD_EPSTATUS_EPIN2_Msk, NRF_USBD_EPSTATUS_EPIN3_MASK = USBD_EPSTATUS_EPIN3_Msk, NRF_USBD_EPSTATUS_EPIN4_MASK = USBD_EPSTATUS_EPIN4_Msk, NRF_USBD_EPSTATUS_EPIN5_MASK = USBD_EPSTATUS_EPIN5_Msk, NRF_USBD_EPSTATUS_EPIN6_MASK = USBD_EPSTATUS_EPIN6_Msk, NRF_USBD_EPSTATUS_EPIN7_MASK = USBD_EPSTATUS_EPIN7_Msk, NRF_USBD_EPSTATUS_EPOUT0_MASK = USBD_EPSTATUS_EPOUT0_Msk, NRF_USBD_EPSTATUS_EPOUT1_MASK = USBD_EPSTATUS_EPOUT1_Msk, NRF_USBD_EPSTATUS_EPOUT2_MASK = USBD_EPSTATUS_EPOUT2_Msk, NRF_USBD_EPSTATUS_EPOUT3_MASK = USBD_EPSTATUS_EPOUT3_Msk, NRF_USBD_EPSTATUS_EPOUT4_MASK = USBD_EPSTATUS_EPOUT4_Msk, NRF_USBD_EPSTATUS_EPOUT5_MASK = USBD_EPSTATUS_EPOUT5_Msk, NRF_USBD_EPSTATUS_EPOUT6_MASK = USBD_EPSTATUS_EPOUT6_Msk, NRF_USBD_EPSTATUS_EPOUT7_MASK = USBD_EPSTATUS_EPOUT7_Msk } |
|
EPSTATUS bit masks.
|
|
| enum |
nrf_usbd_dataepstatus_mask_t
{
NRF_USBD_EPDATASTATUS_EPIN1_MASK = USBD_EPDATASTATUS_EPIN1_Msk, NRF_USBD_EPDATASTATUS_EPIN2_MASK = USBD_EPDATASTATUS_EPIN2_Msk, NRF_USBD_EPDATASTATUS_EPIN3_MASK = USBD_EPDATASTATUS_EPIN3_Msk, NRF_USBD_EPDATASTATUS_EPIN4_MASK = USBD_EPDATASTATUS_EPIN4_Msk, NRF_USBD_EPDATASTATUS_EPIN5_MASK = USBD_EPDATASTATUS_EPIN5_Msk, NRF_USBD_EPDATASTATUS_EPIN6_MASK = USBD_EPDATASTATUS_EPIN6_Msk, NRF_USBD_EPDATASTATUS_EPIN7_MASK = USBD_EPDATASTATUS_EPIN7_Msk, NRF_USBD_EPDATASTATUS_EPOUT1_MASK = USBD_EPDATASTATUS_EPOUT1_Msk, NRF_USBD_EPDATASTATUS_EPOUT2_MASK = USBD_EPDATASTATUS_EPOUT2_Msk, NRF_USBD_EPDATASTATUS_EPOUT3_MASK = USBD_EPDATASTATUS_EPOUT3_Msk, NRF_USBD_EPDATASTATUS_EPOUT4_MASK = USBD_EPDATASTATUS_EPOUT4_Msk, NRF_USBD_EPDATASTATUS_EPOUT5_MASK = USBD_EPDATASTATUS_EPOUT5_Msk, NRF_USBD_EPDATASTATUS_EPOUT6_MASK = USBD_EPDATASTATUS_EPOUT6_Msk, NRF_USBD_EPDATASTATUS_EPOUT7_MASK = USBD_EPDATASTATUS_EPOUT7_Msk } |
|
DATAEPSTATUS bit masks.
|
|
| enum |
nrf_usbd_isosplit_t
{
NRF_USBD_ISOSPLIT_OneDir = USBD_ISOSPLIT_SPLIT_OneDir, NRF_USBD_ISOSPLIT_Half = USBD_ISOSPLIT_SPLIT_HalfIN } |
|
ISOSPLIT configurations.
|
|
| __STATIC_INLINE void | nrf_usbd_enable (void) |
|
Enable USBD.
|
|
| __STATIC_INLINE void | nrf_usbd_disable (void) |
|
Disable USBD.
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_eventcause_get (void) |
|
Get EVENTCAUSE register.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_eventcause_clear (uint32_t flags) |
|
Clear EVENTCAUSE flags.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_eventcause_get_and_clear (void) |
|
Get EVENTCAUSE register and clear flags that are set.
More...
|
|
| __STATIC_INLINE nrf_usbd_busstate_t | nrf_usbd_busstate_get (void) |
|
Get BUSSTATE register value.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_haltedep (uint8_t ep) |
|
Get HALTEDEPIN register value.
More...
|
|
| __STATIC_INLINE bool | nrf_usbd_ep_is_stall (uint8_t ep) |
|
Check if selected endpoint is stalled.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_epstatus_get (void) |
|
Get EPSTATUS register value.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_epstatus_clear (uint32_t flags) |
|
Clear EPSTATUS register value.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_epstatus_get_and_clear (void) |
|
Get and clear EPSTATUS register value.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_epdatastatus_get (void) |
|
Get DATAEPSTATUS register value.
More...
|
|
| __STATIC_INLINE void | nrf_usbd_epdatastatus_clear (uint32_t flags) |
|
Clear DATAEPSTATUS register value.
More...
|
|
| __STATIC_INLINE uint32_t | nrf_usbd_epdatastatus_get_and_clear (void) |
|
Get and clear DATAEPSTATUS register value.
More...
|
|
| #define | NRF_USBD_FRAMECNTR_SIZE ( (USBD_FRAMECNTR_FRAMECNTR_Msk >> USBD_FRAMECNTR_FRAMECNTR_Pos) + 1UL ) |
|
Frame counter size.
More...
|
|
| #define | NRF_USBD_EPISO_FIRST 8 |
|
First isochronous endpoint number.
More...
|
|
| #define | NRF_USBD_EPIN_CNT 9 |
|
Total number of IN endpoints.
More...
|
|
| #define | NRF_USBD_EPOUT_CNT 9 |
|
Total number of OUT endpoints.
More...
|
|
| #define | NRF_USBD_EP_DIR_Msk (1U << 7) |
|
Mask of the direction bit in endpoint number.
|
|
| #define | NRF_USBD_EP_DIR_IN (1U << 7) |
|
The value of direction bit for IN endpoint direction.
|
|
| #define | NRF_USBD_EP_DIR_OUT (0U << 7) |
|
The value of direction bit for OUT endpoint direction.
|
|
| #define | NRF_USBD_EPIN (epnr) (((uint8_t)(epnr)) | NRF_USBD_EP_DIR_IN ) |
|
Make IN endpoint identifier from endpoint number.
More...
|
|
| #define | NRF_USBD_EPOUT (epnr) (((uint8_t)(epnr)) | NRF_USBD_EP_DIR_OUT ) |
|
Make OUT endpoint identifier from endpoint number.
More...
|
|
| #define | NRF_USBD_EP_NR_GET (ep) ((uint8_t)(((uint8_t)(ep)) & 0xFU)) |
|
Extract the endpoint number from endpoint identifier.
More...
|
|
| #define | NRF_USBD_EPIN_CHECK (ep) ( (((uint8_t)(ep)) & NRF_USBD_EP_DIR_Msk ) == NRF_USBD_EP_DIR_IN ) |
|
Macro for checking endpoint direction.
More...
|
|
| #define | NRF_USBD_EPOUT_CHECK (ep) ( (((uint8_t)(ep)) & NRF_USBD_EP_DIR_Msk ) == NRF_USBD_EP_DIR_OUT ) |
|
Macro for checking endpoint direction.
More...
|
|
| #define | NRF_USBD_EPISO_CHECK (ep) ( NRF_USBD_EP_NR_GET (ep) >= NRF_USBD_EPISO_FIRST ) |
|
Macro for checking if endpoint is isochronous.
More...
|
|
Detailed Description
nRF52840 only: Hardware access layer for Two Wire Interface Slave with EasyDMA (USBD) peripheral.
Macro Definition Documentation
| #define NRF_USBD_EP_NR_GET | ( | ep | ) | ((uint8_t)(((uint8_t)(ep)) & 0xFU)) |
Extract the endpoint number from endpoint identifier.
Macro that strips out the information about endpoint direction.
- Parameters
-
[in] ep Endpoint identifier
- Returns
- Endpoint number
| #define NRF_USBD_EPIN | ( | epnr | ) | (((uint8_t)(epnr)) | NRF_USBD_EP_DIR_IN ) |
Make IN endpoint identifier from endpoint number.
Macro that sets direction bit to make IN endpoint
- Parameters
-
[in] epnr Endpoint number
- Returns
- IN Endpoint identifier
| #define NRF_USBD_EPIN_CHECK | ( | ep | ) | ( (((uint8_t)(ep)) & NRF_USBD_EP_DIR_Msk ) == NRF_USBD_EP_DIR_IN ) |
Macro for checking endpoint direction.
This macro checks if given endpoint has IN direction
- Parameters
-
ep Endpoint identifier
- Return values
-
true If the endpoint direction is IN false If the endpoint direction is OUT
| #define NRF_USBD_EPIN_CNT 9 |
Total number of IN endpoints.
Total number of IN endpoint (including ISOCHRONOUS).
| #define NRF_USBD_EPISO_CHECK | ( | ep | ) | ( NRF_USBD_EP_NR_GET (ep) >= NRF_USBD_EPISO_FIRST ) |
Macro for checking if endpoint is isochronous.
- Parameters
-
ep It can be endpoint identifier or just endpoint number to check
- Return values
-
true The endpoint is isochronous type false The endpoint is bulk of interrupt type
| #define NRF_USBD_EPISO_FIRST 8 |
First isochronous endpoint number.
The number of the first isochronous endpoint
| #define NRF_USBD_EPOUT | ( | epnr | ) | (((uint8_t)(epnr)) | NRF_USBD_EP_DIR_OUT ) |
Make OUT endpoint identifier from endpoint number.
Macro that sets direction bit to make OUT endpoint
- Parameters
-
[in] epnr Endpoint number
- Returns
- OUT Endpoint identifier
| #define NRF_USBD_EPOUT_CHECK | ( | ep | ) | ( (((uint8_t)(ep)) & NRF_USBD_EP_DIR_Msk ) == NRF_USBD_EP_DIR_OUT ) |
Macro for checking endpoint direction.
This macro checks if given endpoint has OUT direction
- Parameters
-
ep Endpoint identifier
- Return values
-
true If the endpoint direction is OUT false If the endpoint direction is IN
| #define NRF_USBD_EPOUT_CNT 9 |
Total number of OUT endpoints.
Total number of OUT endpoint (including ISOCHRONOUS).
| #define NRF_USBD_FRAMECNTR_SIZE ( (USBD_FRAMECNTR_FRAMECNTR_Msk >> USBD_FRAMECNTR_FRAMECNTR_Pos) + 1UL ) |
Frame counter size.
The number of counts that can be fitted into frame counter
Enumeration Type Documentation
| enum nrf_usbd_event_t |
USBD events.
| enum nrf_usbd_int_mask_t |
USBD interrupts.
USBD shorts.
| enum nrf_usbd_task_t |
USBD tasks.
Function Documentation
| __STATIC_INLINE nrf_usbd_busstate_t nrf_usbd_busstate_get | ( | void | ) |
Get BUSSTATE register value.
- Returns
- The value of BUSSTATE register
| __STATIC_INLINE bool nrf_usbd_ep_is_stall | ( | uint8_t | ep | ) |
Check if selected endpoint is stalled.
Function to be used as a syntax sweeter for nrf_usbd_haltedep .
Also as the isochronous endpoint cannot be halted - it returns always false if isochronous endpoint is checked.
- Parameters
-
ep Endpoint number with IN/OUT flag
- Returns
- The information if the enepoint is halted.
| __STATIC_INLINE void nrf_usbd_epdatastatus_clear | ( | uint32_t | flags | ) |
Clear DATAEPSTATUS register value.
- Parameters
-
flags Flags defined in nrf_usbd_dataepstatus_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_epdatastatus_get | ( | void | ) |
Get DATAEPSTATUS register value.
- Returns
- Flag values defined in nrf_usbd_dataepstatus_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_epdatastatus_get_and_clear | ( | void | ) |
Get and clear DATAEPSTATUS register value.
Function clears all flags in register set before returning its value.
- Returns
- Flag values defined in nrf_usbd_dataepstatus_mask_t
| __STATIC_INLINE void nrf_usbd_epstatus_clear | ( | uint32_t | flags | ) |
Clear EPSTATUS register value.
- Parameters
-
flags Flags defined in nrf_usbd_epstatus_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_epstatus_get | ( | void | ) |
Get EPSTATUS register value.
- Returns
- Flag values defined in nrf_usbd_epstatus_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_epstatus_get_and_clear | ( | void | ) |
Get and clear EPSTATUS register value.
Function clears all flags in register set before returning its value.
- Returns
- Flag values defined in nrf_usbd_epstatus_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_event_address_get | ( | nrf_usbd_event_t | event | ) |
Function for returning the address of a specific USBD event register.
- Parameters
-
event Event.
- Returns
- Address.
| __STATIC_INLINE bool nrf_usbd_event_check | ( | nrf_usbd_event_t | event | ) |
Function for returning the state of a specific event.
- Parameters
-
event Event.
- Return values
-
true If the event is set. false If the event is not set.
| __STATIC_INLINE void nrf_usbd_event_clear | ( | nrf_usbd_event_t | event | ) |
Function for clearing a specific event.
- Parameters
-
event Event.
| __STATIC_INLINE bool nrf_usbd_event_get_and_clear | ( | nrf_usbd_event_t | event | ) |
Function for getting and clearing the state of specific event.
This function checks the state of the event and clears it.
- Parameters
-
event Event.
- Return values
-
true If the event was set. false If the event was not set.
| __STATIC_INLINE void nrf_usbd_eventcause_clear | ( | uint32_t | flags | ) |
Clear EVENTCAUSE flags.
- Parameters
-
flags Flags defined in nrf_usbd_eventcause_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_eventcause_get | ( | void | ) |
Get EVENTCAUSE register.
- Returns
- Flag values defined in nrf_usbd_eventcause_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_eventcause_get_and_clear | ( | void | ) |
Get EVENTCAUSE register and clear flags that are set.
The safest way to return current EVENTCAUSE register. All the flags that are returned would be cleared inside EVENTCAUSE register.
- Returns
- Flag values defined in nrf_usbd_eventcause_mask_t
| __STATIC_INLINE uint32_t nrf_usbd_haltedep | ( | uint8_t | ep | ) |
Get HALTEDEPIN register value.
- Parameters
-
ep Endpoint number with IN/OUT flag
- Returns
- The value of HALTEDEPIN or HALTEDOUT register for selected endpoint
- Note
- Use this function for the response for GetStatus() request to endpoint. To check if endpoint is stalled in the code use nrf_usbd_ep_is_stall .
| __STATIC_INLINE void nrf_usbd_int_disable | ( | uint32_t | int_mask | ) |
Function for disabling selected interrupts.
- Parameters
-
int_mask Interrupts mask.
| __STATIC_INLINE void nrf_usbd_int_enable | ( | uint32_t | int_mask | ) |
Function for enabling selected interrupts.
- Parameters
-
int_mask Interrupts mask.
| __STATIC_INLINE bool nrf_usbd_int_enable_check | ( | uint32_t | int_mask | ) |
Function for retrieving the state of selected interrupts.
- Parameters
-
int_mask Interrupts mask.
- Return values
-
true If any of selected interrupts is enabled. false If none of selected interrupts is enabled.
| __STATIC_INLINE uint32_t nrf_usbd_int_enable_get | ( | void | ) |
Function for retrieving the information about enabled interrupts.
- Returns
- The flags of enabled interrupts.
| __STATIC_INLINE void nrf_usbd_shorts_disable | ( | uint32_t | short_mask | ) |
Function for clearing shortcuts.
- Parameters
-
short_mask Shortcuts mask.
| __STATIC_INLINE void nrf_usbd_shorts_enable | ( | uint32_t | short_mask | ) |
Function for setting a shortcut.
- Parameters
-
short_mask Shortcuts mask.
| __STATIC_INLINE uint32_t nrf_usbd_shorts_get | ( | void | ) |
Get the shorts mask.
Function returns shorts register.
- Returns
- Flags of currently enabled shortcuts
| __STATIC_INLINE uint32_t nrf_usbd_task_address_get | ( | nrf_usbd_task_t | task | ) |
Function for returning the address of a specific USBD task register.
- Parameters
-
task Task.
- Returns
- Task address.
| __STATIC_INLINE void nrf_usbd_task_trigger | ( | nrf_usbd_task_t | task | ) |
Function for activating a specific USBD task.
- Parameters
-
task Task.