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 		      const uint16_t len,
31 		      struct usb_device_descriptor *const dev);
32 
33 int usbh_req_desc_cfg(struct usb_device *const udev,
34 		      const uint8_t index,
35 		      const uint16_t len,
36 		      struct usb_cfg_descriptor *const desc);
37 
38 int usbh_req_set_alt(struct usb_device *const udev,
39 		     const uint8_t iface,
40 		     const uint8_t alt);
41 
42 int usbh_req_set_address(struct usb_device *const udev,
43 			 const uint8_t addr);
44 
45 int usbh_req_set_cfg(struct usb_device *const udev,
46 		     const uint8_t cfg);
47 
48 int usbh_req_get_cfg(struct usb_device *const udev,
49 		     uint8_t *const cfg);
50 
51 int usbh_req_set_sfs_rwup(struct usb_device *const udev);
52 
53 int usbh_req_clear_sfs_rwup(struct usb_device *const udev);
54 
55 int usbh_req_set_hcfs_ppwr(const struct usb_device *udev,
56 			   const uint8_t port);
57 
58 int usbh_req_set_hcfs_prst(const struct usb_device *udev,
59 			   const uint8_t port);
60 
61 #endif /* ZEPHYR_INCLUDE_USBH_CH9_H */
62