Skip to content

Commit 6b6dcc6

Browse files
committed
refactored multiple ports for hcd rusb2
1 parent 1cb3f0e commit 6b6dcc6

File tree

5 files changed

+268
-242
lines changed

5 files changed

+268
-242
lines changed

.idea/cmake.xml

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/ra6m5.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hw/bsp/ra/boards/ra6m5_ek/ozone/ra6m5.jdebug

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ void OnProjectLoad (void) {
2020
Project.SetTraceSource ("Trace Pins");
2121
Project.SetTracePortWidth (4);
2222

23-
File.Open ("../../../../../../examples/device/cdc_msc/cmake-build-ra6m5/cdc_msc.elf");
23+
//File.Open ("../../../../../../examples/device/cdc_msc/cmake-build-ra6m5/cdc_msc.elf");
24+
//File.Open ("../../../../../../examples/dual/cmake-build-ra6m5/host_hid_to_device_cdc/host_hid_to_device_cdc.elf");
25+
File.Open ("../../../../../../examples/cmake-build-ra6m5/host/cdc_msc_hid/cdc_msc_hid.elf");
2426
}
2527
/*********************************************************************
2628
*

src/portable/renesas/rusb2/dcd_rusb2.c

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ typedef struct TU_ATTR_PACKED
8383
TU_ATTR_PACKED_END // End of definition of packed structs (used by the CCRX toolchain)
8484
TU_ATTR_BIT_FIELD_ORDER_END
8585

86+
typedef struct
87+
{
88+
pipe_state_t pipe[10];
89+
uint8_t ep[2][16]; /* a lookup table for a pipe index from an endpoint address */
90+
} dcd_data_t;
91+
92+
static dcd_data_t _dcd;
93+
94+
//--------------------------------------------------------------------+
95+
// INTERNAL OBJECT & FUNCTION DECLARATION
96+
//--------------------------------------------------------------------+
97+
8698
// Transfer conditions specifiable for each pipe:
8799
// - Pipe 0: Control transfer with 64-byte single buffer
88100
// - Pipes 1 and 2: Bulk isochronous transfer continuous transfer mode with programmable buffer size up
@@ -96,18 +108,6 @@ enum {
96108
PIPE_COUNT = 10,
97109
};
98110

99-
typedef struct
100-
{
101-
pipe_state_t pipe[10];
102-
uint8_t ep[2][16]; /* a lookup table for a pipe index from an endpoint address */
103-
} dcd_data_t;
104-
105-
static dcd_data_t _dcd;
106-
107-
//--------------------------------------------------------------------+
108-
// INTERNAL OBJECT & FUNCTION DECLARATION
109-
//--------------------------------------------------------------------+
110-
111111
static unsigned find_pipe(unsigned xfer)
112112
{
113113
switch (xfer) {
@@ -746,20 +746,17 @@ void dcd_init(uint8_t rhport)
746746
}
747747
}
748748

749-
void dcd_int_enable(uint8_t rhport)
750-
{
749+
void dcd_int_enable(uint8_t rhport) {
751750
rusb2_int_enable(rhport);
752751
}
753752

754-
void dcd_int_disable(uint8_t rhport)
755-
{
753+
void dcd_int_disable(uint8_t rhport) {
756754
rusb2_int_disable(rhport);
757755
}
758756

759-
void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
760-
{
761-
(void)rhport;
762-
(void)dev_addr;
757+
void dcd_set_address(uint8_t rhport, uint8_t dev_addr) {
758+
(void) rhport;
759+
(void) dev_addr;
763760
}
764761

765762
void dcd_remote_wakeup(uint8_t rhport)

0 commit comments

Comments
 (0)