Пример #1
0
static void usbc_core_handle_set_address()
{
    usbc_core_t* pUsbCore = usbc_core_get_instance();
    kal_uint16 wValue = pUsbCore->setup_packet.wValue;

    usbc_core_printf("=========>usbcore_handle_set_address\r\n");
    usbc_trace_info(USBCORE_SET_ADDRESS, (wValue & 0x7f));

    usbc_core_set_usb_address(wValue & 0x7f);
    usbc_core_set_control_request(NULL, 0, USBC_CONTROL_REQUEST_TYPE_RECEIVE);
}
Пример #2
0
static void usbc_cosim_hif_attach(void)
{
    usbc_core_t        *pUsbCore = usbc_core_get_instance();
    /* fake USB HW info for ESL COSIM */
    hifusb_boot_info_t usb_boot_info;
    hifusb_get_boot_info(&usb_boot_info);

    usbc_esl_printf("Emulare USB speed change and reset...\n");
    usbc_core_speed_change(pUsbCore, (usbc_usb_speed_e)usb_boot_info.usb_speed);    // emulate speed change notify
    usbc_core_notify_speed_change((usbc_usb_speed_e)usb_boot_info.usb_speed);
    usbc_core_set_hif_configuration();      // emulate reset notify
    usbc_core_notify_state_reset();

    usbc_esl_printf("Emulare HIF USB set address...\n");
    /* emulate SetAddress */
    usbc_core_set_usb_address(usb_boot_info.usb_addr & 0x7f);     // set USB address

    usbc_esl_printf("Emulare USB set configuration...\n");
    /* emulate SetConfig */
    usbc_core_set_usb_configuration(usb_boot_info.usb_config_val);   //set USB configuration, assume there is only one configuration in META mode
}