Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: libusb - Teensy port?

  1. #1
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,230

    libusb - Teensy port?

    I never really wanted to deal with the USB stuff, but for a new project I can't get around it.

    I want to port a PC software to the Teensy.

    It uses libusb:
    libusb: http://libusb.sourceforge.net/api-1.0/

    API: http://libusb.sourceforge.net/api-1.0/libusb_api.html


    I have a list of the functions I would need (maybe not complete):

    libusb_control_transfer()
    libusb_bulk_transfer()
    libusb_fill_bulk_transfer()
    libusb_submit_transfer()
    libusb_free_transfer()
    libusb_alloc_transfer()
    libusb_cancel_transfer()
    libusb_handle_events_timeout()
    libusb_handle_events_timeout_completed()

    libusb_dev_mem_alloc()
    libusb_dev_mem_free()

    libusb_init() :-)
    libusb_get_device()
    libusb_get_device_descriptor()
    libusb_get_string_descriptor_ascii()

    libusb_open()
    libusb_claim_interface()
    libusb_close()
    libusb_get_device_list()
    libusb_free_device_list()
    libusb_reset_device()
    libusb_exit()
    libusb_release_interface()

    (Possibly not complete)
    What do you think, is this feasible?
    Of course it would be ideal if you could make a libusb compatible wrapper.
    Then it would be easy to port software that uses libusb to the Teensy (USB-Host).
    What are the chances?


    I think the ones in the first package above are the most important.
    Last edited by Frank B; 03-01-2021 at 07:42 AM.

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,756
    Some of that in MSC and USBHost work ongoing in other threads ( wwatson, WMXZ, KurtE, mjs513 ) - how many of those elements are supported now?

    This is for use on USB Host connect on Teensy 3.6 and 4.x? What is the Device connecting to host?

    The MTP code for device responds to some of those presenting 'disk' media to Windows - the MSC as Host is updating the devices it can mount SD and USB HDD and FLASH drives - so current work focusing on FAT16/32/ExFat

    Saw this STM Lightweight USB Device Stack

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,230
    It's for a DVB-T stick, used as a SDR.
    Yes, I sometimes followed these threads - but have no Idea what is supported and what not.
    It would be more for the T4 - don't think 3.6 has enough power. And it is 480MBit anyway.

    I guess there is no API documentation for the Host library..... or is it somewhere?
    A "howto" support a new device?
    Anything?

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,756
    Okay, was just clarifying the need to use Teensy Host to Emulate libusb as Windows Host would present it. T4.x makes sense.

    Names above are the API Doc's - and the source code

    USB Host has support for mice/keyboards/bluetooth/ethernet dongle and current push is on MSC that talks to disk devices. Forum has trails of that stuff 'those' guys added and their adventures. I've only looked after things got added from the sketch level.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •