Lines Matching full:ep
128 uint8_t ep; member
140 static inline uint8_t get_bdt_idx(uint8_t ep, uint8_t odd) in get_bdt_idx() argument
142 if (ep & USB_EP_DIR_IN) { in get_bdt_idx()
143 return ((((KINETIS_ADDR2IDX(ep)) * 4) + 2 + (odd & 1))); in get_bdt_idx()
145 return ((((KINETIS_ADDR2IDX(ep)) * 4) + (odd & 1))); in get_bdt_idx()
342 LOG_DBG("ep %x, mps %d, type %d", cfg->ep_addr, cfg->ep_mps, in usb_dc_ep_configure()
414 int usb_dc_ep_set_stall(const uint8_t ep) in usb_dc_ep_set_stall() argument
416 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_set_stall()
424 LOG_DBG("ep %x, idx %d", ep, ep_idx); in usb_dc_ep_set_stall()
426 if (USB_EP_DIR_IS_OUT(ep)) { in usb_dc_ep_set_stall()
428 bd_idx = get_bdt_idx(ep, in usb_dc_ep_set_stall()
432 bd_idx = get_bdt_idx(ep, in usb_dc_ep_set_stall()
441 int usb_dc_ep_clear_stall(const uint8_t ep) in usb_dc_ep_clear_stall() argument
443 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_clear_stall()
451 LOG_DBG("ep %x, idx %d", ep, ep_idx); in usb_dc_ep_clear_stall()
454 if (USB_EP_DIR_IS_OUT(ep)) { in usb_dc_ep_clear_stall()
457 bd_idx = get_bdt_idx(ep, in usb_dc_ep_clear_stall()
464 bd_idx = get_bdt_idx(ep, in usb_dc_ep_clear_stall()
470 if (ep == 0U) { in usb_dc_ep_clear_stall()
477 int usb_dc_ep_is_stalled(const uint8_t ep, uint8_t *const stalled) in usb_dc_ep_is_stalled() argument
479 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_is_stalled()
486 LOG_DBG("ep %x, idx %d", ep_idx, ep); in usb_dc_ep_is_stalled()
492 if (USB_EP_DIR_IS_OUT(ep)) { in usb_dc_ep_is_stalled()
498 uint8_t bd_idx = get_bdt_idx(ep, in usb_dc_ep_is_stalled()
501 bd_idx = get_bdt_idx(ep, in usb_dc_ep_is_stalled()
508 int usb_dc_ep_halt(const uint8_t ep) in usb_dc_ep_halt() argument
510 return usb_dc_ep_set_stall(ep); in usb_dc_ep_halt()
513 int usb_dc_ep_enable(const uint8_t ep) in usb_dc_ep_enable() argument
515 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_enable()
524 idx_even = get_bdt_idx(ep, 0); in usb_dc_ep_enable()
525 idx_odd = get_bdt_idx(ep, 1); in usb_dc_ep_enable()
529 LOG_WRN("endpoint 0x%x already enabled", ep); in usb_dc_ep_enable()
533 if (USB_EP_DIR_IS_OUT(ep)) { in usb_dc_ep_enable()
549 LOG_INF("ep 0x%x, ep_idx %d", ep, ep_idx); in usb_dc_ep_enable()
554 int usb_dc_ep_disable(const uint8_t ep) in usb_dc_ep_disable() argument
556 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_disable()
565 idx_even = get_bdt_idx(ep, 0); in usb_dc_ep_disable()
566 idx_odd = get_bdt_idx(ep, 1); in usb_dc_ep_disable()
568 LOG_INF("ep %x, idx %d", ep_idx, ep); in usb_dc_ep_disable()
572 if (USB_EP_DIR_IS_OUT(ep)) { in usb_dc_ep_disable()
581 int usb_dc_ep_flush(const uint8_t ep) in usb_dc_ep_flush() argument
583 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_flush()
590 LOG_DBG("ep %x, idx %d", ep_idx, ep); in usb_dc_ep_flush()
595 int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data, in usb_dc_ep_write() argument
598 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_write()
610 bd_idx = get_bdt_idx(ep, odd); in usb_dc_ep_write()
613 if (USB_EP_GET_DIR(ep) != USB_EP_DIR_IN) { in usb_dc_ep_write()
624 LOG_DBG("ep 0x%x is busy", ep); in usb_dc_ep_write()
652 LOG_DBG("ep 0x%x write %d bytes from %d", ep, len_to_send, data_len); in usb_dc_ep_write()
661 int usb_dc_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len, in usb_dc_ep_read_wait() argument
664 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_read_wait()
675 bd_idx = get_bdt_idx(ep, dev_data.ep_ctrl[ep_idx].status.out_odd); in usb_dc_ep_read_wait()
678 if (USB_EP_GET_DIR(ep) != USB_EP_DIR_OUT) { in usb_dc_ep_read_wait()
734 int usb_dc_ep_read_continue(uint8_t ep) in usb_dc_ep_read_continue() argument
736 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_read_continue()
744 bd_idx = get_bdt_idx(ep, dev_data.ep_ctrl[ep_idx].status.out_odd); in usb_dc_ep_read_continue()
746 if (USB_EP_GET_DIR(ep) != USB_EP_DIR_OUT) { in usb_dc_ep_read_continue()
758 bd_idx = get_bdt_idx(ep, ~dev_data.ep_ctrl[ep_idx].status.out_odd); in usb_dc_ep_read_continue()
782 int usb_dc_ep_read(const uint8_t ep, uint8_t *const data, in usb_dc_ep_read() argument
785 int retval = usb_dc_ep_read_wait(ep, data, max_data_len, read_bytes); in usb_dc_ep_read()
798 if (usb_dc_ep_read_continue(ep) != 0) { in usb_dc_ep_read()
807 int usb_dc_ep_set_callback(const uint8_t ep, const usb_dc_ep_callback cb) in usb_dc_ep_set_callback() argument
809 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_set_callback()
820 if (ep & USB_EP_DIR_IN) { in usb_dc_ep_set_callback()
837 int usb_dc_ep_mps(const uint8_t ep) in usb_dc_ep_mps() argument
839 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usb_dc_ep_mps()
846 if (ep & USB_EP_DIR_IN) { in usb_dc_ep_mps()
889 msg.ep = 0U; in usb_kinetis_isr_handler()
897 msg.ep = 0U; in usb_kinetis_isr_handler()
915 uint8_t ep = ((status << 4) & USB_EP_DIR_IN) | ep_idx; in usb_kinetis_isr_handler() local
917 uint8_t idx = get_bdt_idx(ep, odd); in usb_kinetis_isr_handler()
920 msg.ep = ep; in usb_kinetis_isr_handler()
964 msg.ep = 0U; in usb_kinetis_isr_handler()
973 msg.ep = 0U; in usb_kinetis_isr_handler()
999 ep_idx = USB_EP_GET_IDX(msg.ep); in usb_kinetis_thread_main()
1005 dev_data.ep_ctrl[ep_idx].cb_out(msg.ep, in usb_kinetis_thread_main()
1011 dev_data.ep_ctrl[ep_idx].cb_out(msg.ep, in usb_kinetis_thread_main()
1017 dev_data.ep_ctrl[ep_idx].cb_in(msg.ep, in usb_kinetis_thread_main()