Lines Matching refs:phy_context
218 phy_context_t *phy_context = (phy_context_t *) calloc(1, sizeof(phy_context_t)); in usb_new_phy() local
219 ESP_GOTO_ON_FALSE(phy_context, ESP_ERR_NO_MEM, cleanup, USBPHY_TAG, "no mem for phy context"); in usb_new_phy()
222 usb_phy_get_phy_status(config->target, &phy_context->status); in usb_new_phy()
223 if (phy_context->status == USB_PHY_STATUS_FREE) { in usb_new_phy()
227 p_phy_ctrl_obj->external_phy = phy_context; in usb_new_phy()
229 p_phy_ctrl_obj->internal_phy = phy_context; in usb_new_phy()
235 phy_context->target = config->target; in usb_new_phy()
236 phy_context->controller = config->controller; in usb_new_phy()
237 phy_context->status = USB_PHY_STATUS_IN_USE; in usb_new_phy()
239 usb_phy_hal_init(&(phy_context->hal_context)); in usb_new_phy()
241 usb_phy_hal_otg_conf(&(phy_context->hal_context), config->target == USB_PHY_TARGET_EXT); in usb_new_phy()
245 usb_phy_hal_jtag_conf(&(phy_context->hal_context), config->target == USB_PHY_TARGET_EXT); in usb_new_phy()
246 phy_context->otg_mode = USB_OTG_MODE_DEVICE; in usb_new_phy()
247 phy_context->otg_speed = USB_PHY_SPEED_FULL; in usb_new_phy()
256 *handle_ret = (usb_phy_handle_t) phy_context; in usb_new_phy()
258 phy_context->iopins = (usb_phy_gpio_conf_t *) calloc(1, sizeof(usb_phy_gpio_conf_t)); in usb_new_phy()
259 …ESP_GOTO_ON_FALSE(phy_context->iopins, ESP_ERR_NO_MEM, cleanup, USBPHY_TAG, "no mem for storing I/… in usb_new_phy()
260 memcpy(phy_context->iopins, config->gpio_conf, sizeof(usb_phy_gpio_conf_t)); in usb_new_phy()
261 ESP_ERROR_CHECK(phy_external_iopins_configure(phy_context->iopins)); in usb_new_phy()
272 free(phy_context->iopins); in usb_new_phy()
273 free(phy_context); in usb_new_phy()