geekhack

geekhack Projects => Making Stuff Together! => Topic started by: mkHeinzen on Mon, 13 July 2015, 09:15:47

Title: ATtiny85/DigiSpark firmware, where should I start?
Post by: mkHeinzen on Mon, 13 July 2015, 09:15:47
I have a DigiSpark board which is essentially a ATtiny85 controller with Arduino Bootloader.

Their current V-USB implementation does not work as I need it to. The Keyboard implementation does not handle Keyboard Events (such as key_down, key_up, pressed, released). The only thing it implements is key stroke (the full course of clicking and releasing it), meaning that you can't have a "hold" effect.

With that said, where should I start off to rewrite or implement this functionality? I have access to the HID source codes as they are open source on GitHub (https://github.com/digistump/DigisparkArduinoIntegration/tree/master/libraries/DigisparkKeyboard).

I don't know a lot about V-USB or USB communication overall, but DigiSpark is pretty much the perfect solution for my needs and I think that working on this is far more interesting than wasting money on more expensive controllers.

Cheers!
Title: Re: ATtiny85/DigiSpark firmware, where should I start?
Post by: hasu on Mon, 13 July 2015, 19:56:34
That library doesn't intend to implement a real keyboard, just sends ascii chars. V-USB is not guilty there.
You have to write keyboard library yourself but don't need to know deep of V-USB, just read usbdrv.h to know its interface. And send 8 bytes keyboard report with using V-USB directly.

https://github.com/digistump/DigisparkArduinoIntegration/blob/master/libraries/DigisparkKeyboard/usbdrv.h
Title: Re: ATtiny85/DigiSpark firmware, where should I start?
Post by: mkHeinzen on Tue, 14 July 2015, 09:13:37
That library doesn't intend to implement a real keyboard, just sends ascii chars. V-USB is not guilty there.
You have to write keyboard library yourself but don't need to know deep of V-USB, just read usbdrv.h to know its interface. And send 8 bytes keyboard report with using V-USB directly.

https://github.com/digistump/DigisparkArduinoIntegration/blob/master/libraries/DigisparkKeyboard/usbdrv.h

Okay, that's something to start off. Thanks