/* ** =================================================================== ** Method : usb_device_USB_Framework_DeInit (component USB_DEVICE_STACK) ** Description : ** The funtion De-initializes the Class Module ** Parameters : ** NAME - DESCRIPTION ** controller_ID - [IN] Controller ID ** Returns : ** --- - Error code ** =================================================================== */ uint_8 USB_Framework_DeInit(uint_8 controller_ID) { uint_8 error; /* Free framwork_callback */ g_framework_callback = NULL; /* Free other_req_callback */ g_other_req_callback = NULL; /* Unregister CONTROL service */ error = _usb_device_unregister_service(&controller_ID, USB_SERVICE_EP0); /* Return error */ return error; }
/**************************************************************************//*! * * @name USB_Framework_Deinit * * @brief The funtion deinitializes the Class Module * * @param handle : handle to Identify the controller * @param fw_handle: Framework handle * * @return status * USB_OK : When Successfull * Others : Errors * *****************************************************************************/ uint_8 USB_Framework_Deinit ( _usb_device_handle handle, /*[IN]*/ USB_CLASS_FW_HANDLE fw_handle /*[IN]*/ ) { USB_CLASS_FW_OBJECT_STRUCT_PTR usb_fw_ptr = NULL; uint_8 error = USB_OK; usb_fw_ptr = Get_Usb_Class_Fw_Object_Ptr(fw_handle); USB_mem_free((void *)(usb_fw_ptr->ext_req_to_host)); error = _usb_device_unregister_service(handle, USB_SERVICE_EP0); USB_Class_Fw_Free_Handle(fw_handle); return error; }