2022-02-18 01:24:38 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_INCLUDE_USBH_CH9_H
|
|
|
|
#define ZEPHYR_INCLUDE_USBH_CH9_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <zephyr/usb/usbh.h>
|
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
#include "usbh_device.h"
|
|
|
|
|
|
|
|
int usbh_req_setup(struct usb_device *const udev,
|
2022-02-18 01:24:38 +08:00
|
|
|
const uint8_t bmRequestType,
|
|
|
|
const uint8_t bRequest,
|
|
|
|
const uint16_t wValue,
|
|
|
|
const uint16_t wIndex,
|
|
|
|
const uint16_t wLength,
|
2023-08-26 01:00:28 +08:00
|
|
|
struct net_buf *const data);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_desc(struct usb_device *const udev,
|
2022-02-18 01:24:38 +08:00
|
|
|
const uint8_t type, const uint8_t index,
|
2023-11-16 01:05:24 +08:00
|
|
|
const uint16_t id,
|
2023-08-26 01:00:28 +08:00
|
|
|
const uint16_t len,
|
|
|
|
struct net_buf *const data);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_desc_dev(struct usb_device *const udev,
|
|
|
|
struct usb_device_descriptor *const dev);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_desc_cfg(struct usb_device *const udev,
|
2022-02-18 01:24:38 +08:00
|
|
|
const uint8_t index,
|
2023-08-26 01:00:28 +08:00
|
|
|
const uint16_t len,
|
|
|
|
struct usb_cfg_descriptor *const desc);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_set_alt(struct usb_device *const udev,
|
|
|
|
const uint8_t iface,
|
2022-02-18 01:24:38 +08:00
|
|
|
const uint8_t alt);
|
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_set_address(struct usb_device *const udev,
|
|
|
|
const uint8_t addr);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_set_cfg(struct usb_device *const udev,
|
|
|
|
const uint8_t cfg);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:36:34 +08:00
|
|
|
int usbh_req_get_cfg(struct usb_device *const udev,
|
|
|
|
uint8_t *const cfg);
|
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_set_sfs_rwup(struct usb_device *const udev);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_clear_sfs_rwup(struct usb_device *const udev);
|
2022-02-18 01:24:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_set_hcfs_ppwr(const struct usb_device *udev,
|
|
|
|
const uint8_t port);
|
2022-10-15 03:20:38 +08:00
|
|
|
|
2023-08-26 01:00:28 +08:00
|
|
|
int usbh_req_set_hcfs_prst(const struct usb_device *udev,
|
|
|
|
const uint8_t port);
|
2022-10-15 03:20:38 +08:00
|
|
|
|
2022-02-18 01:24:38 +08:00
|
|
|
#endif /* ZEPHYR_INCLUDE_USBH_CH9_H */
|