Skip to content

Commit

Permalink
Rename USBDevice folder to usb
Browse files Browse the repository at this point in the history
  • Loading branch information
kauwua committed Feb 24, 2025
1 parent 15cd3be commit b4fe66d
Show file tree
Hide file tree
Showing 56 changed files with 125 additions and 122 deletions.
3 changes: 3 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
v1.1.4:

* `USBDevice` folder renamed to `usb`
16 changes: 8 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ target_sources(wch-ch56x-lib INTERFACE
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/memory/alloc.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/memory/ramx_alloc.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/SerDesDevice/serdes.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb_device.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb_endpoints.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb20.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb30.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb_device.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb_endpoints.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb20.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb30.c
)

target_include_directories(wch-ch56x-lib INTERFACE ${CMAKE_CURRENT_LIST_DIR})
Expand All @@ -39,10 +39,10 @@ target_sources(wch-ch56x-lib-scheduled INTERFACE
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/memory/alloc.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/memory/ramx_alloc.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/SerDesDevice/serdes.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb_device.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb_endpoints.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb20.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/USBDevice/usb30.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb_device.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb_endpoints.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb20.c
${CMAKE_CURRENT_LIST_DIR}/wch-ch56x-lib/usb/usb30.c
)

target_include_directories(wch-ch56x-lib-scheduled INTERFACE ${CMAKE_CURRENT_LIST_DIR})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
*******************************************************************************/

