hcd_init() take init struct

This commit is contained in:
hathach
2024-10-11 17:53:39 +07:00
parent f3b7d7515e
commit 1587d48e89
11 changed files with 25 additions and 36 deletions

View File

@@ -494,8 +494,8 @@ bool hcd_configure(uint8_t rhport, uint32_t cfg_id, const void* cfg_param) {
}
// Initialize controller to host mode
bool hcd_init(uint8_t rhport) {
(void) rhport;
bool hcd_init(const tusb_rhport_init_t* rh_init) {
const uint8_t rhport = rh_init->rhport;
tuh_max3421_int_api(rhport, false);

View File

@@ -70,7 +70,8 @@ bool hcd_dcache_clean_invalidate(void const* addr, uint32_t data_size) {
// Controller API
//--------------------------------------------------------------------+
bool hcd_init(uint8_t rhport) {
bool hcd_init(const tusb_rhport_init_t* rh_init) {
const uint8_t rhport = rh_init->rhport;
ci_hs_regs_t *hcd_reg = CI_HS_REG(rhport);
// Reset controller

View File

@@ -556,9 +556,8 @@ static void process_pipe_rx(uint8_t rhport, uint_fast8_t pipenum)
* Host API
*------------------------------------------------------------------*/
bool hcd_init(uint8_t rhport)
{
(void)rhport;
bool hcd_init(const tusb_rhport_init_t* rh_init) {
(void) rh_init;
NVIC_ClearPendingIRQ(USB0_IRQn);
_hcd.bmRequestType = REQUEST_TYPE_INVALID;

View File

@@ -368,10 +368,8 @@ static void process_bus_reset(uint8_t rhport)
/*------------------------------------------------------------------*/
/* Host API
*------------------------------------------------------------------*/
bool hcd_init(uint8_t rhport)
{
(void)rhport;
bool hcd_init(const tusb_rhport_init_t* rh_init) {
(void) rh_init;
KHCI->USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
while (KHCI->USBTRC0 & USB_USBTRC0_USBRESET_MASK);

View File

@@ -178,8 +178,8 @@ TU_ATTR_ALWAYS_INLINE static inline void *_virt_addr(void *physical_address)
}
// Initialization according to 5.1.1.4
bool hcd_init(uint8_t rhport)
{
bool hcd_init(const tusb_rhport_init_t* rh_init) {
const uint8_t rhport = rh_init->rhport;
(void) rhport;
//------------- Data Structure init -------------//

View File

@@ -55,8 +55,8 @@ bool hcd_configure(uint8_t rhport, uint32_t cfg_id, const void *cfg_param) {
return true;
}
bool hcd_init(uint8_t rhport) {
(void) rhport;
bool hcd_init(const tusb_rhport_init_t* rh_init) {
(void) rh_init;
// To run USB SOF interrupt in core1, call this init in core1
pio_usb_host_init(&pio_host_cfg);

View File

@@ -375,9 +375,8 @@ static void _hw_endpoint_init(struct hw_endpoint *ep, uint8_t dev_addr, uint8_t
//--------------------------------------------------------------------+
// HCD API
//--------------------------------------------------------------------+
bool hcd_init(uint8_t rhport)
{
(void) rhport;
bool hcd_init(const tusb_rhport_init_t* rh_init) {
(void) rh_init;
pico_trace("hcd_init %d\n", rhport);
assert(rhport == 0);

View File

@@ -466,8 +466,8 @@ static void enable_interrupt(uint32_t pswi)
}
#endif
bool hcd_init(uint8_t rhport)
{
bool hcd_init(const tusb_rhport_init_t* rh_init) {
const uint8_t rhport = rh_init->rhport;
rusb2_reg_t* rusb = RUSB2_REG(rhport);
rusb2_module_start(rhport, true);

View File

@@ -44,9 +44,8 @@ bool hcd_configure(uint8_t rhport, uint32_t cfg_id, const void* cfg_param) {
}
// Initialize controller to host mode
bool hcd_init(uint8_t rhport) {
(void) rhport;
bool hcd_init(const tusb_rhport_init_t* rh_init) {
(void) rh_init;
return false;
}