1 /*
2  * Copyright (c) 2022 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_USBH_CH9_H
8 #define ZEPHYR_INCLUDE_USBH_CH9_H
9 
10 #include <stdint.h>
11 #include <zephyr/usb/usbh.h>
12 
13 #include "usbh_device.h"
14 
15 int usbh_req_setup(struct usb_device *const udev,
16 		   const uint8_t bmRequestType,
17 		   const uint8_t bRequest,
18 		   const uint16_t wValue,
19 		   const uint16_t wIndex,
20 		   const uint16_t wLength,
21 		   struct net_buf *const data);
22 
23 int usbh_req_desc(struct usb_device *const udev,
24 		  const uint8_t type, const uint8_t index,
25 		  const uint16_t id,
26 		  const uint16_t len,
27 		  struct net_buf *const data);
28 
29 int usbh_req_desc_dev(struct usb_device *const udev,
30 		      struct usb_device_descriptor *const dev);
31 
32 int usbh_req_desc_cfg(struct usb_device *const udev,
33 		      const uint8_t index,
34 		      const uint16_t len,
35 		      struct usb_cfg_descriptor *const desc);
36 
37 int usbh_req_set_alt(struct usb_device *const udev,
38 		     const uint8_t iface,
39 		     const uint8_t alt);
40 
41 int usbh_req_set_address(struct usb_device *const udev,
42 			 const uint8_t addr);
43 
44 int usbh_req_set_cfg(struct usb_device *const udev,
45 		     const uint8_t cfg);
46 
47 int usbh_req_get_cfg(struct usb_device *const udev,
48 		     uint8_t *const cfg);
49 
50 int usbh_req_set_sfs_rwup(struct usb_device *const udev);
51 
52 int usbh_req_clear_sfs_rwup(struct usb_device *const udev);
53 
54 int usbh_req_set_hcfs_ppwr(const struct usb_device *udev,
55 			   const uint8_t port);
56 
57 int usbh_req_set_hcfs_prst(const struct usb_device *udev,
58 			   const uint8_t port);
59 
60 #endif /* ZEPHYR_INCLUDE_USBH_CH9_H */
61