Lines Matching full:ep

60  *  EP addr | ep_idx | ep_abs_idx
71 #define EP_ABS_IDX(ep) (USB_EP_GET_IDX(ep) * 2 + \ argument
72 (USB_EP_GET_DIR(ep) >> 7))
284 uint8_t ep; in usb_dc_ep_configure() local
301 ep = cfg->ep_addr; in usb_dc_ep_configure()
304 kUSB_DeviceControlEndpointDeinit, &ep); in usb_dc_ep_configure()
354 int usb_dc_ep_set_stall(const uint8_t ep) in usb_dc_ep_set_stall() argument
356 uint8_t endpoint = ep; in usb_dc_ep_set_stall()
357 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_set_stall()
376 int usb_dc_ep_clear_stall(const uint8_t ep) in usb_dc_ep_clear_stall() argument
378 uint8_t endpoint = ep; in usb_dc_ep_clear_stall()
379 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_clear_stall()
395 if ((USB_EP_GET_IDX(ep) != USB_CONTROL_ENDPOINT) && in usb_dc_ep_clear_stall()
396 (USB_EP_DIR_IS_OUT(ep))) { in usb_dc_ep_clear_stall()
398 dev_state.dev_struct.controllerHandle, ep, in usb_dc_ep_clear_stall()
402 LOG_ERR("Failed to enable reception on 0x%02x", ep); in usb_dc_ep_clear_stall()
412 int usb_dc_ep_is_stalled(const uint8_t ep, uint8_t *const stalled) in usb_dc_ep_is_stalled() argument
414 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_is_stalled()
428 ep_status.endpointAddress = ep; in usb_dc_ep_is_stalled()
443 int usb_dc_ep_halt(const uint8_t ep) in usb_dc_ep_halt() argument
445 return usb_dc_ep_set_stall(ep); in usb_dc_ep_halt()
448 int usb_dc_ep_enable(const uint8_t ep) in usb_dc_ep_enable() argument
450 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_enable()
467 LOG_WRN("endpoint 0x%x already enabled", ep); in usb_dc_ep_enable()
471 if ((USB_EP_GET_IDX(ep) != USB_CONTROL_ENDPOINT) && in usb_dc_ep_enable()
472 (USB_EP_DIR_IS_OUT(ep))) { in usb_dc_ep_enable()
474 dev_state.dev_struct.controllerHandle, ep, in usb_dc_ep_enable()
478 LOG_ERR("Failed to enable reception on 0x%02x", ep); in usb_dc_ep_enable()
494 int usb_dc_ep_disable(const uint8_t ep) in usb_dc_ep_disable() argument
496 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_disable()
507 ep); in usb_dc_ep_disable()
509 LOG_ERR("Failed to disable ep 0x%02x", ep); in usb_dc_ep_disable()
520 int usb_dc_ep_flush(const uint8_t ep) in usb_dc_ep_flush() argument
522 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_flush()
529 LOG_DBG("Not implemented, idx 0x%02x, ep %u", ep_abs_idx, ep); in usb_dc_ep_flush()
534 int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data, in usb_dc_ep_write() argument
537 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_write()
547 if (USB_EP_GET_DIR(ep) != USB_EP_DIR_IN) { in usb_dc_ep_write()
575 ep, buffer, len_to_send); in usb_dc_ep_write()
577 LOG_ERR("Failed to fill ep 0x%02x buffer", ep); in usb_dc_ep_write()
613 int usb_dc_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len, in usb_dc_ep_read_wait() argument
616 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_read_wait()
626 (USB_EP_GET_DIR(ep) != USB_EP_DIR_OUT)) { in usb_dc_ep_read_wait()
675 if (USB_EP_GET_IDX(ep) == USB_ENDPOINT_CONTROL) { in usb_dc_ep_read_wait()
683 int usb_dc_ep_read_continue(uint8_t ep) in usb_dc_ep_read_continue() argument
685 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_read_continue()
689 USB_EP_GET_DIR(ep) != USB_EP_DIR_OUT) { in usb_dc_ep_read_continue()
695 LOG_WRN("endpoint 0x%x already occupied", ep); in usb_dc_ep_read_continue()
699 if (USB_EP_GET_IDX(ep) == USB_ENDPOINT_CONTROL) { in usb_dc_ep_read_continue()
710 dev_state.dev_struct.controllerHandle, ep, in usb_dc_ep_read_continue()
714 LOG_ERR("Failed to enable reception on ep 0x%02x", ep); in usb_dc_ep_read_continue()
723 int usb_dc_ep_read(const uint8_t ep, uint8_t *const data, in usb_dc_ep_read() argument
726 int retval = usb_dc_ep_read_wait(ep, data, max_data_len, read_bytes); in usb_dc_ep_read()
740 return usb_dc_ep_read_continue(ep); in usb_dc_ep_read()
743 int usb_dc_ep_set_callback(const uint8_t ep, const usb_dc_ep_callback cb) in usb_dc_ep_set_callback() argument
745 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_set_callback()
765 int usb_dc_ep_mps(const uint8_t ep) in usb_dc_ep_mps() argument
767 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in usb_dc_ep_mps()
831 uint8_t ep = cb_msg->code; in handle_transfer_msg() local
832 uint8_t ep_abs_idx = EP_ABS_IDX(ep); in handle_transfer_msg()
840 * LOG_WRN("Drop message for ep 0x%02x", ep); in handle_transfer_msg()
849 if (USB_EP_DIR_IS_IN(ep)) { in handle_transfer_msg()
880 dev_state.eps[ep_abs_idx].callback(ep, ep_status_code); in handle_transfer_msg()
882 LOG_ERR("No cb pointer for endpoint 0x%02x", ep); in handle_transfer_msg()