#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#define USB2_UNSUPPORTED_ENDPOINTS \
((ENDPOINT_8_TX | ENDPOINT_8_RX | ENDPOINT_9_TX | ENDPOINT_9_RX | \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ limitations under the License.

#include "usb_device.h"
#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb2_utils.h"
#include "wch-ch56x-lib/USBDevice/usb_types.h"
#include "wch-ch56x-lib/usb/usb2_utils.h"
#include "wch-ch56x-lib/usb/usb_types.h"

#ifdef __cplusplus
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ limitations under the License.
#pragma GCC diagnostic pop

#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_types.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_types.h"
#include <stdbool.h>

#ifdef __cplusplus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ limitations under the License.
*******************************************************************************/

#include "wch-ch56x-lib/USBDevice/usb30.h"
#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb30_utils.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb30.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb30_utils.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#define ENDP0_MAX_PACKET_SIZE 512

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ extern "C" {
#pragma GCC diagnostic pop

#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_types.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_types.h"

// link CFG
#define TERM_EN (1 << 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ limitations under the License.
#pragma GCC diagnostic pop

#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb_types.h"
#include "wch-ch56x-lib/usb/usb_types.h"

#ifdef __cplusplus
extern "C" {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*******************************************************************************/

#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/usb/usb_device.h"

uint16_t _default_endp0_user_handled_control_request(USB_SETUP* request,
uint8_t** buffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ USB3.0/USB2.0 management in the back.
#pragma GCC diagnostic pop

#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/USBDevice/usb_types.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_types.h"
#include "wch-ch56x-lib/utils/critical_section.h"
#include <stdint.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ limitations under the License.
*******************************************************************************/

#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_device.h"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ limitations under the License.
#include <stdint.h>
#include <string.h>

#include "wch-ch56x-lib/USBDevice/usb_types.h"
#include "wch-ch56x-lib/usb/usb_types.h"

#ifdef __cplusplus
extern "C" {
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions tests/test_firmware_hspi/User/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ limitations under the License.

#include "wch-ch56x-lib/HSPIDevice/hspi.h"
#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb30.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb30.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#undef FREQ_SYS
/* System clock / MCU frequency in Hz (lowest possible speed 15MHz) */
Expand Down
8 changes: 4 additions & 4 deletions tests/test_firmware_loopback/User/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ limitations under the License.
#include "wch-ch56x-lib/HSPIDevice/hspi.h"
#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/SerDesDevice/serdes.h"
#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb30.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb30.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#undef FREQ_SYS
/* System clock / MCU frequency in Hz (lowest possible speed 15MHz) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB2_DEVICE_DESCRIPTOR_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

const uint8_t* usb2_device_configs[1];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB3_DEVICE_DESCRIPTOR_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

uint8_t device_capabilities_1[4] = { 0x1e, 0xf4, 0x00, 0x00 };
uint8_t device_capabilities_2[7] = { 0x00, 0x0c, 0x00, 0x02, 0x0a, 0xff, 0x07 };
Expand Down
6 changes: 3 additions & 3 deletions tests/test_firmware_loopback/User/usb_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ limitations under the License.
#define USB_DEVICE_USER_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

uint8_t hydradancer_product_string_descriptor[] = {
'H',
Expand Down
10 changes: 5 additions & 5 deletions tests/test_firmware_serdes/User/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ limitations under the License.

#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/SerDesDevice/serdes.h"
#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb30.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb30.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#undef FREQ_SYS
/* System clock / MCU frequency in Hz (lowest possible speed 15MHz) */
Expand Down
4 changes: 2 additions & 2 deletions tests/test_firmware_unittests/User/test_usb_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ limitations under the License.
#ifndef TEST_USBDEVICE_H
#define TEST_USBDEVICE_H

#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

bool test_usb_device(void);

Expand Down
8 changes: 4 additions & 4 deletions tests/test_firmware_usb_loopback/User/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ limitations under the License.
#include "usb3_device_descriptors.h"
#include "usb_device.h"
#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb30.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb30.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#undef FREQ_SYS
/* System clock / MCU frequency in Hz (lowest possible speed 15MHz) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB2_DEVICE_DESCRIPTOR_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

const uint8_t* usb2_device_configs[1];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB2_DEVICE_DESCRIPTOR_ALT_ENDPOINTS_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

const uint8_t* usb2_device_configs_alt_endpoints[1];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB3_DEVICE_DESCRIPTOR_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

const uint8_t* usb3_device_configs[1];

Expand Down
6 changes: 3 additions & 3 deletions tests/test_firmware_usb_loopback/User/usb_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ limitations under the License.
#define USB_DEVICE_USER_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

uint8_t hydradancer_product_string_descriptor[] = {
'H',
Expand Down
8 changes: 4 additions & 4 deletions tests/test_firmware_usb_loopback_delayed/User/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ limitations under the License.
#include "usb2_hs_device_descriptors.h"
#include "usb_device.h"
#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb30.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb30.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#undef FREQ_SYS
/* System clock / MCU frequency in Hz (lowest possible speed 15MHz) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB2_FS_DEVICE_DESCRIPTOR_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

const uint8_t* usb2_fs_device_configs[1];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB2_HS_DEVICE_DESCRIPTOR_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

const uint8_t* usb2_hs_device_configs[1];

Expand Down
6 changes: 3 additions & 3 deletions tests/test_firmware_usb_loopback_delayed/User/usb_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ limitations under the License.
#define USB_DEVICE_USER_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

uint8_t hydradancer_product_string_descriptor[] = {
'H',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ limitations under the License.
#include "usb3_device_descriptors.h"
#include "usb3_device_handlers.h"
#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb20.h"
#include "wch-ch56x-lib/USBDevice/usb30.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb20.h"
#include "wch-ch56x-lib/usb/usb30.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

#undef FREQ_SYS
/* System clock / MCU frequency in Hz (lowest possible speed 15MHz) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ limitations under the License.
#define USB2_DEVICE_USER_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

extern const USB_STRING_DESCR* usb2_board_string_descriptors_array[2];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#define USB2_DEVICE_DESCRIPTOR_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"

const uint8_t* usb2_device_configs[1];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
#include "definitions.h"
#include "usb2_device.h"
#include "wch-ch56x-lib/logging/logging.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/usb/usb_device.h"

void usb2_board_endp1_tx_complete(TRANSACTION_STATUS status);
void usb2_board_endp1_tx_complete(TRANSACTION_STATUS status) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ limitations under the License.
#define USB3_DEVICE_USER_H

#include "definitions.h"
#include "wch-ch56x-lib/USBDevice/usb_descriptors.h"
#include "wch-ch56x-lib/USBDevice/usb_device.h"
#include "wch-ch56x-lib/USBDevice/usb_endpoints.h"
#include "wch-ch56x-lib/usb/usb_descriptors.h"
#include "wch-ch56x-lib/usb/usb_device.h"
#include "wch-ch56x-lib/usb/usb_endpoints.h"

extern const USB_STRING_DESCR* usb3_board_string_descriptors_array[2];

Expand Down
Loading

0 comments on commit b4fe66d

Please sign in to comment.