Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

board corrections + atmega firmware

  • Loading branch information...
commit 8f0ee9923c2c55d66a2a03e7f086cd06e2f61d35 1 parent 9e599e4
Nephirus Nephirus authored
Showing with 9,364 additions and 3 deletions.
  1. +429 −1 eagle/brmscope/eagle.epf
  2. +4 −0 eagle/brmscope/stepper_driver.brd
  3. +12 −2 eagle/brmscope/stepper_driver.sch
  4. +75 −0 firmware/Readme.txt
  5. +42 −0 firmware/commandline/Makefile
  6. +18 −0 firmware/commandline/Makefile.windows
  7. +324 −0 firmware/commandline/hiddata.c
  8. +71 −0 firmware/commandline/hiddata.h
  9. BIN  firmware/commandline/hiddata.o
  10. +49 −0 firmware/commandline/hidsdi.h
  11. BIN  firmware/commandline/hidtool
  12. +127 −0 firmware/commandline/hidtool.c
  13. BIN  firmware/commandline/hidtool.o
  14. +164 −0 firmware/firmware/Makefile
  15. +265 −0 firmware/firmware/main.c
  16. +373 −0 firmware/firmware/usbconfig.h
  17. +318 −0 firmware/firmware/usbdrv/Changelog.txt
  18. +166 −0 firmware/firmware/usbdrv/CommercialLicense.txt
  19. +361 −0 firmware/firmware/usbdrv/License.txt
  20. +172 −0 firmware/firmware/usbdrv/Readme.txt
  21. +149 −0 firmware/firmware/usbdrv/USB-ID-FAQ.txt
  22. +154 −0 firmware/firmware/usbdrv/USB-IDs-for-free.txt
  23. +188 −0 firmware/firmware/usbdrv/asmcommon.inc
  24. +50 −0 firmware/firmware/usbdrv/oddebug.c
  25. +123 −0 firmware/firmware/usbdrv/oddebug.h
  26. +376 −0 firmware/firmware/usbdrv/usbconfig-prototype.h
  27. +628 −0 firmware/firmware/usbdrv/usbdrv.c
  28. +736 −0 firmware/firmware/usbdrv/usbdrv.h
  29. +393 −0 firmware/firmware/usbdrv/usbdrvasm.S
  30. +21 −0 firmware/firmware/usbdrv/usbdrvasm.asm
  31. +393 −0 firmware/firmware/usbdrv/usbdrvasm12.inc
  32. +750 −0 firmware/firmware/usbdrv/usbdrvasm128.inc
  33. +423 −0 firmware/firmware/usbdrv/usbdrvasm15.inc
  34. +346 −0 firmware/firmware/usbdrv/usbdrvasm16.inc
  35. +453 −0 firmware/firmware/usbdrv/usbdrvasm165.inc
  36. +707 −0 firmware/firmware/usbdrv/usbdrvasm18-crc.inc
  37. +360 −0 firmware/firmware/usbdrv/usbdrvasm20.inc
  38. +144 −0 firmware/firmware/usbdrv/usbportability.h
