zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \ xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g" git grep -l 's\(8\|16\|32\|64\)_t' | \ xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g" Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
ee6fa31af6
commit
a1b77fd589
2364 changed files with 32505 additions and 32505 deletions
|
@ -20,41 +20,41 @@
|
|||
|
||||
/* BOS Capability Descriptor */
|
||||
struct usb_bos_platform_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bDevCapabilityType;
|
||||
u8_t bReserved;
|
||||
u8_t PlatformCapabilityUUID[16];
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bDevCapabilityType;
|
||||
uint8_t bReserved;
|
||||
uint8_t PlatformCapabilityUUID[16];
|
||||
} __packed;
|
||||
|
||||
/* BOS Descriptor */
|
||||
struct usb_bos_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u16_t wTotalLength;
|
||||
u8_t bNumDeviceCaps;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint16_t wTotalLength;
|
||||
uint8_t bNumDeviceCaps;
|
||||
} __packed;
|
||||
|
||||
/* BOS Capability webusb */
|
||||
struct usb_bos_capability_webusb {
|
||||
u16_t bcdVersion;
|
||||
u8_t bVendorCode;
|
||||
u8_t iLandingPage;
|
||||
uint16_t bcdVersion;
|
||||
uint8_t bVendorCode;
|
||||
uint8_t iLandingPage;
|
||||
} __packed;
|
||||
|
||||
/* BOS Capability MS OS Descriptors version 2 */
|
||||
struct usb_bos_capability_msos {
|
||||
u32_t dwWindowsVersion;
|
||||
u16_t wMSOSDescriptorSetTotalLength;
|
||||
u8_t bMS_VendorCode;
|
||||
u8_t bAltEnumCode;
|
||||
uint32_t dwWindowsVersion;
|
||||
uint16_t wMSOSDescriptorSetTotalLength;
|
||||
uint8_t bMS_VendorCode;
|
||||
uint8_t bAltEnumCode;
|
||||
} __packed;
|
||||
|
||||
size_t usb_bos_get_length(void);
|
||||
void usb_bos_fix_total_length(void);
|
||||
void usb_bos_register_cap(struct usb_bos_platform_descriptor *hdr);
|
||||
const void *usb_bos_get_header(void);
|
||||
int usb_handle_bos(struct usb_setup_packet *setup, s32_t *len, u8_t **data);
|
||||
int usb_handle_bos(struct usb_setup_packet *setup, int32_t *len, uint8_t **data);
|
||||
#else
|
||||
#define usb_handle_bos(x, y, z) -ENOTSUP
|
||||
#endif
|
||||
|
|
|
@ -155,8 +155,8 @@ enum usb_audio_direction {
|
|||
struct usb_audio_fu_evt {
|
||||
enum usb_audio_direction dir;
|
||||
enum usb_audio_fucs cs;
|
||||
u8_t channel;
|
||||
u8_t val_len;
|
||||
uint8_t channel;
|
||||
uint8_t val_len;
|
||||
const void *val;
|
||||
};
|
||||
|
||||
|
|
|
@ -103,66 +103,66 @@
|
|||
|
||||
/** Header Functional Descriptor */
|
||||
struct cdc_header_descriptor {
|
||||
u8_t bFunctionLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bDescriptorSubtype;
|
||||
u16_t bcdCDC;
|
||||
uint8_t bFunctionLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bDescriptorSubtype;
|
||||
uint16_t bcdCDC;
|
||||
} __packed;
|
||||
|
||||
/** Union Interface Functional Descriptor */
|
||||
struct cdc_union_descriptor {
|
||||
u8_t bFunctionLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bDescriptorSubtype;
|
||||
u8_t bControlInterface;
|
||||
u8_t bSubordinateInterface0;
|
||||
uint8_t bFunctionLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bDescriptorSubtype;
|
||||
uint8_t bControlInterface;
|
||||
uint8_t bSubordinateInterface0;
|
||||
} __packed;
|
||||
|
||||
/** Call Management Functional Descriptor */
|
||||
struct cdc_cm_descriptor {
|
||||
u8_t bFunctionLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bDescriptorSubtype;
|
||||
u8_t bmCapabilities;
|
||||
u8_t bDataInterface;
|
||||
uint8_t bFunctionLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bDescriptorSubtype;
|
||||
uint8_t bmCapabilities;
|
||||
uint8_t bDataInterface;
|
||||
} __packed;
|
||||
|
||||
/** Abstract Control Management Functional Descriptor */
|
||||
struct cdc_acm_descriptor {
|
||||
u8_t bFunctionLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bDescriptorSubtype;
|
||||
u8_t bmCapabilities;
|
||||
uint8_t bFunctionLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bDescriptorSubtype;
|
||||
uint8_t bmCapabilities;
|
||||
} __packed;
|
||||
|
||||
/** Data structure for GET_LINE_CODING / SET_LINE_CODING class requests */
|
||||
struct cdc_acm_line_coding {
|
||||
u32_t dwDTERate;
|
||||
u8_t bCharFormat;
|
||||
u8_t bParityType;
|
||||
u8_t bDataBits;
|
||||
uint32_t dwDTERate;
|
||||
uint8_t bCharFormat;
|
||||
uint8_t bParityType;
|
||||
uint8_t bDataBits;
|
||||
} __packed;
|
||||
|
||||
/** Data structure for the notification about SerialState */
|
||||
struct cdc_acm_notification {
|
||||
u8_t bmRequestType;
|
||||
u8_t bNotificationType;
|
||||
u16_t wValue;
|
||||
u16_t wIndex;
|
||||
u16_t wLength;
|
||||
u16_t data;
|
||||
uint8_t bmRequestType;
|
||||
uint8_t bNotificationType;
|
||||
uint16_t wValue;
|
||||
uint16_t wIndex;
|
||||
uint16_t wLength;
|
||||
uint16_t data;
|
||||
} __packed;
|
||||
|
||||
/** Ethernet Networking Functional Descriptor */
|
||||
struct cdc_ecm_descriptor {
|
||||
u8_t bFunctionLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bDescriptorSubtype;
|
||||
u8_t iMACAddress;
|
||||
u32_t bmEthernetStatistics;
|
||||
u16_t wMaxSegmentSize;
|
||||
u16_t wNumberMCFilters;
|
||||
u8_t bNumberPowerFilters;
|
||||
uint8_t bFunctionLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bDescriptorSubtype;
|
||||
uint8_t iMACAddress;
|
||||
uint32_t bmEthernetStatistics;
|
||||
uint16_t wMaxSegmentSize;
|
||||
uint16_t wNumberMCFilters;
|
||||
uint8_t bNumberPowerFilters;
|
||||
} __packed;
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_USB_CLASS_USB_CDC_H_ */
|
||||
|
|
|
@ -76,12 +76,12 @@
|
|||
|
||||
/** Run-Time Functional Descriptor */
|
||||
struct dfu_runtime_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bmAttributes;
|
||||
u16_t wDetachTimeOut;
|
||||
u16_t wTransferSize;
|
||||
u16_t bcdDFUVersion;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bmAttributes;
|
||||
uint16_t wDetachTimeOut;
|
||||
uint16_t wTransferSize;
|
||||
uint16_t bcdDFUVersion;
|
||||
} __packed;
|
||||
|
||||
/** bStatus values for the DFU_GETSTATUS response */
|
||||
|
|
|
@ -23,16 +23,16 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
struct usb_hid_class_subdescriptor {
|
||||
u8_t bDescriptorType;
|
||||
u16_t wDescriptorLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint16_t wDescriptorLength;
|
||||
} __packed;
|
||||
|
||||
struct usb_hid_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u16_t bcdHID;
|
||||
u8_t bCountryCode;
|
||||
u8_t bNumDescriptors;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint16_t bcdHID;
|
||||
uint8_t bCountryCode;
|
||||
uint8_t bNumDescriptors;
|
||||
|
||||
/*
|
||||
* Specification says at least one Class Descriptor needs to
|
||||
|
@ -57,11 +57,11 @@ struct usb_hid_descriptor {
|
|||
|
||||
/* Public headers */
|
||||
|
||||
typedef int (*hid_cb_t)(struct usb_setup_packet *setup, s32_t *len,
|
||||
u8_t **data);
|
||||
typedef int (*hid_cb_t)(struct usb_setup_packet *setup, int32_t *len,
|
||||
uint8_t **data);
|
||||
typedef void (*hid_int_ready_callback)(void);
|
||||
typedef void (*hid_protocol_cb_t)(u8_t protocol);
|
||||
typedef void (*hid_idle_cb_t)(u16_t report_id);
|
||||
typedef void (*hid_protocol_cb_t)(uint8_t protocol);
|
||||
typedef void (*hid_idle_cb_t)(uint16_t report_id);
|
||||
|
||||
struct hid_ops {
|
||||
hid_cb_t get_report;
|
||||
|
@ -431,16 +431,16 @@ enum hid_kbd_led {
|
|||
};
|
||||
|
||||
/* Register HID device */
|
||||
void usb_hid_register_device(struct device *dev, const u8_t *desc, size_t size,
|
||||
void usb_hid_register_device(struct device *dev, const uint8_t *desc, size_t size,
|
||||
const struct hid_ops *op);
|
||||
|
||||
/* Write to hid interrupt endpoint */
|
||||
int hid_int_ep_write(const struct device *dev, const u8_t *data, u32_t data_len,
|
||||
u32_t *bytes_ret);
|
||||
int hid_int_ep_write(const struct device *dev, const uint8_t *data, uint32_t data_len,
|
||||
uint32_t *bytes_ret);
|
||||
|
||||
/* Read from hid interrupt endpoint */
|
||||
int hid_int_ep_read(const struct device *dev, u8_t *data, u32_t max_data_len,
|
||||
u32_t *ret_bytes);
|
||||
int hid_int_ep_read(const struct device *dev, uint8_t *data, uint32_t max_data_len,
|
||||
uint32_t *ret_bytes);
|
||||
|
||||
/* Initialize USB HID */
|
||||
int usb_hid_init(const struct device *dev);
|
||||
|
|
|
@ -62,13 +62,13 @@
|
|||
|
||||
/** MSC Bulk-Only Command Block Wrapper (CBW) */
|
||||
struct CBW {
|
||||
u32_t Signature;
|
||||
u32_t Tag;
|
||||
u32_t DataLength;
|
||||
u8_t Flags;
|
||||
u8_t LUN;
|
||||
u8_t CBLength;
|
||||
u8_t CB[16];
|
||||
uint32_t Signature;
|
||||
uint32_t Tag;
|
||||
uint32_t DataLength;
|
||||
uint8_t Flags;
|
||||
uint8_t LUN;
|
||||
uint8_t CBLength;
|
||||
uint8_t CB[16];
|
||||
} __packed;
|
||||
|
||||
/** MSC Command Status Wrapper (CBW) Signature */
|
||||
|
@ -81,10 +81,10 @@ struct CBW {
|
|||
|
||||
/** MSC Bulk-Only Command Status Wrapper (CSW) */
|
||||
struct CSW {
|
||||
u32_t Signature;
|
||||
u32_t Tag;
|
||||
u32_t DataResidue;
|
||||
u8_t Status;
|
||||
uint32_t Signature;
|
||||
uint32_t Tag;
|
||||
uint32_t DataResidue;
|
||||
uint8_t Status;
|
||||
} __packed;
|
||||
|
||||
/** SCSI transparent command set used by MSC */
|
||||
|
|
|
@ -138,74 +138,74 @@
|
|||
|
||||
/** Standard Device Descriptor */
|
||||
struct usb_device_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u16_t bcdUSB;
|
||||
u8_t bDeviceClass;
|
||||
u8_t bDeviceSubClass;
|
||||
u8_t bDeviceProtocol;
|
||||
u8_t bMaxPacketSize0;
|
||||
u16_t idVendor;
|
||||
u16_t idProduct;
|
||||
u16_t bcdDevice;
|
||||
u8_t iManufacturer;
|
||||
u8_t iProduct;
|
||||
u8_t iSerialNumber;
|
||||
u8_t bNumConfigurations;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint16_t bcdUSB;
|
||||
uint8_t bDeviceClass;
|
||||
uint8_t bDeviceSubClass;
|
||||
uint8_t bDeviceProtocol;
|
||||
uint8_t bMaxPacketSize0;
|
||||
uint16_t idVendor;
|
||||
uint16_t idProduct;
|
||||
uint16_t bcdDevice;
|
||||
uint8_t iManufacturer;
|
||||
uint8_t iProduct;
|
||||
uint8_t iSerialNumber;
|
||||
uint8_t bNumConfigurations;
|
||||
} __packed;
|
||||
|
||||
/** Unicode (UTF16LE) String Descriptor */
|
||||
struct usb_string_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u16_t bString;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint16_t bString;
|
||||
} __packed;
|
||||
|
||||
/** Association Descriptor */
|
||||
struct usb_association_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bFirstInterface;
|
||||
u8_t bInterfaceCount;
|
||||
u8_t bFunctionClass;
|
||||
u8_t bFunctionSubClass;
|
||||
u8_t bFunctionProtocol;
|
||||
u8_t iFunction;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bFirstInterface;
|
||||
uint8_t bInterfaceCount;
|
||||
uint8_t bFunctionClass;
|
||||
uint8_t bFunctionSubClass;
|
||||
uint8_t bFunctionProtocol;
|
||||
uint8_t iFunction;
|
||||
} __packed;
|
||||
|
||||
/** Standard Configuration Descriptor */
|
||||
struct usb_cfg_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u16_t wTotalLength;
|
||||
u8_t bNumInterfaces;
|
||||
u8_t bConfigurationValue;
|
||||
u8_t iConfiguration;
|
||||
u8_t bmAttributes;
|
||||
u8_t bMaxPower;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint16_t wTotalLength;
|
||||
uint8_t bNumInterfaces;
|
||||
uint8_t bConfigurationValue;
|
||||
uint8_t iConfiguration;
|
||||
uint8_t bmAttributes;
|
||||
uint8_t bMaxPower;
|
||||
} __packed;
|
||||
|
||||
/** Standard Interface Descriptor */
|
||||
struct usb_if_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bInterfaceNumber;
|
||||
u8_t bAlternateSetting;
|
||||
u8_t bNumEndpoints;
|
||||
u8_t bInterfaceClass;
|
||||
u8_t bInterfaceSubClass;
|
||||
u8_t bInterfaceProtocol;
|
||||
u8_t iInterface;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bInterfaceNumber;
|
||||
uint8_t bAlternateSetting;
|
||||
uint8_t bNumEndpoints;
|
||||
uint8_t bInterfaceClass;
|
||||
uint8_t bInterfaceSubClass;
|
||||
uint8_t bInterfaceProtocol;
|
||||
uint8_t iInterface;
|
||||
} __packed;
|
||||
|
||||
/** Standard Endpoint Descriptor */
|
||||
struct usb_ep_descriptor {
|
||||
u8_t bLength;
|
||||
u8_t bDescriptorType;
|
||||
u8_t bEndpointAddress;
|
||||
u8_t bmAttributes;
|
||||
u16_t wMaxPacketSize;
|
||||
u8_t bInterval;
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
uint8_t bEndpointAddress;
|
||||
uint8_t bmAttributes;
|
||||
uint16_t wMaxPacketSize;
|
||||
uint8_t bInterval;
|
||||
} __packed;
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_USB_USB_COMMON_H_ */
|
||||
|
|
|
@ -83,11 +83,11 @@ extern "C" {
|
|||
|
||||
/** setup packet definitions */
|
||||
struct usb_setup_packet {
|
||||
u8_t bmRequestType; /**< characteristics of the specific request */
|
||||
u8_t bRequest; /**< specific request */
|
||||
u16_t wValue; /**< request specific parameter */
|
||||
u16_t wIndex; /**< request specific parameter */
|
||||
u16_t wLength; /**< length of data transferred in data phase */
|
||||
uint8_t bmRequestType; /**< characteristics of the specific request */
|
||||
uint8_t bRequest; /**< specific request */
|
||||
uint16_t wValue; /**< request specific parameter */
|
||||
uint16_t wIndex; /**< request specific parameter */
|
||||
uint16_t wLength; /**< length of data transferred in data phase */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@ struct usb_setup_packet {
|
|||
/**
|
||||
* @brief Callback function signature for the USB Endpoint status
|
||||
*/
|
||||
typedef void (*usb_ep_callback)(u8_t ep,
|
||||
typedef void (*usb_ep_callback)(uint8_t ep,
|
||||
enum usb_dc_ep_cb_status_code cb_status);
|
||||
|
||||
/**
|
||||
|
@ -114,13 +114,13 @@ typedef void (*usb_ep_callback)(u8_t ep,
|
|||
* data to be transmitted buffer respectively.
|
||||
*/
|
||||
typedef int (*usb_request_handler)(struct usb_setup_packet *setup,
|
||||
s32_t *transfer_len, u8_t **payload_data);
|
||||
int32_t *transfer_len, uint8_t **payload_data);
|
||||
|
||||
/**
|
||||
* @brief Function for interface runtime configuration
|
||||
*/
|
||||
typedef void (*usb_interface_config)(struct usb_desc_header *head,
|
||||
u8_t bInterfaceNumber);
|
||||
uint8_t bInterfaceNumber);
|
||||
|
||||
/**
|
||||
* @brief USB Endpoint Configuration
|
||||
|
@ -140,7 +140,7 @@ struct usb_ep_cfg_data {
|
|||
* IN EP = 0x80 | \<endpoint number\>
|
||||
* OUT EP = 0x00 | \<endpoint number\>
|
||||
*/
|
||||
u8_t ep_addr;
|
||||
uint8_t ep_addr;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -178,7 +178,7 @@ struct usb_cfg_data {
|
|||
* USB device description, see
|
||||
* http://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors
|
||||
*/
|
||||
const u8_t *usb_device_description;
|
||||
const uint8_t *usb_device_description;
|
||||
/** Pointer to interface descriptor */
|
||||
const void *interface_descriptor;
|
||||
/** Function for interface runtime configuration */
|
||||
|
@ -186,11 +186,11 @@ struct usb_cfg_data {
|
|||
/** Callback to be notified on USB connection status change */
|
||||
void (*cb_usb_status)(struct usb_cfg_data *cfg,
|
||||
enum usb_dc_status_code cb_status,
|
||||
const u8_t *param);
|
||||
const uint8_t *param);
|
||||
/** USB interface (Class) handler and storage space */
|
||||
struct usb_interface_cfg_data interface;
|
||||
/** Number of individual endpoints in the device configuration */
|
||||
u8_t num_endpoints;
|
||||
uint8_t num_endpoints;
|
||||
/**
|
||||
* Pointer to an array of endpoint structs of length equal to the
|
||||
* number of EP associated with the device description,
|
||||
|
@ -209,7 +209,7 @@ struct usb_cfg_data {
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
int usb_set_config(const u8_t *usb_descriptor);
|
||||
int usb_set_config(const uint8_t *usb_descriptor);
|
||||
|
||||
/**
|
||||
* @brief Deconfigure USB controller
|
||||
|
@ -265,7 +265,7 @@ int usb_disable(void);
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
int usb_write(u8_t ep, const u8_t *data, u32_t data_len, u32_t *bytes_ret);
|
||||
int usb_write(uint8_t ep, const uint8_t *data, uint32_t data_len, uint32_t *bytes_ret);
|
||||
|
||||
/**
|
||||
* @brief Read data from the specified endpoint
|
||||
|
@ -284,7 +284,7 @@ int usb_write(u8_t ep, const u8_t *data, u32_t data_len, u32_t *bytes_ret);
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
int usb_read(u8_t ep, u8_t *data, u32_t max_data_len, u32_t *ret_bytes);
|
||||
int usb_read(uint8_t ep, uint8_t *data, uint32_t max_data_len, uint32_t *ret_bytes);
|
||||
|
||||
/**
|
||||
* @brief Set STALL condition on the specified endpoint
|
||||
|
@ -297,7 +297,7 @@ int usb_read(u8_t ep, u8_t *data, u32_t max_data_len, u32_t *ret_bytes);
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
int usb_ep_set_stall(u8_t ep);
|
||||
int usb_ep_set_stall(uint8_t ep);
|
||||
|
||||
/**
|
||||
* @brief Clears STALL condition on the specified endpoint
|
||||
|
@ -310,7 +310,7 @@ int usb_ep_set_stall(u8_t ep);
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
int usb_ep_clear_stall(u8_t ep);
|
||||
int usb_ep_clear_stall(uint8_t ep);
|
||||
|
||||
/**
|
||||
* @brief Read data from the specified endpoint
|
||||
|
@ -330,8 +330,8 @@ int usb_ep_clear_stall(u8_t ep);
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail.
|
||||
*/
|
||||
int usb_ep_read_wait(u8_t ep, u8_t *data, u32_t max_data_len,
|
||||
u32_t *read_bytes);
|
||||
int usb_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len,
|
||||
uint32_t *read_bytes);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -347,12 +347,12 @@ int usb_ep_read_wait(u8_t ep, u8_t *data, u32_t max_data_len,
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail.
|
||||
*/
|
||||
int usb_ep_read_continue(u8_t ep);
|
||||
int usb_ep_read_continue(uint8_t ep);
|
||||
|
||||
/**
|
||||
* Callback function signature for transfer completion.
|
||||
*/
|
||||
typedef void (*usb_transfer_callback)(u8_t ep, int tsize, void *priv);
|
||||
typedef void (*usb_transfer_callback)(uint8_t ep, int tsize, void *priv);
|
||||
|
||||
/* USB transfer flags */
|
||||
#define USB_TRANS_READ BIT(0) /** Read transfer flag */
|
||||
|
@ -365,7 +365,7 @@ typedef void (*usb_transfer_callback)(u8_t ep, int tsize, void *priv);
|
|||
* If a USB class driver wants to use high-level transfer functions, driver
|
||||
* needs to register this callback as usb endpoint callback.
|
||||
*/
|
||||
void usb_transfer_ep_callback(u8_t ep, enum usb_dc_ep_cb_status_code);
|
||||
void usb_transfer_ep_callback(uint8_t ep, enum usb_dc_ep_cb_status_code);
|
||||
|
||||
/**
|
||||
* @brief Start a transfer
|
||||
|
@ -384,7 +384,7 @@ void usb_transfer_ep_callback(u8_t ep, enum usb_dc_ep_cb_status_code);
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail.
|
||||
*/
|
||||
int usb_transfer(u8_t ep, u8_t *data, size_t dlen, unsigned int flags,
|
||||
int usb_transfer(uint8_t ep, uint8_t *data, size_t dlen, unsigned int flags,
|
||||
usb_transfer_callback cb, void *priv);
|
||||
|
||||
/**
|
||||
|
@ -401,7 +401,7 @@ int usb_transfer(u8_t ep, u8_t *data, size_t dlen, unsigned int flags,
|
|||
*
|
||||
* @return number of bytes transferred on success, negative errno code on fail.
|
||||
*/
|
||||
int usb_transfer_sync(u8_t ep, u8_t *data, size_t dlen, unsigned int flags);
|
||||
int usb_transfer_sync(uint8_t ep, uint8_t *data, size_t dlen, unsigned int flags);
|
||||
|
||||
/**
|
||||
* @brief Cancel any ongoing transfer on the specified endpoint
|
||||
|
@ -411,7 +411,7 @@ int usb_transfer_sync(u8_t ep, u8_t *data, size_t dlen, unsigned int flags);
|
|||
*
|
||||
* @return 0 on success, negative errno code on fail.
|
||||
*/
|
||||
void usb_cancel_transfer(u8_t ep);
|
||||
void usb_cancel_transfer(uint8_t ep);
|
||||
|
||||
/**
|
||||
* @brief Cancel all ongoing transfers
|
||||
|
@ -426,7 +426,7 @@ void usb_cancel_transfers(void);
|
|||
*
|
||||
* @return true if transfer is ongoing, false otherwise.
|
||||
*/
|
||||
bool usb_transfer_is_busy(u8_t ep);
|
||||
bool usb_transfer_is_busy(uint8_t ep);
|
||||
|
||||
/**
|
||||
* @brief Start the USB remote wakeup procedure
|
||||
|
|
|
@ -80,8 +80,8 @@
|
|||
|
||||
/** USB descriptor header */
|
||||
struct usb_desc_header {
|
||||
u8_t bLength; /**< descriptor length */
|
||||
u8_t bDescriptorType; /**< descriptor type */
|
||||
uint8_t bLength; /**< descriptor length */
|
||||
uint8_t bDescriptorType; /**< descriptor type */
|
||||
};
|
||||
|
||||
#define GET_DESC_TYPE(x) (((x)>>8)&0xFF)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue