diff --git a/README.md b/README.md index fcf50d7..5e354ef 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,5 @@ The lamest things are than my Pi Zero is the model with no built-in storage, so - [Turn Your Raspberry Pi Zero into a USB Keyboard (HID)](https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/) - [USB Keyboard Emulation with the Raspberry Pi Zero](https://www.makerhacks.com/usb-keyboard-emulation-with-the-raspberry-pi-zero/) - [Getting started with gpiozero](https://dronebotworkshop.com/raspberry-pi-gpio/) + +![Rasberry Pi Zero Pinout Diagram](https://tutorials-raspberrypi.de/wp-content/uploads/Raspbery-Pi-GPIO-Pin-Belegung.png) diff --git a/raspi_config/hid_usb b/raspi_config/hid_usb new file mode 100755 index 0000000..237876f --- /dev/null +++ b/raspi_config/hid_usb @@ -0,0 +1,27 @@ +#!/bin/bash + +cd /sys/kernel/config/usb_gadget +mkdir -p usb_hid +cd usb_hid +echo 0x1d6b > idVendor # Linux Foundation +echo 0x0104 > idProduct # Multifunction Composite Gadget +echo 0x0100 > bcdDevice # v1.0.0 +echo 0x0200 > bcdUSB # USB2 +mkdir -p strings/0x409 +echo "fedcba9876543210" > strings/0x409/serialnumber +echo "Rudis Muiznieks" > strings/0x409/manufacturer +echo "Button Buddy" > strings/0x409/product +mkdir -p configs/c.1/strings/0x409 +echo "Config 1: ECM network" > configs/c.1/strings/0x409/configuration +echo 250 > configs/c.1/MaxPower + +# functions +mkdir -p functions/hid.usb0 +echo 1 > functions/hid.usb0/protocol +echo 1 > functions/hid.usb0/subclass +echo 8 > functions/hid.usb0/report_length +echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc +ln -s functions/hid.usb0 configs/c.1 +# end functions + +ls /sys/class/udc > UDC