mirror of
https://github.com/ArteryTek/AT32F413_Firmware_Library.git
synced 2026-05-21 09:22:02 +00:00
update version to v2.0.4
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usb_std.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief usb standard header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
/** @addtogroup AT32F413_middlewares_usbd_drivers
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup USB_standard
|
||||
* @{
|
||||
*/
|
||||
@@ -130,7 +130,7 @@ typedef enum
|
||||
USB_CONN_STATE_ADDRESSED, /*!< usb device connect state address */
|
||||
USB_CONN_STATE_CONFIGURED, /*!< usb device connect state configured */
|
||||
USB_CONN_STATE_SUSPENDED /*!< usb device connect state suspend */
|
||||
}usbd_conn_state;
|
||||
}usbd_conn_state;
|
||||
|
||||
/**
|
||||
* @brief endpoint 0 state
|
||||
@@ -141,7 +141,7 @@ typedef enum
|
||||
#define USB_EPT0_DATA_OUT 3 /*!< usb endpoint state data out */
|
||||
#define USB_EPT0_STATUS_IN 4 /*!< usb endpoint state status in */
|
||||
#define USB_EPT0_STATUS_OUT 5 /*!< usb endpoint state status out */
|
||||
#define USB_EPT0_STALL 6 /*!< usb endpoint state stall */
|
||||
#define USB_EPT0_STALL 6 /*!< usb endpoint state stall */
|
||||
|
||||
/**
|
||||
* @brief usb descriptor length
|
||||
@@ -209,7 +209,7 @@ typedef enum
|
||||
/**
|
||||
* @brief usb cdc class set line coding struct
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
uint32_t bitrate; /* line coding baud rate */
|
||||
uint8_t format; /* line coding foramt */
|
||||
@@ -266,7 +266,7 @@ typedef struct
|
||||
/** @defgroup USB_standard_exported_types
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief usb return status
|
||||
*/
|
||||
@@ -279,7 +279,7 @@ typedef enum
|
||||
USB_ERROR, /*!< usb status error */
|
||||
}usb_sts_type;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief format of usb setup data
|
||||
*/
|
||||
typedef struct
|
||||
@@ -287,12 +287,12 @@ typedef struct
|
||||
uint8_t bmRequestType; /*!< characteristics of request */
|
||||
uint8_t bRequest; /*!< specific request */
|
||||
uint16_t wValue; /*!< word-sized field that varies according to request */
|
||||
uint16_t wIndex; /*!< word-sized field that varies according to request
|
||||
uint16_t wIndex; /*!< word-sized field that varies according to request
|
||||
typically used to pass an index or offset */
|
||||
uint16_t wLength; /*!< number of bytes to transfer if there is a data stage */
|
||||
}usb_setup_type;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief format of standard device descriptor
|
||||
*/
|
||||
typedef struct
|
||||
@@ -313,28 +313,28 @@ typedef struct
|
||||
uint8_t bNumConfigurations; /*!< number of possible configurations */
|
||||
}usb_device_desc_type;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief format of standard configuration descriptor
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t bLength; /*!< size of this descriptor in bytes */
|
||||
uint8_t bDescriptorType; /*!< configuration descriptor type */
|
||||
uint8_t bDescriptorType; /*!< configuration descriptor type */
|
||||
uint16_t wTotalLength; /*!< total length of data returned for this configuration */
|
||||
uint8_t bNumInterfaces; /*!< number of interfaces supported by this configuration */
|
||||
uint8_t bConfigurationValue; /*!< value to use as an argument to the SetConfiguration() request */
|
||||
uint8_t iConfiguration; /*!< index of string descriptor describing this configuration */
|
||||
uint8_t bmAttributes; /*!< configuration characteristics
|
||||
uint8_t bmAttributes; /*!< configuration characteristics
|
||||
D7 reserved
|
||||
D6 self-powered
|
||||
D5 remote wakeup
|
||||
D4~D0 reserved */
|
||||
D4~D0 reserved */
|
||||
uint8_t bMaxPower; /*!< maximum power consumption of the usb device from the bus */
|
||||
|
||||
|
||||
|
||||
|
||||
}usb_configuration_desc_type;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief format of standard interface descriptor
|
||||
*/
|
||||
typedef struct
|
||||
@@ -343,14 +343,14 @@ typedef struct
|
||||
uint8_t bDescriptorType; /*!< interface descriptor type */
|
||||
uint8_t bInterfaceNumber; /*!< number of this interface */
|
||||
uint8_t bAlternateSetting; /*!< value used to select this alternate setting for the interface */
|
||||
uint8_t bNumEndpoints; /*!< number of endpoints used by this interface */
|
||||
uint8_t bNumEndpoints; /*!< number of endpoints used by this interface */
|
||||
uint8_t bInterfaceClass; /*!< class code (assigned by the usb-if) */
|
||||
uint8_t bInterfaceSubClass; /*!< subclass code (assigned by the usb-if) */
|
||||
uint8_t bInterfaceProtocol; /*!< protocol code (assigned by the usb-if) */
|
||||
uint8_t iInterface; /*!< index of string descriptor describing this interface */
|
||||
}usb_interface_desc_type;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief format of standard endpoint descriptor
|
||||
*/
|
||||
typedef struct
|
||||
@@ -360,10 +360,10 @@ typedef struct
|
||||
uint8_t bEndpointAddress; /*!< the address of the endpoint on the usb device described by this descriptor */
|
||||
uint8_t bmAttributes; /*!< describes the endpoints attributes when it is configured using bConfiguration value */
|
||||
uint16_t wMaxPacketSize; /*!< maximum packet size this endpoint */
|
||||
uint8_t bInterval; /*!< interval for polling endpoint for data transfers */
|
||||
uint8_t bInterval; /*!< interval for polling endpoint for data transfers */
|
||||
}usb_endpoint_desc_type;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief format of header
|
||||
*/
|
||||
typedef struct
|
||||
@@ -380,7 +380,7 @@ typedef struct
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usbd_core.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief usb device core header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
/** @addtogroup AT32F413_middlewares_usbd_drivers
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup USBD_drivers_core
|
||||
* @{
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ typedef enum
|
||||
}usbd_event_type;
|
||||
|
||||
/**
|
||||
* @brief usb device descriptor struct
|
||||
* @brief usb device descriptor struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
@@ -70,7 +70,7 @@ typedef struct
|
||||
}usbd_desc_t;
|
||||
|
||||
/**
|
||||
* @brief usb device descriptor handler
|
||||
* @brief usb device descriptor handler
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
@@ -109,23 +109,23 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
usb_reg_type *usb_reg; /*!< usb register pointer */
|
||||
|
||||
|
||||
usbd_class_handler *class_handler; /*!< usb device class handler pointer */
|
||||
usbd_desc_handler *desc_handler; /*!< usb device descriptor handler pointer */
|
||||
|
||||
|
||||
usb_ept_info ept_in[USB_EPT_MAX_NUM]; /*!< usb in endpoint infomation struct */
|
||||
usb_ept_info ept_out[USB_EPT_MAX_NUM]; /*!< usb out endpoint infomation struct */
|
||||
|
||||
|
||||
usb_setup_type setup; /*!< usb setup type struct */
|
||||
uint8_t setup_buffer[12]; /*!< usb setup request buffer */
|
||||
|
||||
|
||||
uint8_t ept0_sts; /*!< usb control endpoint 0 state */
|
||||
uint8_t speed; /*!< usb speed */
|
||||
uint16_t ept0_wlength; /*!< usb endpoint 0 transfer length */
|
||||
|
||||
|
||||
usbd_conn_state conn_state; /*!< usb current connect state */
|
||||
usbd_conn_state old_conn_state; /*!< usb save the previous connect state */
|
||||
|
||||
|
||||
uint8_t device_addr; /*!< device address */
|
||||
uint8_t remote_wakup; /*!< remote wakeup state */
|
||||
uint8_t default_config; /*!< usb default config state */
|
||||
@@ -135,7 +135,7 @@ typedef struct
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/** @defgroup USBD_core_exported_functions
|
||||
* @{
|
||||
@@ -161,25 +161,25 @@ uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr);
|
||||
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev);
|
||||
void usbd_ept_dbuffer_enable(usbd_core_type *udev, uint8_t ept_addr);
|
||||
void usbd_ept_buf_auto_define(usb_ept_info *ept_info);
|
||||
void usbd_ept_buf_custom_define( usbd_core_type *udev, uint8_t ept_addr,
|
||||
void usbd_ept_buf_custom_define( usbd_core_type *udev, uint8_t ept_addr,
|
||||
uint32_t addr);
|
||||
void usbd_ept_defaut_init(usbd_core_type *udev);
|
||||
void usbd_remote_wakeup(usbd_core_type *udev);
|
||||
void usbd_enter_suspend(usbd_core_type *udev);
|
||||
void usbd_core_init(usbd_core_type *udev,
|
||||
usb_reg_type *usb_reg,
|
||||
usbd_class_handler *dev_handler,
|
||||
usbd_class_handler *dev_handler,
|
||||
usbd_desc_handler *desc_handler,
|
||||
uint8_t core_id);
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usb_int.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief usb header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -39,11 +39,11 @@ extern "C" {
|
||||
/** @addtogroup AT32F413_middlewares_usbd_drivers
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup USBD_drivers_interrupt
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup USBD_int_exported_functions
|
||||
* @{
|
||||
*/
|
||||
@@ -57,11 +57,11 @@ void usbd_wakeup_handler(usbd_core_type *udev);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usbd_sdr.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief usb standard request header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
/** @addtogroup AT32F413_middlewares_usbd_drivers
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup USBD_drivers_standard_request
|
||||
* @{
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ extern "C" {
|
||||
/** @defgroup USBD_sdr_exported_functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf);
|
||||
usb_sts_type usbd_device_request(usbd_core_type *udev);
|
||||
usb_sts_type usbd_interface_request(usbd_core_type *udev);
|
||||
@@ -56,11 +56,11 @@ usb_sts_type usbd_endpoint_request(usbd_core_type *udev);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
Reference in New Issue
Block a user