nrfusb.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Koen Zandberg
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <stdint.h>
22 #include <stddef.h>
23 #include "periph/usbdev.h"
24 #include "cpu.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 #define NRF_USB_NUM_PERIPH 1
34 
38 #define NRF_USB_NUM_EP USBDEV_NUM_ENDPOINTS
39 
43 typedef enum {
50 
54 typedef struct {
58  NRF_USBD_Type *device;
60 } nrfusb_t;
61 
62 #ifdef __cplusplus
63 }
64 #endif
#define NRF_USB_NUM_EP
Number of USB IN and OUT endpoints.
Definition: nrfusb.h:38
nrfusb_setup_state_t
nrfusb setup packet state tracker for endpoint 0 handling
Definition: nrfusb.h:43
@ NRFUSB_SETUP_WRITE
Write request received
Definition: nrfusb.h:46
@ NRFUSB_SETUP_ACKOUT
Expecting an ACK on the out endpoint.
Definition: nrfusb.h:47
@ NRFUSB_SETUP_ACKIN
Expecting an ACK on the in endpoint
Definition: nrfusb.h:48
@ NRFUSB_SETUP_READ
Read request received
Definition: nrfusb.h:45
@ NRFUSB_SETUP_READY
Ready for a new setup request
Definition: nrfusb.h:44
nrf usb peripheral device context
Definition: nrfusb.h:54
nrfusb_setup_state_t sstate
Setup request state machine
Definition: nrfusb.h:59
NRF_USBD_Type * device
Ptr to the device registers
Definition: nrfusb.h:58
usbdev_t usbdev
Inherited usbdev struct
Definition: nrfusb.h:55
usbdev endpoint descriptor
Definition: usbdev.h:259
usbdev device descriptor
Definition: usbdev.h:247
Definitions low-level USB driver interface.