nrfusb.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Koen Zandberg
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
24 #include <stdint.h>
25 #include <stddef.h>
26 #include "periph/usbdev.h"
27 #include "cpu.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 #define NRF_USB_NUM_PERIPH 1
37 
41 #define NRF_USB_NUM_EP USBDEV_NUM_ENDPOINTS
42 
46 typedef enum {
53 
57 typedef struct {
61  NRF_USBD_Type *device;
63 } nrfusb_t;
64 
65 #ifdef __cplusplus
66 }
67 #endif
#define NRF_USB_NUM_EP
Number of USB IN and OUT endpoints.
Definition: nrfusb.h:41
nrfusb_setup_state_t
nrfusb setup packet state tracker for endpoint 0 handling
Definition: nrfusb.h:46
@ NRFUSB_SETUP_WRITE
Write request received
Definition: nrfusb.h:49
@ NRFUSB_SETUP_ACKOUT
Expecting an ACK on the out endpoint.
Definition: nrfusb.h:50
@ NRFUSB_SETUP_ACKIN
Expecting an ACK on the in endpoint
Definition: nrfusb.h:51
@ NRFUSB_SETUP_READ
Read request received
Definition: nrfusb.h:48
@ NRFUSB_SETUP_READY
Ready for a new setup request
Definition: nrfusb.h:47
nrf usb peripheral device context
Definition: nrfusb.h:57
nrfusb_setup_state_t sstate
Setup request state machine
Definition: nrfusb.h:62
NRF_USBD_Type * device
Ptr to the device registers
Definition: nrfusb.h:61
usbdev_t usbdev
Inherited usbdev struct
Definition: nrfusb.h:58
usbdev endpoint descriptor
Definition: usbdev.h:259
usbdev device descriptor
Definition: usbdev.h:247
Definitions low-level USB driver interface.