430 eagle/brmscope/eagle.epf
View
@@ -1,2 +1,430 @@
[Eagle]
-Version="06 02 00"
+Version="06 02 00"
+Platform="Linux"
+Serial="62191E841E-LSR-WLM-1EL"
+Globals="Globals"
+Desktop="Desktop"
+
+[Globals]
+AutoSaveProject=1
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/19inch.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/40xx.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/41xx.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/45xx.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/74ac-logic.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/74ttl-din.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/74xx-eu.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/74xx-little-de.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/74xx-little-us.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/74xx-us.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/751xx.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/advanced-test-technologies.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/agilent-technologies.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/allegro.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/altera-cyclone-II.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/altera-cyclone-III.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/altera-stratix-iv.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/altera.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/am29-memory.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/amd-mach.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/amd.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/amis.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/analog-devices.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ase.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/atmel.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/austriamicrosystems.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/avago.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/axis.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/battery.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/belton-engineering.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/burr-brown.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/busbar.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/buzzer.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/c-trimm.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/california-micro-devices.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/capacitor-wima.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/chipcard-siemens.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/cirrus-logic.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-3m.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-4ucon.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amp-champ.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amp-micromatch.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amp-mt.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amp-mt6.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amp-quick.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amp-te.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amp.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-amphenol.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-avx.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-berg.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-bosch.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-chipcard-iso7816.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-coax.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-commcon.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-conrad.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-cpci.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-cui.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-cypressindustries.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-deutsch.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-dil.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-ebyelectro.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-elco.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-erni.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-faston.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-fci.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-friwo.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-garry.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-harting-h.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-harting-ml.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-harting-v.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-harting.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-hirose.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-hirschmann.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-jack.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-jae.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-jst.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-kycon.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-kyocera-elco.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-lemo.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-leotronics.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-lsta.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-lstb.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-lumberg.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-ml.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-molex.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-neutrik_ag.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-omron.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-panasonic.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-panduit.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-pc.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-pc104.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-254.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-3.81.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-350.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-500.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-508.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-762.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-me_max.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-mkds_5.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-phoenix-smkdsp.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-ptr500.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-pulse.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-rib.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-samtec.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-shallin.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-shiua-chyuan.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-stewart.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-stocko.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-subd.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-sullinselectronics.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-thomas-betts.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-tyco.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-tycoelectronics.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-vg.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-wago-500.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-wago-508.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-wago.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-wago255.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-weidmueller-sl35.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-wenzhou-yihua.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-xmultiple.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/con-yamaichi.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/crystal.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/csr.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/cypress.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/davicom.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/dc-dc-converter.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/dimensions.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/diode.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/discrete.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/display-hp.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/display-kingbright.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/display-lcd.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/docu-dummy.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ecl.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/em-microelectronic.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/etx-board.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/exar.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/fairchild-semic.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/farnell.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/fiber-optic-hp.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/fiber-optic-siemens.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/fifo.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/flexipanel.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/fox-electronics.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/frames.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/freescale.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ftdichip.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/fujitsu.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/fuse.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/gennum.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/halo-electronics.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/heatsink.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/holes.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/holtek.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ic-package.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/inductor-coilcraft.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/inductor-neosid.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/inductor-nkl.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/inductors.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/infineon-tricore.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/infineon.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/intersil.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ir.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/isd.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/johanson-technology.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/jump-0r-smd.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/jumper.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/lantronix.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/lattice.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/lc-filter.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/led-7-segment.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/led-citizen-electronics.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/led-lumiled.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/led.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/lem.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/linear-technology.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/linear.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/linx.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/logo.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/lprs.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/lsi-computer-systems.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/lumiled.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/marks.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/maxim.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/maxstream.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/melexis.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory-hitachi.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory-idt.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory-micron.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory-motorola-dram.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory-nec.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory-samsung.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory-sram.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/memory.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/mems.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micrel.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-cyrod.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-fujitsu.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-harris.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-hitachi.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-infineon.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-intel.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-mc68000.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-motorola.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-philips.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-renesas.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-samsung.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micro-siemens.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/microchip.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micron.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/micronas.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/microphon.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/microwave.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/midori-sensor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/minicircuits.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/mitsubishi-semiconductor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/motorola-sensor-driver.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/murata-filter.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/murata-sensor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/nanotec.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/national-instruments.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/national-semiconductor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/nec-lqfp100-pack.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/nec.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/nrj-semiconductor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/omnivision.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/on-semiconductor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/opto-honeywell-3000.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/opto-honeywell-4000.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/opto-honeywell.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/opto-micro-linear.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/opto-trans-siemens.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/opto-transmittter-hp.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/opto-vishay.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/optocoupler.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/pal.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/philips-semiconductors.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/photo-elements.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/piher.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/pinhead.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/plcc-socket.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/pld-intel.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/plxtech.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/pot-vitrohm.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/pot-xicor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/pot.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ptc-ntc.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/quantum-research-group.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/rcl.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/recom-international.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/rectifier.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ref-packages-longpad.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/ref-packages.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/relay.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/renesas.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor-bourns.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor-dil.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor-net.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor-power.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor-ruf.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor-shunt.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor-sil.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/resistor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/rf-micro-devices.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/rf-solutions.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/rohm.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/semicon-smd-ipc.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/sensor-comus-group.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/sensor-heraeus.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/sensor-infratec.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/sharp.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/silabs.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/sim-technology.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/sipex.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/smd-ipc.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/smd-special.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/solomon-systech.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/solpad.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/special-drill.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/special.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/st-microelectronics.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/supertex.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/supply1.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/supply2.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch-alps.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch-coto.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch-dil.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch-misc.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch-omron.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch-raychem.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch-reed.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/switch.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/telcom.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/telecontrolli.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/telefunken.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/testpad.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/texas.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/toshiba.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/traco-electronic.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/trafo-bei.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/trafo-siemens.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/trafo-xicon.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/trafo.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transformer-pulse.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transistor-fet.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transistor-neu-to92.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transistor-npn.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transistor-pnp.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transistor-power.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transistor-small-signal.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/transistor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/triac.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/trimble.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/tripas.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/u-blox.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/uln-udn.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/v-reg-micrel.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/v-reg.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/varistor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/wafer-scale-psd.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/wirepad.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/xicor.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/xilinx-virtex-v5.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/xilinx-xc18v.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/xilinx-xc9.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/xilinx-xcv.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/zetex.lbr"
+UsedLibrary="/home/nephirus/eagle-6.2.0/lbr/zilog.lbr"
+
+[Win_1]
+Type="Board Editor"
+Loc="0 0 599 399"
+State=1
+Number=1
+File="stepper_driver.brd"
+View="32.7968 27.4967 61.0265 53.7359"
+WireWidths=" 0 0.254 0.3048 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0.4064"
+PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
+PadDrills=" 0.5 0.6 0.7 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.8"
+ViaDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
+ViaDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
+HoleDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
+TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
+PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
+PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
+MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
+SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
+WireBend=0
+WireBendSet=0
+WireCap=1
+MiterStyle=0
+PadShape=0
+ViaShape=0
+PolygonPour=0
+PolygonRank=1
+PolygonThermals=1
+PolygonOrphans=0
+TextRatio=8
+PinDirection=3
+PinFunction=0
+PinLength=2
+PinVisible=3
+SwapLevel=0
+ArcDirection=0
+AddLevel=2
+PadsSameType=0
+Layer=16
+
+[Win_2]
+Type="Schematic Editor"
+Loc="0 0 599 399"
+State=1
+Number=2
+File="stepper_driver.sch"
+View="-74.8882 -29.4087 49.0571 77.3967"
+WireWidths=" 0 0.3048 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0.4064 0.1524"
+PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
+PadDrills=" 0.5 0.6 0.7 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.8"
+ViaDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
+ViaDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
+HoleDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
+TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
+PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
+PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
+MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
+SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
+WireBend=0
+WireBendSet=31
+WireCap=1
+MiterStyle=0
+PadShape=0
+ViaShape=0
+PolygonPour=0
+PolygonRank=0
+PolygonThermals=1
+PolygonOrphans=0
+TextRatio=8
+PinDirection=3
+PinFunction=0
+PinLength=2
+PinVisible=3
+SwapLevel=0
+ArcDirection=0
+AddLevel=2
+PadsSameType=0
+Layer=91
+Views=" 1: -74.8882 -29.4087 49.0571 77.3967"
+Sheet=1
+
+[Win_3]
+Type="Control Panel"
+Loc="0 0 599 399"
+State=2
+Number=0
+
+[Desktop]
+Screen="1366 768"
+Window="Win_1"
+Window="Win_2"
+Window="Win_3"
4 eagle/brmscope/stepper_driver.brd
View
@@ -2184,6 +2184,8 @@ design rules under a new name.</description>
<wire x1="31.75" y1="36.195" x2="31.115" y2="35.56" width="0.4064" layer="16"/>
<wire x1="31.115" y1="35.56" x2="31.115" y2="33.02" width="0.4064" layer="16"/>
<wire x1="31.115" y1="33.02" x2="32.385" y2="31.75" width="0.4064" layer="16"/>
+<contactref element="IC4" pad="2"/>
+<wire x1="37.6174" y1="41.84" x2="46.2026" y2="42.64" width="0" layer="19" extent="16-16"/>
</signal>
<signal name="N$3">
<contactref element="IC4" pad="15"/>
@@ -2392,6 +2394,8 @@ design rules under a new name.</description>
<wire x1="32.385" y1="35.56" x2="34.925" y2="35.56" width="0.4064" layer="16"/>
<wire x1="34.925" y1="35.56" x2="36.195" y2="36.83" width="0.4064" layer="16"/>
<wire x1="36.195" y1="36.83" x2="36.195" y2="39.37" width="0.4064" layer="16"/>
+<contactref element="IC4" pad="1"/>
+<wire x1="37.6174" y1="39.44" x2="46.2026" y2="43.44" width="0" layer="19" extent="16-16"/>
</signal>
<signal name="N$37">
<contactref element="X5" pad="1"/>
14 eagle/brmscope/stepper_driver.sch
View
@@ -11101,10 +11101,15 @@ Source: www.kingbright.com</description>
<net name="N$13" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="ADC7"/>
-<wire x1="-43.18" y1="22.86" x2="10.16" y2="22.86" width="0.1524" layer="91"/>
+<wire x1="-43.18" y1="22.86" x2="-33.02" y2="22.86" width="0.1524" layer="91"/>
<pinref part="IC2" gate="A" pin="I1"/>
+<wire x1="-33.02" y1="22.86" x2="10.16" y2="22.86" width="0.1524" layer="91"/>
<wire x1="10.16" y1="22.86" x2="10.16" y2="20.32" width="0.1524" layer="91"/>
<wire x1="10.16" y1="20.32" x2="12.7" y2="20.32" width="0.1524" layer="91"/>
+<pinref part="IC4" gate="G$1" pin="PD4(XCK/T0)"/>
+<wire x1="-43.18" y1="7.62" x2="-33.02" y2="7.62" width="0.1524" layer="91"/>
+<wire x1="-33.02" y1="7.62" x2="-33.02" y2="22.86" width="0.1524" layer="91"/>
+<junction x="-33.02" y="22.86"/>
</segment>
</net>
<net name="N$3" class="0">
@@ -11315,10 +11320,15 @@ Source: www.kingbright.com</description>
<net name="N$12" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="ADC6"/>
-<wire x1="-43.18" y1="25.4" x2="5.08" y2="25.4" width="0.1524" layer="91"/>
+<wire x1="-43.18" y1="25.4" x2="-35.56" y2="25.4" width="0.1524" layer="91"/>
<pinref part="IC2" gate="A" pin="I2"/>
+<wire x1="-35.56" y1="25.4" x2="5.08" y2="25.4" width="0.1524" layer="91"/>
<wire x1="5.08" y1="25.4" x2="5.08" y2="12.7" width="0.1524" layer="91"/>
<wire x1="5.08" y1="12.7" x2="12.7" y2="12.7" width="0.1524" layer="91"/>
+<pinref part="IC4" gate="G$1" pin="PD3(INT1)"/>
+<wire x1="-43.18" y1="10.16" x2="-35.56" y2="10.16" width="0.1524" layer="91"/>
+<wire x1="-35.56" y1="10.16" x2="-35.56" y2="25.4" width="0.1524" layer="91"/>
+<junction x="-35.56" y="25.4"/>
</segment>
</net>
<net name="N$37" class="0">
75 firmware/Readme.txt
View
@@ -0,0 +1,75 @@
+This is the Readme file for the hid-data example. In this example, we show
+how blocks of data can be exchanged with the device using only functionality
+compliant to the HID class. Since class drivers for HID are included with
+Windows, you don't need to install drivers on Windows.
+
+
+WHAT IS DEMONSTRATED?
+=====================
+This example demonstrates how the HID class can be misused to transfer fixed
+size blocks of data (up to the driver's transfer size limit) over HID feature
+reports. This technique is of great value on Windows because no driver DLLs
+are needed (the hid-custom-rq example still requires the libusb-win32 DLL,
+although it may be in the program's directory). The host side application
+requires no installation, it can even be started directly from a CD. This
+example also demonstrates how to transfer data using usbFunctionWrite() and
+usbFunctionRead().
+
+
+PREREQUISITES
+=============
+Target hardware: You need an AVR based circuit based on one of the examples
+(see the "circuits" directory at the top level of this package), e.g. the
+metaboard (http://www.obdev.at/goto.php?t=metaboard).
+
+AVR development environment: You need the gcc tool chain for the AVR, see
+the Prerequisites section in the top level Readme file for how to obtain it.
+
+Host development environment: A C compiler and libusb on Unix. On Windows
+you need the Driver Development Kit (DDK) Instead of libusb. MinGW ships
+with a free version of the DDK.
+
+
+BUILDING THE FIRMWARE
+=====================
+Change to the "firmware" directory and modify Makefile according to your
+architecture (CPU clock, target device, fuse values) and ISP programmer. Then
+edit usbconfig.h according to your pin assignments for D+ and D-. The default
+settings are for the metaboard hardware.
+
+Type "make hex" to build main.hex, then "make flash" to upload the firmware
+to the device. Don't forget to run "make fuse" once to program the fuses. If
+you use a prototyping board with boot loader, follow the instructions of the
+boot loader instead.
+
+Please note that the first "make hex" copies the driver from the top level
+into the firmware directory. If you use a different build system than our
+Makefile, you must copy the driver by hand.
+
+
+BUILDING THE HOST SOFTWARE
+==========================
+Make sure that you have libusb (on Unix) or the DDK (on Windows) installed.
+We recommend MinGW on Windows since it includes a free version of the DDK.
+Then change to directory "commandline" and run "make" on Unix or
+"make -f Makefile.windows" on Windows.
+
+
+USING THE COMMAND LINE TOOL
+===========================
+The device implements a data store of 128 bytes in EEPROM. You can send a
+block of 128 bytes to the device or read the block using the command line
+tool.
+
+To send a block to the device, use e.g.
+
+ hidtool write 0x01,0x02,0x03,0x04,...
+
+and to receive the block, use
+
+ hidtool read
+
+
+----------------------------------------------------------------------------
+(c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH.
+http://www.obdev.at/
42 firmware/commandline/Makefile
View
@@ -0,0 +1,42 @@
+# Name: Makefile
+# Project: hid-data example
+# Author: Christian Starkjohann
+# Creation Date: 2008-04-11
+# Tabsize: 4
+# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
+# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+# This Revision: $Id$
+
+# Please read the definitions below and edit them as appropriate for your
+# system:
+
+# Use the following 3 lines on Unix and Mac OS X:
+USBFLAGS= `libusb-config --cflags`
+USBLIBS= `libusb-config --libs`
+EXE_SUFFIX=
+
+# Use the following 3 lines on Windows and comment out the 3 above:
+#USBFLAGS=
+#USBLIBS= -lhid -lusb -lsetupapi
+#EXE_SUFFIX= .exe
+
+CC= gcc
+CFLAGS= -O -Wall $(USBFLAGS)
+LIBS= $(USBLIBS)
+
+OBJ= hidtool.o hiddata.o
+PROGRAM= hidtool$(EXE_SUFFIX)
+
+all: $(PROGRAM)
+
+$(PROGRAM): $(OBJ)
+ $(CC) -o $(PROGRAM) $(OBJ) $(LIBS)
+
+strip: $(PROGRAM)
+ strip $(PROGRAM)
+
+clean:
+ rm -f $(OBJ) $(PROGRAM)
+
+.c.o:
+ $(CC) $(ARCH_COMPILE) $(CFLAGS) -c $*.c -o $*.o
18 firmware/commandline/Makefile.windows
View
@@ -0,0 +1,18 @@
+# Name: Makefile.windows
+# Project: hid-data example
+# Author: Christian Starkjohann
+# Creation Date: 2008-04-11
+# Tabsize: 4
+# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
+# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+# This Revision: $Id$
+
+# You may use this file with
+# make -f Makefile.windows
+# on Windows with MinGW instead of editing the main Makefile.
+
+include Makefile
+
+USBFLAGS=
+USBLIBS= -lhid -lsetupapi
+EXE_SUFFIX= .exe
324 firmware/commandline/hiddata.c
View
@@ -0,0 +1,324 @@
+/* Name: hiddata.c
+ * Author: Christian Starkjohann
+ * Creation Date: 2008-04-11
+ * Tabsize: 4
+ * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+ * This Revision: $Id$
+ */
+
+#include <stdio.h>
+#include "hiddata.h"
+
+/* ######################################################################## */
+#if defined(WIN32) /* ##################################################### */
+/* ######################################################################## */
+
+#include <windows.h>
+#include <setupapi.h>
+#include "hidsdi.h"
+#include <ddk/hidpi.h>
+
+#ifdef DEBUG
+#define DEBUG_PRINT(arg) printf arg
+#else
+#define DEBUG_PRINT(arg)
+#endif
+
+/* ------------------------------------------------------------------------ */
+
+static void convertUniToAscii(char *buffer)
+{
+unsigned short *uni = (void *)buffer;
+char *ascii = buffer;
+
+ while(*uni != 0){
+ if(*uni >= 256){
+ *ascii++ = '?';
+ }else{
+ *ascii++ = *uni++;
+ }
+ }
+ *ascii++ = 0;
+}
+
+int usbhidOpenDevice(usbDevice_t **device, int vendor, char *vendorName, int product, char *productName, int usesReportIDs)
+{
+GUID hidGuid; /* GUID for HID driver */
+HDEVINFO deviceInfoList;
+SP_DEVICE_INTERFACE_DATA deviceInfo;
+SP_DEVICE_INTERFACE_DETAIL_DATA *deviceDetails = NULL;
+DWORD size;
+int i, openFlag = 0; /* may be FILE_FLAG_OVERLAPPED */
+int errorCode = USBOPEN_ERR_NOTFOUND;
+HANDLE handle = INVALID_HANDLE_VALUE;
+HIDD_ATTRIBUTES deviceAttributes;
+
+ HidD_GetHidGuid(&hidGuid);
+ deviceInfoList = SetupDiGetClassDevs(&hidGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_INTERFACEDEVICE);
+ deviceInfo.cbSize = sizeof(deviceInfo);
+ for(i=0;;i++){
+ if(handle != INVALID_HANDLE_VALUE){
+ CloseHandle(handle);
+ handle = INVALID_HANDLE_VALUE;
+ }
+ if(!SetupDiEnumDeviceInterfaces(deviceInfoList, 0, &hidGuid, i, &deviceInfo))
+ break; /* no more entries */
+ /* first do a dummy call just to determine the actual size required */
+ SetupDiGetDeviceInterfaceDetail(deviceInfoList, &deviceInfo, NULL, 0, &size, NULL);
+ if(deviceDetails != NULL)
+ free(deviceDetails);
+ deviceDetails = malloc(size);
+ deviceDetails->cbSize = sizeof(*deviceDetails);
+ /* this call is for real: */
+ SetupDiGetDeviceInterfaceDetail(deviceInfoList, &deviceInfo, deviceDetails, size, &size, NULL);
+ DEBUG_PRINT(("checking HID path \"%s\"\n", deviceDetails->DevicePath));
+#if 0
+ /* If we want to access a mouse our keyboard, we can only use feature
+ * requests as the device is locked by Windows. It must be opened
+ * with ACCESS_TYPE_NONE.
+ */
+ handle = CreateFile(deviceDetails->DevicePath, ACCESS_TYPE_NONE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, openFlag, NULL);
+#endif
+ /* attempt opening for R/W -- we don't care about devices which can't be accessed */
+ handle = CreateFile(deviceDetails->DevicePath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, openFlag, NULL);
+ if(handle == INVALID_HANDLE_VALUE){
+ DEBUG_PRINT(("opening failed: %d\n", (int)GetLastError()));
+ /* errorCode = USBOPEN_ERR_ACCESS; opening will always fail for mouse -- ignore */
+ continue;
+ }
+ deviceAttributes.Size = sizeof(deviceAttributes);
+ HidD_GetAttributes(handle, &deviceAttributes);
+ DEBUG_PRINT(("device attributes: vid=%d pid=%d\n", deviceAttributes.VendorID, deviceAttributes.ProductID));
+ if(deviceAttributes.VendorID != vendor || deviceAttributes.ProductID != product)
+ continue; /* ignore this device */
+ errorCode = USBOPEN_ERR_NOTFOUND;
+ if(vendorName != NULL && productName != NULL){
+ char buffer[512];
+ if(!HidD_GetManufacturerString(handle, buffer, sizeof(buffer))){
+ DEBUG_PRINT(("error obtaining vendor name\n"));
+ errorCode = USBOPEN_ERR_IO;
+ continue;
+ }
+ convertUniToAscii(buffer);
+ DEBUG_PRINT(("vendorName = \"%s\"\n", buffer));
+ if(strcmp(vendorName, buffer) != 0)
+ continue;
+ if(!HidD_GetProductString(handle, buffer, sizeof(buffer))){
+ DEBUG_PRINT(("error obtaining product name\n"));
+ errorCode = USBOPEN_ERR_IO;
+ continue;
+ }
+ convertUniToAscii(buffer);
+ DEBUG_PRINT(("productName = \"%s\"\n", buffer));
+ if(strcmp(productName, buffer) != 0)
+ continue;
+ }
+ break; /* we have found the device we are looking for! */
+ }
+ SetupDiDestroyDeviceInfoList(deviceInfoList);
+ if(deviceDetails != NULL)
+ free(deviceDetails);
+ if(handle != INVALID_HANDLE_VALUE){
+ *device = (usbDevice_t *)handle;
+ errorCode = 0;
+ }
+ return errorCode;
+}
+
+/* ------------------------------------------------------------------------ */
+
+void usbhidCloseDevice(usbDevice_t *device)
+{
+ CloseHandle((HANDLE)device);
+}
+
+/* ------------------------------------------------------------------------ */
+
+int usbhidSetReport(usbDevice_t *device, char *buffer, int len)
+{
+BOOLEAN rval;
+
+ rval = HidD_SetFeature((HANDLE)device, buffer, len);
+ return rval == 0 ? USBOPEN_ERR_IO : 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+int usbhidGetReport(usbDevice_t *device, int reportNumber, char *buffer, int *len)
+{
+BOOLEAN rval = 0;
+
+ buffer[0] = reportNumber;
+ rval = HidD_GetFeature((HANDLE)device, buffer, *len);
+ return rval == 0 ? USBOPEN_ERR_IO : 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+/* ######################################################################## */
+#else /* defined WIN32 #################################################### */
+/* ######################################################################## */
+
+#include <string.h>
+#include <usb.h>
+
+#define usbDevice usb_dev_handle /* use libusb's device structure */
+
+/* ------------------------------------------------------------------------- */
+
+#define USBRQ_HID_GET_REPORT 0x01
+#define USBRQ_HID_SET_REPORT 0x09
+
+#define USB_HID_REPORT_TYPE_FEATURE 3
+
+
+static int usesReportIDs;
+
+/* ------------------------------------------------------------------------- */
+
+static int usbhidGetStringAscii(usb_dev_handle *dev, int index, char *buf, int buflen)
+{
+char buffer[256];
+int rval, i;
+
+ if((rval = usb_get_string_simple(dev, index, buf, buflen)) >= 0) /* use libusb version if it works */
+ return rval;
+ if((rval = usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, (USB_DT_STRING << 8) + index, 0x0409, buffer, sizeof(buffer), 5000)) < 0)
+ return rval;
+ if(buffer[1] != USB_DT_STRING){
+ *buf = 0;
+ return 0;
+ }
+ if((unsigned char)buffer[0] < rval)
+ rval = (unsigned char)buffer[0];
+ rval /= 2;
+ /* lossy conversion to ISO Latin1: */
+ for(i=1;i<rval;i++){
+ if(i > buflen) /* destination buffer overflow */
+ break;
+ buf[i-1] = buffer[2 * i];
+ if(buffer[2 * i + 1] != 0) /* outside of ISO Latin1 range */
+ buf[i-1] = '?';
+ }
+ buf[i-1] = 0;
+ return i-1;
+}
+
+int usbhidOpenDevice(usbDevice_t **device, int vendor, char *vendorName, int product, char *productName, int _usesReportIDs)
+{
+struct usb_bus *bus;
+struct usb_device *dev;
+usb_dev_handle *handle = NULL;
+int errorCode = USBOPEN_ERR_NOTFOUND;
+static int didUsbInit = 0;
+
+ if(!didUsbInit){
+ usb_init();
+ didUsbInit = 1;
+ }
+ usb_find_busses();
+ usb_find_devices();
+ for(bus=usb_get_busses(); bus; bus=bus->next){
+ for(dev=bus->devices; dev; dev=dev->next){
+ if(dev->descriptor.idVendor == vendor && dev->descriptor.idProduct == product){
+ char string[256];
+ int len;
+ handle = usb_open(dev); /* we need to open the device in order to query strings */
+ if(!handle){
+ errorCode = USBOPEN_ERR_ACCESS;
+ fprintf(stderr, "Warning: cannot open USB device: %s\n", usb_strerror());
+ continue;
+ }
+ if(vendorName == NULL && productName == NULL){ /* name does not matter */
+ break;
+ }
+ /* now check whether the names match: */
+ len = usbhidGetStringAscii(handle, dev->descriptor.iManufacturer, string, sizeof(string));
+ if(len < 0){
+ errorCode = USBOPEN_ERR_IO;
+ fprintf(stderr, "Warning: cannot query manufacturer for device: %s\n", usb_strerror());
+ }else{
+ errorCode = USBOPEN_ERR_NOTFOUND;
+ /* fprintf(stderr, "seen device from vendor ->%s<-\n", string); */
+ if(strcmp(string, vendorName) == 0){
+ len = usbhidGetStringAscii(handle, dev->descriptor.iProduct, string, sizeof(string));
+ if(len < 0){
+ errorCode = USBOPEN_ERR_IO;
+ fprintf(stderr, "Warning: cannot query product for device: %s\n", usb_strerror());
+ }else{
+ errorCode = USBOPEN_ERR_NOTFOUND;
+ /* fprintf(stderr, "seen product ->%s<-\n", string); */
+ if(strcmp(string, productName) == 0)
+ break;
+ }
+ }
+ }
+ usb_close(handle);
+ handle = NULL;
+ }
+ }
+ if(handle)
+ break;
+ }
+ if(handle != NULL){
+ errorCode = 0;
+ *device = (void *)handle;
+ usesReportIDs = _usesReportIDs;
+ }
+ return errorCode;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void usbhidCloseDevice(usbDevice_t *device)
+{
+ if(device != NULL)
+ usb_close((void *)device);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int usbhidSetReport(usbDevice_t *device, char *buffer, int len)
+{
+int bytesSent, reportId = buffer[0];
+
+ if(!usesReportIDs){
+ buffer++; /* skip dummy report ID */
+ len--;
+ }
+ bytesSent = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, USBRQ_HID_SET_REPORT, USB_HID_REPORT_TYPE_FEATURE << 8 | (reportId & 0xff), 0, buffer, len, 5000);
+ if(bytesSent != len){
+ if(bytesSent < 0)
+ fprintf(stderr, "Error sending message: %s\n", usb_strerror());
+ return USBOPEN_ERR_IO;
+ }
+ return 0;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int usbhidGetReport(usbDevice_t *device, int reportNumber, char *buffer, int *len)
+{
+int bytesReceived, maxLen = *len;
+
+ if(!usesReportIDs){
+ buffer++; /* make room for dummy report ID */
+ maxLen--;
+ }
+ bytesReceived = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_DEVICE | USB_ENDPOINT_IN, USBRQ_HID_GET_REPORT, USB_HID_REPORT_TYPE_FEATURE << 8 | reportNumber, 0, buffer, maxLen, 5000);
+ if(bytesReceived < 0){
+ fprintf(stderr, "Error sending message: %s\n", usb_strerror());
+ return USBOPEN_ERR_IO;
+ }
+ *len = bytesReceived;
+ if(!usesReportIDs){
+ buffer[-1] = reportNumber; /* add dummy report ID */
+ (*len)++;
+ }
+ return 0;
+}
+
+/* ######################################################################## */
+#endif /* defined WIN32 ################################################### */
+/* ######################################################################## */
71 firmware/commandline/hiddata.h
View
@@ -0,0 +1,71 @@
+/* Name: hiddata.h
+ * Author: Christian Starkjohann
+ * Creation Date: 2008-04-11
+ * Tabsize: 4
+ * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+ * This Revision: $Id$
+ */
+
+#ifndef __HIDDATA_H_INCLUDED__
+#define __HIDDATA_H_INCLUDED__
+
+/*
+General Description:
+This module implements an abstraction layer for data transfer over HID feature
+requests. The implementation uses native Windows functions on Windows so that
+no driver installation is required and libusb on Unix. You must link the
+appropriate libraries in either case: "-lhid -lusb -lsetupapi" on Windows and
+`libusb-config --libs` on Unix.
+*/
+
+/* ------------------------------------------------------------------------ */
+
+#define USBOPEN_SUCCESS 0 /* no error */
+#define USBOPEN_ERR_ACCESS 1 /* not enough permissions to open device */
+#define USBOPEN_ERR_IO 2 /* I/O error */
+#define USBOPEN_ERR_NOTFOUND 3 /* device not found */
+
+/* ------------------------------------------------------------------------ */
+
+typedef struct usbDevice usbDevice_t;
+/* Opaque data type representing the USB device. This can be a Windows handle
+ * or a libusb handle, depending on the backend implementation.
+ */
+
+/* ------------------------------------------------------------------------ */
+
+int usbhidOpenDevice(usbDevice_t **device, int vendorID, char *vendorName, int productID, char *productName, int usesReportIDs);
+/* This function opens a USB device. 'vendorID' and 'productID' are the numeric
+ * Vendor-ID and Product-ID of the device we want to open. If 'vendorName' and
+ * 'productName' are both not NULL, only devices with matching manufacturer-
+ * and product name strings are accepted. If the device uses report IDs,
+ * 'usesReportIDs' must be set to a non-zero value.
+ * Returns: If a matching device has been found, USBOPEN_SUCCESS is returned
+ * and '*device' is set to an opaque pointer representing the device. The
+ * device must be closed with usbhidCloseDevice(). If the device has not been
+ * found or opening failed, an error code is returned.
+ */
+void usbhidCloseDevice(usbDevice_t *device);
+/* Every device opened with usbhidOpenDevice() must be closed with this function.
+ */
+int usbhidSetReport(usbDevice_t *device, char *buffer, int len);
+/* This function sends a feature report to the device. The report ID must be
+ * in the first byte of buffer and the length 'len' of the report is specified
+ * including this report ID. If no report IDs are used, buffer[0] must be set
+ * to 0 (dummy report ID).
+ * Returns: 0 on success, an error code otherwise.
+ */
+int usbhidGetReport(usbDevice_t *device, int reportID, char *buffer, int *len);
+/* This function obtains a feature report from the device. The requested
+ * report-ID is passed in 'reportID'. The caller must pass a buffer of the size
+ * of the expected report in 'buffer' and initialize the variable pointed to by
+ * 'len' to the total size of this buffer. Upon successful return, the report
+ * (prefixed with the report-ID) is in 'buffer' and the actual length of the
+ * report is returned in '*len'.
+ * Returns: 0 on success, an error code otherwise.
+ */
+
+/* ------------------------------------------------------------------------ */
+
+#endif /* __HIDDATA_H_INCLUDED__ */
BIN  firmware/commandline/hiddata.o
View
Binary file not shown
49 firmware/commandline/hidsdi.h
View
@@ -0,0 +1,49 @@
+/* Name: hidsdi.h
+ * Author: Christian Starkjohann
+ * Creation Date: 2006-02-02
+ * Tabsize: 4
+ * Copyright: (c) 2006-2008 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+ * This Revision: $Id$
+ */
+
+/*
+General Description
+This file is a replacement for hidsdi.h from the Windows DDK. It defines some
+of the types and function prototypes of this header for our project. If you
+have the Windows DDK version of this file or a version shipped with MinGW, use
+that instead.
+*/
+
+#ifndef _HIDSDI_H
+#define _HIDSDI_H
+
+#include <pshpack4.h>
+
+#include <ddk/hidusage.h>
+#include <ddk/hidpi.h>
+
+typedef struct{
+ ULONG Size;
+ USHORT VendorID;
+ USHORT ProductID;
+ USHORT VersionNumber;
+}HIDD_ATTRIBUTES;
+
+void __stdcall HidD_GetHidGuid(OUT LPGUID hidGuid);
+
+BOOLEAN __stdcall HidD_GetAttributes(IN HANDLE device, OUT HIDD_ATTRIBUTES *attributes);
+
+BOOLEAN __stdcall HidD_GetManufacturerString(IN HANDLE device, OUT void *buffer, IN ULONG bufferLen);
+BOOLEAN __stdcall HidD_GetProductString(IN HANDLE device, OUT void *buffer, IN ULONG bufferLen);
+BOOLEAN __stdcall HidD_GetSerialNumberString(IN HANDLE device, OUT void *buffer, IN ULONG bufferLen);
+
+BOOLEAN __stdcall HidD_GetFeature(IN HANDLE device, OUT void *reportBuffer, IN ULONG bufferLen);
+BOOLEAN __stdcall HidD_SetFeature(IN HANDLE device, IN void *reportBuffer, IN ULONG bufferLen);
+
+BOOLEAN __stdcall HidD_GetNumInputBuffers(IN HANDLE device, OUT ULONG *numBuffers);
+BOOLEAN __stdcall HidD_SetNumInputBuffers(IN HANDLE device, OUT ULONG numBuffers);
+
+#include <poppack.h>
+
+#endif
BIN  firmware/commandline/hidtool
View
Binary file not shown
127 firmware/commandline/hidtool.c
View
@@ -0,0 +1,127 @@
+/* Name: hidtool.c
+ * Project: hid-data example
+ * Author: Christian Starkjohann
+ * Creation Date: 2008-04-11
+ * Tabsize: 4
+ * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+ * This Revision: $Id$
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "hiddata.h"
+#include "../firmware/usbconfig.h" /* for device VID, PID, vendor name and product name */
+
+/* ------------------------------------------------------------------------- */
+
+static char *usbErrorMessage(int errCode)
+{
+static char buffer[80];
+
+ switch(errCode){
+ case USBOPEN_ERR_ACCESS: return "Access to device denied";
+ case USBOPEN_ERR_NOTFOUND: return "The specified device was not found";
+ case USBOPEN_ERR_IO: return "Communication error with device";
+ default:
+ sprintf(buffer, "Unknown USB error %d", errCode);
+ return buffer;
+ }
+ return NULL; /* not reached */
+}
+
+static usbDevice_t *openDevice(void)
+{
+usbDevice_t *dev = NULL;
+unsigned char rawVid[2] = {USB_CFG_VENDOR_ID}, rawPid[2] = {USB_CFG_DEVICE_ID};
+char vendorName[] = {USB_CFG_VENDOR_NAME, 0}, productName[] = {USB_CFG_DEVICE_NAME, 0};
+int vid = rawVid[0] + 256 * rawVid[1];
+int pid = rawPid[0] + 256 * rawPid[1];
+int err;
+
+ if((err = usbhidOpenDevice(&dev, vid, vendorName, pid, productName, 0)) != 0){
+ fprintf(stderr, "error finding %s: %s\n", productName, usbErrorMessage(err));
+ return NULL;
+ }
+ return dev;
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void hexdump(char *buffer, int len)
+{
+int i;
+FILE *fp = stdout;
+
+ for(i = 0; i < len; i++){
+ if(i != 0){
+ if(i % 16 == 0){
+ fprintf(fp, "\n");
+ }else{
+ fprintf(fp, " ");
+ }
+ }
+ fprintf(fp, "0x%02x", buffer[i] & 0xff);
+ }
+ if(i != 0)
+ fprintf(fp, "\n");
+}
+
+static int hexread(char *buffer, char *string, int buflen)
+{
+char *s;
+int pos = 0;
+
+ while((s = strtok(string, ", ")) != NULL && pos < buflen){
+ string = NULL;
+ buffer[pos++] = (char)strtol(s, NULL, 0);
+ }
+ return pos;
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void usage(char *myName)
+{
+ fprintf(stderr, "usage:\n");
+ fprintf(stderr, " %s read\n", myName);
+ fprintf(stderr, " %s write <listofbytes>\n", myName);
+}
+
+int main(int argc, char **argv)
+{
+usbDevice_t *dev;
+char buffer[4]; /* room for dummy report ID */
+int err;
+
+ if(argc < 2){
+ usage(argv[0]);
+ exit(1);
+ }
+ if((dev = openDevice()) == NULL)
+ exit(1);
+ if(strcasecmp(argv[1], "read") == 0){
+ int len = sizeof(buffer);
+ if((err = usbhidGetReport(dev, 0, buffer, &len)) != 0){
+ fprintf(stderr, "error reading data: %s\n", usbErrorMessage(err));
+ }else{
+ hexdump(buffer + 1, sizeof(buffer) - 1);
+ }
+ }else if(strcasecmp(argv[1], "write") == 0){
+ int i, pos;
+ memset(buffer, 0, sizeof(buffer));
+ for(pos = 1, i = 2; i < argc && pos < sizeof(buffer); i++){
+ pos += hexread(buffer + pos, argv[i], sizeof(buffer) - pos);
+ }
+ if((err = usbhidSetReport(dev, buffer, sizeof(buffer))) != 0) /* add a dummy report ID */
+ fprintf(stderr, "error writing data: %s\n", usbErrorMessage(err));
+ }else{
+ usage(argv[0]);
+ exit(1);
+ }
+ usbhidCloseDevice(dev);
+ return 0;
+}
+
+/* ------------------------------------------------------------------------- */
BIN  firmware/commandline/hidtool.o
View
Binary file not shown
164 firmware/firmware/Makefile
View
@@ -0,0 +1,164 @@
+# Name: Makefile
+# Project: hid-data example
+# Author: Christian Starkjohann
+# Creation Date: 2008-04-07
+# Tabsize: 4
+# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
+# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+# This Revision: $Id$
+
+DEVICE = atmega8
+F_CPU = 12000000 # in Hz
+FUSE_L = # see below for fuse values for particular devices
+FUSE_H =
+AVRDUDE = avrdude -c usbasp -p $(DEVICE) # edit this line for your programmer
+
+CFLAGS = -Iusbdrv -I. -DDEBUG_LEVEL=0
+OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
+
+COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)
+
+##############################################################################
+# Fuse values for particular devices
+##############################################################################
+# If your device is not listed here, go to
+# http://palmavr.sourceforge.net/cgi-bin/fc.cgi
+# and choose options for external crystal clock and no clock divider
+#
+################################## ATMega8 ##################################
+# ATMega8 FUSE_L (Fuse low byte):
+# 0x9f = 1 0 0 1 1 1 1 1
+# ^ ^ \ / \--+--/
+# | | | +------- CKSEL 3..0 (external >8M crystal)
+# | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
+# | +------------------ BODEN (BrownOut Detector enabled)
+# +-------------------- BODLEVEL (2.7V)
+# ATMega8 FUSE_H (Fuse high byte):
+# 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
+# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
+# | | | | | +-------- BOOTSZ1
+# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
+# | | | +-------------- CKOPT (full output swing)
+# | | +---------------- SPIEN (allow serial programming)
+# | +------------------ WDTON (WDT not always on)
+# +-------------------- RSTDISBL (reset pin is enabled)
+#
+############################## ATMega48/88/168 ##############################
+# ATMega*8 FUSE_L (Fuse low byte):
+# 0xdf = 1 1 0 1 1 1 1 1
+# ^ ^ \ / \--+--/
+# | | | +------- CKSEL 3..0 (external >8M crystal)
+# | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
+# | +------------------ CKOUT (if 0: Clock output enabled)
+# +-------------------- CKDIV8 (if 0: divide by 8)
+# ATMega*8 FUSE_H (Fuse high byte):
+# 0xde = 1 1 0 1 1 1 1 0
+# ^ ^ ^ ^ ^ \-+-/
+# | | | | | +------ BODLEVEL 0..2 (110 = 1.8 V)
+# | | | | + --------- EESAVE (preserve EEPROM over chip erase)
+# | | | +-------------- WDTON (if 0: watchdog always on)
+# | | +---------------- SPIEN (allow serial programming)
+# | +------------------ DWEN (debug wire enable)
+# +-------------------- RSTDISBL (reset pin is enabled)
+#
+############################## ATTiny25/45/85 ###############################
+# ATMega*5 FUSE_L (Fuse low byte):
+# 0xef = 1 1 1 0 1 1 1 1
+# ^ ^ \+/ \--+--/
+# | | | +------- CKSEL 3..0 (clock selection -> crystal @ 12 MHz)
+# | | +--------------- SUT 1..0 (BOD enabled, fast rising power)
+# | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
+# +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
+# ATMega*5 FUSE_H (Fuse high byte):
+# 0xdd = 1 1 0 1 1 1 0 1
+# ^ ^ ^ ^ ^ \-+-/
+# | | | | | +------ BODLEVEL 2..0 (brownout trigger level -> 2.7V)
+# | | | | +---------- EESAVE (preserve EEPROM on Chip Erase -> not preserved)
+# | | | +-------------- WDTON (watchdog timer always on -> disable)
+# | | +---------------- SPIEN (enable serial programming -> enabled)
+# | +------------------ DWEN (debug wire enable)
+# +-------------------- RSTDISBL (disable external reset -> enabled)
+#
+################################ ATTiny2313 #################################
+# ATTiny2313 FUSE_L (Fuse low byte):
+# 0xef = 1 1 1 0 1 1 1 1
+# ^ ^ \+/ \--+--/
+# | | | +------- CKSEL 3..0 (clock selection -> crystal @ 12 MHz)
+# | | +--------------- SUT 1..0 (BOD enabled, fast rising power)
+# | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
+# +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
+# ATTiny2313 FUSE_H (Fuse high byte):
+# 0xdb = 1 1 0 1 1 0 1 1
+# ^ ^ ^ ^ \-+-/ ^
+# | | | | | +---- RSTDISBL (disable external reset -> enabled)
+# | | | | +-------- BODLEVEL 2..0 (brownout trigger level -> 2.7V)
+# | | | +-------------- WDTON (watchdog timer always on -> disable)
+# | | +---------------- SPIEN (enable serial programming -> enabled)
+# | +------------------ EESAVE (preserve EEPROM on Chip Erase -> not preserved)
+# +-------------------- DWEN (debug wire enable)
+
+
+# symbolic targets:
+help:
+ @echo "This Makefile has no default rule. Use one of the following:"
+ @echo "make hex ....... to build main.hex"
+ @echo "make program ... to flash fuses and firmware"
+ @echo "make fuse ...... to flash the fuses"
+ @echo "make flash ..... to flash the firmware (use this on metaboard)"
+ @echo "make clean ..... to delete objects and hex file"
+
+hex: main.hex
+
+program: flash fuse
+
+# rule for programming fuse bits:
+fuse:
+ @[ "$(FUSE_H)" != "" -a "$(FUSE_L)" != "" ] || \
+ { echo "*** Edit Makefile and choose values for FUSE_L and FUSE_H!"; exit 1; }
+ $(AVRDUDE) -U hfuse:w:$(FUSE_H):m -U lfuse:w:$(FUSE_L):m
+
+# rule for uploading firmware:
+flash: main.hex
+ $(AVRDUDE) -U flash:w:main.hex:i
+
+# rule for deleting dependent files (those which can be built by Make):
+clean:
+ rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.elf *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
+
+# Generic rule for compiling C files:
+.c.o:
+ $(COMPILE) -c $< -o $@
+
+# Generic rule for assembling Assembler source files:
+.S.o:
+ $(COMPILE) -x assembler-with-cpp -c $< -o $@
+# "-x assembler-with-cpp" should not be necessary since this is the default
+# file type for the .S (with capital S) extension. However, upper case
+# characters are not always preserved on Windows. To ensure WinAVR
+# compatibility define the file type manually.
+
+# Generic rule for compiling C to assembler, used for debugging only.
+.c.s:
+ $(COMPILE) -S $< -o $@
+
+# file targets:
+
+# Since we don't want to ship the driver multipe times, we copy it into this project:
+usbdrv:
+ cp -r ../../../usbdrv .
+
+main.elf: usbdrv $(OBJECTS) # usbdrv dependency only needed because we copy it
+ $(COMPILE) -o main.elf $(OBJECTS)
+
+main.hex: main.elf
+ rm -f main.hex main.eep.hex
+ avr-objcopy -j .text -j .data -O ihex main.elf main.hex
+ avr-size main.hex
+
+# debugging targets:
+
+disasm: main.elf
+ avr-objdump -d main.elf
+
+cpp:
+ $(COMPILE) -E main.c
265 firmware/firmware/main.c
View
@@ -0,0 +1,265 @@
+/* Name: main.c
+ * Project: hid-data, example how to use HID for data transfer
+ * Author: Christian Starkjohann
+ * Creation Date: 2008-04-11
+ * Tabsize: 4
+ * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+ * This Revision: $Id$
+ */
+
+/*
+This example should run on most AVRs with only little changes. No special
+hardware resources except INT0 are used. You may have to change usbconfig.h for
+different I/O pins for USB. Please note that USB D+ must be the INT0 pin, or
+at least be connected to INT0 as well.
+*/
+
+#include <avr/io.h>
+#include <avr/wdt.h>
+#include <avr/interrupt.h> /* for sei() */
+#include <util/delay.h> /* for _delay_ms() */
+#include <avr/eeprom.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <avr/pgmspace.h> /* required by usbdrv.h */
+#include "usbdrv.h"
+#include "oddebug.h" /* This is also an example for using debug macros */
+
+/* ------------------------------------------------------------------------- */
+/* ----------------------------- USB interface ----------------------------- */
+/* ------------------------------------------------------------------------- */
+
+PROGMEM char usbHidReportDescriptor[22] = { /* USB report descriptor */
+ 0x06, 0x00, 0xff, // USAGE_PAGE (Generic Desktop)
+ 0x09, 0x01, // USAGE (Vendor Usage 1)
+ 0xa1, 0x01, // COLLECTION (Application)
+ 0x15, 0x00, // LOGICAL_MINIMUM (0)
+ 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
+ 0x75, 0x08, // REPORT_SIZE (8)
+ 0x95, 0x80, // REPORT_COUNT (128)
+ 0x09, 0x00, // USAGE (Undefined)
+ 0xb2, 0x02, 0x01, // FEATURE (Data,Var,Abs,Buf)
+ 0xc0 // END_COLLECTION
+};
+/* Since we define only one feature report, we don't use report-IDs (which
+ * would be the first byte of the report). The entire report consists of 128
+ * opaque data bytes.
+ */
+
+/* The following variables store the status of the current data transfer */
+static uchar currentAddress;
+static uchar bytesRemaining;
+volatile uint8_t vect[3];
+volatile uint8_t action = 0;
+
+/* ------------------------------------------------------------------------- */
+
+/* usbFunctionRead() is called when the host requests a chunk of data from
+ * the device. For more information see the documentation in usbdrv/usbdrv.h.
+ */
+uchar usbFunctionRead(uchar *data, uchar len)
+{
+ if(len > bytesRemaining)
+ len = bytesRemaining;
+ //eeprom_read_block(data, (uchar *)0 + currentAddress, len);
+ data[0] = vect[0];
+ data[1] = vect[1];
+ data[2] = vect[2];
+ currentAddress += len;
+ bytesRemaining -= len;
+ return len;
+}
+
+/* usbFunctionWrite() is called when the host sends a chunk of data to the
+ * device. For more information see the documentation in usbdrv/usbdrv.h.
+ */
+uchar usbFunctionWrite(uchar *data, uchar len)
+{
+ uint8_t i;
+ if(bytesRemaining == 0)
+ return 1; /* end of transfer */
+ if(len > bytesRemaining)
+ len = bytesRemaining;
+ eeprom_write_block(data, (uchar *)0 + currentAddress, len);
+ for(i=0; i<len; i++){
+ vect[currentAddress + i] = data[i];
+ }
+ //move(vect);
+ action = 1;
+ currentAddress += len;
+ bytesRemaining -= len;
+ return bytesRemaining == 0; /* return 1 if this was the last chunk */
+}
+
+/* ------------------------------------------------------------------------- */
+
+usbMsgLen_t usbFunctionSetup(uchar data[8])
+{
+usbRequest_t *rq = (void *)data;
+
+ if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){ /* HID class request */
+ if(rq->bRequest == USBRQ_HID_GET_REPORT){ /* wValue: ReportType (highbyte), ReportID (lowbyte) */
+ /* since we have only one report type, we can ignore the report-ID */
+ bytesRemaining = 3;
+ currentAddress = 0;
+ return USB_NO_MSG; /* use usbFunctionRead() to obtain data */
+ }else if(rq->bRequest == USBRQ_HID_SET_REPORT){
+ /* since we have only one report type, we can ignore the report-ID */
+ bytesRemaining = 3;
+ currentAddress = 0;
+ return USB_NO_MSG; /* use usbFunctionWrite() to receive data from host */
+ }
+ }else{
+ /* ignore vendor type requests, we don't use any */
+ }
+ return 0;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void move(int8_t* vect)
+{
+ int i;
+ action = 0;
+ for(i=0; i<abs(vect[0]); i++){
+ if(vect[0]>0){
+ DDRC |= (1<<5) | (1<<4) | (1<<3) | (1<<2);
+ PORTC &= ~(1<<4);
+ PORTC |= (1<<5);
+ _delay_ms(40);
+ PORTC &= ~(1<<5);
+ PORTC |= (1<<2);
+ _delay_ms(40);
+ PORTC &= ~(1<<2);
+ PORTC |= (1<<3);
+ _delay_ms(40);
+ PORTC &= ~(1<<3);
+ PORTC |= (1<<4);
+ _delay_ms(40);
+ PORTC &= ~(1<<4);
+ }
+ if(vect[0]<0){
+ DDRC |= (1<<5) | (1<<4) | (1<<3) | (1<<2);
+ PORTC &= ~(1<<5);
+ PORTC |= (1<<4);
+ _delay_ms(40);
+ PORTC &= ~(1<<4);
+ PORTC |= (1<<3);
+ _delay_ms(40);
+ PORTC &= ~(1<<3);
+ PORTC |= (1<<2);
+ _delay_ms(40);
+ PORTC &= ~(1<<2);
+ PORTC |= (1<<5);
+ _delay_ms(40);
+ PORTC &= ~(1<<5);
+ }
+ }
+ for(i=0; i<abs(vect[1]); i++){
+ DDRB |= (1<<2) | (1<<1);
+ DDRD |= (1<<3) | (1<<4);
+ if(vect[1]>0){
+ PORTB |= (1<<1);
+ _delay_ms(40);
+ PORTB &= ~(1<<1);
+ PORTB |= (1<<2);
+ _delay_ms(40);
+ PORTB &= ~(1<<2);
+ PORTD |= (1<<3);
+ _delay_ms(40);
+ PORTD &= ~(1<<3);
+ PORTD |= (1<<4);
+ _delay_ms(40);
+ PORTD &= ~(1<<4);
+ }
+ if(vect[1]<0){
+ PORTD |= (1<<4);
+ _delay_ms(40);
+ PORTD &= ~(1<<4);
+ PORTD |= (1<<3);
+ _delay_ms(40);
+ PORTD &= ~(1<<3);
+ PORTB |= (1<<2);
+ _delay_ms(40);
+ PORTB &= ~(1<<2);
+ PORTB |= (1<<1);
+ _delay_ms(40);
+ PORTB &= ~(1<<1);
+ }
+ }
+ for(i=0; i<abs(vect[2]); i++){
+ DDRB |= (1<<0);
+ DDRD |= (1<<7) | (1<<6) | (1<<5);
+ if(vect[2]<0){
+ PORTB |= (1<<0);
+ _delay_ms(40);
+ PORTB &= ~(1<<0);
+ PORTD |= (1<<7);
+ _delay_ms(40);
+ PORTD &= ~(1<<7);
+ PORTD |= (1<<6);
+ _delay_ms(40);
+ PORTD &= ~(1<<6);
+ PORTD |= (1<<5);
+ _delay_ms(40);
+ PORTD &= ~(1<<5);
+ }
+ if(vect[2]>0){
+ PORTD |= (1<<5);
+ _delay_ms(40);
+ PORTD &= ~(1<<5);
+ PORTD |= (1<<6);
+ _delay_ms(40);
+ PORTD &= ~(1<<6);
+ PORTD |= (1<<7);
+ _delay_ms(40);
+ PORTD &= ~(1<<7);
+ PORTB |= (1<<0);
+ _delay_ms(40);
+ PORTB &= ~(1<<0);
+ }
+ }
+}
+
+
+
+/* ------------------------------------------------------------------------- */
+
+int main(void)
+{
+uchar i;
+
+ //wdt_enable(WDTO_1S);
+ wdt_disable();
+ /* Even if you don't use the watchdog, turn it off here. On newer devices,
+ * the status of the watchdog (on/off, period) is PRESERVED OVER RESET!
+ */
+ /* RESET status: all port bits are inputs without pull-up.
+ * That's the way we need D+ and D-. Therefore we don't need any
+ * additional hardware initialization.
+ */
+ odDebugInit();
+ DBG1(0x00, 0, 0); /* debug output: main starts */
+ usbInit();
+ usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */
+ i = 0;
+ while(--i){ /* fake USB disconnect for > 250 ms */
+ //wdt_reset();
+ _delay_ms(1);
+ }
+ usbDeviceConnect();
+ sei();
+ DBG1(0x01, 0, 0); /* debug output: main loop starts */
+ for(;;){ /* main event loop */
+ DBG1(0x02, 0, 0); /* debug output: main loop iterates */
+ //wdt_reset();
+ usbPoll();
+ if(action)
+ move(vect);
+ }
+ return 0;
+}
+
+/* ------------------------------------------------------------------------- */
373 firmware/firmware/usbconfig.h
View
@@ -0,0 +1,373 @@
+/* Name: usbconfig.h
+ * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
+ * Author: Christian Starkjohann
+ * Creation Date: 2005-04-01
+ * Tabsize: 4
+ * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+ * This Revision: $Id$
+ */
+
+#ifndef __usbconfig_h_included__
+#define __usbconfig_h_included__
+
+/*
+General Description:
+This file is an example configuration (with inline documentation) for the USB
+driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
+also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
+wire the lines to any other port, as long as D+ is also wired to INT0 (or any
+other hardware interrupt, as long as it is the highest level interrupt, see
+section at the end of this file).
+*/
+
+/* ---------------------------- Hardware Config ---------------------------- */
+
+#define USB_CFG_IOPORTNAME C
+/* This is the port where the USB bus is connected. When you configure it to
+ * "B", the registers PORTB, PINB and DDRB will be used.
+ */
+#define USB_CFG_DMINUS_BIT 1
+/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
+ * This may be any bit in the port.
+ */
+#define USB_CFG_DPLUS_BIT 0
+/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
+ * This may be any bit in the port. Please note that D+ must also be connected
+ * to interrupt pin INT0! [You can also use other interrupts, see section
+ * "Optional MCU Description" below, or you can connect D- to the interrupt, as
+ * it is required if you use the USB_COUNT_SOF feature. If you use D- for the
+ * interrupt, the USB interrupt will also be triggered at Start-Of-Frame
+ * markers every millisecond.]
+ */
+#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
+/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
+ * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
+ * require no crystal, they tolerate +/- 1% deviation from the nominal
+ * frequency. All other rates require a precision of 2000 ppm and thus a
+ * crystal!
+ * Since F_CPU should be defined to your actual clock rate anyway, you should
+ * not need to modify this setting.
+ */
+#define USB_CFG_CHECK_CRC 0
+/* Define this to 1 if you want that the driver checks integrity of incoming
+ * data packets (CRC checks). CRC checks cost quite a bit of code size and are
+ * currently only available for 18 MHz crystal clock. You must choose
+ * USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
+ */
+
+/* ----------------------- Optional Hardware Config ------------------------ */
+
+/* #define USB_CFG_PULLUP_IOPORTNAME D */
+/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
+ * V+, you can connect and disconnect the device from firmware by calling
+ * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
+ * This constant defines the port on which the pullup resistor is connected.
+ */
+/* #define USB_CFG_PULLUP_BIT 4 */
+/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
+ * above) where the 1.5k pullup resistor is connected. See description
+ * above for details.
+ */
+
+/* --------------------------- Functional Range ---------------------------- */
+
+#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
+/* Define this to 1 if you want to compile a version with two endpoints: The
+ * default control endpoint 0 and an interrupt-in endpoint (any other endpoint
+ * number).
+ */
+#define USB_CFG_HAVE_INTRIN_ENDPOINT3 0
+/* Define this to 1 if you want to compile a version with three endpoints: The
+ * default control endpoint 0, an interrupt-in endpoint 3 (or the number
+ * configured below) and a catch-all default interrupt-in endpoint as above.
+ * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
+ */
+#define USB_CFG_EP3_NUMBER 3
+/* If the so-called endpoint 3 is used, it can now be configured to any other
+ * endpoint number (except 0) with this macro. Default if undefined is 3.
+ */
+/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
+/* The above macro defines the startup condition for data toggling on the
+ * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
+ * Since the token is toggled BEFORE sending any data, the first packet is
+ * sent with the oposite value of this configuration!
+ */
+#define USB_CFG_IMPLEMENT_HALT 0
+/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
+ * for endpoint 1 (interrupt endpoint). Although you may not need this feature,
+ * it is required by the standard. We have made it a config option because it
+ * bloats the code considerably.
+ */
+#define USB_CFG_SUPPRESS_INTR_CODE 0
+/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
+ * want to send any data over them. If this macro is defined to 1, functions
+ * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
+ * you need the interrupt-in endpoints in order to comply to an interface
+ * (e.g. HID), but never want to send any data. This option saves a couple
+ * of bytes in flash memory and the transmit buffers in RAM.
+ */
+#define USB_CFG_INTR_POLL_INTERVAL 100
+/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
+ * interval. The value is in milliseconds and must not be less than 10 ms for
+ * low speed devices.
+ */
+#define USB_CFG_IS_SELF_POWERED 0
+/* Define this to 1 if the device has its own power supply. Set it to 0 if the
+ * device is powered from the USB bus.
+ */
+#define USB_CFG_MAX_BUS_POWER 20
+/* Set this variable to the maximum USB bus power consumption of your device.
+ * The value is in milliamperes. [It will be divided by two since USB
+ * communicates power requirements in units of 2 mA.]
+ */
+#define USB_CFG_IMPLEMENT_FN_WRITE 1
+/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
+ * transfers. Set it to 0 if you don't need it and want to save a couple of
+ * bytes.
+ */
+#define USB_CFG_IMPLEMENT_FN_READ 1
+/* Set this to 1 if you need to send control replies which are generated
+ * "on the fly" when usbFunctionRead() is called. If you only want to send
+ * data from a static buffer, set it to 0 and return the data from
+ * usbFunctionSetup(). This saves a couple of bytes.
+ */
+#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
+/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
+ * You must implement the function usbFunctionWriteOut() which receives all
+ * interrupt/bulk data sent to any endpoint other than 0. The endpoint number
+ * can be found in 'usbRxToken'.
+ */
+#define USB_CFG_HAVE_FLOWCONTROL 0
+/* Define this to 1 if you want flowcontrol over USB data. See the definition
+ * of the macros usbDisableAllRequests() and usbEnableAllRequests() in
+ * usbdrv.h.
+ */
+#define USB_CFG_DRIVER_FLASH_PAGE 0
+/* If the device has more than 64 kBytes of flash, define this to the 64 k page
+ * where the driver's constants (descriptors) are located. Or in other words:
+ * Define this to 1 for boot loaders on the ATMega128.
+ */
+#define USB_CFG_LONG_TRANSFERS 0
+/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
+ * in a single control-in or control-out transfer. Note that the capability
+ * for long transfers increases the driver size.
+ */
+/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
+/* This macro is a hook if you want to do unconventional things. If it is
+ * defined, it's inserted at the beginning of received message processing.
+ * If you eat the received message and don't want default processing to
+ * proceed, do a return after doing your things. One possible application
+ * (besides debugging) is to flash a status LED on each packet.
+ */
+/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
+/* This macro is a hook if you need to know when an USB RESET occurs. It has
+ * one parameter which distinguishes between the start of RESET state and its
+ * end.
+ */
+/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
+/* This macro (if defined) is executed when a USB SET_ADDRESS request was
+ * received.
+ */
+#define USB_COUNT_SOF 0
+/* define this macro to 1 if you need the global variable "usbSofCount" which
+ * counts SOF packets. This feature requires that the hardware interrupt is
+ * connected to D- instead of D+.
+ */
+/* #ifdef __ASSEMBLER__
+ * macro myAssemblerMacro
+ * in YL, TCNT0
+ * sts timer0Snapshot, YL
+ * endm
+ * #endif
+ * #define USB_SOF_HOOK myAssemblerMacro
+ * This macro (if defined) is executed in the assembler module when a
+ * Start Of Frame condition is detected. It is recommended to define it to
+ * the name of an assembler macro which is defined here as well so that more
+ * than one assembler instruction can be used. The macro may use the register
+ * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
+ * immediately after an SOF pulse may be lost and must be retried by the host.
+ * What can you do with this hook? Since the SOF signal occurs exactly every
+ * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
+ * designs running on the internal RC oscillator.
+ * Please note that Start Of Frame detection works only if D- is wired to the
+ * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
+ */
+#define USB_CFG_CHECK_DATA_TOGGLING 0
+/* define this macro to 1 if you want to filter out duplicate data packets
+ * sent by the host. Duplicates occur only as a consequence of communication
+ * errors, when the host does not receive an ACK. Please note that you need to
+ * implement the filtering yourself in usbFunctionWriteOut() and
+ * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
+ * for each control- and out-endpoint to check for duplicate packets.
+ */
+#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
+/* define this macro to 1 if you want the function usbMeasureFrameLength()
+ * compiled in. This function can be used to calibrate the AVR's RC oscillator.
+ */
+#define USB_USE_FAST_CRC 0
+/* The assembler module has two implementations for the CRC algorithm. One is
+ * faster, the other is smaller. This CRC routine is only used for transmitted
+ * messages where timing is not critical. The faster routine needs 31 cycles
+ * per byte while the smaller one needs 61 to 69 cycles. The faster routine
+ * may be worth the 32 bytes bigger code size if you transmit lots of data and
+ * run the AVR close to its limit.
+ */
+
+/* -------------------------- Device Description --------------------------- */
+
+#define USB_CFG_VENDOR_ID 0xc0, 0x16 /* = 0x16c0 = 5824 = voti.nl */
+/* USB vendor ID for the device, low byte first. If you have registered your
+ * own Vendor ID, define it here. Otherwise you may use one of obdev's free
+ * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
+ * *** IMPORTANT NOTE ***
+ * This template uses obdev's shared VID/PID pair for Vendor Class devices
+ * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
+ * the implications!
+ */
+#define USB_CFG_DEVICE_ID 0xdf, 0x05 /* obdev's shared PID for HIDs */
+/* This is the ID of the product, low byte first. It is interpreted in the
+ * scope of the vendor ID. If you have registered your own VID with usb.org
+ * or if you have licensed a PID from somebody else, define it here. Otherwise
+ * you may use one of obdev's free shared VID/PID pairs. See the file
+ * USB-IDs-for-free.txt for details!
+ * *** IMPORTANT NOTE ***
+ * This template uses obdev's shared VID/PID pair for Vendor Class devices
+ * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
+ * the implications!
+ */
+#define USB_CFG_DEVICE_VERSION 0x00, 0x01
+/* Version number of the device: Minor number first, then major number.
+ */
+#define USB_CFG_VENDOR_NAME 'o', 'b', 'd', 'e', 'v', '.', 'a', 't'
+#define USB_CFG_VENDOR_NAME_LEN 8
+/* These two values define the vendor name returned by the USB device. The name
+ * must be given as a list of characters under single quotes. The characters
+ * are interpreted as Unicode (UTF-16) entities.
+ * If you don't want a vendor name string, undefine these macros.
+ * ALWAYS define a vendor name containing your Internet domain name if you use
+ * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
+ * details.
+ */
+#define USB_CFG_DEVICE_NAME 'D', 'a', 't', 'a', 'S', 't', 'o', 'r', 'e'
+#define USB_CFG_DEVICE_NAME_LEN 9
+/* Same as above for the device name. If you don't want a device name, undefine
+ * the macros. See the file USB-IDs-for-free.txt before you assign a name if
+ * you use a shared VID/PID.
+ */
+/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
+/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
+/* Same as above for the serial number. If you don't want a serial number,
+ * undefine the macros.
+ * It may be useful to provide the serial number through other means than at
+ * compile time. See the section about descriptor properties below for how
+ * to fine tune control over USB descriptors such as the string descriptor
+ * for the serial number.
+ */
+#define USB_CFG_DEVICE_CLASS 0
+#define USB_CFG_DEVICE_SUBCLASS 0
+/* See USB specification if you want to conform to an existing device class.
+ * Class 0xff is "vendor specific".
+ */
+#define USB_CFG_INTERFACE_CLASS 3
+#define USB_CFG_INTERFACE_SUBCLASS 0
+#define USB_CFG_INTERFACE_PROTOCOL 0
+/* See USB specification if you want to conform to an existing device class or
+ * protocol. The following classes must be set at interface level:
+ * HID class is 3, no subclass and protocol required (but may be useful!)
+ * CDC class is 2, use subclass 2 and protocol 1 for ACM
+ */
+#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 22
+/* Define this to the length of the HID report descriptor, if you implement
+ * an HID device. Otherwise don't define it or define it to 0.
+ * If you use this define, you must add a PROGMEM character array named
+ * "usbHidReportDescriptor" to your code which contains the report descriptor.
+ * Don't forget to keep the array and this define in sync!
+ */
+
+/* #define USB_PUBLIC static */
+/* Use the define above if you #include usbdrv.c instead of linking against it.
+ * This technique saves a couple of bytes in flash memory.
+ */
+
+/* ------------------- Fine Control over USB Descriptors ------------------- */
+/* If you don't want to use the driver's default USB descriptors, you can
+ * provide our own. These can be provided as (1) fixed length static data in
+ * flash memory, (2) fixed length static data in RAM or (3) dynamically at
+ * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
+ * information about this function.
+ * Descriptor handling is configured through the descriptor's properties. If
+ * no properties are defined or if they are 0, the default descriptor is used.
+ * Possible properties are:
+ * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
+ * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
+ * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
+ * you want RAM pointers.
+ * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
+ * in static memory is in RAM, not in flash memory.
+ * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
+ * the driver must know the descriptor's length. The descriptor itself is
+ * found at the address of a well known identifier (see below).
+ * List of static descriptor names (must be declared PROGMEM if in flash):
+ * char usbDescriptorDevice[];
+ * char usbDescriptorConfiguration[];
+ * char usbDescriptorHidReport[];
+ * char usbDescriptorString0[];
+ * int usbDescriptorStringVendor[];
+ * int usbDescriptorStringDevice[];
+ * int usbDescriptorStringSerialNumber[];
+ * Other descriptors can't be provided statically, they must be provided
+ * dynamically at runtime.
+ *
+ * Descriptor properties are or-ed or added together, e.g.:
+ * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
+ *
+ * The following descriptors are defined:
+ * USB_CFG_DESCR_PROPS_DEVICE
+ * USB_CFG_DESCR_PROPS_CONFIGURATION
+ * USB_CFG_DESCR_PROPS_STRINGS
+ * USB_CFG_DESCR_PROPS_STRING_0
+ * USB_CFG_DESCR_PROPS_STRING_VENDOR
+ * USB_CFG_DESCR_PROPS_STRING_PRODUCT
+ * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
+ * USB_CFG_DESCR_PROPS_HID
+ * USB_CFG_DESCR_PROPS_HID_REPORT
+ * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
+ *
+ * Note about string descriptors: String descriptors are not just strings, they
+ * are Unicode strings prefixed with a 2 byte header. Example:
+ * int serialNumberDescriptor[] = {
+ * USB_STRING_DESCRIPTOR_HEADER(6),
+ * 'S', 'e', 'r', 'i', 'a', 'l'
+ * };
+ */
+
+#define USB_CFG_DESCR_PROPS_DEVICE 0
+#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
+#define USB_CFG_DESCR_PROPS_STRINGS 0
+#define USB_CFG_DESCR_PROPS_STRING_0 0
+#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
+#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
+#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
+#define USB_CFG_DESCR_PROPS_HID 0
+#define USB_CFG_DESCR_PROPS_HID_REPORT 0
+#define USB_CFG_DESCR_PROPS_UNKNOWN 0
+
+/* ----------------------- Optional MCU Description ------------------------ */
+
+/* The following configurations have working defaults in usbdrv.h. You
+ * usually don't need to set them explicitly. Only if you want to run
+ * the driver on a device which is not yet supported or with a compiler
+ * which is not fully supported (such as IAR C) or if you use a differnt
+ * interrupt than INT0, you may have to define some of these.
+ */
+/* #define USB_INTR_CFG MCUCR */
+/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
+/* #define USB_INTR_CFG_CLR 0 */
+/* #define USB_INTR_ENABLE GIMSK */
+/* #define USB_INTR_ENABLE_BIT INT0 */
+/* #define USB_INTR_PENDING GIFR */
+/* #define USB_INTR_PENDING_BIT INTF0 */
+/* #define USB_INTR_VECTOR INT0_vect */
+
+#endif /* __usbconfig_h_included__ */
318 firmware/firmware/usbdrv/Changelog.txt
View
@@ -0,0 +1,318 @@
+This file documents changes in the firmware-only USB driver for atmel's AVR
+microcontrollers. New entries are always appended to the end of the file.
+Scroll down to the bottom to see the most recent changes.
+
+2005-04-01:
+ - Implemented endpoint 1 as interrupt-in endpoint.
+ - Moved all configuration options to usbconfig.h which is not part of the
+ driver.
+ - Changed interface for usbVendorSetup().
+ - Fixed compatibility with ATMega8 device.
+ - Various minor optimizations.
+
+2005-04-11:
+ - Changed interface to application: Use usbFunctionSetup(), usbFunctionRead()
+ and usbFunctionWrite() now. Added configuration options to choose which
+ of these functions to compile in.
+ - Assembler module delivers receive data non-inverted now.
+ - Made register and bit names compatible with more AVR devices.
+
+2005-05-03:
+ - Allow address of usbRxBuf on any memory page as long as the buffer does
+ not cross 256 byte page boundaries.
+ - Better device compatibility: works with Mega88 now.
+ - Code optimization in debugging module.
+ - Documentation updates.
+
+2006-01-02:
+ - Added (free) default Vendor- and Product-IDs bought from voti.nl.
+ - Added USBID-License.txt file which defines the rules for using the free
+ shared VID/PID pair.
+ - Added Readme.txt to the usbdrv directory which clarifies administrative
+ issues.
+
+2006-01-25:
+ - Added "configured state" to become more standards compliant.
+ - Added "HALT" state for interrupt endpoint.
+ - Driver passes the "USB Command Verifier" test from usb.org now.
+ - Made "serial number" a configuration option.
+ - Minor optimizations, we now recommend compiler option "-Os" for best
+ results.
+ - Added a version number to usbdrv.h
+
+2006-02-03:
+ - New configuration variable USB_BUFFER_SECTION for the memory section where
+ the USB rx buffer will go. This defaults to ".bss" if not defined. Since
+ this buffer MUST NOT cross 256 byte pages (not even touch a page at the
+ end), the user may want to pass a linker option similar to
+ "-Wl,--section-start=.mybuffer=0x800060".
+ - Provide structure for usbRequest_t.
+ - New defines for USB constants.
+ - Prepared for HID implementations.
+ - Increased data size limit for interrupt transfers to 8 bytes.
+ - New macro usbInterruptIsReady() to query interrupt buffer state.
+
+2006-02-18:
+ - Ensure that the data token which is sent as an ack to an OUT transfer is
+ always zero sized. This fixes a bug where the host reports an error after
+ sending an out transfer to the device, although all data arrived at the
+ device.
+ - Updated docs in usbdrv.h to reflect changed API in usbFunctionWrite().
+
+* Release 2006-02-20
+
+ - Give a compiler warning when compiling with debugging turned on.
+ - Added Oleg Semyonov's changes for IAR-cc compatibility.
+ - Added new (optional) functions usbDeviceConnect() and usbDeviceDisconnect()
+ (also thanks to Oleg!).
+ - Rearranged tests in usbPoll() to save a couple of instructions in the most
+ likely case that no actions are pending.
+ - We need a delay between the SET ADDRESS request until the new address
+ becomes active. This delay was handled in usbPoll() until now. Since the
+ spec says that the delay must not exceed 2ms, previous versions required
+ aggressive polling during the enumeration phase. We have now moved the
+ handling of the delay into the interrupt routine.
+ - We must not reply with NAK to a SETUP transaction. We can only achieve this
+ by making sure that the rx buffer is empty when SETUP tokens are expected.
+ We therefore don't pass zero sized data packets from the status phase of
+ a transfer to usbPoll(). This change MAY cause troubles if you rely on
+ receiving a less than 8 bytes long packet in usbFunctionWrite() to
+ identify the end of a transfer. usbFunctionWrite() will NEVER be called
+ with a zero length.
+
+* Release 2006-03-14
+
+ - Improved IAR C support: tiny memory model, more devices
+ - Added template usbconfig.h file under the name usbconfig-prototype.h
+
+* Release 2006-03-26
+
+ - Added provision for one more interrupt-in endpoint (endpoint 3).
+ - Added provision for one interrupt-out endpoint (endpoint 1).
+ - Added flowcontrol macros for USB.
+ - Added provision for custom configuration descriptor.
+ - Allow ANY two port bits for D+ and D-.
+ - Merged (optional) receive endpoint number into global usbRxToken variable.
+ - Use USB_CFG_IOPORTNAME instead of USB_CFG_IOPORT. We now construct the
+ variable name from the single port letter instead of computing the address
+ of related ports from the output-port address.
+
+* Release 2006-06-26
+
+ - Updated documentation in usbdrv.h and usbconfig-prototype.h to reflect the
+ new features.
+ - Removed "#warning" directives because IAR does not understand them. Use
+ unused static variables instead to generate a warning.
+ - Do not include <avr/io.h> when compiling with IAR.
+ - Introduced USB_CFG_DESCR_PROPS_* in usbconfig.h to configure how each
+ USB descriptor should be handled. It is now possible to provide descriptor
+ data in Flash, RAM or dynamically at runtime.
+ - STALL is now a status in usbTxLen* instead of a message. We can now conform
+ to the spec and leave the stall status pending until it is cleared.
+ - Made usbTxPacketCnt1 and usbTxPacketCnt3 public. This allows the
+ application code to reset data toggling on interrupt pipes.
+
+* Release 2006-07-18
+
+ - Added an #if !defined __ASSEMBLER__ to the warning in usbdrv.h. This fixes
+ an assembler error.
+ - usbDeviceDisconnect() takes pull-up resistor to high impedance now.
+
+* Release 2007-02-01
+
+ - Merged in some code size improvements from usbtiny (thanks to Dick
+ Streefland for these optimizations!)
+ - Special alignment requirement for usbRxBuf not required any more. Thanks
+ again to Dick Streefland for this hint!
+ - Reverted to "#warning" instead of unused static variables -- new versions
+ of IAR CC should handle this directive.
+ - Changed Open Source license to GNU GPL v2 in order to make linking against
+ other free libraries easier. We no longer require publication of the
+ circuit diagrams, but we STRONGLY encourage it. If you improve the driver
+ itself, PLEASE grant us a royalty free license to your changes for our
+ commercial license.
+
+* Release 2007-03-29
+
+ - New configuration option "USB_PUBLIC" in usbconfig.h.
+ - Set USB version number to 1.10 instead of 1.01.
+ - Code used USB_CFG_DESCR_PROPS_STRING_DEVICE and
+ USB_CFG_DESCR_PROPS_STRING_PRODUCT inconsistently. Changed all occurrences
+ to USB_CFG_DESCR_PROPS_STRING_PRODUCT.
+ - New assembler module for 16.5 MHz RC oscillator clock with PLL in receiver
+ code.
+ - New assembler module for 16 MHz crystal.
+ - usbdrvasm.S contains common code only, clock-specific parts have been moved
+ to usbdrvasm12.S, usbdrvasm16.S and usbdrvasm165.S respectively.
+
+* Release 2007-06-25
+
+ - 16 MHz module: Do SE0 check in stuffed bits as well.
+
+* Release 2007-07-07
+
+ - Define hi8(x) for IAR compiler to limit result to 8 bits. This is necessary
+ for negative values.
+ - Added 15 MHz module contributed by V. Bosch.
+ - Interrupt vector name can now be configured. This is useful if somebody
+ wants to use a different hardware interrupt than INT0.
+
+* Release 2007-08-07
+
+ - Moved handleIn3 routine in usbdrvasm16.S so that relative jump range is
+ not exceeded.
+ - More config options: USB_RX_USER_HOOK(), USB_INITIAL_DATATOKEN,
+ USB_COUNT_SOF
+ - USB_INTR_PENDING can now be a memory address, not just I/O
+
+* Release 2007-09-19
+
+ - Split out common parts of assembler modules into separate include file
+ - Made endpoint numbers configurable so that given interface definitions
+ can be matched. See USB_CFG_EP3_NUMBER in usbconfig-prototype.h.
+ - Store endpoint number for interrupt/bulk-out so that usbFunctionWriteOut()
+ can handle any number of endpoints.
+ - Define usbDeviceConnect() and usbDeviceDisconnect() even if no
+ USB_CFG_PULLUP_IOPORTNAME is defined. Directly set D+ and D- to 0 in this
+ case.
+
+* Release 2007-12-01
+
+ - Optimize usbDeviceConnect() and usbDeviceDisconnect() for less code size
+ when USB_CFG_PULLUP_IOPORTNAME is not defined.
+
+* Release 2007-12-13
+
+ - Renamed all include-only assembler modules from *.S to *.inc so that
+ people don't add them to their project sources.
+ - Distribute leap bits in tx loop more evenly for 16 MHz module.
+ - Use "macro" and "endm" instead of ".macro" and ".endm" for IAR
+ - Avoid compiler warnings for constant expr range by casting some values in
+ USB descriptors.
+
+* Release 2008-01-21
+
+ - Fixed bug in 15 and 16 MHz module where the new address set with
+ SET_ADDRESS was already accepted at the next NAK or ACK we send, not at
+ the next data packet we send. This caused problems when the host polled
+ too fast. Thanks to Alexander Neumann for his help and patience debugging
+ this issue!
+
+* Release 2008-02-05
+
+ - Fixed bug in 16.5 MHz module where a register was used in the interrupt
+ handler before it was pushed. This bug was introduced with version
+ 2007-09-19 when common parts were moved to a separate file.
+ - Optimized CRC routine (thanks to Reimar Doeffinger).
+
+* Release 2008-02-16
+
+ - Removed outdated IAR compatibility stuff (code sections).
+ - Added hook macros for USB_RESET_HOOK() and USB_SET_ADDRESS_HOOK().
+ - Added optional routine usbMeasureFrameLength() for calibration of the
+ internal RC oscillator.
+
+* Release 2008-02-28
+
+ - USB_INITIAL_DATATOKEN defaults to USBPID_DATA1 now, which means that we
+ start with sending USBPID_DATA0.
+ - Changed defaults in usbconfig-prototype.h
+ - Added free USB VID/PID pair for MIDI class devices
+ - Restructured AVR-USB as separate package, not part of PowerSwitch any more.
+
+* Release 2008-04-18
+
+ - Restructured usbdrv.c so that it is easier to read and understand.
+ - Better code optimization with gcc 4.
+ - If a second interrupt in endpoint is enabled, also add it to config
+ descriptor.
+ - Added config option for long transfers (above 254 bytes), see
+ USB_CFG_LONG_TRANSFERS in usbconfig.h.
+ - Added 20 MHz module contributed by Jeroen Benschop.
+
+* Release 2008-05-13
+
+ - Fixed bug in libs-host/hiddata.c function usbhidGetReport(): length
+ was not incremented, pointer to length was incremented instead.
+ - Added code to command line tool(s) which claims an interface. This code
+ is disabled by default, but may be necessary on newer Linux kernels.
+ - Added usbconfig.h option "USB_CFG_CHECK_DATA_TOGGLING".
+ - New header "usbportability.h" prepares ports to other development
+ environments.
+ - Long transfers (above 254 bytes) did not work when usbFunctionRead() was
+ used to supply the data. Fixed this bug. [Thanks to Alexander Neumann!]
+ - In hiddata.c (example code for sending/receiving data over HID), use
+ USB_RECIP_DEVICE instead of USB_RECIP_INTERFACE for control transfers so
+ that we need not claim the interface.
+ - in usbPoll() loop 20 times polling for RESET state instead of 10 times.
+ This accounts for the higher clock rates we now support.
+ - Added a module for 12.8 MHz RC oscillator with PLL in receiver loop.
+ - Added hook to SOF code so that oscillator can be tuned to USB frame clock.
+ - Added timeout to waitForJ loop. Helps preventing unexpected hangs.
+ - Added example code for oscillator tuning to libs-device (thanks to
+ Henrik Haftmann for the idea to this routine).
+ - Implemented option USB_CFG_SUPPRESS_INTR_CODE.
+
+* Release 2008-10-22
+
+ - Fixed libs-device/osctune.h: OSCCAL is memory address on ATMega88 and
+ similar, not offset of 0x20 needs to be added.
+ - Allow distribution under GPLv3 for those who have to link against other
+ code distributed under GPLv3.
+
+* Release 2008-11-26
+
+ - Removed libusb-win32 dependency for hid-data example in Makefile.windows.
+ It was never required and confused many people.
+ - Added extern uchar usbRxToken to usbdrv.h.
+ - Integrated a module with CRC checks at 18 MHz by Lukas Schrittwieser.
+
+* Release 2009-03-23
+
+ - Hid-mouse example used settings from hid-data example, fixed that.
+ - Renamed project to V-USB due to a trademark issue with Atmel(r).
+ - Changed CommercialLicense.txt and USBID-License.txt to make the
+ background of USB ID registration clearer.
+
+* Release 2009-04-15
+
+ - Changed CommercialLicense.txt to reflect the new range of PIDs from
+ Jason Kotzin.
+ - Removed USBID-License.txt in favor of USB-IDs-for-free.txt and
+ USB-ID-FAQ.txt
+ - Fixed a bug in the 12.8 MHz module: End Of Packet decection was made in
+ the center between bit 0 and 1 of each byte. This is where the data lines
+ are expected to change and the sampled data may therefore be nonsense.
+ We therefore check EOP ONLY if bits 0 AND 1 have both been read as 0 on D-.
+ - Fixed a bitstuffing problem in the 16 MHz module: If bit 6 was stuffed,
+ the unstuffing code in the receiver routine was 1 cycle too long. If
+ multiple bytes had the unstuffing in bit 6, the error summed up until the
+ receiver was out of sync.
+ - Included option for faster CRC routine.
+ Thanks to Slawomir Fras (BoskiDialer) for this code!
+ - Updated bits in Configuration Descriptor's bmAttributes according to
+ USB 1.1 (in particular bit 7, it is a must-be-set bit now).
+
+* Release 2009-08-22
+
+ - Moved first DBG1() after odDebugInit() in all examples.
+ - Use vector INT0_vect instead of SIG_INTERRUPT0 if defined. This makes
+ V-USB compatible with the new "p" suffix devices (e.g. ATMega328p).
+ - USB_CFG_CLOCK_KHZ setting is now required in usbconfig.h (no default any
+ more).
+ - New option USB_CFG_DRIVER_FLASH_PAGE allows boot loaders on devices with
+ more than 64 kB flash.
+ - Built-in configuration descriptor allows custom definition for second
+ endpoint now.
+
+* Release 2010-07-15
+
+ - Fixed bug in usbDriverSetup() which prevented descriptor sizes above 255
+ bytes.
+ - Avoid a compiler warning for unused parameter in usbHandleResetHook() when
+ compiler option -Wextra is enabled.
+ - Fixed wrong hex value for some IDs in USB-IDs-for-free.txt.
+ - Keep a define for USBATTR_BUSPOWER, although the flag does not exist
+ in USB 1.1 any more. Set it to 0. This is for backward compatibility.
+
+* Release 2012-01-09
166 firmware/firmware/usbdrv/CommercialLicense.txt
View
@@ -0,0 +1,166 @@
+V-USB Driver Software License Agreement
+Version 2009-08-03
+
+THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN
+ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING
+THE AMOUNT ACCORDING TO SECTION 4 ("PAYMENT") TO OBJECTIVE DEVELOPMENT.
+
+
+1 DEFINITIONS
+
+1.1 "OBJECTIVE DEVELOPMENT" shall mean OBJECTIVE DEVELOPMENT Software GmbH,
+Grosse Schiffgasse 1A/7, 1020 Wien, AUSTRIA.
+
+1.2 "You" shall mean the Licensee.
+
+1.3 "V-USB" shall mean all files included in the package distributed under
+the name "vusb" by OBJECTIVE DEVELOPMENT (http://www.obdev.at/vusb/)
+unless otherwise noted. This includes the firmware-only USB device
+implementation for Atmel AVR microcontrollers, some simple device examples
+and host side software examples and libraries.
+
+
+2 LICENSE GRANTS
+
+2.1 Source Code. OBJECTIVE DEVELOPMENT shall furnish you with the source
+code of V-USB.
+
+2.2 Distribution and Use. OBJECTIVE DEVELOPMENT grants you the
+non-exclusive right to use, copy and distribute V-USB with your hardware
+product(s), restricted by the limitations in section 3 below.
+
+2.3 Modifications. OBJECTIVE DEVELOPMENT grants you the right to modify
+the source code and your copy of V-USB according to your needs.
+
+2.4 USB IDs. OBJECTIVE DEVELOPMENT furnishes you with one or two USB
+Product ID(s), sent to you in e-mail. These Product IDs are reserved
+exclusively for you. OBJECTIVE DEVELOPMENT has obtained USB Product ID
+ranges under the Vendor ID 5824 from Wouter van Ooijen (Van Ooijen
+Technische Informatica, www.voti.nl) and under the Vendor ID 8352 from
+Jason Kotzin (Clay Logic, www.claylogic.com). Both owners of the Vendor IDs
+have obtained these IDs from the USB Implementers Forum, Inc.
+(www.usb.org). OBJECTIVE DEVELOPMENT disclaims all liability which might
+arise from the assignment of USB IDs.
+
+2.5 USB Certification. Although not part of this agreement, we want to make
+it clear that you cannot become USB certified when you use V-USB or a USB
+Product ID assigned by OBJECTIVE DEVELOPMENT. AVR microcontrollers don't
+meet the electrical specifications required by the USB specification and
+the USB Implementers Forum certifies only members who bought a Vendor ID of
+their own.
+
+
+3 LICENSE RESTRICTIONS
+
+3.1 Number of Units. Only one of the following three definitions is
+applicable. Which one is determined by the amount you pay to OBJECTIVE
+DEVELOPMENT, see section 4 ("Payment") below.
+
+Hobby License: You may use V-USB according to section 2 above in no more
+than 5 hardware units. These units must not be sold for profit.
+
+Entry Level License: You may use V-USB according to section 2 above in no
+more than 150 hardware units.
+
+Professional License: You may use V-USB according to section 2 above in
+any number of hardware units, except for large scale production ("unlimited
+fair use"). Quantities below 10,000 units are not considered large scale
+production. If your reach quantities which are obviously large scale
+production, you must pay a license fee of 0.10 EUR per unit for all units
+above 10,000.
+
+3.2 Rental. You may not rent, lease, or lend V-USB or otherwise encumber
+any copy of V-USB, or any of the rights granted herein.
+
+3.3 Transfer. You may not transfer your rights under this Agreement to
+another party without OBJECTIVE DEVELOPMENT's prior written consent. If
+such consent is obtained, you may permanently transfer this License to
+another party. The recipient of such transfer must agree to all terms and
+conditions of this Agreement.
+
+3.4 Reservation of Rights. OBJECTIVE DEVELOPMENT retains all rights not
+expressly granted.
+
+3.5 Non-Exclusive Rights. Your license rights under this Agreement are
+non-exclusive.
+
+3.6 Third Party Rights. This Agreement cannot grant you rights controlled
+by third parties. In particular, you are not allowed to use the USB logo or
+other trademarks owned by the USB Implementers Forum, Inc. without their
+consent. Since such consent depends on USB certification, it should be
+noted that V-USB will not pass certification because it does not
+implement checksum verification and the microcontroller ports do not meet
+the electrical specifications.
+
+
+4 PAYMENT
+
+The payment amount depends on the variation of this agreement (according to
+section 3.1) into which you want to enter. Concrete prices are listed on
+OBJECTIVE DEVELOPMENT's web site, usually at
+http://www.obdev.at/vusb/license.html. You agree to pay the amount listed
+there to OBJECTIVE DEVELOPMENT or OBJECTIVE DEVELOPMENT's payment processor
+or reseller.
+
+
+5 COPYRIGHT AND OWNERSHIP
+
+V-USB is protected by copyright laws and international copyright
+treaties, as well as other intellectual property laws and treaties. V-USB
+is licensed, not sold.
+
+
+6 TERM AND TERMINATION
+
+6.1 Term. This Agreement shall continue indefinitely. However, OBJECTIVE
+DEVELOPMENT may terminate this Agreement and revoke the granted license and
+USB-IDs if you fail to comply with any of its terms and conditions.
+
+6.2 Survival of Terms. All provisions regarding secrecy, confidentiality
+and limitation of liability shall survive termination of this agreement.
+
+
+7 DISCLAIMER OF WARRANTY AND LIABILITY
+
+LIMITED WARRANTY. V-USB IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, OBJECTIVE
+DEVELOPMENT AND ITS SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
+NON-INFRINGEMENT, WITH REGARD TO V-USB, AND THE PROVISION OF OR FAILURE
+TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL
+RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO
+STATE/JURISDICTION.
+
+LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
+IN NO EVENT SHALL OBJECTIVE DEVELOPMENT OR ITS SUPPLIERS BE LIABLE FOR ANY
+SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER
+(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY
+LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE V-USB OR THE
+PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF OBJECTIVE
+DEVELOPMENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY
+CASE, OBJECTIVE DEVELOPMENT'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS
+AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR V-USB.
+
+
+8 MISCELLANEOUS TERMS
+
+8.1 Marketing. OBJECTIVE DEVELOPMENT has the right to mention for marketing
+purposes that you entered into this agreement.
+
+8.2 Entire Agreement. This document represents the entire agreement between
+OBJECTIVE DEVELOPMENT and you. It may only be modified in writing signed by
+an authorized representative of both, OBJECTIVE DEVELOPMENT and you.
+
+8.3 Severability. In case a provision of these terms and conditions should
+be or become partly or entirely invalid, ineffective, or not executable,
+the validity of all other provisions shall not be affected.
+
+8.4 Applicable Law. This agreement is governed by the laws of the Republic
+of Austria.
+
+8.5 Responsible Courts. The responsible courts in Vienna/Austria will have
+exclusive jurisdiction regarding all disputes in connection with this
+agreement.
+
361 firmware/firmware/usbdrv/License.txt
View
@@ -0,0 +1,361 @@
+OBJECTIVE DEVELOPMENT GmbH's V-USB driver software is distributed under the
+terms and conditions of the GNU GPL version 2 or the GNU GPL version 3. It is
+your choice whether you apply the terms of version 2 or version 3. The full
+text of GPLv2 is included below. In addition to the requirements in the GPL,
+we STRONGLY ENCOURAGE you to do the following:
+
+(1) Publish your entire project on a web site and drop us a note with the URL.
+Use the form at http://www.obdev.at/vusb/feedback.html for your submission.
+
+(2) Adhere to minimum publication standards. Please include AT LEAST:
+ - a circuit diagram in PDF, PNG or GIF format
+ - full source code for the host software
+ - a Readme.txt file in ASCII format which describes the purpose of the
+ project and what can be found in which directories and which files
+ - a reference to http://www.obdev.at/vusb/
+
+(3) If you improve the driver firmware itself, please give us a free license
+to your modifications for our commercial license offerings.
+
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on