Teensy as a USB network device?

Status
Not open for further replies.

samy

Member
Hi all,

Is Teensy capable of acting as a USB network device? Just as it can emulate a USB keyboard, I'd like to see how to emulate a USB network device -- is this technically possible and if so, suggestions on where to get started?

I've started going over these two to understand how Teensy emulates keyboard and joystick but some additional references would be helpful!
hardware/teensy/cores/teensy3/usb_keyboard.c
hardware/teensy/cores/teensy3/usb_joystick.c

Thanks!

-samy
 
Create a new USB type involves 2 steps.

First, you need to edit the USB descriptor data, to get the PC to recognize Teensy as the type of device you want. Descriptors are just binary data, but getting every byte right so the device is recognized can be quite a bit of work.

Then once the PC is detecting the device, you actually need to provide the code which sends and receive data on whatever endpoints your descriptors promised it would use. As you can see in those files, the lower-level USB code takes care of actually sending packets and letting you receive them, without having to worry about all the thorny details of DMA, buffer tables, data phase toggle bits, and so on.

But the first step is merely coming up with the descriptor data that tell the PC you're going to act as that type of device.
 
Hi Paul,

Going through the cores I saw your usb_disk core -- I switched the Arduino environment to Teensy 2 and saw Disks appear! I see Teensy 3.x don't have it available though, does this just require some changes to code?
 
Status
Not open for further replies.
Back
Top