Lines Matching refs:deviceHandle
256 usb_device_struct_t *deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceTransfer() local
263 if (NULL == deviceHandle) in USB_DeviceTransfer()
268 if (NULL != deviceHandle->controllerInterface) in USB_DeviceTransfer()
275 if (0U != deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].isBusy) in USB_DeviceTransfer()
280 deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].isBusy = 1U; in USB_DeviceTransfer()
286 …status = deviceHandle->controllerInterface->deviceSend(deviceHandle->controllerHandle, endpointAdd… in USB_DeviceTransfer()
293 …status = deviceHandle->controllerInterface->deviceRecv(deviceHandle->controllerHandle, endpointAdd… in USB_DeviceTransfer()
299 deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].isBusy = 0U; in USB_DeviceTransfer()
327 usb_device_struct_t *deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceControl() local
330 if (NULL == deviceHandle) in USB_DeviceControl()
335 if (NULL != deviceHandle->controllerInterface) in USB_DeviceControl()
339 …status = deviceHandle->controllerInterface->deviceControl(deviceHandle->controllerHandle, type, pa… in USB_DeviceControl()
684 usb_device_struct_t *deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceNotificationTrigger() local
693 if (NULL == deviceHandle->deviceCallback) in USB_DeviceNotificationTrigger()
699 if (0U != deviceHandle->epCallbackDirectly) in USB_DeviceNotificationTrigger()
703 return USB_DeviceNotification(deviceHandle, message); in USB_DeviceNotificationTrigger()
708 … if (KOSA_StatusSuccess != OSA_MsgQPut(deviceHandle->notificationQueue, (osa_msg_handle_t)message)) in USB_DeviceNotificationTrigger()
715 return USB_DeviceNotification(deviceHandle, message); in USB_DeviceNotificationTrigger()
740 usb_device_struct_t *deviceHandle = NULL; in USB_DeviceInit() local
750 error = USB_DeviceAllocateHandle(controllerId, &deviceHandle); in USB_DeviceInit()
758 deviceHandle->deviceCallback = deviceCallback; in USB_DeviceInit()
760 deviceHandle->controllerId = controllerId; in USB_DeviceInit()
762 deviceHandle->deviceAddress = 0U; in USB_DeviceInit()
764 deviceHandle->isResetting = 0U; in USB_DeviceInit()
769 deviceHandle->epCallback[count].callbackFn = (usb_device_endpoint_callback_t)NULL; in USB_DeviceInit()
770 deviceHandle->epCallback[count].callbackParam = NULL; in USB_DeviceInit()
771 deviceHandle->epCallback[count].isBusy = 0U; in USB_DeviceInit()
775 error = USB_DeviceGetControllerInterface(controllerId, &deviceHandle->controllerInterface); in USB_DeviceInit()
779 if (kStatus_USB_Success != USB_DeviceFreeHandle(deviceHandle)) in USB_DeviceInit()
784 (void)USB_DeviceFreeHandle(deviceHandle); in USB_DeviceInit()
788 if (NULL == deviceHandle->controllerInterface) in USB_DeviceInit()
791 if (kStatus_USB_Success != USB_DeviceFreeHandle(deviceHandle)) in USB_DeviceInit()
796 (void)USB_DeviceFreeHandle(deviceHandle); in USB_DeviceInit()
800 if (((usb_device_controller_init_t)NULL == deviceHandle->controllerInterface->deviceInit) || in USB_DeviceInit()
801 ((usb_device_controller_deinit_t)NULL == deviceHandle->controllerInterface->deviceDeinit) || in USB_DeviceInit()
802 ((usb_device_controller_send_t)NULL == deviceHandle->controllerInterface->deviceSend) || in USB_DeviceInit()
803 ((usb_device_controller_recv_t)NULL == deviceHandle->controllerInterface->deviceRecv) || in USB_DeviceInit()
804 ((usb_device_controller_cancel_t)NULL == deviceHandle->controllerInterface->deviceCancel) || in USB_DeviceInit()
805 ((usb_device_controller_control_t)NULL == deviceHandle->controllerInterface->deviceControl)) in USB_DeviceInit()
808 if (kStatus_USB_Success != USB_DeviceFreeHandle(deviceHandle)) in USB_DeviceInit()
813 (void)USB_DeviceFreeHandle(deviceHandle); in USB_DeviceInit()
820 deviceHandle->notificationQueue = (osa_msgq_handle_t)&deviceHandle->notificationQueueBuffer[0]; in USB_DeviceInit()
822 …OSA_MsgQCreate(deviceHandle->notificationQueue, USB_DEVICE_CONFIG_MAX_MESSAGES, USB_DEVICE_MESSAGE… in USB_DeviceInit()
825 error = USB_DeviceDeinit(deviceHandle); in USB_DeviceInit()
831 (void)USB_DeviceDeinit(deviceHandle); in USB_DeviceInit()
837 *handle = deviceHandle; in USB_DeviceInit()
840 …error = deviceHandle->controllerInterface->deviceInit(controllerId, deviceHandle, &deviceHandle->c… in USB_DeviceInit()
844 if (kStatus_USB_Success != USB_DeviceDeinit(deviceHandle)) in USB_DeviceInit()
849 (void)USB_DeviceDeinit(deviceHandle); in USB_DeviceInit()
855 deviceHandle->state = (uint8_t)kUSB_DeviceStateDefault; in USB_DeviceInit()
905 usb_device_struct_t *deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceDeinit() local
907 if (NULL == deviceHandle) in USB_DeviceDeinit()
912 if (NULL != deviceHandle->controllerInterface) in USB_DeviceDeinit()
916 …if (kStatus_USB_Success != deviceHandle->controllerInterface->deviceDeinit(deviceHandle->controlle… in USB_DeviceDeinit()
921 (void)deviceHandle->controllerInterface->deviceDeinit(deviceHandle->controllerHandle); in USB_DeviceDeinit()
923 deviceHandle->controllerInterface = (usb_device_controller_interface_struct_t *)NULL; in USB_DeviceDeinit()
928 if (NULL != deviceHandle->notificationQueue) in USB_DeviceDeinit()
931 if (KOSA_StatusSuccess != OSA_MsgQDestroy(deviceHandle->notificationQueue)) in USB_DeviceDeinit()
936 (void)OSA_MsgQDestroy(deviceHandle->notificationQueue); in USB_DeviceDeinit()
938 deviceHandle->notificationQueue = NULL; in USB_DeviceDeinit()
944 if (kStatus_USB_Success != USB_DeviceFreeHandle(deviceHandle)) in USB_DeviceDeinit()
949 (void)USB_DeviceFreeHandle(deviceHandle); in USB_DeviceDeinit()
1032 usb_device_struct_t *deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceCancel() local
1035 if (NULL == deviceHandle) in USB_DeviceCancel()
1040 if (NULL != deviceHandle->controllerInterface) in USB_DeviceCancel()
1043 …status = deviceHandle->controllerInterface->deviceCancel(deviceHandle->controllerHandle, endpointA… in USB_DeviceCancel()
1073 usb_device_struct_t *deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceInitEndpoint() local
1077 if (NULL == deviceHandle) in USB_DeviceInitEndpoint()
1093 …deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].callbackFn = epCallback-… in USB_DeviceInitEndpoint()
1094 deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].callbackParam = in USB_DeviceInitEndpoint()
1096 deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].isBusy = 0U; in USB_DeviceInitEndpoint()
1121 usb_device_struct_t *deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceDeinitEndpoint() local
1130 if (NULL == deviceHandle) in USB_DeviceDeinitEndpoint()
1136 deviceHandle->epCallbackDirectly = 1U; in USB_DeviceDeinitEndpoint()
1142 deviceHandle->epCallbackDirectly = 0U; in USB_DeviceDeinitEndpoint()
1148 deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].callbackFn = in USB_DeviceDeinitEndpoint()
1150 … deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].callbackParam = NULL; in USB_DeviceDeinitEndpoint()
1151 … deviceHandle->epCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].isBusy = 0U; in USB_DeviceDeinitEndpoint()
1406 void USB_DeviceTaskFunction(void *deviceHandle) in USB_DeviceTaskFunction() argument
1408 usb_device_struct_t *handle = (usb_device_struct_t *)deviceHandle; in USB_DeviceTaskFunction()
1411 if (NULL != deviceHandle) in USB_DeviceTaskFunction()
1468 usb_device_struct_t *deviceHandle; in USB_DeviceUpdateHwTick() local
1482 deviceHandle = (usb_device_struct_t *)handle; in USB_DeviceUpdateHwTick()
1484 deviceHandle->hwTick = tick; in USB_DeviceUpdateHwTick()
1488 …status = USB_DeviceControl(handle, kUSB_DeviceControlUpdateHwTick, (void *)(&deviceHandle->hwTick)… in USB_DeviceUpdateHwTick()
1492 tempValue = deviceHandle->hwTick; in USB_DeviceUpdateHwTick()