From 39f1c0c136520a3f4746ad6381d1242979125ff3 Mon Sep 17 00:00:00 2001 From: Peter Henn Date: Sat, 28 Feb 2009 12:00:00 +0100 Subject: [PATCH] USBasp 2009.02.28. unmodified content from archive usbasp.2009-02-28.tar.gz --- .gitattributes | 3 +- Changelog.txt | 10 +- Readme.txt | 2 +- bin/firmware/usbasp.atmega48.2007-10-23.hex | 238 ------- bin/firmware/usbasp.atmega48.2009-02-28.hex | 242 +++++++ bin/firmware/usbasp.atmega8.2007-10-23.hex | 237 ------- bin/firmware/usbasp.atmega8.2009-02-28.hex | 241 +++++++ bin/win-driver/Readme.txt | 2 + bin/win-driver/{ => libusb_0.1.10.1}/libusb0.dll | Bin bin/win-driver/{ => libusb_0.1.10.1}/libusb0.sys | Bin bin/win-driver/{ => libusb_0.1.10.1}/usbasp.inf | 0 bin/win-driver/libusb_0.1.12.1/libusb0.dll | Bin 0 -> 43520 bytes bin/win-driver/libusb_0.1.12.1/libusb0.sys | Bin 0 -> 28672 bytes bin/win-driver/libusb_0.1.12.1/libusb0_x64.dll | Bin 0 -> 43008 bytes bin/win-driver/libusb_0.1.12.1/libusb0_x64.sys | Bin 0 -> 16896 bytes bin/win-driver/libusb_0.1.12.1/testlibusb-win.exe | Bin 0 -> 13824 bytes bin/win-driver/libusb_0.1.12.1/testlibusb.exe | Bin 0 -> 8192 bytes bin/win-driver/libusb_0.1.12.1/usbasp.cat | 3 + bin/win-driver/libusb_0.1.12.1/usbasp.inf | 136 ++++ bin/win-driver/libusb_0.1.12.1/usbasp_x64.cat | 3 + firmware/clock.c | 27 +- firmware/clock.h | 16 +- firmware/isp.c | 426 ++++++------ firmware/isp.h | 22 +- firmware/main.c | 372 +++++----- firmware/usbasp.h | 58 ++ firmware/usbconfig.h | 2 +- firmware/usbdrv/Changelog.txt | 111 +++ firmware/usbdrv/CommercialLicense.txt | 15 +- firmware/usbdrv/License.txt | 16 +- firmware/usbdrv/Readme.txt | 107 ++- firmware/usbdrv/USBID-License.txt | 13 +- firmware/usbdrv/asmcommon.inc | 185 +++++ firmware/usbdrv/iarcompat.h | 70 -- firmware/usbdrv/oddebug.c | 4 +- firmware/usbdrv/oddebug.h | 9 +- firmware/usbdrv/usbconfig-prototype.h | 173 +++-- firmware/usbdrv/usbdrv.c | 637 +++++++++-------- firmware/usbdrv/usbdrv.h | 212 ++++-- firmware/usbdrv/usbdrvasm.S | 193 ++++-- firmware/usbdrv/usbdrvasm.asm | 2 +- firmware/usbdrv/usbdrvasm12.S | 555 --------------- firmware/usbdrv/usbdrvasm12.inc | 393 +++++++++++ firmware/usbdrv/usbdrvasm128.inc | 752 +++++++++++++++++++++ firmware/usbdrv/usbdrvasm15.inc | 423 ++++++++++++ firmware/usbdrv/{usbdrvasm16.S => usbdrvasm16.inc} | 252 ++----- .../usbdrv/{usbdrvasm165.S => usbdrvasm165.inc} | 194 +----- firmware/usbdrv/usbdrvasm20.inc | 360 ++++++++++ firmware/usbdrv/usbportability.h | 140 ++++ 49 files changed, 4466 insertions(+), 2390 deletions(-) delete mode 100644 bin/firmware/usbasp.atmega48.2007-10-23.hex create mode 100644 bin/firmware/usbasp.atmega48.2009-02-28.hex delete mode 100644 bin/firmware/usbasp.atmega8.2007-10-23.hex create mode 100644 bin/firmware/usbasp.atmega8.2009-02-28.hex create mode 100644 bin/win-driver/Readme.txt rename bin/win-driver/{ => libusb_0.1.10.1}/libusb0.dll (100%) rename bin/win-driver/{ => libusb_0.1.10.1}/libusb0.sys (100%) rename bin/win-driver/{ => libusb_0.1.10.1}/usbasp.inf (100%) create mode 100755 bin/win-driver/libusb_0.1.12.1/libusb0.dll create mode 100755 bin/win-driver/libusb_0.1.12.1/libusb0.sys create mode 100755 bin/win-driver/libusb_0.1.12.1/libusb0_x64.dll create mode 100755 bin/win-driver/libusb_0.1.12.1/libusb0_x64.sys create mode 100755 bin/win-driver/libusb_0.1.12.1/testlibusb-win.exe create mode 100755 bin/win-driver/libusb_0.1.12.1/testlibusb.exe create mode 100644 bin/win-driver/libusb_0.1.12.1/usbasp.cat create mode 100644 bin/win-driver/libusb_0.1.12.1/usbasp.inf create mode 100644 bin/win-driver/libusb_0.1.12.1/usbasp_x64.cat create mode 100644 firmware/usbasp.h create mode 100644 firmware/usbdrv/asmcommon.inc delete mode 100644 firmware/usbdrv/iarcompat.h delete mode 100644 firmware/usbdrv/usbdrvasm12.S create mode 100644 firmware/usbdrv/usbdrvasm12.inc create mode 100644 firmware/usbdrv/usbdrvasm128.inc create mode 100644 firmware/usbdrv/usbdrvasm15.inc rename firmware/usbdrv/{usbdrvasm16.S => usbdrvasm16.inc} (53%) rename firmware/usbdrv/{usbdrvasm165.S => usbdrvasm165.inc} (67%) create mode 100644 firmware/usbdrv/usbdrvasm20.inc create mode 100644 firmware/usbdrv/usbportability.h diff --git a/.gitattributes b/.gitattributes index 3e01c7143..45814c14e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ # Declare files that will always have CRLF line endings on checkout. -*.inf text eol=crlf +*.inf text eol=crlf +*.cat text eol=crlf # Declare pacth and diff files allow trailing whitespace *.diff text=auto -whitespace diff --git a/Changelog.txt b/Changelog.txt index d38402d38..208da9440 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,11 @@ -usbasp.2007-10-23 ------------------ +usbasp.2009-02-28 (v1.3) +------------------------ +- added support for software control of ISP speed (based on patch by Jurgis Brigmanis) +- included new AVRUSB driver version (Release 2008-11-26) +- added libusb 0.1.12.1 windows drivers (needed for WinAVR version 20080512 or greater) + +usbasp.2007-10-23 (v1.2) +------------------------ - red LED turns on before connecting to target device: this signal can be used to control external tri-state buffers (by Pawel Szramowski) usbasp.2007-07-23 diff --git a/Readme.txt b/Readme.txt index c34bdd7c6..19d1064aa 100644 --- a/Readme.txt +++ b/Readme.txt @@ -133,5 +133,5 @@ libusb .......................... http://libusb.sourceforge.net/ libusb-win32 .................... http://libusb-win32.sourceforge.net/ -2007-07-23 Thomas Fischl +2009-02-28 Thomas Fischl http://www.fischl.de diff --git a/bin/firmware/usbasp.atmega48.2007-10-23.hex b/bin/firmware/usbasp.atmega48.2007-10-23.hex deleted file mode 100644 index 9cc8782d9..000000000 --- a/bin/firmware/usbasp.atmega48.2007-10-23.hex +++ /dev/null @@ -1,238 +0,0 @@ -:1000000042C0D7C15BC05AC059C058C057C056C0C3 -:1000100055C054C053C052C051C050C04FC04EC054 -:100020004DC04CC04BC04AC049C048C047C046C084 -:1000300045C044C0040309041C037700770077001F -:100040002E00660069007300630068006C002E00DB -:10005000640065000E035500530042006100730008 -:10006000700012011001FF000008C016DC0502013B -:1000700001020001090212000101008019090400B7 -:1000800000000000000011241FBECFEFD2E0DEBF51 -:10009000CDBF11E0A0E0B1E0E2EBFEE002C00590D0 -:1000A0000D92A230B107D9F711E0A2E0B1E001C092 -:1000B0001D92A334B107E1F797D4FAC6A1CFE9E6C0 -:1000C000F0E0808183608083E89A08950F931F9306 -:1000D000CF93DF9360912701161604F5635080914A -:1000E0002401C7E3D1E0C81BD109809123018D32DF -:1000F00009F44DC08091020187FD4EC0CE018CD421 -:100100008F3F09F485C0882309F05AC02FEF30E0F3 -:100110003093020120930001109227018091010188 -:1001200084FF29C0809100018F3F29F1682F893019 -:1001300008F03DC0861B809300018091020180FF82 -:1001400034C003EC8F5F8093020187FD69C0662392 -:1001500009F455C088E191E01BD5682F7727162F49 -:10016000693008F479C08FEF809300019EE100931D -:100170001701909301019AE083B1837009F0F7C0F1 -:100180009150D1F71092280110922201F0C08AE517 -:10019000809301016830B9F020E030E8309302012B -:1001A0002093000110922701B9CF0BE4CBCF68E078 -:1001B000861B809300018091020180FFF6CFC1CFA2 -:1001C00020E030E0EBCF8881807609F05CC020E24F -:1001D00031E0109220018981882309F05BC01092E0 -:1001E0002101309326012093250122E030E88F8100 -:1001F0008823A1F68E81821788F6282FCFCF60E062 -:1002000088E191E0D2D094E08FEF80930001AFCFEE -:10021000809300018EE1809301012FEF30E078CFD1 -:10022000209125013091260186FD1FC0462F4150A7 -:100230004F3F61F0F901942FA8E1B1E081918D93D6 -:100240009150E0F7240F311D2F5F3F4F309326016F -:1002500020932501772783CF88E191E0A6D0912FC5 -:100260009C5F183008F083CFCFCF462F41504F3FCF -:1002700069F3F901942FA8E1B1E084918D9331964F -:100280009150D8F7DFCFCE01D5D4282F8F3FA9F0DA -:1002900030E8ADCF853059F08630A9F08830E9F0EC -:1002A000893021F18A3041F120E030E8A0CF8A8105 -:1002B0008093280120E030E89ACF888187FF27CFFC -:1002C0002E8130E025CF8B818130E9F0823081F1C1 -:1002D000833011F120E030EC8ACF8AE291E09093F4 -:1002E00026018093250121E030E881CF8A81809327 -:1002F0002A0120E030E87BCF3093260120932501AE -:1003000021E030E874CF82E690E09093260180935C -:10031000250122E130EC6BCF8A81882391F484E3BC -:1003200090E0909326018093250124E030EC5FCF8C -:1003300084E790E0909326018093250122E130EC40 -:1003400056CF813059F0823029F684E590E09093C1 -:100350002601809325012EE030EC49CF88E390E020 -:1003600090932601809325012CE130EC40CFDF9162 -:10037000CF911F910F910895A82FB92F8FEF9FEF65 -:1003800041E050EA615070F02D9138E0722F7827EB -:1003900096958795269570FF02C0842795273A95F4 -:1003A000A9F7F0CF809590950895E6DF8D939D9302 -:1003B0000895CF93CFB7CF93189BFECF189B09C05A -:1003C000189B07C0189B05C0189B03C0189B01C051 -:1003D0009EC0DF93C0912401DD27C55DDE4F189BD1 -:1003E00002C0DF91EBCF2F930F931F9303B12FEF39 -:1003F00000FB20F94F933F9313B14FEF012700FB10 -:1004000021F93BE031C04E7F012F13B1216028C09C -:10041000102F4D7F2260000003B129C04B7F246064 -:10042000012F000013B12BC013B1477F28602AC0F1 -:100430004F7E03B120612CC04F7D13B120622FC0CD -:100440004F7B03B1206432C0422703B149934FEF81 -:100450000000102710FB20F913B11370A9F1297FB8 -:1004600091F2012700FB21F903B1237F89F231507A -:10047000F0F1102710FB22F913B1277E79F2012742 -:1004800000FB23F92F7C81F203B1102710FB24F924 -:100490002F7971F200C013B1012700FB25F92F73EA -:1004A00059F200C003B1102710FB26F9223040F2A8 -:1004B00000C013B1012700FB27F9243028F64F773D -:1004C000206813B10000F9CF3B503195333011E073 -:1004D0001CBBB8F0C31BD0400881033C41F10B3476 -:1004E00031F11981412F1F7720912201121731F428 -:1004F000093691F10D3279F0013E69F022272093FF -:1005000029013F914F911F910F912F91DF91CF9131 -:10051000CFBFCF911895009329013F914F911F9123 -:100520000F912F91DF91CCB3C0FD46CFF0CF00915A -:100530002901002331F310912701112349F53430AB -:100540004AF13093270100932301109124013BE0ED -:10055000311B309324011EC0009127010130C4F4E7 -:100560000AE53091010134FD17C000930101C7E194 -:10057000D1E016C0052710E005B91FC0052722C02D -:10058000052727C005272CC0052710E005B933C073 -:100590004AE503C042ED01C0432FC4E1D0E032E0A0 -:1005A00014B11360289A05B114B95F9353E020E8A1 -:1005B00020FF052705B9279517951C3FD8F620FF82 -:1005C0000527279505B917951C3FC0F620FF05277D -:1005D0002795179505B91C3F98F620FF0527279505 -:1005E00017951C3F05B970F600C0499120FF0527FB -:1005F00005B9279517951C3F38F620FF0527279545 -:1006000005B917951C3F38F520FF05272795179545 -:1006100005B91C3F10F520FF0527279517951C3FAE -:1006200005B9E8F4242F3A9519F60C7F5F9105B9C6 -:1006300000C010912801C651D04011F01093220142 -:1006400011E01CBB016014B11C7F402F4C7F05B929 -:1006500014B945B956CF0527D3CF0527D8CF0527DD -:10066000DDCF82E58CBD81E08DBD0895882339F40E -:1006700087E693E09093420180934101089584E8D6 -:1006800093E09093420180934101089596B586B519 -:10069000891B8C30E0F3089584B18C6284B92A9868 -:1006A0002D98F4DF2A9AF2DF2A98809141019091E7 -:1006B00042018458934009F00895D3DF089584B12E -:1006C000837D84B985B1837D85B91CBC0895FF9273 -:1006D0000F931F93182FFF2400E00CC02B98FF0CE2 -:1006E0001C99F3942D9AD2DF2D98D0DF0F5F08303C -:1006F00029F0110F17FFF2CF2B9AF1CF8F2D9927E9 -:100700001F910F91FF9008958EBD0DB407FEFDCF90 -:100710008EB5992708950F931F930FE103C00150E1 -:100720000F3F51F1E0914101F09142018CEA0995AE -:10073000E0914101F091420183E50995E091410189 -:10074000F091420180E00995182FE0914101F0916C -:10075000420180E00995133591F01CBC2D9A96DF7B -:100760002D9894DF809141019091420184589340EB -:10077000B1F677DF0150B0F681E090E002C080E092 -:1007800090E01F910F910895EF92FF920F931F93A6 -:100790007B018C01862F8170880F880F880FE09174 -:1007A0004101F091420180620995D801C70129E019 -:1007B000B695A795979587952A95D1F7E091410130 -:1007C000F0914201099516950795F794E794E09109 -:1007D0004101F09142018E2D0995E0914101F09186 -:1007E000420180E0099599271F910F91FF90EF90AA -:1007F00008950F931F938C01E0914101F091420104 -:1008000080EA0995812F9927E0914101F0914201F9 -:100810000995E0914101F0914201802F0995E09105 -:100820004101F091420180E0099599271F910F91B4 -:100830000895FF920F931F938C01F62EE0914101D2 -:10084000F091420180EC0995812F9927E0914101B7 -:10085000F09142010995E0914101F0914201802F10 -:100860000995E0914101F09142018F2D09958EE1AA -:10087000AED080E090E01F910F91FF900895CF924D -:10088000DF92EF92FF920F931F936B017C01142F65 -:10089000E0914101F09142018CE40995D701C60134 -:1008A00069E0B695A795979587956A95D1F7E091F8 -:1008B0004101F09142010995D701C601B695A7956E -:1008C00097958795E0914101F09142010995E0915A -:1008D0004101F091420180E009951F3FA9F006B562 -:1008E0001EE1C701B60150DF8F3F59F486B5801B6A -:1008F0008D3310F006B51150112399F781E090E087 -:1009000007C080E090E004C08FE061D080E090E01C -:100910001F910F91FF90EF90DF90CF900895CF92AD -:10092000DF92EF92FF920F931F936B017C01042FD4 -:10093000122F862F8170880F880F880FE091410158 -:10094000F091420180640995D701C601E9E0B695AE -:10095000A79597958795EA95D1F7E0914101F09198 -:1009600042010995D701C601B695A7959795879538 -:10097000E0914101F09142010995E0914101F0912E -:100980004201802F09951123A1F00F37A9F006B578 -:100990001EE1C701B601F8DE8F3759F486B5801B1A -:1009A0008D3310F006B51150112399F781E090E0D6 -:1009B00007C080E090E004C08FE009D080E090E0C4 -:1009C0001F910F91FF90EF90DF90CF900895382FF7 -:1009D000882349F020E096B586B5891B8C33E0F377 -:1009E0002F5F3217C1F708951BB815B88BEF8AB97E -:1009F0008FEF84B99EEF9150F1F78150E1F714B871 -:100A000093E097B98EEF88B995BD81E02FDE57DB73 -:100A100078945CDB5BDBFDCFBF92CF92DF92EF92ED -:100A2000FF920F931F93CF93DF937C01C62E80918B -:100A30000301813029F0843019F08FEF90E09EC0DF -:100A4000CC2009F499C0BB24DD2458C08091130147 -:100A500090911401892B09F063C0CD2DDD27F7019A -:100A6000EC0FFD1F60910F01709110018091110139 -:100A70009091120121E0408152DF80910401909118 -:100A8000050101979093050180930401892BF1F4EE -:100A9000109203018091150181FF3FC080911601E2 -:100AA0009927209113013091140182179307A9F11E -:100AB000CE0DDF1D60910F01709110018091110129 -:100AC000909112014881DBDE91E0B92E80910F01F7 -:100AD00090911001A0911101B09112010196A11DF8 -:100AE000B11D80930F0190931001A0931101B09359 -:100AF0001201D394CD14E9F180910301813009F4FE -:100B0000A5CFCD2DDD27F701EC0FFD1F6081809172 -:100B10000F01909110018DDEB0CF81E0B82ED6CFBD -:100B2000CD2DDD2787010C0F1D1F60910F017091E6 -:100B30001001809111019091120120E0F801408193 -:100B4000EEDE80911601815080931601882309F012 -:100B500094CF60910F0170911001809111019091DB -:100B60001201F80140818BDE809113018093160100 -:100B700084CF8B2D992702C080E090E0DF91CF9148 -:100B80001F910F91FF90EF90DF90CF90BF9008954D -:100B90000F931F93CF93DF93EC01062F90910301E6 -:100BA000892F8250823018F08FEF90E03EC066238C -:100BB000C1F110E021C080910F019091100119DE68 -:100BC000FE01E10FF11D808380910F0190911001D2 -:100BD000A0911101B09112010196A11DB11D809348 -:100BE0000F0190931001A0931101B09312011F5FA8 -:100BF000011791F0909103019230E9F660910F0195 -:100C0000709110018091110190911201BDDDFE01E2 -:100C1000E10FF11D8083D8CF083018F0802F99277D -:100C200004C010920301802F9927DF91CF911F916B -:100C30000F910895CF93DF93EC018981813041F1C9 -:100C4000823009F4B6C0833009F4B8C0843059F159 -:100C5000873009F484C0853009F41BC1863009F45B -:100C60004FC0883009F4E5C0893079F481E0809381 -:100C700006018A819B81AC81BD8180930F01909395 -:100C80001001A0931101B093120120E030E006C1E1 -:100C9000329933C080E0EADC109206014198FCDC16 -:100CA00020E030E0FBC0809106018823A1F48B8115 -:100CB0002A819927982F88273327822B932BAA27BD -:100CC00097FDA095BA2F80930F0190931001A093E8 -:100CD0001101B09312018F812E819927982F8827B7 -:100CE0003327822B932B909305018093040182E09C -:100CF000809303012FEF30E0D1C081E0B7DCCCCF8F -:100D000080910601882309F47FC02C819D819F700A -:100D1000909315018D81482F5527407F5070429543 -:100D20005295507F5427407F5427420F511D5093B6 -:100D300014014093130190FD64C08F812E81992787 -:100D4000982F88273327822B932B9093050180932C -:100D5000040181E0809303012FEF30E09FC0809178 -:100D600006018823A1F48B812A819927982F88274F -:100D70003327822B932BAA2797FDA095BA2F809318 -:100D80000F0190931001A0931101B09312018F8174 -:100D90002E819927982F88273327822B932B909386 -:100DA00005018093040183E0809303012FEF30E07D -:100DB00075C085DC419A20E030E070C0E0914101CF -:100DC000F09142018A81099580930701E0914101E8 -:100DD000F09142018B81099580930801E0914101D6 -:100DE000F09142018C81099580930901E0914101C4 -:100DF000F09142018D81099580930A0124E030E051 -:100E00004DC04093160199CF8B812A819927982F45 -:100E100088273327822B932BAA2797FDA095BA2FDB -:100E200080930F0190931001A0931101B0931201D0 -:100E30006CCF809106018823A1F48B812A819927A8 -:100E4000982F88273327822B932BAA2797FDA095CD -:100E5000BA2F80930F0190931001A0931101B093CA -:100E600012011092140110921301109215018F813A -:100E70002E819927982F88273327822B932B9093A5 -:100E800005018093040184E0809303012FEF30E09B -:100E900005C041DC8093070121E030E087E091E06C -:100EA0009093260180932501C901DF91CF91089588 -:020EB000FFCF72 -:020EB200FF5AE5 -:00000001FF diff --git a/bin/firmware/usbasp.atmega48.2009-02-28.hex b/bin/firmware/usbasp.atmega48.2009-02-28.hex new file mode 100644 index 000000000..1b25ac548 --- /dev/null +++ b/bin/firmware/usbasp.atmega48.2009-02-28.hex @@ -0,0 +1,242 @@ +:1000000042C0ADC15BC05AC059C058C057C056C0ED +:1000100055C054C053C052C051C050C04FC04EC054 +:100020004DC04CC04BC04AC049C048C047C046C084 +:1000300045C044C0040309041C037700770077001F +:100040002E00660069007300630068006C002E00DB +:10005000640065000E035500530042006100730008 +:10006000700012011001FF000008C016DC0503013A +:1000700001020001090212000101008019090400B7 +:1000800000000000000011241FBECFEFD2E0DEBF51 +:10009000CDBF11E0A0E0B1E0E0E0FFE002C00590DC +:1000A0000D92A230B107D9F711E0A2E0B1E001C092 +:1000B0001D92A734B107E1F7C4D420C7A1CFE9E668 +:1000C000F0E0808183608083E89A08951F93CF9346 +:1000D000DF9360912801635067FD13C08091250173 +:1000E000CCE0D0E0C81BD109C45DDE4F8091240173 +:1000F0008D3209F462C08091020187FD84C01092A4 +:1001000028018091000184FF4AC0609101016F3F86 +:1001100009F445C0693070F1685060930101809125 +:10012000180198E889278093180168E080910201FE +:1001300087FD8BC0209126013091270186FF6DC07D +:10014000A9E1B1E080E090E0F901E80FF91FE49146 +:10015000ED9301966817C1F76150862F90E06F5FAD +:100160000196820F931F9093270180932601162FEB +:100170001C5F0BC0109201018091180198E889273B +:1001800080931801662391F614E089E191E0E3D0B1 +:100190001C3019F08FEF809301011093000194E15E +:1001A00083B1837031F49150D9F7109229011092E4 +:1001B0002301DF91CF911F910895683009F09FCFFF +:1001C00083EC809318018AE580930001109202016C +:1001D0008881807659F59A8110922101898188233E +:1001E00009F043C01092220122E081E291E0909355 +:1001F0002701809326018F81882319F49E8192170D +:1002000008F1922F1FC0CE012DD48F3F51F18823CA +:1002100009F475CF1092010172CF962FD901E9E14F +:10022000F1E08D9181939150E1F796CFCE010CD5FD +:10023000282F8F3F01F7888187FD25C09FEF80E839 +:1002400080930201909301015ACF89E191E0ACD4EF +:10025000682F893008F453C08FEF809301011EE1AD +:100260009CCF8EE1809300014ACF853071F08630BB +:1002700091F0883031F1893061F18A3031F120E03C +:1002800081E291E0B4CF9E81DACF9093290120E002 +:1002900081E291E0ACCF8B81813049F18230F9F07D +:1002A000833029F020E080E480930201A4CF9923D9 +:1002B00049F584E390E0909327018093260124E0A0 +:1002C000F2CF21E08BE291E092CF21E081E291E058 +:1002D0008ECF90932B0120E081E291E088CF84E7DC +:1002E00090E0909327018093260122E1DCCF82E603 +:1002F00090E0909327018093260122E1D4CF182F1C +:100300001C5F43CF913051F0923061F684E590E06C +:1003100090932701809326012EE0C5CF88E390E0DB +:1003200090932701809326012CE1BDCFA82FB92FF0 +:1003300080E090E041E050EA60956F5F58F42D91C5 +:1003400038EF82279795879510F0842795273F5F90 +:10035000C8F3F3CF0895EADF8D939D930895CF936B +:10036000CFB7CF93C395189BE9F7189B09C0189B8B +:1003700007C0189B05C0189B03C0189B01C0A1C0F3 +:10038000DF93C0912501DD27C45DDE4F189B02C0BD +:10039000DF91EBCF2F930F931F9303B12FEF00FB50 +:1003A00020F94F933F9313B14FEF012700FB21F941 +:1003B0003BE031C04E7F012F13B1216028C0102FC8 +:1003C0004D7F2260000003B129C04B7F2460012FC4 +:1003D000000013B12BC013B1477F28602AC04F7EA5 +:1003E00003B120612CC04F7D13B120622FC04F7B21 +:1003F00003B1206432C0422703B149934FEF00009C +:10040000102710FB20F913B11370C9F1297F91F265 +:10041000012700FB21F903B1237F89F2315058F104 +:10042000102710FB22F913B1277E79F2012700FB78 +:1004300023F92F7C81F203B1102710FB24F92F79C7 +:1004400071F200C013B1012700FB25F92F7359F297 +:1004500000C003B1102710FB26F9223040F200C083 +:1004600013B1012700FB27F9243028F64F772068C5 +:1004700013B10000F9CF11E01CBB002717C03B509F +:100480003195C31BD04011E01CBB0881033CE9F04F +:100490000B34D9F0209123011981110F1213EDCFE4 +:1004A000093641F10D3211F0013E39F700932A016E +:1004B0003F914F911F910F912F91DF91CCB3C0FDD0 +:1004C00051CFCF91CFBFCF91189520912A012223F0 +:1004D00079F310912801112311F5343012F1309382 +:1004E000280120932401109125013BE0311B30931A +:1004F000250117C00091280101308CF40AE53091E4 +:10050000000134FD10C000930001C8E1D1E00FC02C +:100510002795A8F45150A9F4220F0000F9CF4AE51D +:1005200003C042ED01C0432FC4E1D0E032E014B17A +:100530001360289A14B905B120E413E05F930127F2 +:1005400056E005B9279520F4515021F4220FF9CF38 +:10055000012756E000003B5A05B9D0F2279528F450 +:10056000515029F4220F0000F9CF012756E02795BA +:1005700005B920F4515021F4220FF9CF012756E09C +:100580002991332305B921F60C7F10912901110F10 +:10059000C651D04005B911F01093230111E01CBBE6 +:1005A000016014B11C7F402F4C7F5F9100C000C0E0 +:1005B00005B914B945B97CCF809145018CBD8091B6 +:1005C00042018DBD0895282F8823A1F0883008F0BE +:1005D0003FC08CE793E09093440180934301243023 +:1005E00001F12530A0F0263081F1263050F127307E +:1005F000E1F008958DE993E09093440180934301E5 +:1006000082E58093450181E0809342010895223084 +:10061000A1F0233070F4213061F780EC8093460123 +:10062000089588E180934601089583E08093460110 +:10063000089580E380934601089580E68093460103 +:1006400008958CE080934601089520934601089513 +:100650008DE993E09093440180934301109242010D +:10066000293041F02A3050F4283051F683E5809348 +:100670004501089582E58093450108952B3031F0BE +:100680002C3009F0BDCF81E08093420181E5809359 +:100690004501089526B59091460186B5821B8917BC +:1006A000E0F3089584B18C6284B92A982D9896B5A8 +:1006B0002091460186B5891B8217E0F32A9A96B5E8 +:1006C00086B5891B8217E0F32A98809143019091A7 +:1006D00044018D59934009F00895809145018CBDE6 +:1006E000809142018DBD089584B1837D84B985B127 +:1006F000837D85B91CBC0895582F2091460140E0A8 +:1007000030E057FD16C02B98440F1C994F5F2D9A6F +:1007100096B586B5891B8217E0F32D9896B586B5F8 +:10072000891B8217E0F33F5F383029F0550F57FFE0 +:10073000EACF2B9AE9CF842F08958EBD0DB407FE22 +:10074000FDCF8EB508950F931F930FE1E091430104 +:10075000F09144018CEA0995E0914301F091440144 +:1007600083E50995E0914301F091440180E009950A +:10077000182FE0914301F091440180E00995133571 +:1007800039F11CBC2D9A96B52091460186B5891B7E +:100790008217E0F32D9896B586B5891B8217E0F392 +:1007A000E0914301F091440183E0ED39F80721F035 +:1007B000002351F00150CECF809145018CBD809136 +:1007C00042018DBD0023B1F781E01F910F91089583 +:1007D00080E01F910F910895EF92FF920F931F9366 +:1007E0007B018C01862F8170880F880F880FE09124 +:1007F0004301F091440180620995D801C70129E0C5 +:10080000B695A795979587952A95D1F7E0914301DD +:10081000F0914401099516950795F794E794E091B6 +:100820004301F09144018E2D0995E0914301F0912F +:10083000440180E009951F910F91FF90EF9008957A +:100840000F931F938C01E0914301F091440180EAE2 +:100850000995E0914301F0914401812F0995E091C0 +:100860004301F0914401802F0995E0914301F091FB +:10087000440180E009951F910F910895FF920F9315 +:100880001F938C01F62EE0914301F091440180EC1E +:100890000995E0914301F0914401812F0995E09180 +:1008A0004301F0914401802F0995E0914301F091BB +:1008B00044018F2D09958EE1B7D080E01F910F91F3 +:1008C000FF900895CF92DF92EF92FF920F931F93C4 +:1008D0006B017C01142FE0914301F09144018CE401 +:1008E0000995D701C60149E0B695A79597958795D3 +:1008F0004A95D1F7E0914301F09144010995D70160 +:10090000C601B695A79597958795E0914301F0911B +:1009100044010995E0914301F091440180E009957B +:100920001F3FF1F016B50EE1C701B60155DF8F3F4D +:1009300079F486B5811B8D33B8F316B50150A1F754 +:1009400081E01F910F91FF90EF90DF90CF9008957D +:1009500080E01F910F91FF90EF90DF90CF9008956E +:100960008FE062D080E01F910F91FF90EF90DF90B9 +:10097000CF900895CF92DF92EF92FF920F931F9343 +:100980006B017C01042F122F862F8170880F880F36 +:10099000880FE0914301F091440180640995D701EB +:1009A000C60169E0B695A795979587956A95D1F7A1 +:1009B000E0914301F09144010995D701C601B69534 +:1009C000A79597958795E0914301F091440109958A +:1009D000E0914301F0914401802F09951123C1F06A +:1009E0000F37F1F016B50EE1C701B601F5DE8F370E +:1009F00079F486B5811B8D33B8F316B50150A1F794 +:100A000081E01F910F91FF90EF90DF90CF900895BC +:100A100080E01F910F91FF90EF90DF90CF900895AD +:100A20008FE002D080E0F5CF382F882349F020E016 +:100A300096B586B5891B8C33E0F32F5F2317C0F37F +:100A400008951BB815B88BEF8AB98FEF84B914B825 +:100A500093E097B98EEF88B995BD31DB789436DB9A +:100A600035DBFDCFFF920F931F93CF93DF93F82ECB +:100A7000292F062F40910301413051F0443041F0BD +:100A80001FEF812FDF91CF911F910F91FF9008955C +:100A9000002309F487C08F2D922F9C01E90110E0FB +:100AA00053C08091140190911501892B09F058C011 +:100AB00060911001709111018091120190911301C8 +:100AC00021E0488157DF8091040190910501019751 +:100AD0009093050180930401892BD9F410920301AE +:100AE0008091160181FF3AC08091170190E020911A +:100AF0001401309115018217930781F16091100163 +:100B00007091110180911201909113014881DADEF8 +:100B100011E08091100190911101A0911201B0910A +:100B200013010196A11DB11D809310019093110135 +:100B3000A0931201B093130121969E012F19201743 +:100B400008F09FCF40910301413009F4AACF68819A +:100B5000809110019091110191DEB5CF11E0D9CFB4 +:100B60006091100170911101809112019091130117 +:100B700020E04881FFDE80911701815080931701AA +:100B8000882309F0A0CF609110017091110180912C +:100B9000120190911301488195DE80911401809398 +:100BA000170191CF10E06DCF0F931F93CF93DF9379 +:100BB000082F162F40910301842F8250823038F085 +:100BC0001FEF812FDF91CF911F910F910895662321 +:100BD00099F1802F9C01E90120C080911001909132 +:100BE00011012EDE88838091100190911101A09156 +:100BF0001201B09113010196A11DB11D8093100146 +:100C000090931101A0931201B093130121969E01BC +:100C1000201B211778F4409103014230F1F66091D6 +:100C20001001709111018091120190911301D4DD96 +:100C30008883D9CF183028F610920301812FDF91D5 +:100C4000CF911F910F9108950F931F93CF93DF932F +:100C50008C01EC0189818130F1F0823009F4B0C05F +:100C6000833031F1843009F482C0873009F456C0F2 +:100C7000853009F41EC1863009F4D7C0883009F4E4 +:100C8000A5C0893009F41CC18A3009F42DC180E067 +:100C9000C8E0D1E037C0329B3EC08091060193DCB2 +:100CA000109207014198FEDC80E0C8E0D1E02AC044 +:100CB000E0914301F0914401E8018A810995C8E07F +:100CC000D1E0809308012091430130914401F80163 +:100CD0008381F901099580930901209143013091A5 +:100CE0004401F8018481F901099580930A0120915A +:100CF000430130914401F8018581F9010995809300 +:100D00000B0184E0D0932701C0932601DF91CF919E +:100D10001F910F91089585E056DCC2CF80910701A5 +:100D2000882399F4E8019B8180E02A8130E0822BBE +:100D3000932BAA2797FDA095BA2F8093100190932B +:100D40001101A0931201B0931301F801978180E083 +:100D5000268130E0822B932B909305018093040130 +:100D600083E0809303018FEFC8E0D1E0CBCF809187 +:100D70000701882399F4E8019B8180E02A8130E013 +:100D8000822B932BAA2797FDA095BA2F8093100151 +:100D900090931101A0931201B0931301F801978170 +:100DA00080E0268130E0822B932B90930501809385 +:100DB000040182E0809303018FEFC8E0D1E0A2CF6D +:100DC00093DC419A80E0C8E0D1E09CCF809107019C +:100DD000882399F4F801938180E0228130E0822B0E +:100DE000932BAA2797FDA095BA2F8093100190937B +:100DF0001101A0931201B0931301109215011092EA +:100E0000140110921601E8019F8180E02E8130E0EC +:100E1000822B932B909305018093040184E08093AF +:100E200003018FEFC8E0D1E06DCF809107018823E7 +:100E300099F4E8019B8180E02A8130E0822B932B9A +:100E4000AA2797FDA095BA2F8093100190931101C6 +:100E5000A0931201B0931301F80184819581292F89 +:100E60002F7020931601492F50E0407F507042951B +:100E70005295507F5427407F5427480F511D50935F +:100E800015014093140120FF02C040931701E801AF +:100E90009F8180E02E8130E0822B932B909305017F +:100EA0008093040181E0809303018FEFC8E0D1E0DB +:100EB00029CF49DCC8E0D1E08093080181E022CF4E +:100EC00081E080930701F80182819381A481B5813B +:100ED0008093100190931101A0931201B09313011C +:100EE00080E0C8E0D1E00ECFE8018A81809306015E +:100EF000C8E0D1E01092080181E004CFF894FFCF60 +:020F00005AFF96 +:00000001FF diff --git a/bin/firmware/usbasp.atmega8.2007-10-23.hex b/bin/firmware/usbasp.atmega8.2007-10-23.hex deleted file mode 100644 index 71f99a346..000000000 --- a/bin/firmware/usbasp.atmega8.2007-10-23.hex +++ /dev/null @@ -1,237 +0,0 @@ -:100000003BC0D0C154C053C052C051C050C04FC0FB -:100010004EC04DC04CC04BC04AC049C048C047C08C -:1000200046C045C044C0040309041C0377007700A0 -:1000300077002E00660069007300630068006C00A2 -:100040002E00640065000E0355005300420061005D -:100050007300700012011001FF000008C016DC05DB -:1000600002010102000109021200010100801909C8 -:10007000040000000000000011241FBECFE5D4E002 -:10008000DEBFCDBF10E0A0E6B0E0E2EAFEE002C0D5 -:1000900005900D92A236B107D9F710E0A2E6B0E0C4 -:1000A00001C01D92A33AB107E1F796D4F9C6A8CFD3 -:1000B00085B7836085BF8BB780648BBF08950F932E -:1000C0001F93CF93DF9360918700161604F563505A -:1000D00080918400C7E9D0E0C81BD10980918300DA -:1000E0008D3209F44DC08091620087FD4EC0CE0173 -:1000F0008BD48F3F09F485C0882309F05AC02FEFB5 -:1001000030E030936200209360001092870080916D -:10011000610084FF29C0809160008F3F29F1682F22 -:10012000893008F03DC0861B80936000809162009A -:1001300080FF34C003EC8F5F8093620087FD69C04D -:10014000662309F455C088E790E01AD5682F772711 -:10015000162F693008F479C08FEF809360009EE11C -:1001600000937700909361009AE086B3837009F062 -:10017000F7C09150D1F71092880010928200F0C021 -:100180008AE5809361006830B9F020E030E8309370 -:1001900062002093600010928700B9CF0BE4CBCFB0 -:1001A00068E0861B809360008091620080FFF6CF3C -:1001B000C1CF20E030E0EBCF8881807609F05CC0D1 -:1001C00020E830E0109280008981882309F05BC02C -:1001D00010928100309386002093850022E030E861 -:1001E0008F818823A1F68E81821788F6282FCFCFA2 -:1001F00060E088E790E0D2D094E08FEF80936000D9 -:10020000AFCF809360008EE1809361002FEF30E0EC -:1002100078CF209185003091860086FD1FC0462F43 -:1002200041504F3F61F0F901942FA8E7B0E0819170 -:100230008D939150E0F7240F311D2F5F3F4F309386 -:10024000860020938500772783CF88E790E0A6D0AB -:10025000912F9C5F183008F083CFCFCF462F4150AD -:100260004F3F69F3F901942FA8E7B0E084918D9393 -:1002700031969150D8F7DFCFCE01D4D4282F8F3FBD -:10028000A9F030E8ADCF853059F08630A9F088303C -:10029000E9F0893021F18A3041F120E030E8A0CF47 -:1002A0008A818093880020E030E89ACF888187FF98 -:1002B00027CF2E8130E025CF8B818130E9F082304D -:1002C00081F1833011F120E030EC8ACF8AE890E0B0 -:1002D000909386008093850021E030E881CF8A8169 -:1002E00080938A0020E030E87BCF30938600209313 -:1002F000850021E030E874CF84E590E0909386009B -:100300008093850022E130EC6BCF8A81882391F4C1 -:1003100086E290E0909386008093850024E030ECA4 -:100320005FCF86E690E0909386008093850022E17F -:1003300030EC56CF813059F0823029F686E490E0D7 -:1003400090938600809385002EE030EC49CF8AE2BE -:1003500090E090938600809385002CE130EC40CFB4 -:10036000DF91CF911F910F910895A82FB92F8FEF93 -:100370009FEF41E050EA615070F02D9138E0722F0C -:10038000782796958795269570FF02C08427952734 -:100390003A95A9F7F0CF809590950895E6DF8D9373 -:1003A0009D930895CF93CFB7CF93B09BFECFB09BD3 -:1003B00009C0B09B07C0B09B05C0B09B03C0B09BF9 -:1003C00001C09EC0DF93C0918400DD27C557DF4F79 -:1003D000B09B02C0DF91EBCF2F930F931F9306B317 -:1003E0002FEF00FB20F94F933F9316B34FEF0127F8 -:1003F00000FB21F93BE031C04E7F012F16B3216095 -:1004000028C0102F4D7F2260000006B329C04B7F0B -:100410002460012F000016B32BC016B3477F28605D -:100420002AC04F7E06B320612CC04F7D16B32062D8 -:100430002FC04F7B06B3206432C0422706B34993D6 -:100440004FEF0000102710FB20F916B31370A9F12D -:10045000297F91F2012700FB21F906B3237F89F25E -:100460003150F0F1102710FB22F916B3277E79F2F4 -:10047000012700FB23F92F7C81F206B3102710FB24 -:1004800024F92F7971F200C016B3012700FB25F97A -:100490002F7359F200C006B3102710FB26F9223043 -:1004A00040F200C016B3012700FB27F9243028F6DC -:1004B0004F77206816B30000F9CF3B5031953330A9 -:1004C00010E41ABFB8F0C31BD0400881033C41F1CF -:1004D0000B3431F11981412F1F77209182001217BF -:1004E00031F4093691F10D3279F0013E69F022279D -:1004F000209389003F914F911F910F912F91DF9190 -:10050000CF91CFBFCF911895009389003F914F9124 -:100510001F910F912F91DF91CAB7C6FD46CFF0CF43 -:1005200000918900002331F310918700112349F5D0 -:1005300034304AF130938700009383001091840097 -:100540003BE0311B309384001EC0009187000130D6 -:10055000C4F40AE53091610034FD17C000936100D6 -:10056000C7E7D0E016C0052710E008BB1FC005276D -:1005700022C0052727C005272CC0052710E008BB8F -:1005800033C04AE503C042ED01C0432FC4E1D0E0CF -:1005900032E017B31360C09A08B317BB5F9353E000 -:1005A00020E820FF052708BB279517951C3FD8F6A4 -:1005B00020FF0527279508BB17951C3FC0F620FF95 -:1005C00005272795179508BB1C3F98F620FF0527A0 -:1005D000279517951C3F08BB70F600C0499120FF76 -:1005E000052708BB279517951C3F38F620FF0527E0 -:1005F000279508BB17951C3F38F520FF0527279541 -:10060000179508BB1C3F10F520FF05272795179568 -:100610001C3F08BBE8F4242F3A9519F60C7F5F9134 -:1006200008BB00C010918800C651D04011F0109353 -:10063000820010E41ABF016017B31C7F402F4C7F6B -:1006400008BB17BB48BB56CF0527D3CF0527D8CF4C -:100650000527DDCF82E58DB981E08EB90895882325 -:1006600039F480E693E09093A2008093A10008956E -:100670008DE793E09093A2008093A100089592B734 -:1006800082B7891B8C30E0F3089587B38C6287BBF7 -:10069000C298C598F4DFC29AF2DFC2988091A10097 -:1006A0009091A2008D57934009F00895D3DF0895EB -:1006B00087B3837D87BB88B3837D88BB1DB80895CE -:1006C000FF920F931F93182FFF2400E00CC0C398D4 -:1006D000FF0CB499F394C59AD2DFC598D0DF0F5FB1 -:1006E000083029F0110F17FFF2CFC39AF1CF8F2DE9 -:1006F00099271F910F91FF9008958FB9779BFECF97 -:100700008FB1992708950F931F930FE103C00150F4 -:100710000F3F51F1E091A100F091A2008CEA099500 -:10072000E091A100F091A20083E50995E091A1007C -:10073000F091A20080E00995182FE091A100F091BE -:10074000A20080E00995133591F01DB8C59A97DF96 -:10075000C59895DF8091A1009091A2008D5793409C -:10076000B1F678DF0150B0F681E090E002C080E0A1 -:1007700090E01F910F910895EF92FF920F931F93B6 -:100780007B018C01862F8170880F880F880FE09184 -:10079000A100F091A20080620995D801C70129E06B -:1007A000B695A795979587952A95D1F7E091A100E1 -:1007B000F091A200099516950795F794E794E091BA -:1007C000A100F091A2008E2D0995E091A100F09179 -:1007D000A20080E0099599271F910F91FF90EF905B -:1007E00008950F931F938C01E091A100F091A20056 -:1007F00080EA0995812F9927E091A100F091A2004C -:100800000995E091A100F091A200802F0995E09157 -:10081000A100F091A20080E0099599271F910F9106 -:100820000895FF920F931F938C01F62EE091A10083 -:10083000F091A20080EC0995812F9927E091A10009 -:10084000F091A2000995E091A100F091A200802F03 -:100850000995E091A100F091A2008F2D09958EE1FC -:10086000AED080E090E01F910F91FF900895CF925D -:10087000DF92EF92FF920F931F936B017C01142F75 -:10088000E091A100F091A2008CE40995D701C60186 -:1008900069E0B695A795979587956A95D1F7E09108 -:1008A000A100F091A2000995D701C601B695A795C0 -:1008B00097958795E091A100F091A2000995E091AC -:1008C000A100F091A20080E009951F3FA9F002B7B6 -:1008D0001EE1C701B60150DF8F3F59F482B7801B7C -:1008E0008D3310F002B71150112399F781E090E099 -:1008F00007C080E090E004C08FE061D080E090E02D -:100900001F910F91FF90EF90DF90CF900895CF92BD -:10091000DF92EF92FF920F931F936B017C01042FE4 -:10092000122F862F8170880F880F880FE091A10009 -:10093000F091A20080640995D701C601E9E0B6955F -:10094000A79597958795EA95D1F7E091A100F09149 -:10095000A2000995D701C601B695A79597958795E9 -:10096000E091A100F091A2000995E091A100F09121 -:10097000A200802F09951123A1F00F37A9F002B72B -:100980001EE1C701B601F8DE8F3759F482B7801B2C -:100990008D3310F002B71150112399F781E090E0E8 -:1009A00007C080E090E004C08FE009D080E090E0D4 -:1009B0001F910F91FF90EF90DF90CF900895382F07 -:1009C000882349F020E092B782B7891B8C33E0F38B -:1009D0002F5F3217C1F7089512BA18BA8BEF81BB97 -:1009E0008FEF87BB9EEF9150F1F78150E1F717BA77 -:1009F00093E094BB8EEF85BB93BF81E030DE58DB84 -:100A000078945DDB5CDBFDCFBF92CF92DF92EF92FB -:100A1000FF920F931F93CF93DF937C01C62E80919B -:100A20006300813029F0843019F08FEF90E09EC090 -:100A3000CC2009F499C0BB24DD2458C080917300F8 -:100A400090917400892B09F063C0CD2DDD27F7014B -:100A5000EC0FFD1F60916F0070917000809171002C -:100A60009091720021E0408152DF8091640090916A -:100A7000650001979093650080936400892BF1F4E1 -:100A8000109263008091750081FF3FC080917600D5 -:100A90009927209173003091740082179307A9F170 -:100AA000CE0DDF1D60916F0070917000809171001C -:100AB000909172004881DBDE91E0B92E80916F0049 -:100AC00090917000A0917100B09172000196A11DEB -:100AD000B11D80936F0090937000A0937100B0934C -:100AE0007200D394CD14E9F180916300813009F450 -:100AF000A5CFCD2DDD27F701EC0FFD1F6081809183 -:100B00006F00909170008DDEB0CF81E0B82ED6CF0F -:100B1000CD2DDD2787010C0F1D1F60916F00709197 -:100B20007000809171009091720020E0F801408186 -:100B3000EEDE80917600815080937600882309F064 -:100B400094CF60916F0070917000809171009091CE -:100B50007200F80140818BDE8091730080937600F3 -:100B600084CF8B2D992702C080E090E0DF91CF9158 -:100B70001F910F91FF90EF90DF90CF90BF9008955D -:100B80000F931F93CF93DF93EC01062F9091630097 -:100B9000892F8250823018F08FEF90E03EC066239C -:100BA000C1F110E021C080916F009091700019DEBA -:100BB000FE01E10FF11D808380916F009091700024 -:100BC000A0917100B09172000196A11DB11D80939A -:100BD0006F0090937000A0937100B09372001F5F3C -:100BE000011791F0909163009230E9F660916F00E7 -:100BF000709170008091710090917200BDDDFE01D6 -:100C0000E10FF11D8083D8CF083018F0802F99278D -:100C100004C010926300802F9927DF91CF911F911C -:100C20000F910895CF93DF93EC018981813041F1D9 -:100C3000823009F4B6C0833009F4B8C0843059F169 -:100C4000873009F484C0853009F41BC1863009F46B -:100C50004FC0883009F4E5C0893079F481E0809391 -:100C600066008A819B81AC81BD8180936F009093E7 -:100C70007000A0937100B093720020E030E006C1D4 -:100C80009A9933C080E0EBDC10926600A998FDDCF5 -:100C900020E030E0FBC0809166008823A1F48B81C6 -:100CA0002A819927982F88273327822B932BAA27CD -:100CB00097FDA095BA2F80936F0090937000A0933A -:100CC0007100B09372008F812E819927982F882709 -:100CD0003327822B932B909365008093640082E0EE -:100CE000809363002FEF30E0D1C081E0B8DCCCCF3F -:100CF00080916600882309F47FC02C819D819F70BC -:100D0000909375008D81482F5527407F50704295F4 -:100D10005295507F5427407F5427420F511D5093C6 -:100D200074004093730090FD64C08F812E819927D9 -:100D3000982F88273327822B932B909365008093DD -:100D4000640081E0809363002FEF30E09FC08091CA -:100D500066008823A1F48B812A819927982F882700 -:100D60003327822B932BAA2797FDA095BA2F809328 -:100D70006F0090937000A0937100B09372008F8108 -:100D80002E819927982F88273327822B932B909396 -:100D900065008093640083E0809363002FEF30E070 -:100DA00075C086DCA99A20E030E070C0E091A10017 -:100DB000F091A2008A81099580936700E091A100DB -:100DC000F091A2008B81099580936800E091A100C9 -:100DD000F091A2008C81099580936900E091A100B7 -:100DE000F091A2008D81099580936A0024E030E0A3 -:100DF0004DC04093760099CF8B812A819927982FF7 -:100E000088273327822B932BAA2797FDA095BA2FEB -:100E100080936F0090937000A0937100B093720064 -:100E20006CCF809166008823A1F48B812A81992759 -:100E3000982F88273327822B932BAA2797FDA095DD -:100E4000BA2F80936F0090937000A0937100B093BD -:100E500072001092740010927300109275008F81CE -:100E60002E819927982F88273327822B932B9093B5 -:100E700065008093640084E0809363002FEF30E08E -:100E800005C041DC8093670021E030E087E690E018 -:100E90009093860080938500C901DF91CF910895DA -:020EA000FFCF82 -:020EA200FF5AF5 -:00000001FF diff --git a/bin/firmware/usbasp.atmega8.2009-02-28.hex b/bin/firmware/usbasp.atmega8.2009-02-28.hex new file mode 100644 index 000000000..b06b92574 --- /dev/null +++ b/bin/firmware/usbasp.atmega8.2009-02-28.hex @@ -0,0 +1,241 @@ +:100000003BC0A6C154C053C052C051C050C04FC025 +:100010004EC04DC04CC04BC04AC049C048C047C08C +:1000200046C045C044C0040309041C0377007700A0 +:1000300077002E00660069007300630068006C00A2 +:100040002E00640065000E0355005300420061005D +:100050007300700012011001FF000008C016DC05DB +:1000600003010102000109021200010100801909C7 +:10007000040000000000000011241FBECFE5D4E002 +:10008000DEBFCDBF10E0A0E6B0E0E0EFFEE002C0D2 +:1000900005900D92A236B107D9F710E0A2E6B0E0C4 +:1000A00001C01D92A73AB107E1F7C3D41FC7A8CF7B +:1000B00085B7836085BF8BB780648BBF08951F931E +:1000C000CF93DF9360918800635067FD13C08091E8 +:1000D0008500CCE0D0E0C81BD109C457DF4F809128 +:1000E00084008D3209F462C08091620087FD84C073 +:1000F000109288008091600084FF4AC06091610086 +:100100006F3F09F445C0693070F168506093610039 +:100110008091780098E889278093780068E0809142 +:10012000620087FD8BC0209186003091870086FF9A +:100130006DC0A9E7B0E080E090E0F901E80FF91F99 +:10014000E491ED9301966817C1F76150862F90E016 +:100150006F5F0196820F931F9093870080938600B4 +:10016000162F1C5F0BC0109261008091780098E8F8 +:10017000892780937800662391F614E089E790E060 +:10018000E3D01C3019F08FEF809361001093600072 +:1001900094E186B3837031F49150D9F710928900BD +:1001A00010928300DF91CF911F910895683009F07C +:1001B0009FCF83EC809378008AE580936000109253 +:1001C00062008881807659F59A8110928100898138 +:1001D000882309F043C01092820022E081E890E079 +:1001E00090938700809386008F81882319F49E81E5 +:1001F000921708F1922F1FC0CE012CD48F3F51F1DE +:10020000882309F475CF1092610072CF962FD9011F +:10021000E9E7F0E08D9181939150E1F796CFCE011F +:100220000BD5282F8F3F01F7888187FD25C09FEFD1 +:1002300080E880936200909361005ACF89E790E054 +:10024000ABD4682F893008F453C08FEF80936100DE +:100250001EE19CCF8EE1809360004ACF853071F023 +:10026000863091F0883031F1893061F18A3031F196 +:1002700020E081E890E0B4CF9E81DACF90938900AE +:1002800020E081E890E0ACCF8B81813049F1823071 +:10029000F9F0833029F020E080E480936200A4CF5D +:1002A000992349F586E290E0909387008093860039 +:1002B00024E0F2CF21E08BE890E092CF21E081E8CA +:1002C00090E08ECF90938B0020E081E890E088CF83 +:1002D00086E690E0909387008093860022E1DCCF51 +:1002E00084E590E0909387008093860022E1D4CF4C +:1002F000182F1C5F43CF913051F0923061F686E4A5 +:1003000090E090938700809386002EE0C5CF8AE22C +:1003100090E090938700809386002CE1BDCFA82FBA +:10032000B92F80E090E041E050EA60956F5F58F4AB +:100330002D9138EF82279795879510F08427952780 +:100340003F5FC8F3F3CF0895EADF8D939D9308953F +:10035000CF93CFB7CF93C395B09BE9F7B09B09C0BC +:10036000B09B07C0B09B05C0B09B03C0B09B01C051 +:10037000A1C0DF93C0918500DD27C457DF4FB09B3C +:1003800002C0DF91EBCF2F930F931F9306B32FEF94 +:1003900000FB20F94F933F9316B34FEF012700FB6B +:1003A00021F93BE031C04E7F012F16B3216028C0F8 +:1003B000102F4D7F2260000006B329C04B7F2460C0 +:1003C000012F000016B32BC016B3477F28602AC048 +:1003D0004F7E06B320612CC04F7D16B320622FC024 +:1003E0004F7B06B3206432C0422706B349934FEFD8 +:1003F0000000102710FB20F916B31370C9F1297FF4 +:1004000091F2012700FB21F906B3237F89F23150D5 +:1004100058F1102710FB22F916B3277E79F2012735 +:1004200000FB23F92F7C81F206B3102710FB24F97F +:100430002F7971F200C016B3012700FB25F92F7345 +:1004400059F200C006B3102710FB26F9223040F203 +:1004500000C016B3012700FB27F9243028F64F7798 +:10046000206816B30000F9CF10E41ABF002717C0A8 +:100470003B503195C31BD04010E41ABF0881033CA8 +:10048000E9F00B34D9F0209183001981110F121378 +:10049000EDCF093641F10D3211F0013E39F70093ED +:1004A0008A003F914F911F910F912F91DF91CAB711 +:1004B000C6FD51CFCF91CFBFCF91189520918A0023 +:1004C000222379F310918800112311F5343012F1B1 +:1004D0003093880020938400109185003BE0311B0D +:1004E0003093850017C00091880001308CF40AE534 +:1004F0003091600034FD10C000936000C8E7D0E088 +:100500000FC02795A8F45150A9F4220F0000F9CF8D +:100510004AE503C042ED01C0432FC4E1D0E032E020 +:1005200017B31360C09A17BB08B320E413E05F93BE +:10053000012756E008BB279520F4515021F4220FE3 +:10054000F9CF012756E000003B5A08BBD0F22795AF +:1005500028F4515029F4220F0000F9CF012756E06A +:10056000279508BB20F4515021F4220FF9CF012721 +:1005700056E02991332308BB21F60C7F10918900A6 +:10058000110FC651D04008BB11F01093830010E446 +:100590001ABF016017B31C7F402F4C7F5F9100C0D2 +:1005A00000C008BB17BB48BB7CCF8091A5008DB9AC +:1005B0008091A2008EB90895282F8823A1F0883059 +:1005C00008F03FC085E793E09093A4008093A300D8 +:1005D000243001F12530A0F0263081F1263050F191 +:1005E0002730E1F0089586E993E09093A40080938A +:1005F000A30082E58093A50081E08093A200089586 +:100600002230A1F0233070F4213061F780EC809328 +:10061000A600089588E18093A600089583E0809362 +:10062000A600089580E38093A600089580E6809355 +:10063000A60008958CE08093A60008952093A6005C +:10064000089586E993E09093A4008093A30010920C +:10065000A200293041F02A3050F4283051F683E5C9 +:100660008093A500089582E58093A50008952B301E +:1006700031F02C3009F0BDCF81E08093A20081E5FC +:100680008093A500089522B79091A60082B7821B9F +:100690008917E0F3089587B38C6287BBC298C59829 +:1006A00092B72091A60082B7891B8217E0F3C29A05 +:1006B00092B782B7891B8217E0F3C2988091A3009A +:1006C0009091A4008659934009F008958091A50067 +:1006D0008DB98091A2008EB9089587B3837D87BBC1 +:1006E00088B3837D88BB1DB80895582F2091A6003C +:1006F00040E030E057FD16C0C398440FB4994F5FF7 +:10070000C59A92B782B7891B8217E0F3C59892B752 +:1007100082B7891B8217E0F33F5F383029F0550F0D +:1007200057FFEACFC39AE9CF842F08958FB9779BFB +:10073000FECF8FB108950F931F930FE1E091A300B7 +:10074000F091A4008CEA0995E091A300F091A40037 +:1007500083E50995E091A300F091A40080E009955C +:10076000182FE091A300F091A40080E009951335C3 +:1007700039F11DB8C59A92B72091A60082B7891B9E +:100780008217E0F3C59892B782B7891B8217E0F30E +:10079000E091A300F091A40083E0E639F80721F08E +:1007A000002351F00150CECF8091A5008DB98091EA +:1007B000A2008EB90023B1F781E01F910F91089537 +:1007C00080E01F910F910895EF92FF920F931F9376 +:1007D0007B018C01862F8170880F880F880FE09134 +:1007E000A300F091A40080620995D801C70129E017 +:1007F000B695A795979587952A95D1F7E091A3008F +:10080000F091A400099516950795F794E794E09167 +:10081000A300F091A4008E2D0995E091A300F09122 +:10082000A40080E009951F910F91FF90EF9008952B +:100830000F931F938C01E091A300F091A40080EA34 +:100840000995E091A300F091A400812F0995E09112 +:10085000A300F091A400802F0995E091A300F091EE +:10086000A40080E009951F910F910895FF920F93C6 +:100870001F938C01F62EE091A300F091A40080EC70 +:100880000995E091A300F091A400812F0995E091D2 +:10089000A300F091A400802F0995E091A300F091AE +:1008A000A4008F2D09958EE1B7D080E01F910F91A4 +:1008B000FF900895CF92DF92EF92FF920F931F93D4 +:1008C0006B017C01142FE091A300F091A4008CE453 +:1008D0000995D701C60149E0B695A79597958795E3 +:1008E0004A95D1F7E091A300F091A4000995D701B2 +:1008F000C601B695A79597958795E091A300F091CD +:10090000A4000995E091A300F091A40080E009956E +:100910001F3FF1F012B70EE1C701B60155DF8F3F5F +:1009200079F482B7811B8D33B8F312B70150A1F768 +:1009300081E01F910F91FF90EF90DF90CF9008958D +:1009400080E01F910F91FF90EF90DF90CF9008957E +:100950008FE062D080E01F910F91FF90EF90DF90C9 +:10096000CF900895CF92DF92EF92FF920F931F9353 +:100970006B017C01042F122F862F8170880F880F46 +:10098000880FE091A300F091A40080640995D7013D +:10099000C60169E0B695A795979587956A95D1F7B1 +:1009A000E091A300F091A4000995D701C601B69586 +:1009B000A79597958795E091A300F091A4000995DC +:1009C000E091A300F091A400802F09951123C1F0BC +:1009D0000F37F1F012B70EE1C701B601F5DE8F3720 +:1009E00079F482B7811B8D33B8F312B70150A1F7A8 +:1009F00081E01F910F91FF90EF90DF90CF900895CD +:100A000080E01F910F91FF90EF90DF90CF900895BD +:100A10008FE002D080E0F5CF382F882349F020E026 +:100A200092B782B7891B8C33E0F32F5F2317C0F393 +:100A3000089512BA18BA8BEF81BB8FEF87BB17BA34 +:100A400093E094BB8EEF85BB93BF32DB789437DBAA +:100A500036DBFDCFFF920F931F93CF93DF93F82EDA +:100A6000292F062F40916300413051F0443041F06E +:100A70001FEF812FDF91CF911F910F91FF9008956C +:100A8000002309F487C08F2D922F9C01E90110E00B +:100A900053C08091740090917500892B09F058C063 +:100AA000609170007091710080917200909173005C +:100AB00021E0488157DF80916400909165000197A3 +:100AC0009093650080936400892BD9F410926300A1 +:100AD0008091760081FF3AC08091770090E020916C +:100AE0007400309175008217930781F16091700056 +:100AF0007091710080917200909173004881DADEEC +:100B000011E08091700090917100A0917200B091FD +:100B100073000196A11DB11D809370009093710028 +:100B2000A0937200B093730021969E012F19201795 +:100B300008F09FCF40916300413009F4AACF68814B +:100B4000809170009091710091DEB5CF11E0D9CF06 +:100B500060917000709171008091720090917300AB +:100B600020E04881FFDE80917700815080937700FC +:100B7000882309F0A0CF609170007091710080917E +:100B8000720090917300488195DE8091740080938B +:100B9000770091CF10E06DCF0F931F93CF93DF932A +:100BA000082F162F40916300842F8250823038F036 +:100BB0001FEF812FDF91CF911F910F910895662331 +:100BC00099F1802F9C01E90120C0809170009091E3 +:100BD00071002EDE88838091700090917100A09149 +:100BE0007200B09173000196A11DB11D8093700039 +:100BF00090937100A0937200B093730021969E01B0 +:100C0000201B211778F4409163004230F1F6609187 +:100C10007000709171008091720090917300D4DD2A +:100C20008883D9CF183028F610926300812FDF9186 +:100C3000CF911F910F9108950F931F93CF93DF933F +:100C40008C01EC0189818130F1F0823009F4B0C06F +:100C5000833031F1843009F482C0873009F456C002 +:100C6000853009F41EC1863009F4D7C0883009F4F4 +:100C7000A5C0893009F41CC18A3009F42DC180E077 +:100C8000C8E6D0E037C09A9B3EC08091660094DCF5 +:100C900010926700A998FFDC80E0C8E6D0E02AC087 +:100CA000E091A300F091A400E8018A810995C8E6CB +:100CB000D0E0809368002091A3003091A400F80157 +:100CC0008381F9010995809369002091A3003091F7 +:100CD000A400F8018481F901099580936A002091AC +:100CE000A3003091A400F8018581F9010995809352 +:100CF0006B0084E0D0938700C0938600DF91CF9192 +:100D00001F910F91089585E057DCC2CF8091670055 +:100D1000882399F4E8019B8180E02A8130E0822BCE +:100D2000932BAA2797FDA095BA2F809370009093DC +:100D30007100A0937200B0937300F801978180E076 +:100D4000268130E0822B932B909365008093640082 +:100D500083E0809363008FEFC8E6D0E0CBCF809133 +:100D60006700882399F4E8019B8180E02A8130E0C4 +:100D7000822B932BAA2797FDA095BA2F8093700002 +:100D800090937100A0937200B0937300F801978163 +:100D900080E0268130E0822B932B90936500809336 +:100DA000640082E0809363008FEFC8E6D0E0A2CFBA +:100DB00094DCA99A80E0C8E6D0E09CCF80916700DF +:100DC000882399F4F801938180E0228130E0822B1E +:100DD000932BAA2797FDA095BA2F8093700090932C +:100DE0007100A0937200B09373001092750010927E +:100DF000740010927600E8019F8180E02E8130E03F +:100E0000822B932B909365008093640084E0809301 +:100E100063008FEFC8E6D0E06DCF80916700882334 +:100E200099F4E8019B8180E02A8130E0822B932BAA +:100E3000AA2797FDA095BA2F809370009093710018 +:100E4000A0937200B0937300F80184819581292FDB +:100E50002F7020937600492F50E0407F50704295CC +:100E60005295507F5427407F5427480F511D50936F +:100E700075004093740020FF02C040937700E801A2 +:100E80009F8180E02E8130E0822B932B9093650030 +:100E90008093640081E0809363008FEFC8E6D0E028 +:100EA00029CF49DCC8E6D0E08093680081E022CFFA +:100EB00081E080936700F80182819381A481B581EC +:100EC0008093700090937100A0937200B0937300B0 +:100ED00080E0C8E6D0E00ECFE8018A81809366000A +:100EE000C8E6D0E01092680081E004CFF894FFCF0C +:020EF0005AFFA7 +:00000001FF diff --git a/bin/win-driver/Readme.txt b/bin/win-driver/Readme.txt new file mode 100644 index 000000000..37170d791 --- /dev/null +++ b/bin/win-driver/Readme.txt @@ -0,0 +1,2 @@ +With WinAVR version 20080512 or greater, please use libusb_0.1.12.1. +Use libusb_0.1.10.1 with older WinAVR versions. diff --git a/bin/win-driver/libusb0.dll b/bin/win-driver/libusb_0.1.10.1/libusb0.dll similarity index 100% rename from bin/win-driver/libusb0.dll rename to bin/win-driver/libusb_0.1.10.1/libusb0.dll diff --git a/bin/win-driver/libusb0.sys b/bin/win-driver/libusb_0.1.10.1/libusb0.sys similarity index 100% rename from bin/win-driver/libusb0.sys rename to bin/win-driver/libusb_0.1.10.1/libusb0.sys diff --git a/bin/win-driver/usbasp.inf b/bin/win-driver/libusb_0.1.10.1/usbasp.inf similarity index 100% rename from bin/win-driver/usbasp.inf rename to bin/win-driver/libusb_0.1.10.1/usbasp.inf diff --git a/bin/win-driver/libusb_0.1.12.1/libusb0.dll b/bin/win-driver/libusb_0.1.12.1/libusb0.dll new file mode 100755 index 0000000000000000000000000000000000000000..9387bedad1d4ec91bfb903486d1ed37abccab63e GIT binary patch literal 43520 zcmeIb3w)Ht)j$3utP(J=5rf8xy4s+i1b34SxracqTq-w#09IniWdo@piM!8oQNZA4 zmF?p~s$gv^7QFPe)we~9xCsaWQbLsaMoKLTDk9crO{x(n;-%#GJ!hV0Zv^%2@Am)v z{;p1*XJ*cvIp@roGiT1sE>nNpB=wUd$$-?`D@lGl=~KXezxhuCss~@&GFaL=;Lq3j zW2XH1y4j1Wou+z6-9ks%VpBy~ZEc-wDz}>)u3A%dt*L1GEYsq;O8e+Rg9avRsAt$D zX-Z6-ROj!-oA?})2LJGqnAl9I3i;n45pfAxYQR%kP|NvPQ5Ay{0udkNknyjHVZJ2E zB-&B~!hsJzS|#b~i;(G*q|AYM9+RXd5=8W;N0O2V?tk%Tv}|7{1LvVi{2_vf*ANrP zfJ^*8y0T0z!}}JhYe2df=_g2Gp8`p09qkZ+^}|rngmev3JyO`G0K+=E-07qu=5 zhO^hy0gz?hgG%c6=`bL?7D&?g$dd1K|E>gzy&uk^TsEu7p0?gAHW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z&io5=v-zLqL`$+|Ds-aGveELY-Z6n2*Pt8uRs-i!ugh{2(JG<98W>414B*%-+nztVtO8`?J<%jmw^% zy*hh+_O!9}V?AR}6AcRxSHa_Y^BmCd1jh8B`JDN3i^X!Mr4}=x#d657HDi3Qv8G#X);jC2tS!*7_tU42`Q4az#so5MhRj!FuFhPa`RmMcnIp1_Felb! z9nGrEemJ`;`gX`cI*pdo5vm)`^MNW z$HK5no51r$<^=Oq<{QiwbFR6_JPj8{?l*5RZ!|vx861Z_h{gQ8-jZq=Zh-CqspC^;rk1BVQtwZFIQ7ZY7gP779!x!+dNMUOZAjYn zX{l-B(`KfXr#aH@PkT7+$+Q>K_M{!eIG#+4wGOdfZ%wt1x6ZVdTOHQ>tq)tDw6!Hby zXK%`WI{VpdViMC;%FQUqD9V_WF(qS0#_WuF8S^t1WK?D>%Babx&yX{gWvs|($Y{&} J;QvoP{{uEZBLe^c literal 0 HcmV?d00001 diff --git a/bin/win-driver/libusb_0.1.12.1/libusb0.sys b/bin/win-driver/libusb_0.1.12.1/libusb0.sys new file mode 100755 index 0000000000000000000000000000000000000000..0a02d3ee3319b77949c890c206b02c824007bb49 GIT binary patch literal 28672 zcmeHw4|r77weLwX$Up~Y#Guhe8DOwj1I;88k{Lo6k_-?H5J?6RiTOJrQ$rFbXF^bd z!AUg7<7jRxYAag&b6Z-ueQJ3a@LwR5NNal$eHE47QcHElq#FNRL`8FdYwvSr&P)=d z-+S--`rX@U&&=6tueJ8tYp=cb+G}sa^0hrek{}2=JR>85(2HOCINA5vzdBHT{`7t4 z3%e)%ZbolH@$Y7o)q7ja&Az7fzN!u8nySXeCed8&G5h?DW^bdpaAm1^LsPA1-jpem zEeh)rmmm};=!K2FBY5MV6T1mS8b>=1-AMEn%`PKt>C^a(=4Snznfzq33~^t6ef z+2Oz!2}FI3bOP`Am<6G7UTu|Fg?A=%30~0W_`z`sLf;>q4z*i}NAqzKKQG5)I^2QE^YB#T(R`dtz7}5%U`)qP z;f4BIk4N)y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Rmm)qc{hbEG=vIv#L5>3G&5EVyXFwF~MNv@W=J!NUulSkS*FGJ? zOVbafznA`5dXm**EwHY&-faD~^&RU)8CPZ8oY9@}c*Y-~>(4SS%dE_7%)B>qAI3S; zw%&Ho_L{9YYh6|YdhmIcasK7=Cug^1cV^#}{b2U4?4j(Bvkf`UoFzHcIli3RbAFKX zSk5y!2Xc<)yp!{BPNIFPeWpFbo^M}eueST_x7&YUf6V@j{eb~G}?a$l$><8^H+h4IC!FV3C zAGe=?#zOWX`>_2}`)T_byWr3{^bUi=<}Goj?In^N2jCPakrz#ai8Ns$9BgK#}kg7j$MwY9J?L8 zj^`bHj)RVu9j`c!I9_)ga~yY^aGZ45@^bQW^PG8w7=z-xlDx9KHF@juD)Vad>hl`% cn)AfGw!F=G9eJI3-LR`3?#|G|f2_}c0qd(7^8f$< literal 0 HcmV?d00001 diff --git a/bin/win-driver/libusb_0.1.12.1/libusb0_x64.dll b/bin/win-driver/libusb_0.1.12.1/libusb0_x64.dll new file mode 100755 index 0000000000000000000000000000000000000000..c89a59fe38b5cd1a9470b75deccb26b552ac1c7e GIT binary patch literal 43008 zcmeIb33yaR)<0aG1;P?KAgzfKX(ULL#U=?52uL?{@J2ciNmx{zq)B&3hLE(qAShy> z6Q#YhqT(_$j^o0pGsCzb!!{~mkwrlPQBYiP8Ry1^8C*uAjQ00CRdu^N5OL=Hp6~xW z-}8SPZlAh!t4^Id=hUfls;YBKuUo~E8DlB9qEW^+0n*3HzklY-z*w*TTY9ne-S!XI zWN_>sP*GdwGkd&^^SsUl=4xj{L!;k3*KPI&8q9SKX8W{q^MXc~dw6YicGbnAPFOg1S ztP7HKr83;`510aGF8GRZz6#Fb0k2C1WFmGia~@_aJC(6hXmb%2JI>fcB$xw?m634t z&nde=1>L3Aao5jD$~0xLU%c64pvM zTf&JF7D#xhgx@@*_guh54+=P2!hQ1jS_xN6*d*Z`3GEV^B}|j>ONr+L33o}jM#7a6 z>Qo$-{QX!$J%6e!XP3|{VIK**N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al 0 HcmV?d00001 diff --git a/bin/win-driver/libusb_0.1.12.1/testlibusb-win.exe b/bin/win-driver/libusb_0.1.12.1/testlibusb-win.exe new file mode 100755 index 0000000000000000000000000000000000000000..a0c3e31775db4ad6b4e364c94bb06482d886c86c GIT binary patch literal 13824 zcmeHN4|G%4dA~A($izlUVyA9v+85U}(1UFW2!{}h$jBl<3^>>Z5^!w&dA8Nck|sTY zosq;;))}uaYTOgpIBR=`Lb|b?Y@<6A3?YdE^cZi+=24ol6HZ4?lTMDkmUfIfDUJ5~ z?t4#?MY`^++fH|ui|@Pl`~ThVe)rFNXwzdOYz|}0h?>nZHj0*tgFpY{#}LR1K6`or zJ6`(6J)?$}H|}Zg^GAhnB-9&m_X}QkFc^{qk0?Z9LBSssnzytG{UM)NUtT`HR#V;T zVywk5kA+9G=&9u@Gtar*P_l}B3h*-262?aEL~B8{qLO#i2cG;kpi;}r5S{>@RyY}e zpz@Lc$)ISB3Uo7ea~`^3#tu;Xzf|faaX^ACUlktY5RElA2=r09@mKG2OK$XA31LOW znAv9t$QK7=>H3Jum?j-SFdB=1T2LII)O(^)LUmKnxKe^yD&P$SC3jy9N;SeKkoh(MW91|H$Gh@cg`psCfi$b?50v;yP+`q*Dz;$ zoc1J|$j($V&dAf9XN}B$ z04k)jdp6piqt5Z!)Din!!tS&$L=*ci6jA=#ZpadBbZa)g2pfN@tgkWj2zOVnSsxl3m;~)Bgx}@cj5U+blT@M`q4tVQf~6Vk9Rw>ZzrYC zvks+v20A!Af&%%@$?XU=0VwKxR3tmglyWNupi~Mpj0;O9?AbYtJ=Ku15WK6l%rJo^ z0N-gEP7{sic?$+&m`gJ8^A$Tg&n5TKE=}WA1u@q5??T$8rGMHtmkbbDHFAVBPraZG zET13Sx3%q?-i7gV4UiK%jcvmilYpU zSQMuTO_|~}qA@9Rpha+COz<)DON35wR;z4PDq96-b6UXHsPlave1LZW&Wxj<8HN=( z@eaDQP+q1%aYz|5VP;@IaTPT4@KFRxIY@l*vnKiAd32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N-0S~SJ3+*+=ygGS8=Y(8CBqW7eLs+Ik^H0$7*SEbXBzXe$Vz6EM+}g>@2|>e6 zU8mO>3by&%V-b(!4+Zb^1Y#6y&7OY>&9F!`CJ5fo<&Q5=%dsF(`a;{aND@J7BwJRs ze6vs?@R1pW+>w=4UKgzsyM*tS`LOgTM50^(e`OE^XDAl%1s6&}M8x(HyF|e!Mq4BP zuoQ|!xu^iS z%|^7mTv$*eR1xRbyESc_^lvj(rUKrXgX;#)=3(s79NcN(76bQXtsAsnl0knKJ&k?_ z{eAQ?^oizWtPs5veG&Q!bfay?yaT-({Q>kR(D$JqKtGCp68%l|_t8hu&!aQ=Rfs+p z-A+ED8|~}n(`76c^}1UFp{U4a@_Cy-=yQ8x(Wn?@9yV(d=M%g9tw6Fuj%ybsgAIJP z30xE>EZFXj`a8n`5r0l3{r;d|qCeZwJQNm#hzp-bp~EM7W9|5V6_i-o$+e6<&RpGo z355*S=#PZYu{H2XBfdRl$K&sZ1t_r1!46N*7Z81}?p85OHEE5X>Mvv$GPfI^c6$6l zPozD{RsjyX-D0rI9|^&an>DzN{vJ#@Y5+`LdBS10v?I)MA?8Lc79&^!+riweBD^Es z40HQK$oE|)cPOYMdrc&+Y5Rl8-4zXn5e})1_)7{r-Vn5u7T{jcb=*>bn+H}R1)ZKi zAjEgdJq4X&C$x~vu7XMV`wPM`2?6OVi2B=uo&eF=woCT_F3YI5s?rw-uwwA$_uE_> dH@NDTE#(YQwFo@_joumUYK=&SRw({A?O$|HF5CbB literal 0 HcmV?d00001 diff --git a/bin/win-driver/libusb_0.1.12.1/usbasp.cat b/bin/win-driver/libusb_0.1.12.1/usbasp.cat new file mode 100644 index 000000000..d40149030 --- /dev/null +++ b/bin/win-driver/libusb_0.1.12.1/usbasp.cat @@ -0,0 +1,3 @@ +This file will contain the digital signature of the files to be installed +on the system. +This file will be provided by Microsoft upon certification of your drivers. diff --git a/bin/win-driver/libusb_0.1.12.1/usbasp.inf b/bin/win-driver/libusb_0.1.12.1/usbasp.inf new file mode 100644 index 000000000..54d1973bd --- /dev/null +++ b/bin/win-driver/libusb_0.1.12.1/usbasp.inf @@ -0,0 +1,136 @@ +[Version] +Signature = "$Chicago$" +provider = %manufacturer% +DriverVer = 03/20/2007,0.1.12.1 +CatalogFile = usbasp.cat +CatalogFile.NT = usbasp.cat +CatalogFile.NTAMD64 = usbasp_x64.cat + +Class = LibUsbDevices +ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567} + +[ClassInstall] +AddReg=libusb_class_install_add_reg + +[ClassInstall32] +AddReg=libusb_class_install_add_reg + +[libusb_class_install_add_reg] +HKR,,,,"LibUSB-Win32 Devices" +HKR,,Icon,,"-20" + +[Manufacturer] +%manufacturer%=Devices,NT,NTAMD64 + +;-------------------------------------------------------------------------- +; Files +;-------------------------------------------------------------------------- + +[SourceDisksNames] +1 = "Libusb-Win32 Driver Installation Disk",, + +[SourceDisksFiles] +libusb0.sys = 1,, +libusb0.dll = 1,, +libusb0_x64.sys = 1,, +libusb0_x64.dll = 1,, + +[DestinationDirs] +libusb_files_sys = 10,system32\drivers +libusb_files_sys_x64 = 10,system32\drivers +libusb_files_dll = 10,system32 +libusb_files_dll_wow64 = 10,syswow64 +libusb_files_dll_x64 = 10,system32 + +[libusb_files_sys] +libusb0.sys + +[libusb_files_sys_x64] +libusb0.sys,libusb0_x64.sys + +[libusb_files_dll] +libusb0.dll + +[libusb_files_dll_wow64] +libusb0.dll + +[libusb_files_dll_x64] +libusb0.dll,libusb0_x64.dll + +;-------------------------------------------------------------------------- +; Device driver +;-------------------------------------------------------------------------- + +[LIBUSB_DEV] +CopyFiles = libusb_files_sys, libusb_files_dll +AddReg = libusb_add_reg + +[LIBUSB_DEV.NT] +CopyFiles = libusb_files_sys, libusb_files_dll + +[LIBUSB_DEV.NTAMD64] +CopyFiles = libusb_files_sys_x64, libusb_files_dll_wow64, libusb_files_dll_x64 + +[LIBUSB_DEV.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NT.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NTAMD64.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NT.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[LIBUSB_DEV.NTAMD64.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[libusb_add_reg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,libusb0.sys + +; Older versions of this .inf file installed filter drivers. They are not +; needed any more and must be removed +[libusb_del_reg_hw] +HKR,,LowerFilters +HKR,,UpperFilters + +; Device properties +[libusb_add_reg_hw] +HKR,,SurpriseRemovalOK, 0x00010001, 1 + +;-------------------------------------------------------------------------- +; Services +;-------------------------------------------------------------------------- + +[libusb_add_service] +DisplayName = "LibUsb-Win32 - Kernel Driver 03/20/2007, 0.1.12.1" +ServiceType = 1 +StartType = 3 +ErrorControl = 0 +ServiceBinary = %12%\libusb0.sys + +;-------------------------------------------------------------------------- +; Devices +;-------------------------------------------------------------------------- + +[Devices] +"USBasp"=LIBUSB_DEV, USB\VID_16c0&PID_05dc + +[Devices.NT] +"USBasp"=LIBUSB_DEV, USB\VID_16c0&PID_05dc + +[Devices.NTAMD64] +"USBasp"=LIBUSB_DEV, USB\VID_16c0&PID_05dc + + +;-------------------------------------------------------------------------- +; Strings +;-------------------------------------------------------------------------- + +[Strings] +manufacturer = "www.fischl.de" diff --git a/bin/win-driver/libusb_0.1.12.1/usbasp_x64.cat b/bin/win-driver/libusb_0.1.12.1/usbasp_x64.cat new file mode 100644 index 000000000..d40149030 --- /dev/null +++ b/bin/win-driver/libusb_0.1.12.1/usbasp_x64.cat @@ -0,0 +1,3 @@ +This file will contain the digital signature of the files to be installed +on the system. +This file will be provided by Microsoft upon certification of your drivers. diff --git a/firmware/clock.c b/firmware/clock.c index 52138e534..3b90a68ae 100644 --- a/firmware/clock.c +++ b/firmware/clock.c @@ -1,12 +1,12 @@ /* - clock.c - part of USBasp - - Autor..........: Thomas Fischl - Description....: Provides functions for timing/waiting - Licence........: GNU GPL v2 (see Readme.txt) - Creation Date..: 2005-02-23 - Last change....: 2005-04-20 -*/ + * clock.c - part of USBasp + * + * Autor..........: Thomas Fischl + * Description....: Provides functions for timing/waiting + * Licence........: GNU GPL v2 (see Readme.txt) + * Creation Date..: 2005-02-23 + * Last change....: 2005-04-20 + */ #include #include @@ -15,9 +15,10 @@ /* wait time * 320 us */ void clockWait(uint8_t time) { - uint8_t i; - for (i = 0; i < time; i++) { - uint8_t starttime = TIMERVALUE; - while ((uint8_t) (TIMERVALUE - starttime) < CLOCK_T_320us) {} - } + uint8_t i; + for (i = 0; i < time; i++) { + uint8_t starttime = TIMERVALUE; + while ((uint8_t) (TIMERVALUE - starttime) < CLOCK_T_320us) { + } + } } diff --git a/firmware/clock.h b/firmware/clock.h index 405fe2fe7..0183297a5 100644 --- a/firmware/clock.h +++ b/firmware/clock.h @@ -1,12 +1,12 @@ /* - clock.h - part of USBasp - - Autor..........: Thomas Fischl - Description....: Provides functions for timing/waiting - Licence........: GNU GPL v2 (see Readme.txt) - Creation Date..: 2005-02-23 - Last change....: 2006-11-16 -*/ + * clock.h - part of USBasp + * + * Autor..........: Thomas Fischl + * Description....: Provides functions for timing/waiting + * Licence........: GNU GPL v2 (see Readme.txt) + * Creation Date..: 2005-02-23 + * Last change....: 2006-11-16 + */ #ifndef __clock_h_included__ #define __clock_h_included__ diff --git a/firmware/isp.c b/firmware/isp.c index 5153c8eb4..6305aacab 100644 --- a/firmware/isp.c +++ b/firmware/isp.c @@ -1,274 +1,304 @@ /* - isp.c - part of USBasp - - Autor..........: Thomas Fischl - Description....: Provides functions for communication/programming - over ISP interface - Licence........: GNU GPL v2 (see Readme.txt) - Creation Date..: 2005-02-23 - Last change....: 2007-07-23 -*/ + * isp.c - part of USBasp + * + * Autor..........: Thomas Fischl + * Description....: Provides functions for communication/programming + * over ISP interface + * Licence........: GNU GPL v2 (see Readme.txt) + * Creation Date..: 2005-02-23 + * Last change....: 2009-02-28 + */ #include #include "isp.h" #include "clock.h" +#include "usbasp.h" #define spiHWdisable() SPCR = 0 -void spiHWenable() { +uchar sck_sw_delay; +uchar sck_spcr; +uchar sck_spsr; - /* enable SPI, master, 375kHz SCK */ - SPCR = (1 << SPE) | (1 << MSTR) | (1 << SPR1); - SPSR = (1 << SPI2X); +void spiHWenable() { + SPCR = sck_spcr; + SPSR = sck_spsr; } void ispSetSCKOption(uchar option) { - if (option == 0) { - - /* use software spi */ - ispTransmit = ispTransmit_sw; - // spiHWdisable(); - - } else { - - /* use hardware spi */ - ispTransmit = ispTransmit_hw; - - } + if (option == USBASP_ISP_SCK_AUTO) + option = USBASP_ISP_SCK_375; + + if (option >= USBASP_ISP_SCK_93_75) { + ispTransmit = ispTransmit_hw; + sck_spsr = 0; + + switch (option) { + + case USBASP_ISP_SCK_1500: + /* enable SPI, master, 1.5MHz, XTAL/8 */ + sck_spcr = (1 << SPE) | (1 << MSTR) | (1 << SPR0); + sck_spsr = (1 << SPI2X); + case USBASP_ISP_SCK_750: + /* enable SPI, master, 750kHz, XTAL/16 */ + sck_spcr = (1 << SPE) | (1 << MSTR) | (1 << SPR0); + break; + case USBASP_ISP_SCK_375: + default: + /* enable SPI, master, 375kHz, XTAL/32 (default) */ + sck_spcr = (1 << SPE) | (1 << MSTR) | (1 << SPR1); + sck_spsr = (1 << SPI2X); + break; + case USBASP_ISP_SCK_187_5: + /* enable SPI, master, 187.5kHz XTAL/64 */ + sck_spcr = (1 << SPE) | (1 << MSTR) | (1 << SPR1); + break; + case USBASP_ISP_SCK_93_75: + /* enable SPI, master, 93.75kHz XTAL/128 */ + sck_spcr = (1 << SPE) | (1 << MSTR) | (1 << SPR1) | (1 << SPR0); + break; + } + + } else { + ispTransmit = ispTransmit_sw; + switch (option) { + + case USBASP_ISP_SCK_32: + sck_sw_delay = 3; + + break; + case USBASP_ISP_SCK_16: + sck_sw_delay = 6; + + break; + case USBASP_ISP_SCK_8: + sck_sw_delay = 12; + + break; + case USBASP_ISP_SCK_4: + sck_sw_delay = 24; + + break; + case USBASP_ISP_SCK_2: + sck_sw_delay = 48; + + break; + case USBASP_ISP_SCK_1: + sck_sw_delay = 96; + + break; + case USBASP_ISP_SCK_0_5: + sck_sw_delay = 192; + + break; + } + } } void ispDelay() { - uint8_t starttime = TIMERVALUE; - while ((uint8_t) (TIMERVALUE - starttime) < 12) { } + uint8_t starttime = TIMERVALUE; + while ((uint8_t) (TIMERVALUE - starttime) < sck_sw_delay) { + } } void ispConnect() { - /* all ISP pins are inputs before */ - /* now set output pins */ - ISP_DDR |= (1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI); + /* all ISP pins are inputs before */ + /* now set output pins */ + ISP_DDR |= (1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI); - /* reset device */ - ISP_OUT &= ~(1 << ISP_RST); /* RST low */ - ISP_OUT &= ~(1 << ISP_SCK); /* SCK low */ + /* reset device */ + ISP_OUT &= ~(1 << ISP_RST); /* RST low */ + ISP_OUT &= ~(1 << ISP_SCK); /* SCK low */ - /* positive reset pulse > 2 SCK (target) */ - ispDelay(); - ISP_OUT |= (1 << ISP_RST); /* RST high */ - ispDelay(); - ISP_OUT &= ~(1 << ISP_RST); /* RST low */ + /* positive reset pulse > 2 SCK (target) */ + ispDelay(); + ISP_OUT |= (1 << ISP_RST); /* RST high */ + ispDelay(); + ISP_OUT &= ~(1 << ISP_RST); /* RST low */ - if (ispTransmit == ispTransmit_hw) { - spiHWenable(); - } + if (ispTransmit == ispTransmit_hw) { + spiHWenable(); + } } void ispDisconnect() { - /* set all ISP pins inputs */ - ISP_DDR &= ~((1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI)); - /* switch pullups off */ - ISP_OUT &= ~((1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI)); + /* set all ISP pins inputs */ + ISP_DDR &= ~((1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI)); + /* switch pullups off */ + ISP_OUT &= ~((1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI)); - /* disable hardware SPI */ - spiHWdisable(); + /* disable hardware SPI */ + spiHWdisable(); } uchar ispTransmit_sw(uchar send_byte) { - uchar rec_byte = 0; - uchar i; - for (i = 0; i < 8; i++) { - - /* set MSB to MOSI-pin */ - if ((send_byte & 0x80) != 0) { - ISP_OUT |= (1 << ISP_MOSI); /* MOSI high */ - } else { - ISP_OUT &= ~(1 << ISP_MOSI); /* MOSI low */ - } - /* shift to next bit */ - send_byte = send_byte << 1; - - /* receive data */ - rec_byte = rec_byte << 1; - if ((ISP_IN & (1 << ISP_MISO)) != 0) { - rec_byte++; - } - - /* pulse SCK */ - ISP_OUT |= (1 << ISP_SCK); /* SCK high */ - ispDelay(); - ISP_OUT &= ~(1 << ISP_SCK); /* SCK low */ - ispDelay(); - } - - return rec_byte; + uchar rec_byte = 0; + uchar i; + for (i = 0; i < 8; i++) { + + /* set MSB to MOSI-pin */ + if ((send_byte & 0x80) != 0) { + ISP_OUT |= (1 << ISP_MOSI); /* MOSI high */ + } else { + ISP_OUT &= ~(1 << ISP_MOSI); /* MOSI low */ + } + /* shift to next bit */ + send_byte = send_byte << 1; + + /* receive data */ + rec_byte = rec_byte << 1; + if ((ISP_IN & (1 << ISP_MISO)) != 0) { + rec_byte++; + } + + /* pulse SCK */ + ISP_OUT |= (1 << ISP_SCK); /* SCK high */ + ispDelay(); + ISP_OUT &= ~(1 << ISP_SCK); /* SCK low */ + ispDelay(); + } + + return rec_byte; } uchar ispTransmit_hw(uchar send_byte) { - SPDR = send_byte; + SPDR = send_byte; - while (!(SPSR & (1 << SPIF))); - return SPDR; + while (!(SPSR & (1 << SPIF))) + ; + return SPDR; } uchar ispEnterProgrammingMode() { - uchar check; - uchar count = 32; + uchar check; + uchar count = 32; - while (count--) { - ispTransmit(0xAC); - ispTransmit(0x53); - check = ispTransmit(0); - ispTransmit(0); + while (count--) { + ispTransmit(0xAC); + ispTransmit(0x53); + check = ispTransmit(0); + ispTransmit(0); - if (check == 0x53) { - return 0; - } + if (check == 0x53) { + return 0; + } - spiHWdisable(); + spiHWdisable(); - /* pulse SCK */ - ISP_OUT |= (1 << ISP_SCK); /* SCK high */ - ispDelay(); - ISP_OUT &= ~(1 << ISP_SCK); /* SCK low */ - ispDelay(); + /* pulse SCK */ + ISP_OUT |= (1 << ISP_SCK); /* SCK high */ + ispDelay(); + ISP_OUT &= ~(1 << ISP_SCK); /* SCK low */ + ispDelay(); - if (ispTransmit == ispTransmit_hw) { - spiHWenable(); - } + if (ispTransmit == ispTransmit_hw) { + spiHWenable(); + } - } + } - return 1; /* error: device dosn't answer */ + return 1; /* error: device dosn't answer */ } uchar ispReadFlash(unsigned long address) { - ispTransmit(0x20 | ((address & 1) << 3)); - ispTransmit(address >> 9); - ispTransmit(address >> 1); - return ispTransmit(0); + ispTransmit(0x20 | ((address & 1) << 3)); + ispTransmit(address >> 9); + ispTransmit(address >> 1); + return ispTransmit(0); } - uchar ispWriteFlash(unsigned long address, uchar data, uchar pollmode) { - /* 0xFF is value after chip erase, so skip programming - if (data == 0xFF) { - return 0; - } - */ - - ispTransmit(0x40 | ((address & 1) << 3)); - ispTransmit(address >> 9); - ispTransmit(address >> 1); - ispTransmit(data); - - if (pollmode == 0) - return 0; - - if (data == 0x7F) { - clockWait(15); /* wait 4,8 ms */ - return 0; - } else { - - /* polling flash */ - uchar retries = 30; - uint8_t starttime = TIMERVALUE; - while (retries != 0) { - if (ispReadFlash(address) != 0x7F) { - return 0; - }; - - if ((uint8_t) (TIMERVALUE - starttime) > CLOCK_T_320us) { - starttime = TIMERVALUE; - retries --; - } - - } - return 1; /* error */ - } + /* 0xFF is value after chip erase, so skip programming + if (data == 0xFF) { + return 0; + } + */ + + ispTransmit(0x40 | ((address & 1) << 3)); + ispTransmit(address >> 9); + ispTransmit(address >> 1); + ispTransmit(data); + + if (pollmode == 0) + return 0; + + if (data == 0x7F) { + clockWait(15); /* wait 4,8 ms */ + return 0; + } else { + + /* polling flash */ + uchar retries = 30; + uint8_t starttime = TIMERVALUE; + while (retries != 0) { + if (ispReadFlash(address) != 0x7F) { + return 0; + }; + + if ((uint8_t) (TIMERVALUE - starttime) > CLOCK_T_320us) { + starttime = TIMERVALUE; + retries--; + } + + } + return 1; /* error */ + } } - uchar ispFlushPage(unsigned long address, uchar pollvalue) { - ispTransmit(0x4C); - ispTransmit(address >> 9); - ispTransmit(address >> 1); - ispTransmit(0); - + ispTransmit(0x4C); + ispTransmit(address >> 9); + ispTransmit(address >> 1); + ispTransmit(0); - if (pollvalue == 0xFF) { - clockWait(15); - return 0; - } else { + if (pollvalue == 0xFF) { + clockWait(15); + return 0; + } else { - /* polling flash */ - uchar retries = 30; - uint8_t starttime = TIMERVALUE; + /* polling flash */ + uchar retries = 30; + uint8_t starttime = TIMERVALUE; - while (retries != 0) { - if (ispReadFlash(address) != 0xFF) { - return 0; - }; + while (retries != 0) { + if (ispReadFlash(address) != 0xFF) { + return 0; + }; - if ((uint8_t) (TIMERVALUE - starttime) > CLOCK_T_320us) { - starttime = TIMERVALUE; - retries --; - } + if ((uint8_t) (TIMERVALUE - starttime) > CLOCK_T_320us) { + starttime = TIMERVALUE; + retries--; + } - } + } - return 1; /* error */ - } + return 1; /* error */ + } } - uchar ispReadEEPROM(unsigned int address) { - ispTransmit(0xA0); - ispTransmit(address >> 8); - ispTransmit(address); - return ispTransmit(0); + ispTransmit(0xA0); + ispTransmit(address >> 8); + ispTransmit(address); + return ispTransmit(0); } - uchar ispWriteEEPROM(unsigned int address, uchar data) { - ispTransmit(0xC0); - ispTransmit(address >> 8); - ispTransmit(address); - ispTransmit(data); + ispTransmit(0xC0); + ispTransmit(address >> 8); + ispTransmit(address); + ispTransmit(data); - clockWait(30); // wait 9,6 ms + clockWait(30); // wait 9,6 ms - return 0; - /* - if (data == 0xFF) { - clockWait(30); // wait 9,6 ms - return 0; - } else { - - // polling eeprom - uchar retries = 30; // about 9,6 ms - uint8_t starttime = TIMERVALUE; - - while (retries != 0) { - if (ispReadEEPROM(address) != 0xFF) { return 0; - }; - - if ((uint8_t) (TIMERVALUE - starttime) > CLOCK_T_320us) { - starttime = TIMERVALUE; - retries --; - } - - } - return 1; // error - } - */ - } diff --git a/firmware/isp.h b/firmware/isp.h index e3862e592..0acbb3d65 100644 --- a/firmware/isp.h +++ b/firmware/isp.h @@ -1,13 +1,13 @@ /* - isp.h - part of USBasp - - Autor..........: Thomas Fischl - Description....: Provides functions for communication/programming - over ISP interface - Licence........: GNU GPL v2 (see Readme.txt) - Creation Date..: 2005-02-23 - Last change....: 2007-07-23 -*/ + * isp.h - part of USBasp + * + * Autor..........: Thomas Fischl + * Description....: Provides functions for communication/programming + * over ISP interface + * Licence........: GNU GPL v2 (see Readme.txt) + * Creation Date..: 2005-02-23 + * Last change....: 2009-02-28 + */ #ifndef __isp_h_included__ #define __isp_h_included__ @@ -24,10 +24,6 @@ #define ISP_MISO PB4 #define ISP_SCK PB5 -#define ISP_DELAY 1 -#define ISP_SCK_SLOW 0 -#define ISP_SCK_FAST 1 - /* Prepare connection to target device */ void ispConnect(); diff --git a/firmware/main.c b/firmware/main.c index af740fcc3..ca65df24f 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -1,53 +1,32 @@ /* - USBasp - USB in-circuit programmer for Atmel AVR controllers - - Thomas Fischl - - License........: GNU GPL v2 (see Readme.txt) - Target.........: ATMega8 at 12 MHz - Creation Date..: 2005-02-20 - Last change....: 2007-07-23 - - PC2 SCK speed option. GND -> slow (8khz SCK), - open -> fast (375kHz SCK) -*/ + * USBasp - USB in-circuit programmer for Atmel AVR controllers + * + * Thomas Fischl + * + * License........: GNU GPL v2 (see Readme.txt) + * Target.........: ATMega8 at 12 MHz + * Creation Date..: 2005-02-20 + * Last change....: 2009-02-28 + * + * PC2 SCK speed option. + * GND -> slow (8khz SCK), + * open -> software set speed (default is 375kHz SCK) + */ #include #include #include #include +#include "usbasp.h" #include "usbdrv.h" #include "isp.h" #include "clock.h" -#define USBASP_FUNC_CONNECT 1 -#define USBASP_FUNC_DISCONNECT 2 -#define USBASP_FUNC_TRANSMIT 3 -#define USBASP_FUNC_READFLASH 4 -#define USBASP_FUNC_ENABLEPROG 5 -#define USBASP_FUNC_WRITEFLASH 6 -#define USBASP_FUNC_READEEPROM 7 -#define USBASP_FUNC_WRITEEEPROM 8 -#define USBASP_FUNC_SETLONGADDRESS 9 - -#define PROG_STATE_IDLE 0 -#define PROG_STATE_WRITEFLASH 1 -#define PROG_STATE_READFLASH 2 -#define PROG_STATE_READEEPROM 3 -#define PROG_STATE_WRITEEEPROM 4 - -#define PROG_BLOCKFLAG_FIRST 1 -#define PROG_BLOCKFLAG_LAST 2 - -#define ledRedOn() PORTC &= ~(1 << PC1) -#define ledRedOff() PORTC |= (1 << PC1) -#define ledGreenOn() PORTC &= ~(1 << PC0) -#define ledGreenOff() PORTC |= (1 << PC0) - static uchar replyBuffer[8]; static uchar prog_state = PROG_STATE_IDLE; +static uchar prog_sck = USBASP_ISP_SCK_AUTO; static uchar prog_address_newmode = 0; static unsigned long prog_address; @@ -56,211 +35,220 @@ static unsigned int prog_pagesize; static uchar prog_blockflags; static uchar prog_pagecounter; - uchar usbFunctionSetup(uchar data[8]) { - uchar len = 0; - - if(data[1] == USBASP_FUNC_CONNECT){ + uchar len = 0; - /* set SCK speed */ - if ((PINC & (1 << PC2)) == 0) { - ispSetSCKOption(ISP_SCK_SLOW); - } else { - ispSetSCKOption(ISP_SCK_FAST); - } + if (data[1] == USBASP_FUNC_CONNECT) { - /* set compatibility mode of address delivering */ - prog_address_newmode = 0; + /* set SCK speed */ + if ((PINC & (1 << PC2)) == 0) { + ispSetSCKOption(USBASP_ISP_SCK_8); + } else { + ispSetSCKOption(prog_sck); + } - ledRedOn(); - ispConnect(); + /* set compatibility mode of address delivering */ + prog_address_newmode = 0; - } else if (data[1] == USBASP_FUNC_DISCONNECT) { - ispDisconnect(); - ledRedOff(); + ledRedOn(); + ispConnect(); - } else if (data[1] == USBASP_FUNC_TRANSMIT) { - replyBuffer[0] = ispTransmit(data[2]); - replyBuffer[1] = ispTransmit(data[3]); - replyBuffer[2] = ispTransmit(data[4]); - replyBuffer[3] = ispTransmit(data[5]); - len = 4; + } else if (data[1] == USBASP_FUNC_DISCONNECT) { + ispDisconnect(); + ledRedOff(); - } else if (data[1] == USBASP_FUNC_READFLASH) { + } else if (data[1] == USBASP_FUNC_TRANSMIT) { + replyBuffer[0] = ispTransmit(data[2]); + replyBuffer[1] = ispTransmit(data[3]); + replyBuffer[2] = ispTransmit(data[4]); + replyBuffer[3] = ispTransmit(data[5]); + len = 4; - if (!prog_address_newmode) - prog_address = (data[3] << 8) | data[2]; + } else if (data[1] == USBASP_FUNC_READFLASH) { - prog_nbytes = (data[7] << 8) | data[6]; - prog_state = PROG_STATE_READFLASH; - len = 0xff; /* multiple in */ + if (!prog_address_newmode) + prog_address = (data[3] << 8) | data[2]; - } else if (data[1] == USBASP_FUNC_READEEPROM) { + prog_nbytes = (data[7] << 8) | data[6]; + prog_state = PROG_STATE_READFLASH; + len = 0xff; /* multiple in */ - if (!prog_address_newmode) - prog_address = (data[3] << 8) | data[2]; + } else if (data[1] == USBASP_FUNC_READEEPROM) { - prog_nbytes = (data[7] << 8) | data[6]; - prog_state = PROG_STATE_READEEPROM; - len = 0xff; /* multiple in */ + if (!prog_address_newmode) + prog_address = (data[3] << 8) | data[2]; - } else if (data[1] == USBASP_FUNC_ENABLEPROG) { - replyBuffer[0] = ispEnterProgrammingMode();; - len = 1; + prog_nbytes = (data[7] << 8) | data[6]; + prog_state = PROG_STATE_READEEPROM; + len = 0xff; /* multiple in */ - } else if (data[1] == USBASP_FUNC_WRITEFLASH) { + } else if (data[1] == USBASP_FUNC_ENABLEPROG) { + replyBuffer[0] = ispEnterProgrammingMode(); + len = 1; - if (!prog_address_newmode) - prog_address = (data[3] << 8) | data[2]; + } else if (data[1] == USBASP_FUNC_WRITEFLASH) { - prog_pagesize = data[4]; - prog_blockflags = data[5] & 0x0F; - prog_pagesize += (((unsigned int)data[5] & 0xF0)<<4); - if (prog_blockflags & PROG_BLOCKFLAG_FIRST) { - prog_pagecounter = prog_pagesize; - } - prog_nbytes = (data[7] << 8) | data[6]; - prog_state = PROG_STATE_WRITEFLASH; - len = 0xff; /* multiple out */ + if (!prog_address_newmode) + prog_address = (data[3] << 8) | data[2]; - } else if (data[1] == USBASP_FUNC_WRITEEEPROM) { + prog_pagesize = data[4]; + prog_blockflags = data[5] & 0x0F; + prog_pagesize += (((unsigned int) data[5] & 0xF0) << 4); + if (prog_blockflags & PROG_BLOCKFLAG_FIRST) { + prog_pagecounter = prog_pagesize; + } + prog_nbytes = (data[7] << 8) | data[6]; + prog_state = PROG_STATE_WRITEFLASH; + len = 0xff; /* multiple out */ - if (!prog_address_newmode) - prog_address = (data[3] << 8) | data[2]; + } else if (data[1] == USBASP_FUNC_WRITEEEPROM) { - prog_pagesize = 0; - prog_blockflags = 0; - prog_nbytes = (data[7] << 8) | data[6]; - prog_state = PROG_STATE_WRITEEEPROM; - len = 0xff; /* multiple out */ + if (!prog_address_newmode) + prog_address = (data[3] << 8) | data[2]; - } else if(data[1] == USBASP_FUNC_SETLONGADDRESS) { + prog_pagesize = 0; + prog_blockflags = 0; + prog_nbytes = (data[7] << 8) | data[6]; + prog_state = PROG_STATE_WRITEEEPROM; + len = 0xff; /* multiple out */ - /* set new mode of address delivering (ignore address delivered in commands) */ - prog_address_newmode = 1; - /* set new address */ - prog_address = *((unsigned long*)&data[2]); - } + } else if (data[1] == USBASP_FUNC_SETLONGADDRESS) { - usbMsgPtr = replyBuffer; + /* set new mode of address delivering (ignore address delivered in commands) */ + prog_address_newmode = 1; + /* set new address */ + prog_address = *((unsigned long*) &data[2]); - return len; -} + } else if (data[1] == USBASP_FUNC_SETISPSCK) { + /* set sck option */ + prog_sck = data[2]; + replyBuffer[0] = 0; + len = 1; + } -uchar usbFunctionRead(uchar *data, uchar len) { + usbMsgPtr = replyBuffer; - uchar i; - - /* check if programmer is in correct read state */ - if ((prog_state != PROG_STATE_READFLASH) && - (prog_state != PROG_STATE_READEEPROM)) { - return 0xff; - } - - /* fill packet */ - for (i = 0; i < len; i++) { - if (prog_state == PROG_STATE_READFLASH) { - data[i] = ispReadFlash(prog_address); - } else { - data[i] = ispReadEEPROM(prog_address); - } - prog_address++; - } - - /* last packet? */ - if (len < 8) { - prog_state = PROG_STATE_IDLE; - } - - return len; + return len; } +uchar usbFunctionRead(uchar *data, uchar len) { -uchar usbFunctionWrite(uchar *data, uchar len) { + uchar i; - uchar retVal = 0; - uchar i; + /* check if programmer is in correct read state */ + if ((prog_state != PROG_STATE_READFLASH) && (prog_state + != PROG_STATE_READEEPROM)) { + return 0xff; + } - /* check if programmer is in correct write state */ - if ((prog_state != PROG_STATE_WRITEFLASH) && - (prog_state != PROG_STATE_WRITEEEPROM)) { - return 0xff; - } + /* fill packet */ + for (i = 0; i < len; i++) { + if (prog_state == PROG_STATE_READFLASH) { + data[i] = ispReadFlash(prog_address); + } else { + data[i] = ispReadEEPROM(prog_address); + } + prog_address++; + } + + /* last packet? */ + if (len < 8) { + prog_state = PROG_STATE_IDLE; + } + return len; +} - for (i = 0; i < len; i++) { +uchar usbFunctionWrite(uchar *data, uchar len) { - if (prog_state == PROG_STATE_WRITEFLASH) { - /* Flash */ + uchar retVal = 0; + uchar i; - if (prog_pagesize == 0) { - /* not paged */ - ispWriteFlash(prog_address, data[i], 1); - } else { - /* paged */ - ispWriteFlash(prog_address, data[i], 0); - prog_pagecounter --; - if (prog_pagecounter == 0) { - ispFlushPage(prog_address, data[i]); - prog_pagecounter = prog_pagesize; + /* check if programmer is in correct write state */ + if ((prog_state != PROG_STATE_WRITEFLASH) && (prog_state + != PROG_STATE_WRITEEEPROM)) { + return 0xff; } - } - } else { - /* EEPROM */ - ispWriteEEPROM(prog_address, data[i]); - } + for (i = 0; i < len; i++) { - prog_nbytes --; + if (prog_state == PROG_STATE_WRITEFLASH) { + /* Flash */ - if (prog_nbytes == 0) { - prog_state = PROG_STATE_IDLE; - if ((prog_blockflags & PROG_BLOCKFLAG_LAST) && - (prog_pagecounter != prog_pagesize)) { + if (prog_pagesize == 0) { + /* not paged */ + ispWriteFlash(prog_address, data[i], 1); + } else { + /* paged */ + ispWriteFlash(prog_address, data[i], 0); + prog_pagecounter--; + if (prog_pagecounter == 0) { + ispFlushPage(prog_address, data[i]); + prog_pagecounter = prog_pagesize; + } + } - /* last block and page flush pending, so flush it now */ - ispFlushPage(prog_address, data[i]); - } + } else { + /* EEPROM */ + ispWriteEEPROM(prog_address, data[i]); + } - retVal = 1; // Need to return 1 when no more data is to be received - } + prog_nbytes--; - prog_address ++; - } + if (prog_nbytes == 0) { + prog_state = PROG_STATE_IDLE; + if ((prog_blockflags & PROG_BLOCKFLAG_LAST) && (prog_pagecounter + != prog_pagesize)) { - return retVal; -} + /* last block and page flush pending, so flush it now */ + ispFlushPage(prog_address, data[i]); + } + retVal = 1; // Need to return 1 when no more data is to be received + } -int main(void) -{ - uchar i, j; - - PORTD = 0; - PORTB = 0; /* no pullups on USB and ISP pins */ - DDRD = ~(1 << 2); /* all outputs except PD2 = INT0 */ + prog_address++; + } - DDRB = ~0; /* output SE0 for USB reset */ - j = 0; - while(--j){ /* USB Reset by device only required on Watchdog Reset */ - i = 0; - while(--i); /* delay >10ms for USB reset */ - } - DDRB = 0; /* all USB and ISP pins inputs */ + return retVal; +} - DDRC = 0x03; /* all inputs except PC0, PC1 */ - PORTC = 0xfe; +int main(void) { + uchar i, j; + + /* no pullups on USB and ISP pins */ + PORTD = 0; + PORTB = 0; + /* all outputs except PD2 = INT0 */ + DDRD = ~(1 << 2); + + /* output SE0 for USB reset */ + DDRB = ~0; + j = 0; + /* USB Reset by device only required on Watchdog Reset */ + while (--j) { + i = 0; + /* delay >10ms for USB reset */ + while (--i) + ; + } + /* all USB and ISP pins inputs */ + DDRB = 0; - clockInit(); /* init timer */ + /* all inputs except PC0, PC1 */ + DDRC = 0x03; + PORTC = 0xfe; - ispSetSCKOption(ISP_SCK_FAST); + /* init timer */ + clockInit(); - usbInit(); - sei(); - for(;;){ /* main event loop */ - usbPoll(); - } - return 0; + /* main event loop */ + usbInit(); + sei(); + for (;;) { + usbPoll(); + } + return 0; } diff --git a/firmware/usbasp.h b/firmware/usbasp.h new file mode 100644 index 000000000..6953e8aa4 --- /dev/null +++ b/firmware/usbasp.h @@ -0,0 +1,58 @@ +/* + * usbasp.c - part of USBasp + * + * Autor..........: Thomas Fischl + * Description....: Definitions and macros for usbasp + * Licence........: GNU GPL v2 (see Readme.txt) + * Creation Date..: 2009-02-28 + * Last change....: 2009-02-28 + */ + +#ifndef USBASP_H_ +#define USBASP_H_ + +/* USB function call identifiers */ +#define USBASP_FUNC_CONNECT 1 +#define USBASP_FUNC_DISCONNECT 2 +#define USBASP_FUNC_TRANSMIT 3 +#define USBASP_FUNC_READFLASH 4 +#define USBASP_FUNC_ENABLEPROG 5 +#define USBASP_FUNC_WRITEFLASH 6 +#define USBASP_FUNC_READEEPROM 7 +#define USBASP_FUNC_WRITEEEPROM 8 +#define USBASP_FUNC_SETLONGADDRESS 9 +#define USBASP_FUNC_SETISPSCK 10 + +/* programming state */ +#define PROG_STATE_IDLE 0 +#define PROG_STATE_WRITEFLASH 1 +#define PROG_STATE_READFLASH 2 +#define PROG_STATE_READEEPROM 3 +#define PROG_STATE_WRITEEEPROM 4 + +/* Block mode flags */ +#define PROG_BLOCKFLAG_FIRST 1 +#define PROG_BLOCKFLAG_LAST 2 + +/* ISP SCK speed identifiers */ +#define USBASP_ISP_SCK_AUTO 0 +#define USBASP_ISP_SCK_0_5 1 /* 500 Hz */ +#define USBASP_ISP_SCK_1 2 /* 1 kHz */ +#define USBASP_ISP_SCK_2 3 /* 2 kHz */ +#define USBASP_ISP_SCK_4 4 /* 4 kHz */ +#define USBASP_ISP_SCK_8 5 /* 8 kHz */ +#define USBASP_ISP_SCK_16 6 /* 16 kHz */ +#define USBASP_ISP_SCK_32 7 /* 32 kHz */ +#define USBASP_ISP_SCK_93_75 8 /* 93.75 kHz */ +#define USBASP_ISP_SCK_187_5 9 /* 187.5 kHz */ +#define USBASP_ISP_SCK_375 10 /* 375 kHz */ +#define USBASP_ISP_SCK_750 11 /* 750 kHz */ +#define USBASP_ISP_SCK_1500 12 /* 1.5 MHz */ + +/* macros for gpio functions */ +#define ledRedOn() PORTC &= ~(1 << PC1) +#define ledRedOff() PORTC |= (1 << PC1) +#define ledGreenOn() PORTC &= ~(1 << PC0) +#define ledGreenOff() PORTC |= (1 << PC0) + +#endif /* USBASP_H_ */ diff --git a/firmware/usbconfig.h b/firmware/usbconfig.h index 7170def9c..e8d0ed9ee 100644 --- a/firmware/usbconfig.h +++ b/firmware/usbconfig.h @@ -124,7 +124,7 @@ the newest features and options. * you use obdev's free shared VID/PID pair. Be sure to read the rules in * USBID-License.txt! */ -#define USB_CFG_DEVICE_VERSION 0x02, 0x01 +#define USB_CFG_DEVICE_VERSION 0x03, 0x01 /* Version number of the device: Minor number first, then major number. */ #define USB_CFG_VENDOR_NAME 'w', 'w', 'w', '.', 'f', 'i', 's', 'c', 'h', 'l', '.', 'd', 'e' diff --git a/firmware/usbdrv/Changelog.txt b/firmware/usbdrv/Changelog.txt index 0e9e8bfaf..cdb6ed300 100644 --- a/firmware/usbdrv/Changelog.txt +++ b/firmware/usbdrv/Changelog.txt @@ -150,3 +150,114 @@ Scroll down to the bottom to see the most recent changes. - 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 diff --git a/firmware/usbdrv/CommercialLicense.txt b/firmware/usbdrv/CommercialLicense.txt index 1e4ae0b5c..9fd040fda 100644 --- a/firmware/usbdrv/CommercialLicense.txt +++ b/firmware/usbdrv/CommercialLicense.txt @@ -1,5 +1,5 @@ AVR-USB Driver Software License Agreement -Version 2006-07-24 +Version 2008-10-07 THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING @@ -13,10 +13,11 @@ Grosse Schiffgasse 1A/7, 1020 Wien, AUSTRIA. 1.2 "You" shall mean the Licensee. -1.3 "AVR-USB" shall mean the firmware-only USB device implementation for -Atmel AVR microcontrollers distributed by OBJECTIVE DEVELOPMENT and -consisting of the files usbdrv.c, usbdrv.h, usbdrvasm.S, oddebug.c, -oddebug.h, usbdrvasm.asm, iarcompat.h and usbconfig-prototype.h. +1.3 "AVR-USB" shall mean all files included in the package distributed under +the name "avrusb" by OBJECTIVE DEVELOPMENT (http://www.obdev.at/avrusb/) +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 @@ -25,11 +26,11 @@ oddebug.h, usbdrvasm.asm, iarcompat.h and usbconfig-prototype.h. code of AVR-USB. 2.2 Distribution and Use. OBJECTIVE DEVELOPMENT grants you the -non-exclusive right to use and distribute AVR-USB with your hardware +non-exclusive right to use, copy and distribute AVR-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 -your copy of AVR-USB according to your needs. +the source code and your copy of AVR-USB according to your needs. 2.4 USB IDs. OBJECTIVE DEVELOPMENT grants you the exclusive rights to use USB Product ID(s) sent to you in e-mail after receiving your payment in diff --git a/firmware/usbdrv/License.txt b/firmware/usbdrv/License.txt index a435e0e9b..e9b2752a3 100644 --- a/firmware/usbdrv/License.txt +++ b/firmware/usbdrv/License.txt @@ -1,6 +1,8 @@ OBJECTIVE DEVELOPMENT GmbH's AVR-USB driver software is distributed under the -terms and conditions of the GNU GPL version 2, see the text below. In addition -to the requirements in the GPL, we STRONGLY ENCOURAGE you to do the following: +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/avrusb/feedback.html for your submission. @@ -74,7 +76,7 @@ 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 @@ -129,7 +131,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -187,7 +189,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -244,7 +246,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -297,7 +299,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest diff --git a/firmware/usbdrv/Readme.txt b/firmware/usbdrv/Readme.txt index debc75682..024af5885 100644 --- a/firmware/usbdrv/Readme.txt +++ b/firmware/usbdrv/Readme.txt @@ -3,8 +3,9 @@ for Atmel AVR microcontrollers. For more information please visit http://www.obdev.at/avrusb/ This directory contains the USB firmware only. Copy it as-is to your own -project and add your own version of "usbconfig.h". A template for your own -"usbconfig.h" can be found in "usbconfig-prototype.h" in this directory. +project and add all .c and .S files to your project (these files are marked +with an asterisk in the list below). Then copy usbconfig-prototype.h as +usbconfig.h to your project and edit it according to your configuration. TECHNICAL DOCUMENTATION @@ -23,19 +24,16 @@ The driver consists of the following files: a stub and includes one of the usbdrvasm*.S files depending on processor clock. Link this module to your code! - usbdrvasm12.S .......... 12 MHz version of the assembler routines. Included - by usbdrvasm.S, don't link it directly! - usbdrvasm16.S .......... 16 MHz version of the assembler routines. Included - by usbdrvasm.S, don't link it directly! - usbdrvasm165.S ......... 16.5 MHz version of the assembler routines including - a PLL so that an 1% accurate RC oscillator can be - used. Included by usbdrvasm.S, don't link directly! + usbdrvasm*.inc ......... Assembler routines for particular clock frequencies. + Included by usbdrvasm.S, don't link it directly! + asmcommon.inc .......... Common assembler routines. Included by + usbdrvasm*.inc, don't link it directly! usbconfig-prototype.h .. Prototype for your own usbdrv.h file. * oddebug.c .............. Debug functions. Only used when DEBUG_LEVEL is defined to a value greater than 0. Link this module to your code! oddebug.h .............. Interface definitions of the debug module. - iarcompat.h ............ Compatibility definitions for IAR C-compiler. + usbportability.h ....... Header with compiler-dependent stuff. usbdrvasm.asm .......... Compatibility stub for IAR-C-compiler. Use this module instead of usbdrvasm.S when you assembler with IAR's tools. @@ -49,14 +47,19 @@ The driver consists of the following files: CPU CORE CLOCK FREQUENCY ======================== -We supply assembler modules for clock frequencies of 12 MHz, 16 MHz and -16.5 MHz. Other clock rates are not supported. The actual clock rate must be -configured in usbdrv.h unless you use the default 12 MHz. +We supply assembler modules for clock frequencies of 12 MHz, 12.8 MHz, 15 MHz, +16 MHz, 16.5 MHz and 20 MHz. Other clock rates are not supported. The actual +clock rate must be configured in usbdrv.h unless you use the default 12 MHz. 12 MHz Clock This is the traditional clock rate of AVR-USB because it's the lowest clock rate where the timing constraints of the USB spec can be met. +15 MHz Clock +Similar to 12 MHz, but some NOPs inserted. On the other hand, the higher clock +rate allows for some loops which make the resulting code size somewhat smaller +than the 12 MHz version. + 16 MHz Clock This clock rate has been added for users of the Arduino board and other ready-made boards which come with a fixed 16 MHz crystal. It's also an option @@ -64,21 +67,23 @@ if you need the slightly higher clock rate for performance reasons. Since 16 MHz is not divisible by the USB low speed bit clock of 1.5 MHz, the code is somewhat tricky and has to insert a leap cycle every third byte. -16.5 MHz Clock -The assembler module for this clock rate differs from the other modules because -it has been built for an RC oscillator with only 1% precision. The receiver -code inserts leap cycles to compensate for clock deviations. 1% is also the -precision which can be achieved by calibrating the internal RC oscillator of -the AVR. Please note that only AVRs with internal 64 MHz PLL oscillator can be -used since the 8 MHz RC oscillator cannot be trimmed up to 16.5 MHz. This -includes the very popular ATTiny25, ATTiny45, ATTiny85 series as well as the -ATTiny26. +12.8 MHz and 16.5 MHz Clock +The assembler modules for these clock rates differ from the other modules +because they have been built for an RC oscillator with only 1% precision. The +receiver code inserts leap cycles to compensate for clock deviations. 1% is +also the precision which can be achieved by calibrating the internal RC +oscillator of the AVR. Please note that only AVRs with internal 64 MHz PLL +oscillator can reach 16.5 MHz with the RC oscillator. This includes the very +popular ATTiny25, ATTiny45, ATTiny85 series as well as the ATTiny26. Almost +all AVRs can reach 12.8 MHz, although this is outside the specified range. + +See the EasyLogger example at http://www.obdev.at/avrusb/easylogger.html for +code which calibrates the RC oscillator based on the USB frame clock. -We recommend that you obtain appropriate calibration values for 16.5 MHz core -clock at programming time and store it in flash or EEPROM or compute the value -from a reference clock at run time. However, since Atmel's 8 MHz calibration -is much more precise than the guaranteed 10%, it's usually possible to add a -fixed offset to this value. +20 MHz Clock +This module is for people who won't do it with less than the maximum. Since +20 MHz is not divisible by the USB low speed bit clock of 1.5 MHz, the code +uses similar tricks as the 16 MHz module to insert leap cycles. USB IDENTIFIERS @@ -88,49 +93,39 @@ are obtained from usb.org for a price of 1,500 USD. Once you have a VID, you can assign PIDs at will. Since an entry level cost of 1,500 USD is too high for most small companies -and hobbyists, we provide a single VID/PID pair for free. If you want to use -your own VID and PID instead of our's, define the macros "USB_CFG_VENDOR_ID" -and "USB_CFG_DEVICE_ID" accordingly in "usbconfig.h". - -To use our predefined VID/PID pair, you MUST conform to a couple of -requirements. See the file "USBID-License.txt" for details. - -Objective Development also has some offerings which include product IDs. See -http://www.obdev.at/avrusb/ for details. - +and hobbyists, we provide some VID/PID pairs for free. See the file +USBID-License.txt for details. -HOST DRIVER -=========== -You have received this driver together with an example device implementation -and an example host driver. The host driver is based on libusb and compiles -on various Unix flavors (Linux, BSD, Mac OS X). It also compiles natively on -Windows using MinGW (see www.mingw.org) and libusb-win32 (see -libusb-win32.sourceforge.net). The "Automator" project contains a native -Windows host driver (not based on libusb) for Human Interface Devices. +Objective Development also has some license offerings which include product +IDs. See http://www.obdev.at/avrusb/ for details. DEVELOPMENT SYSTEM ================== This driver has been developed and optimized for the GNU compiler version 3 -(gcc 3). It does work well with gcc 4 and future versions will probably be -optimized for gcc 4. We recommend that you use the GNU compiler suite because -it is freely available. AVR-USB has also been ported to the IAR compiler and -assembler. It has been tested with IAR 4.10B/W32 and 4.12A/W32 on an ATmega8 -with the "small" and "tiny" memory model. Please note that gcc is more -efficient for usbdrv.c because this module has been deliberately optimized -for gcc. +(gcc 3). It does work well with gcc 4, but with bigger code size. We recommend +that you use the GNU compiler suite because it is freely available. AVR-USB +has also been ported to the IAR compiler and assembler. It has been tested +with IAR 4.10B/W32 and 4.12A/W32 on an ATmega8 with the "small" and "tiny" +memory model. Not every release is tested with IAR CC and the driver may +therefore fail to compile with IAR. Please note that gcc is more efficient for +usbdrv.c because this module has been deliberately optimized for gcc. USING AVR-USB FOR FREE ====================== The AVR firmware driver is published under the GNU General Public License -Version 2 (GPL2). See the file "License.txt" for details. +Version 2 (GPL2) and the GNU General Public License Version 3 (GPL3). It is +your choice whether you apply the terms of version 2 or version 3. -If you decide for the free GPL2, we STRONGLY ENCOURAGE you to do the following -things IN ADDITION to the obligations from the GPL2: +If you decide for the free GPL2 or GPL3, we STRONGLY ENCOURAGE you to do the +following things IN ADDITION to the obligations from the GPL: (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/avrusb/feedback.html for your submission. +If you don't have a web site, you can publish the project in obdev's +documentation wiki at +http://www.obdev.at/goto.php?t=avrusb-wiki&p=hosted-projects. (2) Adhere to minimum publication standards. Please include AT LEAST: - a circuit diagram in PDF, PNG or GIF format @@ -145,7 +140,7 @@ to your modifications for our commercial license offerings. COMMERCIAL LICENSES FOR AVR-USB =============================== -If you don't want to publish your source code under the terms of the GPL2, +If you don't want to publish your source code under the terms of the GPL, you can simply pay money for AVR-USB. As an additional benefit you get USB PIDs for free, licensed exclusively to you. See the file "CommercialLicense.txt" for details. diff --git a/firmware/usbdrv/USBID-License.txt b/firmware/usbdrv/USBID-License.txt index 4739a57fe..984c9eef1 100644 --- a/firmware/usbdrv/USBID-License.txt +++ b/firmware/usbdrv/USBID-License.txt @@ -1,7 +1,7 @@ Royalty-Free Non-Exclusive License USB Product-ID ================================================= -Version 2006-06-19 +Version 2008-04-07 OBJECTIVE DEVELOPMENT Software GmbH hereby grants you the non-exclusive right to use three USB.org vendor-ID (VID) / product-ID (PID) pairs with @@ -19,6 +19,9 @@ Atmel AVR microcontrollers: * VID = 5824 (=0x16c0) / PID = 1505 (=0x5e1) for CDC class modem devices Devices using this pair will be referred to as "CDC-ACM CLASS" devices. + * VID = 5824 (=0x16c0) / PID = 1508 (=0x5e4) for MIDI class devices + Devices using this pair will be referred to as "MIDI CLASS" devices. + Since the granted right is non-exclusive, the same VID/PID pairs may be used by many companies and individuals for different products. To avoid conflicts, your device and host driver software MUST adhere to the rules @@ -56,8 +59,8 @@ matching. This means that operating system features which are based on VID/PID matching only (e.g. Windows kernel level drivers, automatic actions when the device is plugged in etc) MUST NOT be used. The driver matching MUST be a comparison of the entire strings, NOT a sub-string match. For -CDC-ACM CLASS devices, a generic class driver should be used and the -matching is based on the USB device class. +CDC-ACM CLASS and MIDI CLASS devices, a generic class driver should be used +and the matching is based on the USB device class. (6) The extent to which VID/PID matching is allowed for non device-specific drivers or features depends on the operating system and particular VID/PID @@ -86,8 +89,8 @@ HOW TO IMPLEMENT THESE RULES ============================ The following rules are for VENDOR CLASS and HID CLASS devices. CDC-ACM -CLASS devices use the operating system's class driver and don't need a -custom driver. +CLASS and MIDI CLASS devices use the operating system's class driver and +don't need a custom driver. The host driver MUST iterate over all devices with the given VID/PID numbers in their device descriptors and query the string representation for diff --git a/firmware/usbdrv/asmcommon.inc b/firmware/usbdrv/asmcommon.inc new file mode 100644 index 000000000..1af53b8ba --- /dev/null +++ b/firmware/usbdrv/asmcommon.inc @@ -0,0 +1,185 @@ +/* Name: asmcommon.inc + * Project: AVR USB driver + * Author: Christian Starkjohann + * Creation Date: 2007-11-05 + * Tabsize: 4 + * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * Revision: $Id$ + */ + +/* Do not link this file! Link usbdrvasm.S instead, which includes the + * appropriate implementation! + */ + +/* +General Description: +This file contains assembler code which is shared among the USB driver +implementations for different CPU cocks. Since the code must be inserted +in the middle of the module, it's split out into this file and #included. + +Jump destinations called from outside: + sofError: Called when no start sequence was found. + se0: Called when a package has been successfully received. + overflow: Called when receive buffer overflows. + doReturn: Called after sending data. + +Outside jump destinations used by this module: + waitForJ: Called to receive an already arriving packet. + sendAckAndReti: + sendNakAndReti: + sendCntAndReti: + usbSendAndReti: + +The following macros must be defined before this file is included: + .macro POP_STANDARD + .endm + .macro POP_RETI + .endm +*/ + +#define token x1 + +overflow: + ldi x2, 1< -#ifndef __IAR_SYSTEMS_ASM__ -# include -#endif - -#define __attribute__(arg) -#define IAR_SECTION(section) @ section - -#ifndef USB_BUFFER_SECTION -# define USB_BUFFER_SECTION "TINY_Z" /* if user has not selected a named section */ -#endif - -#ifdef __IAR_SYSTEMS_ASM__ -# define __ASSEMBLER__ -#endif - -#ifdef __HAS_ELPM__ -# define PROGMEM __farflash -#else -# define PROGMEM __flash -#endif - -#define PRG_RDB(addr) (*(PROGMEM char *)(addr)) - -/* The following definitions are not needed by the driver, but may be of some - * help if you port a gcc based project to IAR. - */ -#define cli() __disable_interrupt() -#define sei() __enable_interrupt() -#define wdt_reset() __watchdog_reset() - -/* Depending on the device you use, you may get problems with the way usbdrv.h - * handles the differences between devices. Since IAR does not use #defines - * for MCU registers, we can't check for the existence of a particular - * register with an #ifdef. If the autodetection mechanism fails, include - * definitions for the required USB_INTR_* macros in your usbconfig.h. See - * usbconfig-prototype.h and usbdrv.h for details. - */ - -#endif /* defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__ */ -#endif /* __iarcompat_h_INCLUDED__ */ diff --git a/firmware/usbdrv/oddebug.c b/firmware/usbdrv/oddebug.c index bd528e2d3..945457c1f 100644 --- a/firmware/usbdrv/oddebug.c +++ b/firmware/usbdrv/oddebug.c @@ -4,8 +4,8 @@ * Creation Date: 2005-01-16 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) - * This Revision: $Id: oddebug.c 275 2007-03-20 09:58:28Z cs $ + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: oddebug.c 692 2008-11-07 15:07:40Z cs $ */ #include "oddebug.h" diff --git a/firmware/usbdrv/oddebug.h b/firmware/usbdrv/oddebug.h index 1b11ef07d..d61309daa 100644 --- a/firmware/usbdrv/oddebug.h +++ b/firmware/usbdrv/oddebug.h @@ -4,8 +4,8 @@ * Creation Date: 2005-01-16 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) - * This Revision: $Id: oddebug.h 275 2007-03-20 09:58:28Z cs $ + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: oddebug.h 692 2008-11-07 15:07:40Z cs $ */ #ifndef __oddebug_h_included__ @@ -29,10 +29,7 @@ the output and a memory block to dump in hex ('data' and 'len'). #endif /* make sure we have the UART defines: */ -#include "iarcompat.h" -#ifndef __IAR_SYSTEMS_ICC__ -# include -#endif +#include "usbportability.h" #ifndef uchar # define uchar unsigned char diff --git a/firmware/usbdrv/usbconfig-prototype.h b/firmware/usbdrv/usbconfig-prototype.h index e1138c9f6..6c9e37a82 100644 --- a/firmware/usbdrv/usbconfig-prototype.h +++ b/firmware/usbdrv/usbconfig-prototype.h @@ -4,8 +4,8 @@ * Creation Date: 2005-04-01 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 358 2007-06-23 13:30:30Z cs $ + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 692 2008-11-07 15:07:40Z cs $ */ #ifndef __usbconfig_h_included__ @@ -14,12 +14,14 @@ /* General Description: This file is an example configuration (with inline documentation) for the USB -driver. It configures AVR-USB for an ATMega8 with USB D+ connected to Port D -bit 2 (which is also hardware interrupt 0) and USB D- to Port D bit 0. You may -wire the lines to any other port, as long as D+ is also wired to INT0. -To create your own usbconfig.h file, copy this file to the directory -containing "usbdrv" (that is your project firmware source directory) and -rename it to "usbconfig.h". Then edit it accordingly. +driver. It configures AVR-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). ++ To create your own usbconfig.h file, copy this file to your project's ++ firmware source directory) and rename it to "usbconfig.h". ++ Then edit it accordingly. */ /* ---------------------------- Hardware Config ---------------------------- */ @@ -28,20 +30,24 @@ rename it to "usbconfig.h". Then edit it accordingly. /* 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 0 +#define USB_CFG_DMINUS_BIT 4 /* 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 2 /* 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! + * 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 MHz. Legal values are 12000, 16000 or 16500. - * The 16.5 MHz version of the code requires no crystal, it tolerates +/- 1% - * deviation from the nominal frequency. All other rates require a precision - * of 2000 ppm and thus a crystal! +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in MHz. Legal values are 12000, 12800, 15000, 16000, + * 16500 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! * Default if not specified: 12 MHz */ @@ -61,14 +67,26 @@ rename it to "usbconfig.h". Then edit it accordingly. /* --------------------------- Functional Range ---------------------------- */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +#define USB_CFG_HAVE_INTRIN_ENDPOINT 0 /* Define this to 1 if you want to compile a version with two endpoints: The - * default control endpoint 0 and an interrupt-in endpoint 1. + * 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 1 and an interrupt-in - * endpoint 3. You must also enable endpoint 1 above. + * 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 @@ -76,7 +94,15 @@ rename it to "usbconfig.h". Then edit it accordingly. * it is required by the standard. We have made it a config option because it * bloats the code considerably. */ -#define USB_CFG_INTR_POLL_INTERVAL 20 +#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 10 /* 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. @@ -102,39 +128,97 @@ rename it to "usbconfig.h". Then edit it accordingly. * 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) endpoint 1. +/* 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 endpoint 1. + * 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_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. + */ /* -------------------------- Device Description --------------------------- */ #define USB_CFG_VENDOR_ID 0xc0, 0x16 /* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you use obdev's free shared - * VID/PID pair. Be sure to read USBID-License.txt for rules! - * This template uses obdev's shared VID/PID pair for HIDs: 0x16c0/0x5df. - * Use this VID/PID pair ONLY if you understand the implications! + * own Vendor ID, define it here. Otherwise you use one of obdev's free shared + * VID/PID pairs. Be sure to read USBID-License.txt for rules! + * + This template uses obdev's shared VID/PID pair: 0x16c0/0x5dc. + * + Use this VID/PID pair ONLY if you understand the implications! */ -#define USB_CFG_DEVICE_ID 0xdf, 0x05 +#define USB_CFG_DEVICE_ID 0xdc, 0x05 /* 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 use obdev's free shared VID/PID pair. Be sure to read the rules in * USBID-License.txt! - * This template uses obdev's shared VID/PID pair for HIDs: 0x16c0/0x5df. - * Use this VID/PID pair ONLY if you understand the implications! + * + This template uses obdev's shared VID/PID pair: 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 'w', 'w', 'w', '.', 'o', 'b', 'd', 'e', 'v', '.', 'a', 't' -#define USB_CFG_VENDOR_NAME_LEN 12 +#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. @@ -158,23 +242,23 @@ rename it to "usbconfig.h". Then edit it accordingly. * 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_CLASS 0xff /* set to 0 if deferred to interface */ #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 /* HID */ +#define USB_CFG_INTERFACE_CLASS 0 /* define class here if not at device level */ #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. - * This template defines a HID class device. If you implement a vendor class - * device, set USB_CFG_INTERFACE_CLASS to 0 and USB_CFG_DEVICE_CLASS to 0xff. + * 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 42 /* total length of report descriptor */ +/* #define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 42 */ /* 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. - * Since this template defines a HID device, it must also specify a HID - * report descriptor length. You must add a PROGMEM character array named + * 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! */ @@ -194,7 +278,9 @@ rename it to "usbconfig.h". Then edit it accordingly. * 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(). + * 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), @@ -226,6 +312,12 @@ rename it to "usbconfig.h". Then edit it accordingly. * 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 @@ -254,5 +346,6 @@ rename it to "usbconfig.h". Then edit it accordingly. /* #define USB_INTR_ENABLE_BIT INT0 */ /* #define USB_INTR_PENDING GIFR */ /* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR SIG_INTERRUPT0 */ #endif /* __usbconfig_h_included__ */ diff --git a/firmware/usbdrv/usbdrv.c b/firmware/usbdrv/usbdrv.c index 04603bd37..02ffed64f 100644 --- a/firmware/usbdrv/usbdrv.c +++ b/firmware/usbdrv/usbdrv.c @@ -4,15 +4,11 @@ * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.c 350 2007-06-13 11:43:16Z cs $ + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbdrv.c 692 2008-11-07 15:07:40Z cs $ */ -#include "iarcompat.h" -#ifndef __IAR_SYSTEMS_ICC__ -# include -# include -#endif +#include "usbportability.h" #include "usbdrv.h" #include "oddebug.h" @@ -22,14 +18,6 @@ This module implements the C-part of the USB driver. See usbdrv.h for a documentation of the entire driver. */ -#ifndef IAR_SECTION -#define IAR_SECTION(arg) -#define __no_init -#endif -/* The macro IAR_SECTION is a hack to allow IAR-cc compatibility. On gcc, it - * is defined to nothing. __no_init is required on IAR. - */ - /* ------------------------------------------------------------------------- */ /* raw USB registers / interface to assembler code: */ @@ -39,38 +27,40 @@ uchar usbDeviceAddr; /* assigned during enumeration, defaults to 0 */ uchar usbNewDeviceAddr; /* device ID which should be set after status phase */ uchar usbConfiguration; /* currently selected configuration. Administered by driver, but not used */ volatile schar usbRxLen; /* = 0; number of bytes in usbRxBuf; 0 means free, -1 for flow control */ -uchar usbCurrentTok; /* last token received, if more than 1 rx endpoint: MSb=endpoint */ -uchar usbRxToken; /* token for data we received; if more than 1 rx endpoint: MSb=endpoint */ -uchar usbMsgLen = 0xff; /* remaining number of bytes, no msg to send if -1 (see usbMsgPtr) */ +uchar usbCurrentTok; /* last token received or endpoint number for last OUT token if != 0 */ +uchar usbRxToken; /* token for data we received; or endpont number for last OUT */ volatile uchar usbTxLen = USBPID_NAK; /* number of bytes to transmit with next IN token or handshake token */ uchar usbTxBuf[USB_BUFSIZE];/* data to transmit with next IN, free if usbTxLen contains handshake token */ -#if USB_CFG_HAVE_INTRIN_ENDPOINT -volatile uchar usbTxLen1 = USBPID_NAK; /* TX count for endpoint 1 */ -uchar usbTxBuf1[USB_BUFSIZE]; /* TX data for endpoint 1 */ -#if USB_CFG_HAVE_INTRIN_ENDPOINT3 -volatile uchar usbTxLen3 = USBPID_NAK; /* TX count for endpoint 1 */ -uchar usbTxBuf3[USB_BUFSIZE]; /* TX data for endpoint 1 */ +#if USB_COUNT_SOF +volatile uchar usbSofCount; /* incremented by assembler module every SOF */ +#endif +#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE +usbTxStatus_t usbTxStatus1; +# if USB_CFG_HAVE_INTRIN_ENDPOINT3 +usbTxStatus_t usbTxStatus3; +# endif #endif +#if USB_CFG_CHECK_DATA_TOGGLING +uchar usbCurrentDataToken;/* when we check data toggling to ignore duplicate packets */ #endif /* USB status registers / not shared with asm code */ -uchar *usbMsgPtr; /* data to transmit next -- ROM or RAM address */ -static uchar usbMsgFlags; /* flag values see below */ +uchar *usbMsgPtr; /* data to transmit next -- ROM or RAM address */ +static usbMsgLen_t usbMsgLen = USB_NO_MSG; /* remaining number of bytes */ +static uchar usbMsgFlags; /* flag values see below */ -#define USB_FLG_TX_PACKET (1<<0) -/* Leave free 6 bits after TX_PACKET. This way we can increment usbMsgFlags to toggle TX_PACKET */ #define USB_FLG_MSGPTR_IS_ROM (1<<6) -#define USB_FLG_USE_DEFAULT_RW (1<<7) +#define USB_FLG_USE_USER_RW (1<<7) /* optimizing hints: - do not post/pre inc/dec integer values in operations -- assign value of PRG_RDB() to register variables and don't use side effects in arg +- assign value of USB_READ_FLASH() to register variables and don't use side effects in arg - use narrow scope for variables which should be in X/Y/Z register - assign char sized expressions to variables to force 8 bit arithmetics */ -/* ------------------------------------------------------------------------- */ +/* -------------------------- String Descriptors --------------------------- */ #if USB_CFG_DESCR_PROPS_STRINGS == 0 @@ -113,6 +103,8 @@ PROGMEM int usbDescriptorStringSerialNumber[] = { #endif /* USB_CFG_DESCR_PROPS_STRINGS == 0 */ +/* --------------------------- Device Descriptor --------------------------- */ + #if USB_CFG_DESCR_PROPS_DEVICE == 0 #undef USB_CFG_DESCR_PROPS_DEVICE #define USB_CFG_DESCR_PROPS_DEVICE sizeof(usbDescriptorDevice) @@ -124,8 +116,11 @@ PROGMEM char usbDescriptorDevice[] = { /* USB device descriptor */ USB_CFG_DEVICE_SUBCLASS, 0, /* protocol */ 8, /* max packet size */ - USB_CFG_VENDOR_ID, /* 2 bytes */ - USB_CFG_DEVICE_ID, /* 2 bytes */ + /* the following two casts affect the first byte of the constant only, but + * that's sufficient to avoid a warning with the default values. + */ + (char)USB_CFG_VENDOR_ID,/* 2 bytes */ + (char)USB_CFG_DEVICE_ID,/* 2 bytes */ USB_CFG_DEVICE_VERSION, /* 2 bytes */ USB_CFG_DESCR_PROPS_STRING_VENDOR != 0 ? 1 : 0, /* manufacturer string index */ USB_CFG_DESCR_PROPS_STRING_PRODUCT != 0 ? 2 : 0, /* product string index */ @@ -134,6 +129,8 @@ PROGMEM char usbDescriptorDevice[] = { /* USB device descriptor */ }; #endif +/* ----------------------- Configuration Descriptor ------------------------ */ + #if USB_CFG_DESCR_PROPS_HID_REPORT != 0 && USB_CFG_DESCR_PROPS_HID == 0 #undef USB_CFG_DESCR_PROPS_HID #define USB_CFG_DESCR_PROPS_HID 9 /* length of HID descriptor in config descriptor below */ @@ -145,15 +142,16 @@ PROGMEM char usbDescriptorDevice[] = { /* USB device descriptor */ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor */ 9, /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */ USBDESCR_CONFIG, /* descriptor type */ - 18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + (USB_CFG_DESCR_PROPS_HID & 0xff), 0, + 18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT3 + + (USB_CFG_DESCR_PROPS_HID & 0xff), 0, /* total length of data returned (including inlined descriptors) */ 1, /* number of interfaces in this configuration */ 1, /* index of this configuration */ 0, /* configuration name string index */ #if USB_CFG_IS_SELF_POWERED - USBATTR_SELFPOWER, /* attributes */ + USBATTR_SELFPOWER, /* attributes */ #else - USBATTR_BUSPOWER, /* attributes */ + (char)USBATTR_BUSPOWER, /* attributes */ #endif USB_CFG_MAX_BUS_POWER/2, /* max USB current in 2mA units */ /* interface descriptor follows inline: */ @@ -161,7 +159,7 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor USBDESCR_INTERFACE, /* descriptor type */ 0, /* index of this interface */ 0, /* alternate setting for this interface */ - USB_CFG_HAVE_INTRIN_ENDPOINT, /* endpoints excl 0: number of endpoint descriptors to follow */ + USB_CFG_HAVE_INTRIN_ENDPOINT + USB_CFG_HAVE_INTRIN_ENDPOINT3, /* endpoints excl 0: number of endpoint descriptors to follow */ USB_CFG_INTERFACE_CLASS, USB_CFG_INTERFACE_SUBCLASS, USB_CFG_INTERFACE_PROTOCOL, @@ -178,7 +176,15 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor #if USB_CFG_HAVE_INTRIN_ENDPOINT /* endpoint descriptor for endpoint 1 */ 7, /* sizeof(usbDescrEndpoint) */ USBDESCR_ENDPOINT, /* descriptor type = endpoint */ - 0x81, /* IN endpoint number 1 */ + (char)0x81, /* IN endpoint number 1 */ + 0x03, /* attrib: Interrupt endpoint */ + 8, 0, /* maximum packet size */ + USB_CFG_INTR_POLL_INTERVAL, /* in ms */ +#endif +#if USB_CFG_HAVE_INTRIN_ENDPOINT3 /* endpoint descriptor for endpoint 3 */ + 7, /* sizeof(usbDescrEndpoint) */ + USBDESCR_ENDPOINT, /* descriptor type = endpoint */ + (char)0x83, /* IN endpoint number 1 */ 0x03, /* attrib: Interrupt endpoint */ 8, 0, /* maximum packet size */ USB_CFG_INTR_POLL_INTERVAL, /* in ms */ @@ -186,304 +192,372 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor }; #endif -/* We don't use prog_int or prog_int16_t for compatibility with various libc - * versions. Here's an other compatibility hack: - */ -#ifndef PRG_RDB -#define PRG_RDB(addr) pgm_read_byte(addr) -#endif - -typedef union{ - unsigned word; - uchar *ptr; - uchar bytes[2]; -}converter_t; -/* We use this union to do type conversions. This is better optimized than - * type casts in gcc 3.4.3 and much better than using bit shifts to build - * ints from chars. Byte ordering is not a problem on an 8 bit platform. - */ +/* ------------------------------------------------------------------------- */ + +static inline void usbResetDataToggling(void) +{ +#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE + USB_SET_DATATOKEN1(USB_INITIAL_DATATOKEN); /* reset data toggling for interrupt endpoint */ +# if USB_CFG_HAVE_INTRIN_ENDPOINT3 + USB_SET_DATATOKEN3(USB_INITIAL_DATATOKEN); /* reset data toggling for interrupt endpoint */ +# endif +#endif +} + +static inline void usbResetStall(void) +{ +#if USB_CFG_IMPLEMENT_HALT && USB_CFG_HAVE_INTRIN_ENDPOINT + usbTxLen1 = USBPID_NAK; +#if USB_CFG_HAVE_INTRIN_ENDPOINT3 + usbTxLen3 = USBPID_NAK; +#endif +#endif +} /* ------------------------------------------------------------------------- */ +#if !USB_CFG_SUPPRESS_INTR_CODE #if USB_CFG_HAVE_INTRIN_ENDPOINT -USB_PUBLIC void usbSetInterrupt(uchar *data, uchar len) +static void usbGenericSetInterrupt(uchar *data, uchar len, usbTxStatus_t *txStatus) { -uchar *p, i; +uchar *p; +char i; #if USB_CFG_IMPLEMENT_HALT if(usbTxLen1 == USBPID_STALL) return; #endif -#if 0 /* No runtime checks! Caller is responsible for valid data! */ - if(len > 8) /* interrupt transfers are limited to 8 bytes */ - len = 8; -#endif - if(usbTxLen1 & 0x10){ /* packet buffer was empty */ - usbTxBuf1[0] ^= USBPID_DATA0 ^ USBPID_DATA1; /* toggle token */ + if(txStatus->len & 0x10){ /* packet buffer was empty */ + txStatus->buffer[0] ^= USBPID_DATA0 ^ USBPID_DATA1; /* toggle token */ }else{ - usbTxLen1 = USBPID_NAK; /* avoid sending outdated (overwritten) interrupt data */ + txStatus->len = USBPID_NAK; /* avoid sending outdated (overwritten) interrupt data */ } - p = usbTxBuf1 + 1; - for(i=len;i--;) + p = txStatus->buffer + 1; + i = len; + do{ /* if len == 0, we still copy 1 byte, but that's no problem */ *p++ = *data++; - usbCrc16Append(&usbTxBuf1[1], len); - usbTxLen1 = len + 4; /* len must be given including sync byte */ - DBG2(0x21, usbTxBuf1, len + 3); + }while(--i > 0); /* loop control at the end is 2 bytes shorter than at beginning */ + usbCrc16Append(&txStatus->buffer[1], len); + txStatus->len = len + 4; /* len must be given including sync byte */ + DBG2(0x21 + (((int)txStatus >> 3) & 3), txStatus->buffer, len + 3); +} + +USB_PUBLIC void usbSetInterrupt(uchar *data, uchar len) +{ + usbGenericSetInterrupt(data, len, &usbTxStatus1); } #endif #if USB_CFG_HAVE_INTRIN_ENDPOINT3 USB_PUBLIC void usbSetInterrupt3(uchar *data, uchar len) { -uchar *p, i; - - if(usbTxLen3 & 0x10){ /* packet buffer was empty */ - usbTxBuf3[0] ^= USBPID_DATA0 ^ USBPID_DATA1; /* toggle token */ - }else{ - usbTxLen3 = USBPID_NAK; /* avoid sending outdated (overwritten) interrupt data */ - } - p = usbTxBuf3 + 1; - for(i=len;i--;) - *p++ = *data++; - usbCrc16Append(&usbTxBuf3[1], len); - usbTxLen3 = len + 4; /* len must be given including sync byte */ - DBG2(0x23, usbTxBuf3, len + 3); + usbGenericSetInterrupt(data, len, &usbTxStatus3); } #endif +#endif /* USB_CFG_SUPPRESS_INTR_CODE */ +/* ------------------ utilities for code following below ------------------- */ -static uchar usbRead(uchar *data, uchar len) -{ -#if USB_CFG_IMPLEMENT_FN_READ - if(usbMsgFlags & USB_FLG_USE_DEFAULT_RW){ -#endif - uchar i = len, *r = usbMsgPtr; - if(usbMsgFlags & USB_FLG_MSGPTR_IS_ROM){ /* ROM data */ - while(i--){ - uchar c = PRG_RDB(r); /* assign to char size variable to enforce byte ops */ - *data++ = c; - r++; - } - }else{ /* RAM data */ - while(i--) - *data++ = *r++; - } - usbMsgPtr = r; - return len; -#if USB_CFG_IMPLEMENT_FN_READ - }else{ - if(len != 0) /* don't bother app with 0 sized reads */ - return usbFunctionRead(data, len); - return 0; - } +/* Use defines for the switch statement so that we can choose between an + * if()else if() and a switch/case based implementation. switch() is more + * efficient for a LARGE set of sequential choices, if() is better in all other + * cases. + */ +#if USB_CFG_USE_SWITCH_STATEMENT +# define SWITCH_START(cmd) switch(cmd){{ +# define SWITCH_CASE(value) }break; case (value):{ +# define SWITCH_CASE2(v1,v2) }break; case (v1): case(v2):{ +# define SWITCH_CASE3(v1,v2,v3) }break; case (v1): case(v2): case(v3):{ +# define SWITCH_DEFAULT }break; default:{ +# define SWITCH_END }} +#else +# define SWITCH_START(cmd) {uchar _cmd = cmd; if(0){ +# define SWITCH_CASE(value) }else if(_cmd == (value)){ +# define SWITCH_CASE2(v1,v2) }else if(_cmd == (v1) || _cmd == (v2)){ +# define SWITCH_CASE3(v1,v2,v3) }else if(_cmd == (v1) || _cmd == (v2) || (_cmd == v3)){ +# define SWITCH_DEFAULT }else{ +# define SWITCH_END }} #endif -} +#ifndef USB_RX_USER_HOOK +#define USB_RX_USER_HOOK(data, len) +#endif +#ifndef USB_SET_ADDRESS_HOOK +#define USB_SET_ADDRESS_HOOK() +#endif + +/* ------------------------------------------------------------------------- */ +/* We use if() instead of #if in the macro below because #if can't be used + * in macros and the compiler optimizes constant conditions anyway. + * This may cause problems with undefined symbols if compiled without + * optimizing! + */ #define GET_DESCRIPTOR(cfgProp, staticName) \ if(cfgProp){ \ if((cfgProp) & USB_PROP_IS_RAM) \ - flags &= ~USB_FLG_MSGPTR_IS_ROM; \ + flags = 0; \ if((cfgProp) & USB_PROP_IS_DYNAMIC){ \ - replyLen = usbFunctionDescriptor(rq); \ + len = usbFunctionDescriptor(rq); \ }else{ \ - replyData = (uchar *)(staticName); \ - SET_REPLY_LEN((cfgProp) & 0xff); \ + len = USB_PROP_LENGTH(cfgProp); \ + usbMsgPtr = (uchar *)(staticName); \ } \ } -/* We use if() instead of #if in the macro above because #if can't be used - * in macros and the compiler optimizes constant conditions anyway. + +/* usbDriverDescriptor() is similar to usbFunctionDescriptor(), but used + * internally for all types of descriptors. + */ +static inline usbMsgLen_t usbDriverDescriptor(usbRequest_t *rq) +{ +usbMsgLen_t len = 0; +uchar flags = USB_FLG_MSGPTR_IS_ROM; + + SWITCH_START(rq->wValue.bytes[1]) + SWITCH_CASE(USBDESCR_DEVICE) /* 1 */ + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_DEVICE, usbDescriptorDevice) + SWITCH_CASE(USBDESCR_CONFIG) /* 2 */ + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_CONFIGURATION, usbDescriptorConfiguration) + SWITCH_CASE(USBDESCR_STRING) /* 3 */ +#if USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC + if(USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_RAM) + flags = 0; + len = usbFunctionDescriptor(rq); +#else /* USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC */ + SWITCH_START(rq->wValue.bytes[0]) + SWITCH_CASE(0) + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_0, usbDescriptorString0) + SWITCH_CASE(1) + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_VENDOR, usbDescriptorStringVendor) + SWITCH_CASE(2) + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_PRODUCT, usbDescriptorStringDevice) + SWITCH_CASE(3) + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER, usbDescriptorStringSerialNumber) + SWITCH_DEFAULT + if(USB_CFG_DESCR_PROPS_UNKNOWN & USB_PROP_IS_DYNAMIC){ + len = usbFunctionDescriptor(rq); + } + SWITCH_END +#endif /* USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC */ +#if USB_CFG_DESCR_PROPS_HID_REPORT /* only support HID descriptors if enabled */ + SWITCH_CASE(USBDESCR_HID) /* 0x21 */ + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID, usbDescriptorConfiguration + 18) + SWITCH_CASE(USBDESCR_HID_REPORT)/* 0x22 */ + GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID_REPORT, usbDescriptorHidReport) +#endif + SWITCH_DEFAULT + if(USB_CFG_DESCR_PROPS_UNKNOWN & USB_PROP_IS_DYNAMIC){ + len = usbFunctionDescriptor(rq); + } + SWITCH_END + usbMsgFlags = flags; + return len; +} + +/* ------------------------------------------------------------------------- */ + +/* usbDriverSetup() is similar to usbFunctionSetup(), but it's used for + * standard requests instead of class and custom requests. */ +static inline usbMsgLen_t usbDriverSetup(usbRequest_t *rq) +{ +uchar len = 0, *dataPtr = usbTxBuf + 9; /* there are 2 bytes free space at the end of the buffer */ +uchar value = rq->wValue.bytes[0]; +#if USB_CFG_IMPLEMENT_HALT +uchar index = rq->wIndex.bytes[0]; +#endif + + dataPtr[0] = 0; /* default reply common to USBRQ_GET_STATUS and USBRQ_GET_INTERFACE */ + SWITCH_START(rq->bRequest) + SWITCH_CASE(USBRQ_GET_STATUS) /* 0 */ + uchar recipient = rq->bmRequestType & USBRQ_RCPT_MASK; /* assign arith ops to variables to enforce byte size */ + if(USB_CFG_IS_SELF_POWERED && recipient == USBRQ_RCPT_DEVICE) + dataPtr[0] = USB_CFG_IS_SELF_POWERED; +#if USB_CFG_IMPLEMENT_HALT + if(recipient == USBRQ_RCPT_ENDPOINT && index == 0x81) /* request status for endpoint 1 */ + dataPtr[0] = usbTxLen1 == USBPID_STALL; +#endif + dataPtr[1] = 0; + len = 2; +#if USB_CFG_IMPLEMENT_HALT + SWITCH_CASE2(USBRQ_CLEAR_FEATURE, USBRQ_SET_FEATURE) /* 1, 3 */ + if(value == 0 && index == 0x81){ /* feature 0 == HALT for endpoint == 1 */ + usbTxLen1 = rq->bRequest == USBRQ_CLEAR_FEATURE ? USBPID_NAK : USBPID_STALL; + usbResetDataToggling(); + } +#endif + SWITCH_CASE(USBRQ_SET_ADDRESS) /* 5 */ + usbNewDeviceAddr = value; + USB_SET_ADDRESS_HOOK(); + SWITCH_CASE(USBRQ_GET_DESCRIPTOR) /* 6 */ + len = usbDriverDescriptor(rq); + goto skipMsgPtrAssignment; + SWITCH_CASE(USBRQ_GET_CONFIGURATION) /* 8 */ + dataPtr = &usbConfiguration; /* send current configuration value */ + len = 1; + SWITCH_CASE(USBRQ_SET_CONFIGURATION) /* 9 */ + usbConfiguration = value; + usbResetStall(); + SWITCH_CASE(USBRQ_GET_INTERFACE) /* 10 */ + len = 1; +#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE + SWITCH_CASE(USBRQ_SET_INTERFACE) /* 11 */ + usbResetDataToggling(); + usbResetStall(); +#endif + SWITCH_DEFAULT /* 7=SET_DESCRIPTOR, 12=SYNC_FRAME */ + /* Should we add an optional hook here? */ + SWITCH_END + usbMsgPtr = dataPtr; +skipMsgPtrAssignment: + return len; +} +/* ------------------------------------------------------------------------- */ -/* Don't make this function static to avoid inlining. - * The entire function would become too large and exceed the range of - * relative jumps. - * 2006-02-25: Either gcc 3.4.3 is better than the gcc used when the comment - * above was written, or other parts of the code have changed. We now get - * better results with an inlined function. Test condition: PowerSwitch code. +/* usbProcessRx() is called for every message received by the interrupt + * routine. It distinguishes between SETUP and DATA packets and processes + * them accordingly. */ -static void usbProcessRx(uchar *data, uchar len) +static inline void usbProcessRx(uchar *data, uchar len) { usbRequest_t *rq = (void *)data; -uchar replyLen = 0, flags = USB_FLG_USE_DEFAULT_RW; -/* We use if() cascades because the compare is done byte-wise while switch() - * is int-based. The if() cascades are therefore more efficient. - */ + /* usbRxToken can be: - * 0x2d 00101101 (USBPID_SETUP for endpoint 0) - * 0xe1 11100001 (USBPID_OUT for endpoint 0) - * 0xff 11111111 (USBPID_OUT for endpoint 1) + * 0x2d 00101101 (USBPID_SETUP for setup data) + * 0xe1 11100001 (USBPID_OUT: data phase of setup transfer) + * 0...0x0f for OUT on endpoint X */ - DBG2(0x10 + ((usbRxToken >> 1) & 3), data, len); /* SETUP0=12; OUT0=10; OUT1=13 */ + DBG2(0x10 + (usbRxToken & 0xf), data, len); /* SETUP=1d, SETUP-DATA=11, OUTx=1x */ + USB_RX_USER_HOOK(data, len) #if USB_CFG_IMPLEMENT_FN_WRITEOUT - if(usbRxToken == 0xff){ + if(usbRxToken < 0x10){ /* OUT to endpoint != 0: endpoint number in usbRxToken */ usbFunctionWriteOut(data, len); - return; /* no reply expected, hence no usbMsgPtr, usbMsgFlags, usbMsgLen set */ + return; } #endif if(usbRxToken == (uchar)USBPID_SETUP){ - usbTxLen = USBPID_NAK; /* abort pending transmit */ - if(len == 8){ /* Setup size must be always 8 bytes. Ignore otherwise. */ - uchar type = rq->bmRequestType & USBRQ_TYPE_MASK; - if(type == USBRQ_TYPE_STANDARD){ - #define SET_REPLY_LEN(len) replyLen = (len); usbMsgPtr = replyData - /* This macro ensures that replyLen and usbMsgPtr are always set in the same way. - * That allows optimization of common code in if() branches */ - uchar *replyData = usbTxBuf + 9; /* there is 3 bytes free space at the end of the buffer */ - replyData[0] = 0; /* common to USBRQ_GET_STATUS and USBRQ_GET_INTERFACE */ - if(rq->bRequest == USBRQ_GET_STATUS){ /* 0 */ - uchar __attribute__((__unused__)) recipient = rq->bmRequestType & USBRQ_RCPT_MASK; /* assign arith ops to variables to enforce byte size */ -#if USB_CFG_IS_SELF_POWERED - if(recipient == USBRQ_RCPT_DEVICE) - replyData[0] = USB_CFG_IS_SELF_POWERED; -#endif -#if USB_CFG_HAVE_INTRIN_ENDPOINT && USB_CFG_IMPLEMENT_HALT - if(recipient == USBRQ_RCPT_ENDPOINT && rq->wIndex.bytes[0] == 0x81) /* request status for endpoint 1 */ - replyData[0] = usbTxLen1 == USBPID_STALL; -#endif - replyData[1] = 0; - SET_REPLY_LEN(2); - }else if(rq->bRequest == USBRQ_SET_ADDRESS){ /* 5 */ - usbNewDeviceAddr = rq->wValue.bytes[0]; - }else if(rq->bRequest == USBRQ_GET_DESCRIPTOR){ /* 6 */ - flags = USB_FLG_MSGPTR_IS_ROM | USB_FLG_USE_DEFAULT_RW; - if(rq->wValue.bytes[1] == USBDESCR_DEVICE){ /* 1 */ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_DEVICE, usbDescriptorDevice) - }else if(rq->wValue.bytes[1] == USBDESCR_CONFIG){ /* 2 */ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_CONFIGURATION, usbDescriptorConfiguration) - }else if(rq->wValue.bytes[1] == USBDESCR_STRING){ /* 3 */ -#if USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC - if(USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_RAM) - flags &= ~USB_FLG_MSGPTR_IS_ROM; - replyLen = usbFunctionDescriptor(rq); -#else /* USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC */ - if(rq->wValue.bytes[0] == 0){ /* descriptor index */ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_0, usbDescriptorString0) - }else if(rq->wValue.bytes[0] == 1){ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_VENDOR, usbDescriptorStringVendor) - }else if(rq->wValue.bytes[0] == 2){ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_PRODUCT, usbDescriptorStringDevice) - }else if(rq->wValue.bytes[0] == 3){ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER, usbDescriptorStringSerialNumber) - }else if(USB_CFG_DESCR_PROPS_UNKNOWN & USB_PROP_IS_DYNAMIC){ - replyLen = usbFunctionDescriptor(rq); - } -#endif /* USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC */ - }else if(rq->wValue.bytes[1] == USBDESCR_HID){ /* 0x21 */ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID, usbDescriptorConfiguration + 18) - }else if(rq->wValue.bytes[1] == USBDESCR_HID_REPORT){ /* 0x22 */ - GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID_REPORT, usbDescriptorHidReport) - }else if(USB_CFG_DESCR_PROPS_UNKNOWN & USB_PROP_IS_DYNAMIC){ - replyLen = usbFunctionDescriptor(rq); - } - }else if(rq->bRequest == USBRQ_GET_CONFIGURATION){ /* 8 */ - replyData = &usbConfiguration; /* send current configuration value */ - SET_REPLY_LEN(1); - }else if(rq->bRequest == USBRQ_SET_CONFIGURATION){ /* 9 */ - usbConfiguration = rq->wValue.bytes[0]; -#if USB_CFG_IMPLEMENT_HALT - usbTxLen1 = USBPID_NAK; -#endif - }else if(rq->bRequest == USBRQ_GET_INTERFACE){ /* 10 */ - SET_REPLY_LEN(1); -#if USB_CFG_HAVE_INTRIN_ENDPOINT - }else if(rq->bRequest == USBRQ_SET_INTERFACE){ /* 11 */ - USB_SET_DATATOKEN1(USBPID_DATA0); /* reset data toggling for interrupt endpoint */ -# if USB_CFG_HAVE_INTRIN_ENDPOINT3 - USB_SET_DATATOKEN3(USBPID_DATA0); /* reset data toggling for interrupt endpoint */ -# endif -# if USB_CFG_IMPLEMENT_HALT - usbTxLen1 = USBPID_NAK; - }else if(rq->bRequest == USBRQ_CLEAR_FEATURE || rq->bRequest == USBRQ_SET_FEATURE){ /* 1|3 */ - if(rq->wValue.bytes[0] == 0 && rq->wIndex.bytes[0] == 0x81){ /* feature 0 == HALT for endpoint == 1 */ - usbTxLen1 = rq->bRequest == USBRQ_CLEAR_FEATURE ? USBPID_NAK : USBPID_STALL; - USB_SET_DATATOKEN1(USBPID_DATA0); /* reset data toggling for interrupt endpoint */ -# if USB_CFG_HAVE_INTRIN_ENDPOINT3 - USB_SET_DATATOKEN3(USBPID_DATA0); /* reset data toggling for interrupt endpoint */ -# endif - } -# endif -#endif + if(len != 8) /* Setup size must be always 8 bytes. Ignore otherwise. */ + return; + usbMsgLen_t replyLen; + usbTxBuf[0] = USBPID_DATA0; /* initialize data toggling */ + usbTxLen = USBPID_NAK; /* abort pending transmit */ + usbMsgFlags = 0; + uchar type = rq->bmRequestType & USBRQ_TYPE_MASK; + if(type != USBRQ_TYPE_STANDARD){ /* standard requests are handled by driver */ + replyLen = usbFunctionSetup(data); + }else{ + replyLen = usbDriverSetup(rq); + } +#if USB_CFG_IMPLEMENT_FN_READ || USB_CFG_IMPLEMENT_FN_WRITE + if(replyLen == USB_NO_MSG){ /* use user-supplied read/write function */ + /* do some conditioning on replyLen, but on IN transfers only */ + if((rq->bmRequestType & USBRQ_DIR_MASK) != USBRQ_DIR_HOST_TO_DEVICE){ + if(sizeof(replyLen) < sizeof(rq->wLength.word)){ /* help compiler with optimizing */ + replyLen = rq->wLength.bytes[0]; }else{ - /* the following requests can be ignored, send default reply */ - /* 1: CLEAR_FEATURE, 3: SET_FEATURE, 7: SET_DESCRIPTOR */ - /* 12: SYNCH_FRAME */ + replyLen = rq->wLength.word; } - #undef SET_REPLY_LEN - }else{ /* not a standard request -- must be vendor or class request */ - replyLen = usbFunctionSetup(data); } -#if USB_CFG_IMPLEMENT_FN_READ || USB_CFG_IMPLEMENT_FN_WRITE - if(replyLen == 0xff){ /* use user-supplied read/write function */ - if((rq->bmRequestType & USBRQ_DIR_MASK) == USBRQ_DIR_DEVICE_TO_HOST){ - replyLen = rq->wLength.bytes[0]; /* IN transfers only */ - } - flags &= ~USB_FLG_USE_DEFAULT_RW; /* we have no valid msg, use user supplied read/write functions */ - }else /* The 'else' prevents that we limit a replyLen of 0xff to the maximum transfer len. */ + usbMsgFlags = USB_FLG_USE_USER_RW; + }else /* The 'else' prevents that we limit a replyLen of USB_NO_MSG to the maximum transfer len. */ #endif - if(!rq->wLength.bytes[1] && replyLen > rq->wLength.bytes[0]) /* limit length to max */ + if(sizeof(replyLen) < sizeof(rq->wLength.word)){ /* help compiler with optimizing */ + if(!rq->wLength.bytes[1] && replyLen > rq->wLength.bytes[0]) /* limit length to max */ replyLen = rq->wLength.bytes[0]; + }else{ + if(replyLen > rq->wLength.word) /* limit length to max */ + replyLen = rq->wLength.word; } - /* make sure that data packets which are sent as ACK to an OUT transfer are always zero sized */ - }else{ /* DATA packet from out request */ + usbMsgLen = replyLen; + }else{ /* usbRxToken must be USBPID_OUT, which means data phase of setup (control-out) */ #if USB_CFG_IMPLEMENT_FN_WRITE - if(!(usbMsgFlags & USB_FLG_USE_DEFAULT_RW)){ + if(usbMsgFlags & USB_FLG_USE_USER_RW){ uchar rval = usbFunctionWrite(data, len); - replyLen = 0xff; - if(rval == 0xff){ /* an error occurred */ - usbMsgLen = 0xff; /* cancel potentially pending data packet for ACK */ + if(rval == 0xff){ /* an error occurred */ usbTxLen = USBPID_STALL; }else if(rval != 0){ /* This was the final package */ - replyLen = 0; /* answer with a zero-sized data packet */ + usbMsgLen = 0; /* answer with a zero-sized data packet */ } - flags = 0; /* start with a DATA1 package, stay with user supplied write() function */ } #endif } - usbMsgFlags = flags; - usbMsgLen = replyLen; } /* ------------------------------------------------------------------------- */ -static void usbBuildTxBlock(void) +/* This function is similar to usbFunctionRead(), but it's also called for + * data handled automatically by the driver (e.g. descriptor reads). + */ +static uchar usbDeviceRead(uchar *data, uchar len) { -uchar wantLen, len, txLen, token; + if(len > 0){ /* don't bother app with 0 sized reads */ +#if USB_CFG_IMPLEMENT_FN_READ + if(usbMsgFlags & USB_FLG_USE_USER_RW){ + len = usbFunctionRead(data, len); + }else +#endif + { + uchar i = len, *r = usbMsgPtr; + if(usbMsgFlags & USB_FLG_MSGPTR_IS_ROM){ /* ROM data */ + do{ + uchar c = USB_READ_FLASH(r); /* assign to char size variable to enforce byte ops */ + *data++ = c; + r++; + }while(--i); + }else{ /* RAM data */ + do{ + *data++ = *r++; + }while(--i); + } + usbMsgPtr = r; + } + } + return len; +} + +/* ------------------------------------------------------------------------- */ + +/* usbBuildTxBlock() is called when we have data to transmit and the + * interrupt routine's transmit buffer is empty. + */ +static inline void usbBuildTxBlock(void) +{ +usbMsgLen_t wantLen; +uchar len; wantLen = usbMsgLen; if(wantLen > 8) wantLen = 8; usbMsgLen -= wantLen; - token = USBPID_DATA1; - if(usbMsgFlags & USB_FLG_TX_PACKET) - token = USBPID_DATA0; - usbMsgFlags++; - len = usbRead(usbTxBuf + 1, wantLen); + usbTxBuf[0] ^= USBPID_DATA0 ^ USBPID_DATA1; /* DATA toggling */ + len = usbDeviceRead(usbTxBuf + 1, wantLen); if(len <= 8){ /* valid data packet */ usbCrc16Append(&usbTxBuf[1], len); - txLen = len + 4; /* length including sync byte */ - if(len < 8) /* a partial package identifies end of message */ - usbMsgLen = 0xff; + len += 4; /* length including sync byte */ + if(len < 12) /* a partial package identifies end of message */ + usbMsgLen = USB_NO_MSG; }else{ - txLen = USBPID_STALL; /* stall the endpoint */ - usbMsgLen = 0xff; + len = USBPID_STALL; /* stall the endpoint */ + usbMsgLen = USB_NO_MSG; } - usbTxBuf[0] = token; - usbTxLen = txLen; - DBG2(0x20, usbTxBuf, txLen-1); + usbTxLen = len; + DBG2(0x20, usbTxBuf, len-1); } -static inline uchar isNotSE0(void) +/* ------------------------------------------------------------------------- */ + +static inline void usbHandleResetHook(uchar notResetState) { -uchar rval; -/* We want to do - * return (USBIN & USBMASK); - * here, but the compiler does int-expansion acrobatics. - * We can avoid this by assigning to a char-sized variable. - */ - rval = USBIN & USBMASK; - return rval; +#ifdef USB_RESET_HOOK +static uchar wasReset; +uchar isReset = !notResetState; + + if(wasReset != isReset){ + USB_RESET_HOOK(isReset); + wasReset = isReset; + } +#endif } /* ------------------------------------------------------------------------- */ @@ -493,14 +567,15 @@ USB_PUBLIC void usbPoll(void) schar len; uchar i; - if((len = usbRxLen) > 0){ + len = usbRxLen - 3; + if(len >= 0){ /* We could check CRC16 here -- but ACK has already been sent anyway. If you * need data integrity checks with this driver, check the CRC in your app * code and report errors back to the host. Since the ACK was already sent, * retries must be handled on application level. * unsigned crc = usbCrc16(buffer + 1, usbRxLen - 3); */ - usbProcessRx(usbRxBuf + USB_BUFSIZE + 1 - usbInputBufOffset, len - 3); + usbProcessRx(usbRxBuf + USB_BUFSIZE + 1 - usbInputBufOffset, len); #if USB_CFG_HAVE_FLOWCONTROL if(usbRxLen > 0) /* only mark as available if not inactivated */ usbRxLen = 0; @@ -508,26 +583,23 @@ uchar i; usbRxLen = 0; /* mark rx buffer as available */ #endif } - if(usbTxLen & 0x10){ /* transmit system idle */ - if(usbMsgLen != 0xff){ /* transmit data pending? */ + if(usbTxLen & 0x10){ /* transmit system idle */ + if(usbMsgLen != USB_NO_MSG){ /* transmit data pending? */ usbBuildTxBlock(); } } - for(i = 10; i > 0; i--){ - if(isNotSE0()) - break; - } - if(i == 0){ /* RESET condition, called multiple times during reset */ - usbNewDeviceAddr = 0; - usbDeviceAddr = 0; -#if USB_CFG_IMPLEMENT_HALT - usbTxLen1 = USBPID_NAK; -#if USB_CFG_HAVE_INTRIN_ENDPOINT3 - usbTxLen3 = USBPID_NAK; -#endif -#endif - DBG1(0xff, 0, 0); + for(i = 20; i > 0; i--){ + uchar usbLineStatus = USBIN & USBMASK; + if(usbLineStatus != 0) /* SE0 has ended */ + goto isNotReset; } + /* RESET condition, called multiple times during reset */ + usbNewDeviceAddr = 0; + usbDeviceAddr = 0; + usbResetStall(); + DBG1(0xff, 0, 0); +isNotReset: + usbHandleResetHook(i); } /* ------------------------------------------------------------------------- */ @@ -541,11 +613,12 @@ USB_PUBLIC void usbInit(void) USB_INTR_CFG &= ~(USB_INTR_CFG_CLR); #endif USB_INTR_ENABLE |= (1 << USB_INTR_ENABLE_BIT); -#if USB_CFG_HAVE_INTRIN_ENDPOINT - USB_SET_DATATOKEN1(USBPID_DATA0); /* reset data toggling for interrupt endpoint */ -# if USB_CFG_HAVE_INTRIN_ENDPOINT3 - USB_SET_DATATOKEN3(USBPID_DATA0); /* reset data toggling for interrupt endpoint */ -# endif + usbResetDataToggling(); +#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE + usbTxLen1 = USBPID_NAK; +#if USB_CFG_HAVE_INTRIN_ENDPOINT3 + usbTxLen3 = USBPID_NAK; +#endif #endif } diff --git a/firmware/usbdrv/usbdrv.h b/firmware/usbdrv/usbdrv.h index 94085762d..0ae387169 100644 --- a/firmware/usbdrv/usbdrv.h +++ b/firmware/usbdrv/usbdrv.h @@ -4,33 +4,38 @@ * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.h 375 2007-07-07 12:01:52Z cs $ + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbdrv.h 697 2008-11-26 17:24:43Z cs $ */ #ifndef __usbdrv_h_included__ #define __usbdrv_h_included__ #include "usbconfig.h" -#include "iarcompat.h" +#include "usbportability.h" /* Hardware Prerequisites: ======================= -USB lines D+ and D- MUST be wired to the same I/O port. D+ must (also) be -connected to INT0. D- requires a pullup of 1.5k to +3.5V (and the device -must be powered at 3.5V) to identify as low-speed USB device. A pullup of -1M SHOULD be connected from D+ to +3.5V to prevent interference when no USB -master is connected. We use D+ as interrupt source and not D- because it -does not trigger on keep-alive and RESET states. - -As a compile time option, the 1.5k pullup resistor on D- can be made +USB lines D+ and D- MUST be wired to the same I/O port. We recommend that D+ +triggers the interrupt (best achieved by using INT0 for D+), but it is also +possible to trigger the interrupt from D-. If D- is used, interrupts are also +triggered by SOF packets. D- requires a pull-up of 1.5k to +3.5V (and the +device must be powered at 3.5V) to identify as low-speed USB device. A +pull-down or pull-up of 1M SHOULD be connected from D+ to +3.5V to prevent +interference when no USB master is connected. If you use Zener diodes to limit +the voltage on D+ and D-, you MUST use a pull-down resistor, not a pull-up. +We use D+ as interrupt source and not D- because it does not trigger on +keep-alive and RESET states. If you want to count keep-alive events with +USB_COUNT_SOF, you MUST use D- as an interrupt source. + +As a compile time option, the 1.5k pull-up resistor on D- can be made switchable to allow the device to disconnect at will. See the definition of usbDeviceConnect() and usbDeviceDisconnect() further down in this file. Please adapt the values in usbconfig.h according to your hardware! -The device MUST be clocked at exactly 12 MHz or 16 MHz or at 16.5 MHz +/- 1%. -See usbconfig-prototype.h for details. +The device MUST be clocked at exactly 12 MHz, 15 MHz, 16 MHz or 20 MHz +or at 12.8 MHz resp. 16.5 MHz +/- 1%. See usbconfig-prototype.h for details. Limitations: @@ -53,16 +58,26 @@ bit rate over the same hardware, we should be on the safe side. Even the spec requires detection of asymmetric states at high bit rate for SE0 detection. Number of endpoints: -The driver supports up to four endpoints: One control endpoint (endpoint 0), -two interrupt-in (or bulk-in) endpoints (endpoint 1 and 3) and one -interrupt-out (or bulk-out) endpoint (endpoint 1). Please note that the USB -standard forbids bulk endpoints for low speed devices! Most operating systems -allow them anyway, but the AVR will spend 90% of the CPU time in the USB -interrupt polling for bulk data. -By default, only the control endpoint 0 is enabled. To get the other endpoints, -define USB_CFG_HAVE_INTRIN_ENDPOINT, USB_CFG_HAVE_INTRIN_ENDPOINT3 and/or -USB_CFG_IMPLEMENT_FN_WRITEOUT respectively (see usbconfig-prototype.h for -details). +The driver supports the following endpoints: + +- Endpoint 0, the default control endpoint. +- Any number of interrupt- or bulk-out endpoints. The data is sent to + usbFunctionWriteOut() and USB_CFG_IMPLEMENT_FN_WRITEOUT must be defined + to 1 to activate this feature. The endpoint number can be found in the + global variable 'usbRxToken'. +- One default interrupt- or bulk-in endpoint. This endpoint is used for + interrupt- or bulk-in transfers which are not handled by any other endpoint. + You must define USB_CFG_HAVE_INTRIN_ENDPOINT in order to activate this + feature and call usbSetInterrupt() to send interrupt/bulk data. +- One additional interrupt- or bulk-in endpoint. This was endpoint 3 in + previous versions of this driver but can now be configured to any endpoint + number. You must define USB_CFG_HAVE_INTRIN_ENDPOINT3 in order to activate + this feature and call usbSetInterrupt3() to send interrupt/bulk data. The + endpoint number can be set with USB_CFG_EP3_NUMBER. + +Please note that the USB standard forbids bulk endpoints for low speed devices! +Most operating systems allow them anyway, but the AVR will spend 90% of the CPU +time in the USB interrupt polling for bulk data. Maximum data payload: Data payload of control in and out transfers may be up to 254 bytes. In order @@ -76,22 +91,23 @@ bus power anyway. Bus-powered devices can achieve this only by putting the CPU in sleep mode. The driver does not implement suspend handling by itself. However, the application may implement activity monitoring and wakeup from sleep. The host sends regular SE0 states on the bus to keep it active. These -SE0 states can be detected by wiring the INT1 pin to D-. It is not necessary -to enable the interrupt, checking the interrupt pending flag should suffice. -Before entering sleep mode, the application should enable INT1 for a wakeup -on the next bus activity. +SE0 states can be detected by using D- as the interrupt source. Define +USB_COUNT_SOF to 1 and use the global variable usbSofCount to check for bus +activity. Operation without an USB master: The driver behaves neutral without connection to an USB master if D- reads as 1. To avoid spurious interrupts, we recommend a high impedance (e.g. 1M) -pullup resistor on D+. If D- becomes statically 0, the driver may block in -the interrupt routine. +pull-down or pull-up resistor on D+ (interrupt). If Zener diodes are used, +use a pull-down. If D- becomes statically 0, the driver may block in the +interrupt routine. Interrupt latency: The application must ensure that the USB interrupt is not disabled for more -than 20 cycles. This implies that all interrupt routines must either be -declared as "INTERRUPT" instead of "SIGNAL" (see "avr/signal.h") or that they -are written in assembler with "sei" as the first instruction. +than 25 cycles (this is for 12 MHz, faster clocks allow longer latency). +This implies that all interrupt routines must either be declared as "INTERRUPT" +instead of "SIGNAL" (see "avr/signal.h") or that they are written in assembler +with "sei" as the first instruction. Maximum interrupt duration / CPU cycle consumption: The driver handles all USB communication during the interrupt service @@ -106,7 +122,7 @@ USB messages, even if they address another (low-speed) device on the same bus. /* --------------------------- Module Interface ---------------------------- */ /* ------------------------------------------------------------------------- */ -#define USBDRV_VERSION 20070707 +#define USBDRV_VERSION 20081126 /* This define uniquely identifies a driver version. It is a decimal number * constructed from the driver's release date in the form YYYYMMDD. If the * driver's behavior or interface changes, you can use this constant to @@ -134,6 +150,19 @@ USB messages, even if they address another (low-speed) device on the same bus. #endif /* shortcuts for well defined 8 bit integer types */ +#if USB_CFG_LONG_TRANSFERS /* if more than 254 bytes transfer size required */ +# define usbMsgLen_t unsigned +#else +# define usbMsgLen_t uchar +#endif +/* usbMsgLen_t is the data type used for transfer lengths. By default, it is + * defined to uchar, allowing a maximum of 254 bytes (255 is reserved for + * USB_NO_MSG below). If the usbconfig.h defines USB_CFG_LONG_TRANSFERS to 1, + * a 16 bit data type is used, allowing up to 16384 bytes (the rest is used + * for flags in the descriptor configuration). + */ +#define USB_NO_MSG ((usbMsgLen_t)-1) /* constant meaning "no message" */ + struct usbRequest; /* forward declaration */ USB_PUBLIC void usbInit(void); @@ -152,7 +181,7 @@ extern uchar *usbMsgPtr; * implementation of usbFunctionWrite(). It is also used internally by the * driver for standard control requests. */ -USB_PUBLIC uchar usbFunctionSetup(uchar data[8]); +USB_PUBLIC usbMsgLen_t usbFunctionSetup(uchar data[8]); /* This function is called when the driver receives a SETUP transaction from * the host which is not answered by the driver itself (in practice: class and * vendor requests). All control transfers start with a SETUP transaction where @@ -165,21 +194,21 @@ USB_PUBLIC uchar usbFunctionSetup(uchar data[8]); * requested data to the driver. There are two ways to transfer this data: * (1) Set the global pointer 'usbMsgPtr' to the base of the static RAM data * block and return the length of the data in 'usbFunctionSetup()'. The driver - * will handle the rest. Or (2) return 0xff in 'usbFunctionSetup()'. The driver - * will then call 'usbFunctionRead()' when data is needed. See the + * will handle the rest. Or (2) return USB_NO_MSG in 'usbFunctionSetup()'. The + * driver will then call 'usbFunctionRead()' when data is needed. See the * documentation for usbFunctionRead() for details. * * If the SETUP indicates a control-out transfer, the only way to receive the * data from the host is through the 'usbFunctionWrite()' call. If you - * implement this function, you must return 0xff in 'usbFunctionSetup()' to - * indicate that 'usbFunctionWrite()' should be used. See the documentation of - * this function for more information. If you just want to ignore the data sent - * by the host, return 0 in 'usbFunctionSetup()'. + * implement this function, you must return USB_NO_MSG in 'usbFunctionSetup()' + * to indicate that 'usbFunctionWrite()' should be used. See the documentation + * of this function for more information. If you just want to ignore the data + * sent by the host, return 0 in 'usbFunctionSetup()'. * * Note that calls to the functions usbFunctionRead() and usbFunctionWrite() * are only done if enabled by the configuration in usbconfig.h. */ -USB_PUBLIC uchar usbFunctionDescriptor(struct usbRequest *rq); +USB_PUBLIC usbMsgLen_t usbFunctionDescriptor(struct usbRequest *rq); /* You need to implement this function ONLY if you provide USB descriptors at * runtime (which is an expert feature). It is very similar to * usbFunctionSetup() above, but it is called only to request USB descriptor @@ -193,7 +222,6 @@ USB_PUBLIC void usbSetInterrupt(uchar *data, uchar len); * interrupt status to the host. * If you need to transfer more bytes, use a control read after the interrupt. */ -extern volatile uchar usbTxLen1; #define usbInterruptIsReady() (usbTxLen1 & 0x10) /* This macro indicates whether the last interrupt message has already been * sent. If you set a new interrupt message before the old was sent, the @@ -201,7 +229,6 @@ extern volatile uchar usbTxLen1; */ #if USB_CFG_HAVE_INTRIN_ENDPOINT3 USB_PUBLIC void usbSetInterrupt3(uchar *data, uchar len); -extern volatile uchar usbTxLen3; #define usbInterruptIsReady3() (usbTxLen3 & 0x10) /* Same as above for endpoint 3 */ #endif @@ -248,25 +275,33 @@ USB_PUBLIC uchar usbFunctionRead(uchar *data, uchar len); #endif /* USB_CFG_IMPLEMENT_FN_READ */ #if USB_CFG_IMPLEMENT_FN_WRITEOUT USB_PUBLIC void usbFunctionWriteOut(uchar *data, uchar len); -/* This function is called by the driver when data on interrupt-out or bulk- - * out endpoint 1 is received. You must define USB_CFG_IMPLEMENT_FN_WRITEOUT - * to 1 in usbconfig.h to get this function called. +/* This function is called by the driver when data is received on an interrupt- + * or bulk-out endpoint. The endpoint number can be found in the global + * variable usbRxToken. You must define USB_CFG_IMPLEMENT_FN_WRITEOUT to 1 in + * usbconfig.h to get this function called. */ #endif /* USB_CFG_IMPLEMENT_FN_WRITEOUT */ #ifdef USB_CFG_PULLUP_IOPORTNAME #define usbDeviceConnect() ((USB_PULLUP_DDR |= (1< /* for CPU I/O register definitions and vectors */ -#endif /* __IAR_SYSTEMS_ASM__ */ -#include "usbdrv.h" /* for common defs */ - +#define __SFR_OFFSET 0 /* used by avr-libc's register definitions */ +#include "usbportability.h" +#include "usbdrv.h" /* for common defs */ /* register names */ #define x1 r16 @@ -39,40 +33,53 @@ the file appropriate for the given clock rate. /* Some assembler dependent definitions and declarations: */ #ifdef __IAR_SYSTEMS_ASM__ - -# define nop2 rjmp $+2 /* jump to next instruction */ -# define XL r26 -# define XH r27 -# define YL r28 -# define YH r29 -# define ZL r30 -# define ZH r31 -# define lo8(x) LOW(x) -# define hi8(x) ((x)>>8) /* not HIGH to allow XLINK to make a proper range check */ - extern usbRxBuf, usbDeviceAddr, usbNewDeviceAddr, usbInputBufOffset extern usbCurrentTok, usbRxLen, usbRxToken, usbTxLen - extern usbTxBuf, usbMsgLen, usbTxLen1, usbTxBuf1, usbTxLen3, usbTxBuf3 + extern usbTxBuf, usbTxStatus1, usbTxStatus3 +# if USB_COUNT_SOF + extern usbSofCount +# endif public usbCrc16 public usbCrc16Append COMMON INTVEC - ORG INT0_vect - rjmp SIG_INTERRUPT0 +# ifndef USB_INTR_VECTOR + ORG INT0_vect +# else /* USB_INTR_VECTOR */ + ORG USB_INTR_VECTOR +# undef USB_INTR_VECTOR +# endif /* USB_INTR_VECTOR */ +# define USB_INTR_VECTOR usbInterruptHandler + rjmp USB_INTR_VECTOR RSEG CODE #else /* __IAR_SYSTEMS_ASM__ */ -# define nop2 rjmp .+0 /* jump to next instruction */ - +# ifndef USB_INTR_VECTOR /* default to hardware interrupt INT0 */ +# define USB_INTR_VECTOR SIG_INTERRUPT0 +# endif .text - .global SIG_INTERRUPT0 - .type SIG_INTERRUPT0, @function + .global USB_INTR_VECTOR + .type USB_INTR_VECTOR, @function .global usbCrc16 .global usbCrc16Append - #endif /* __IAR_SYSTEMS_ASM__ */ + +#if USB_INTR_PENDING < 0x40 /* This is an I/O address, use in and out */ +# define USB_LOAD_PENDING(reg) in reg, USB_INTR_PENDING +# define USB_STORE_PENDING(reg) out USB_INTR_PENDING, reg +#else /* It's a memory address, use lds and sts */ +# define USB_LOAD_PENDING(reg) lds reg, USB_INTR_PENDING +# define USB_STORE_PENDING(reg) sts USB_INTR_PENDING, reg +#endif + +#define usbTxLen1 usbTxStatus1 +#define usbTxBuf1 (usbTxStatus1 + 1) +#define usbTxLen3 usbTxStatus3 +#define usbTxBuf3 (usbTxStatus3 + 1) + + ;---------------------------------------------------------------------------- ; Utility functions ;---------------------------------------------------------------------------- @@ -144,33 +151,30 @@ RTMODEL "__rt_version", "3" usbCrc16: mov ptrL, argPtrL mov ptrH, argPtrH - ldi resCrcL, 0xff - ldi resCrcH, 0xff + ldi resCrcL, 0 + ldi resCrcH, 0 ldi polyL, lo8(0xa001) ldi polyH, hi8(0xa001) + com argLen ; argLen = -argLen - 1 crcByteLoop: - subi argLen, 1 - brcs crcReady + subi argLen, -1 + brcc crcReady ; modified loop to ensure that carry is set below ld byte, ptr+ - ldi bitCnt, 8 + ldi bitCnt, -8 ; strange loop counter to ensure that carry is set where we need it + eor resCrcL, byte crcBitLoop: - mov scratch, byte - eor scratch, resCrcL - lsr resCrcH + ror resCrcH ; carry is always set here ror resCrcL - lsr byte - sbrs scratch, 0 - rjmp crcNoXor + brcs crcNoXor eor resCrcL, polyL eor resCrcH, polyH crcNoXor: - dec bitCnt - brne crcBitLoop + subi bitCnt, -1 + brcs crcBitLoop rjmp crcByteLoop crcReady: - com resCrcL - com resCrcH ret +; Thanks to Reimar Doeffinger for optimizing this CRC routine! ; extern unsigned usbCrc16Append(unsigned char *data, unsigned char len); usbCrc16Append: @@ -179,6 +183,93 @@ usbCrc16Append: st ptr+, resCrcH ret +#undef argLen +#undef argPtrL +#undef argPtrH +#undef resCrcL +#undef resCrcH +#undef ptrL +#undef ptrH +#undef ptr +#undef byte +#undef bitCnt +#undef polyL +#undef polyH +#undef scratch + + +#if USB_CFG_HAVE_MEASURE_FRAME_LENGTH +#ifdef __IAR_SYSTEMS_ASM__ +/* Register assignments for usbMeasureFrameLength on IAR cc */ +/* Calling conventions on IAR: + * First parameter passed in r16/r17, second in r18/r19 and so on. + * Callee must preserve r4-r15, r24-r29 (r28/r29 is frame pointer) + * Result is passed in r16/r17 + * In case of the "tiny" memory model, pointers are only 8 bit with no + * padding. We therefore pass argument 1 as "16 bit unsigned". + */ +# define resL r16 +# define resH r17 +# define cnt16L r30 +# define cnt16H r31 +# define cntH r18 + +#else /* __IAR_SYSTEMS_ASM__ */ +/* Register assignments for usbMeasureFrameLength on gcc */ +/* Calling conventions on gcc: + * First parameter passed in r24/r25, second in r22/23 and so on. + * Callee must preserve r1-r17, r28/r29 + * Result is passed in r24/r25 + */ +# define resL r24 +# define resH r25 +# define cnt16L r24 +# define cnt16H r25 +# define cntH r26 +#endif +# define cnt16 cnt16L + +; extern unsigned usbMeasurePacketLength(void); +; returns time between two idle strobes in multiples of 7 CPU clocks +.global usbMeasureFrameLength +usbMeasureFrameLength: + ldi cntH, 6 ; wait ~ 10 ms for D- == 0 + clr cnt16L + clr cnt16H +usbMFTime16: + dec cntH + breq usbMFTimeout +usbMFWaitStrobe: ; first wait for D- == 0 (idle strobe) + sbiw cnt16, 1 ;[0] [6] + breq usbMFTime16 ;[2] + sbic USBIN, USBMINUS ;[3] + rjmp usbMFWaitStrobe ;[4] +usbMFWaitIdle: ; then wait until idle again + sbis USBIN, USBMINUS ;1 wait for D- == 1 + rjmp usbMFWaitIdle ;2 + ldi cnt16L, 1 ;1 represents cycles so far + clr cnt16H ;1 +usbMFWaitLoop: + in cntH, USBIN ;[0] [7] + adiw cnt16, 1 ;[1] + breq usbMFTimeout ;[3] + andi cntH, USBMASK ;[4] + brne usbMFWaitLoop ;[5] +usbMFTimeout: +#if resL != cnt16L + mov resL, cnt16L + mov resH, cnt16H +#endif + ret + +#undef resL +#undef resH +#undef cnt16 +#undef cnt16L +#undef cnt16H +#undef cntH + +#endif /* USB_CFG_HAVE_MEASURE_FRAME_LENGTH */ ;---------------------------------------------------------------------------- ; Now include the clock rate specific code @@ -189,11 +280,17 @@ usbCrc16Append: #endif #if USB_CFG_CLOCK_KHZ == 12000 -# include "usbdrvasm12.S" +# include "usbdrvasm12.inc" +#elif USB_CFG_CLOCK_KHZ == 12800 +# include "usbdrvasm128.inc" +#elif USB_CFG_CLOCK_KHZ == 15000 +# include "usbdrvasm15.inc" #elif USB_CFG_CLOCK_KHZ == 16000 -# include "usbdrvasm16.S" +# include "usbdrvasm16.inc" #elif USB_CFG_CLOCK_KHZ == 16500 -# include "usbdrvasm165.S" +# include "usbdrvasm165.inc" +#elif USB_CFG_CLOCK_KHZ == 20000 +# include "usbdrvasm20.inc" #else # error "USB_CFG_CLOCK_KHZ is not one of the supported rates!" #endif diff --git a/firmware/usbdrv/usbdrvasm.asm b/firmware/usbdrv/usbdrvasm.asm index 4a5486fda..a534b73bb 100644 --- a/firmware/usbdrv/usbdrvasm.asm +++ b/firmware/usbdrv/usbdrvasm.asm @@ -4,7 +4,7 @@ * Creation Date: 2006-03-01 * Tabsize: 4 * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) * This Revision: $Id$ */ diff --git a/firmware/usbdrv/usbdrvasm12.S b/firmware/usbdrv/usbdrvasm12.S deleted file mode 100644 index b141e85e8..000000000 --- a/firmware/usbdrv/usbdrvasm12.S +++ /dev/null @@ -1,555 +0,0 @@ -/* Name: usbdrvasm12.S - * Project: AVR USB driver - * Author: Christian Starkjohann - * Creation Date: 2004-12-29 - * Tabsize: 4 - * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrvasm12.S 353 2007-06-21 19:05:08Z cs $ - */ - -/* Do not link this file! Link usbdrvasm.S instead, which includes the - * appropriate implementation! - */ - -/* -General Description: -This file is the 12 MHz version of the asssembler part of the USB driver. It -requires a 12 MHz crystal (not a ceramic resonator and not a calibrated RC -oscillator). - -See usbdrv.h for a description of the entire driver. - -Since almost all of this code is timing critical, don't change unless you -really know what you are doing! Many parts require not only a maximum number -of CPU cycles, but even an exact number of cycles! - - -Timing constraints according to spec (in bit times): -timing subject min max CPUcycles ---------------------------------------------------------------------------- -EOP of OUT/SETUP to sync pattern of DATA0 (both rx) 2 16 16-128 -EOP of IN to sync pattern of DATA0 (rx, then tx) 2 7.5 16-60 -DATAx (rx) to ACK/NAK/STALL (tx) 2 7.5 16-60 -*/ - -;Software-receiver engine. Strict timing! Don't change unless you can preserve timing! -;interrupt response time: 4 cycles + insn running = 7 max if interrupts always enabled -;max allowable interrupt latency: 34 cycles -> max 25 cycles interrupt disable -;max stack usage: [ret(2), YL, SREG, YH, shift, x1, x2, x3, cnt, x4] = 11 bytes -;Numbers in brackets are maximum cycles since SOF. -SIG_INTERRUPT0: -;order of registers pushed: YL, SREG [sofError], YH, shift, x1, x2, x3, cnt - push YL ;2 [35] push only what is necessary to sync with edge ASAP - in YL, SREG ;1 [37] - push YL ;2 [39] -;---------------------------------------------------------------------------- -; Synchronize with sync pattern: -;---------------------------------------------------------------------------- -;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K] -;sync up with J to K edge during sync pattern -- use fastest possible loops -;first part has no timeout because it waits for IDLE or SE1 (== disconnected) -waitForJ: - sbis USBIN, USBMINUS ;1 [40] wait for D- == 1 - rjmp waitForJ ;2 -waitForK: -;The following code results in a sampling window of 1/4 bit which meets the spec. - sbis USBIN, USBMINUS - rjmp foundK - sbis USBIN, USBMINUS - rjmp foundK - sbis USBIN, USBMINUS - rjmp foundK - sbis USBIN, USBMINUS - rjmp foundK - sbis USBIN, USBMINUS - rjmp foundK - rjmp sofError -foundK: -;{3, 5} after falling D- edge, average delay: 4 cycles [we want 4 for center sampling] -;we have 1 bit time for setup purposes, then sample again. Numbers in brackets -;are cycles from center of first sync (double K) bit after the instruction - push YH ;2 [2] - lds YL, usbInputBufOffset;2 [4] - clr YH ;1 [5] - subi YL, lo8(-(usbRxBuf));1 [6] - sbci YH, hi8(-(usbRxBuf));1 [7] - - sbis USBIN, USBMINUS ;1 [8] we want two bits K [sample 1 cycle too early] - rjmp haveTwoBitsK ;2 [10] - pop YH ;2 [11] undo the push from before - rjmp waitForK ;2 [13] this was not the end of sync, retry -haveTwoBitsK: -;---------------------------------------------------------------------------- -; push more registers and initialize values while we sample the first bits: -;---------------------------------------------------------------------------- - push shift ;2 [16] - push x1 ;2 [12] - push x2 ;2 [14] - - in x1, USBIN ;1 [17] <-- sample bit 0 - ldi shift, 0xff ;1 [18] - bst x1, USBMINUS ;1 [19] - bld shift, 0 ;1 [20] - push x3 ;2 [22] - push cnt ;2 [24] - - in x2, USBIN ;1 [25] <-- sample bit 1 - ser x3 ;1 [26] [inserted init instruction] - eor x1, x2 ;1 [27] - bst x1, USBMINUS ;1 [28] - bld shift, 1 ;1 [29] - ldi cnt, USB_BUFSIZE;1 [30] [inserted init instruction] - rjmp rxbit2 ;2 [32] - -;---------------------------------------------------------------------------- -; Receiver loop (numbers in brackets are cycles within byte after instr) -;---------------------------------------------------------------------------- - -unstuff0: ;1 (branch taken) - andi x3, ~0x01 ;1 [15] - mov x1, x2 ;1 [16] x2 contains last sampled (stuffed) bit - in x2, USBIN ;1 [17] <-- sample bit 1 again - ori shift, 0x01 ;1 [18] - rjmp didUnstuff0 ;2 [20] - -unstuff1: ;1 (branch taken) - mov x2, x1 ;1 [21] x1 contains last sampled (stuffed) bit - andi x3, ~0x02 ;1 [22] - ori shift, 0x02 ;1 [23] - nop ;1 [24] - in x1, USBIN ;1 [25] <-- sample bit 2 again - rjmp didUnstuff1 ;2 [27] - -unstuff2: ;1 (branch taken) - andi x3, ~0x04 ;1 [29] - ori shift, 0x04 ;1 [30] - mov x1, x2 ;1 [31] x2 contains last sampled (stuffed) bit - nop ;1 [32] - in x2, USBIN ;1 [33] <-- sample bit 3 - rjmp didUnstuff2 ;2 [35] - -unstuff3: ;1 (branch taken) - in x2, USBIN ;1 [34] <-- sample stuffed bit 3 [one cycle too late] - andi x3, ~0x08 ;1 [35] - ori shift, 0x08 ;1 [36] - rjmp didUnstuff3 ;2 [38] - -unstuff4: ;1 (branch taken) - andi x3, ~0x10 ;1 [40] - in x1, USBIN ;1 [41] <-- sample stuffed bit 4 - ori shift, 0x10 ;1 [42] - rjmp didUnstuff4 ;2 [44] - -unstuff5: ;1 (branch taken) - andi x3, ~0x20 ;1 [48] - in x2, USBIN ;1 [49] <-- sample stuffed bit 5 - ori shift, 0x20 ;1 [50] - rjmp didUnstuff5 ;2 [52] - -unstuff6: ;1 (branch taken) - andi x3, ~0x40 ;1 [56] - in x1, USBIN ;1 [57] <-- sample stuffed bit 6 - ori shift, 0x40 ;1 [58] - rjmp didUnstuff6 ;2 [60] - -; extra jobs done during bit interval: -; bit 0: store, clear [SE0 is unreliable here due to bit dribbling in hubs] -; bit 1: se0 check -; bit 2: overflow check -; bit 3: recovery from delay [bit 0 tasks took too long] -; bit 4: none -; bit 5: none -; bit 6: none -; bit 7: jump, eor -rxLoop: - eor x3, shift ;1 [0] reconstruct: x3 is 0 at bit locations we changed, 1 at others - in x1, USBIN ;1 [1] <-- sample bit 0 - st y+, x3 ;2 [3] store data - ser x3 ;1 [4] - nop ;1 [5] - eor x2, x1 ;1 [6] - bst x2, USBMINUS;1 [7] - bld shift, 0 ;1 [8] - in x2, USBIN ;1 [9] <-- sample bit 1 (or possibly bit 0 stuffed) - andi x2, USBMASK ;1 [10] - breq se0 ;1 [11] SE0 check for bit 1 - andi shift, 0xf9 ;1 [12] -didUnstuff0: - breq unstuff0 ;1 [13] - eor x1, x2 ;1 [14] - bst x1, USBMINUS;1 [15] - bld shift, 1 ;1 [16] -rxbit2: - in x1, USBIN ;1 [17] <-- sample bit 2 (or possibly bit 1 stuffed) - andi shift, 0xf3 ;1 [18] - breq unstuff1 ;1 [19] do remaining work for bit 1 -didUnstuff1: - subi cnt, 1 ;1 [20] - brcs overflow ;1 [21] loop control - eor x2, x1 ;1 [22] - bst x2, USBMINUS;1 [23] - bld shift, 2 ;1 [24] - in x2, USBIN ;1 [25] <-- sample bit 3 (or possibly bit 2 stuffed) - andi shift, 0xe7 ;1 [26] - breq unstuff2 ;1 [27] -didUnstuff2: - eor x1, x2 ;1 [28] - bst x1, USBMINUS;1 [29] - bld shift, 3 ;1 [30] -didUnstuff3: - andi shift, 0xcf ;1 [31] - breq unstuff3 ;1 [32] - in x1, USBIN ;1 [33] <-- sample bit 4 - eor x2, x1 ;1 [34] - bst x2, USBMINUS;1 [35] - bld shift, 4 ;1 [36] -didUnstuff4: - andi shift, 0x9f ;1 [37] - breq unstuff4 ;1 [38] - nop2 ;2 [40] - in x2, USBIN ;1 [41] <-- sample bit 5 - eor x1, x2 ;1 [42] - bst x1, USBMINUS;1 [43] - bld shift, 5 ;1 [44] -didUnstuff5: - andi shift, 0x3f ;1 [45] - breq unstuff5 ;1 [46] - nop2 ;2 [48] - in x1, USBIN ;1 [49] <-- sample bit 6 - eor x2, x1 ;1 [50] - bst x2, USBMINUS;1 [51] - bld shift, 6 ;1 [52] -didUnstuff6: - cpi shift, 0x02 ;1 [53] - brlo unstuff6 ;1 [54] - nop2 ;2 [56] - in x2, USBIN ;1 [57] <-- sample bit 7 - eor x1, x2 ;1 [58] - bst x1, USBMINUS;1 [59] - bld shift, 7 ;1 [60] -didUnstuff7: - cpi shift, 0x04 ;1 [61] - brsh rxLoop ;2 [63] loop control -unstuff7: - andi x3, ~0x80 ;1 [63] - ori shift, 0x80 ;1 [64] - in x2, USBIN ;1 [65] <-- sample stuffed bit 7 - nop ;1 [66] - rjmp didUnstuff7 ;2 [68] - - -;---------------------------------------------------------------------------- -; Processing of received packet (numbers in brackets are cycles after end of SE0) -;---------------------------------------------------------------------------- -;This is the only non-error exit point for the software receiver loop -;we don't check any CRCs here because there is no time left. -#define token x1 -se0: ; [0] - subi cnt, USB_BUFSIZE ;1 [1] - neg cnt ;1 [2] - cpi cnt, 3 ;1 [3] - ldi x2, 1< max 25 cycles interrupt disable +;max stack usage: [ret(2), YL, SREG, YH, shift, x1, x2, x3, cnt, x4] = 11 bytes +;Numbers in brackets are maximum cycles since SOF. +USB_INTR_VECTOR: +;order of registers pushed: YL, SREG [sofError], YH, shift, x1, x2, x3, cnt + push YL ;2 [35] push only what is necessary to sync with edge ASAP + in YL, SREG ;1 [37] + push YL ;2 [39] +;---------------------------------------------------------------------------- +; Synchronize with sync pattern: +;---------------------------------------------------------------------------- +;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K] +;sync up with J to K edge during sync pattern -- use fastest possible loops +;The first part waits at most 1 bit long since we must be in sync pattern. +;YL is guarenteed to be < 0x80 because I flag is clear. When we jump to +;waitForJ, ensure that this prerequisite is met. +waitForJ: + inc YL + sbis USBIN, USBMINUS + brne waitForJ ; just make sure we have ANY timeout +waitForK: +;The following code results in a sampling window of 1/4 bit which meets the spec. + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK +#if USB_COUNT_SOF + lds YL, usbSofCount + inc YL + sts usbSofCount, YL +#endif /* USB_COUNT_SOF */ +#ifdef USB_SOF_HOOK + USB_SOF_HOOK +#endif + rjmp sofError +foundK: +;{3, 5} after falling D- edge, average delay: 4 cycles [we want 4 for center sampling] +;we have 1 bit time for setup purposes, then sample again. Numbers in brackets +;are cycles from center of first sync (double K) bit after the instruction + push YH ;2 [2] + lds YL, usbInputBufOffset;2 [4] + clr YH ;1 [5] + subi YL, lo8(-(usbRxBuf));1 [6] + sbci YH, hi8(-(usbRxBuf));1 [7] + + sbis USBIN, USBMINUS ;1 [8] we want two bits K [sample 1 cycle too early] + rjmp haveTwoBitsK ;2 [10] + pop YH ;2 [11] undo the push from before + rjmp waitForK ;2 [13] this was not the end of sync, retry +haveTwoBitsK: +;---------------------------------------------------------------------------- +; push more registers and initialize values while we sample the first bits: +;---------------------------------------------------------------------------- + push shift ;2 [16] + push x1 ;2 [12] + push x2 ;2 [14] + + in x1, USBIN ;1 [17] <-- sample bit 0 + ldi shift, 0xff ;1 [18] + bst x1, USBMINUS ;1 [19] + bld shift, 0 ;1 [20] + push x3 ;2 [22] + push cnt ;2 [24] + + in x2, USBIN ;1 [25] <-- sample bit 1 + ser x3 ;1 [26] [inserted init instruction] + eor x1, x2 ;1 [27] + bst x1, USBMINUS ;1 [28] + bld shift, 1 ;1 [29] + ldi cnt, USB_BUFSIZE;1 [30] [inserted init instruction] + rjmp rxbit2 ;2 [32] + +;---------------------------------------------------------------------------- +; Receiver loop (numbers in brackets are cycles within byte after instr) +;---------------------------------------------------------------------------- + +unstuff0: ;1 (branch taken) + andi x3, ~0x01 ;1 [15] + mov x1, x2 ;1 [16] x2 contains last sampled (stuffed) bit + in x2, USBIN ;1 [17] <-- sample bit 1 again + ori shift, 0x01 ;1 [18] + rjmp didUnstuff0 ;2 [20] + +unstuff1: ;1 (branch taken) + mov x2, x1 ;1 [21] x1 contains last sampled (stuffed) bit + andi x3, ~0x02 ;1 [22] + ori shift, 0x02 ;1 [23] + nop ;1 [24] + in x1, USBIN ;1 [25] <-- sample bit 2 again + rjmp didUnstuff1 ;2 [27] + +unstuff2: ;1 (branch taken) + andi x3, ~0x04 ;1 [29] + ori shift, 0x04 ;1 [30] + mov x1, x2 ;1 [31] x2 contains last sampled (stuffed) bit + nop ;1 [32] + in x2, USBIN ;1 [33] <-- sample bit 3 + rjmp didUnstuff2 ;2 [35] + +unstuff3: ;1 (branch taken) + in x2, USBIN ;1 [34] <-- sample stuffed bit 3 [one cycle too late] + andi x3, ~0x08 ;1 [35] + ori shift, 0x08 ;1 [36] + rjmp didUnstuff3 ;2 [38] + +unstuff4: ;1 (branch taken) + andi x3, ~0x10 ;1 [40] + in x1, USBIN ;1 [41] <-- sample stuffed bit 4 + ori shift, 0x10 ;1 [42] + rjmp didUnstuff4 ;2 [44] + +unstuff5: ;1 (branch taken) + andi x3, ~0x20 ;1 [48] + in x2, USBIN ;1 [49] <-- sample stuffed bit 5 + ori shift, 0x20 ;1 [50] + rjmp didUnstuff5 ;2 [52] + +unstuff6: ;1 (branch taken) + andi x3, ~0x40 ;1 [56] + in x1, USBIN ;1 [57] <-- sample stuffed bit 6 + ori shift, 0x40 ;1 [58] + rjmp didUnstuff6 ;2 [60] + +; extra jobs done during bit interval: +; bit 0: store, clear [SE0 is unreliable here due to bit dribbling in hubs] +; bit 1: se0 check +; bit 2: overflow check +; bit 3: recovery from delay [bit 0 tasks took too long] +; bit 4: none +; bit 5: none +; bit 6: none +; bit 7: jump, eor +rxLoop: + eor x3, shift ;1 [0] reconstruct: x3 is 0 at bit locations we changed, 1 at others + in x1, USBIN ;1 [1] <-- sample bit 0 + st y+, x3 ;2 [3] store data + ser x3 ;1 [4] + nop ;1 [5] + eor x2, x1 ;1 [6] + bst x2, USBMINUS;1 [7] + bld shift, 0 ;1 [8] + in x2, USBIN ;1 [9] <-- sample bit 1 (or possibly bit 0 stuffed) + andi x2, USBMASK ;1 [10] + breq se0 ;1 [11] SE0 check for bit 1 + andi shift, 0xf9 ;1 [12] +didUnstuff0: + breq unstuff0 ;1 [13] + eor x1, x2 ;1 [14] + bst x1, USBMINUS;1 [15] + bld shift, 1 ;1 [16] +rxbit2: + in x1, USBIN ;1 [17] <-- sample bit 2 (or possibly bit 1 stuffed) + andi shift, 0xf3 ;1 [18] + breq unstuff1 ;1 [19] do remaining work for bit 1 +didUnstuff1: + subi cnt, 1 ;1 [20] + brcs overflow ;1 [21] loop control + eor x2, x1 ;1 [22] + bst x2, USBMINUS;1 [23] + bld shift, 2 ;1 [24] + in x2, USBIN ;1 [25] <-- sample bit 3 (or possibly bit 2 stuffed) + andi shift, 0xe7 ;1 [26] + breq unstuff2 ;1 [27] +didUnstuff2: + eor x1, x2 ;1 [28] + bst x1, USBMINUS;1 [29] + bld shift, 3 ;1 [30] +didUnstuff3: + andi shift, 0xcf ;1 [31] + breq unstuff3 ;1 [32] + in x1, USBIN ;1 [33] <-- sample bit 4 + eor x2, x1 ;1 [34] + bst x2, USBMINUS;1 [35] + bld shift, 4 ;1 [36] +didUnstuff4: + andi shift, 0x9f ;1 [37] + breq unstuff4 ;1 [38] + nop2 ;2 [40] + in x2, USBIN ;1 [41] <-- sample bit 5 + eor x1, x2 ;1 [42] + bst x1, USBMINUS;1 [43] + bld shift, 5 ;1 [44] +didUnstuff5: + andi shift, 0x3f ;1 [45] + breq unstuff5 ;1 [46] + nop2 ;2 [48] + in x1, USBIN ;1 [49] <-- sample bit 6 + eor x2, x1 ;1 [50] + bst x2, USBMINUS;1 [51] + bld shift, 6 ;1 [52] +didUnstuff6: + cpi shift, 0x02 ;1 [53] + brlo unstuff6 ;1 [54] + nop2 ;2 [56] + in x2, USBIN ;1 [57] <-- sample bit 7 + eor x1, x2 ;1 [58] + bst x1, USBMINUS;1 [59] + bld shift, 7 ;1 [60] +didUnstuff7: + cpi shift, 0x04 ;1 [61] + brsh rxLoop ;2 [63] loop control +unstuff7: + andi x3, ~0x80 ;1 [63] + ori shift, 0x80 ;1 [64] + in x2, USBIN ;1 [65] <-- sample stuffed bit 7 + nop ;1 [66] + rjmp didUnstuff7 ;2 [68] + +macro POP_STANDARD ; 12 cycles + pop cnt + pop x3 + pop x2 + pop x1 + pop shift + pop YH + endm +macro POP_RETI ; 5 cycles + pop YL + out SREG, YL + pop YL + endm + +#include "asmcommon.inc" + +;---------------------------------------------------------------------------- +; Transmitting data +;---------------------------------------------------------------------------- + +txByteLoop: +txBitloop: +stuffN1Delay: ; [03] + ror shift ;[-5] [11] [59] + brcc doExorN1 ;[-4] [60] + subi x4, 1 ;[-3] + brne commonN1 ;[-2] + lsl shift ;[-1] compensate ror after rjmp stuffDelay + nop ;[00] stuffing consists of just waiting 8 cycles + rjmp stuffN1Delay ;[01] after ror, C bit is reliably clear + +sendNakAndReti: ;0 [-19] 19 cycles until SOP + ldi x3, USBPID_NAK ;1 [-18] + rjmp usbSendX3 ;2 [-16] +sendAckAndReti: ;0 [-19] 19 cycles until SOP + ldi x3, USBPID_ACK ;1 [-18] + rjmp usbSendX3 ;2 [-16] +sendCntAndReti: ;0 [-17] 17 cycles until SOP + mov x3, cnt ;1 [-16] +usbSendX3: ;0 [-16] + ldi YL, 20 ;1 [-15] 'x3' is R20 + ldi YH, 0 ;1 [-14] + ldi cnt, 2 ;1 [-13] +; rjmp usbSendAndReti fallthrough + +; USB spec says: +; idle = J +; J = (D+ = 0), (D- = 1) or USBOUT = 0x01 +; K = (D+ = 1), (D- = 0) or USBOUT = 0x02 +; Spec allows 7.5 bit times from EOP to SOP for replies (= 60 cycles) + +;usbSend: +;pointer to data in 'Y' +;number of bytes in 'cnt' -- including sync byte +;uses: x1...x2, x4, shift, cnt, Y [x1 = mirror USBOUT, x2 = USBMASK, x4 = bitstuff cnt] +;Numbers in brackets are time since first bit of sync pattern is sent (start of instruction) +usbSendAndReti: + in x2, USBDDR ;[-12] 12 cycles until SOP + ori x2, USBMASK ;[-11] + sbi USBOUT, USBMINUS ;[-10] prepare idle state; D+ and D- must have been 0 (no pullups) + out USBDDR, x2 ;[-8] <--- acquire bus + in x1, USBOUT ;[-7] port mirror for tx loop + ldi shift, 0x40 ;[-6] sync byte is first byte sent (we enter loop after ror) + ldi x2, USBMASK ;[-5] + push x4 ;[-4] +doExorN1: + eor x1, x2 ;[-2] [06] [62] + ldi x4, 6 ;[-1] [07] [63] +commonN1: +stuffN2Delay: + out USBOUT, x1 ;[00] [08] [64] <--- set bit + ror shift ;[01] + brcc doExorN2 ;[02] + subi x4, 1 ;[03] + brne commonN2 ;[04] + lsl shift ;[05] compensate ror after rjmp stuffDelay + rjmp stuffN2Delay ;[06] after ror, C bit is reliably clear +doExorN2: + eor x1, x2 ;[04] [12] + ldi x4, 6 ;[05] [13] +commonN2: + nop ;[06] [14] + subi cnt, 171 ;[07] [15] trick: (3 * 171) & 0xff = 1 + out USBOUT, x1 ;[08] [16] <--- set bit + brcs txBitloop ;[09] [25] [41] + +stuff6Delay: + ror shift ;[42] [50] + brcc doExor6 ;[43] + subi x4, 1 ;[44] + brne common6 ;[45] + lsl shift ;[46] compensate ror after rjmp stuffDelay + nop ;[47] stuffing consists of just waiting 8 cycles + rjmp stuff6Delay ;[48] after ror, C bit is reliably clear +doExor6: + eor x1, x2 ;[45] [53] + ldi x4, 6 ;[46] +common6: +stuff7Delay: + ror shift ;[47] [55] + out USBOUT, x1 ;[48] <--- set bit + brcc doExor7 ;[49] + subi x4, 1 ;[50] + brne common7 ;[51] + lsl shift ;[52] compensate ror after rjmp stuffDelay + rjmp stuff7Delay ;[53] after ror, C bit is reliably clear +doExor7: + eor x1, x2 ;[51] [59] + ldi x4, 6 ;[52] +common7: + ld shift, y+ ;[53] + tst cnt ;[55] + out USBOUT, x1 ;[56] <--- set bit + brne txByteLoop ;[57] + +;make SE0: + cbr x1, USBMASK ;[58] prepare SE0 [spec says EOP may be 15 to 18 cycles] + lds x2, usbNewDeviceAddr;[59] + lsl x2 ;[61] we compare with left shifted address + subi YL, 2 + 20 ;[62] Only assign address on data packets, not ACK/NAK in x3 + sbci YH, 0 ;[63] + out USBOUT, x1 ;[00] <-- out SE0 -- from now 2 bits = 16 cycles until bus idle +;2006-03-06: moved transfer of new address to usbDeviceAddr from C-Code to asm: +;set address only after data packet was sent, not after handshake + breq skipAddrAssign ;[01] + sts usbDeviceAddr, x2 ; if not skipped: SE0 is one cycle longer +skipAddrAssign: +;end of usbDeviceAddress transfer + ldi x2, 1< 12.5625 MHz +max frequency: 69.286 cycles for 8 bit -> 12.99 MHz +nominal frequency: 12.77 MHz ( = sqrt(min * max)) + +sampling positions: (next even number in range [+/- 0.5]) +cycle index range: 0 ... 66 +bits: +.5, 8.875, 17.25, 25.625, 34, 42.375, 50.75, 59.125 +[0/1], [9], [17], [25/+26], [34], [+42/43], [51], [59] + +bit number: 0 1 2 3 4 5 6 7 +spare cycles 1 2 1 2 1 1 1 0 + +operations to perform: duration cycle + ---------------- + eor fix, shift 1 -> 00 + andi phase, USBMASK 1 -> 08 + breq se0 1 -> 16 (moved to 11) + st y+, data 2 -> 24, 25 + mov data, fix 1 -> 33 + ser data 1 -> 41 + subi cnt, 1 1 -> 49 + brcs overflow 1 -> 50 + +layout of samples and operations: +[##] = sample bit +<##> = sample phase +*##* = operation + +0: *00* [01] 02 03 04 <05> 06 07 +1: *08* [09] 10 11 12 <13> 14 15 *16* +2: [17] 18 19 20 <21> 22 23 +3: *24* *25* [26] 27 28 29 <30> 31 32 +4: *33* [34] 35 36 37 <38> 39 40 +5: *41* [42] 43 44 45 <46> 47 48 +6: *49* *50* [51] 52 53 54 <55> 56 57 58 +7: [59] 60 61 62 <63> 64 65 66 +*****************************************************************************/ + +/* we prefer positive expressions (do if condition) instead of negative + * (skip if condition), therefore use defines for skip instructions: + */ +#define ifioclr sbis +#define ifioset sbic +#define ifrclr sbrs +#define ifrset sbrc + +/* The registers "fix" and "data" swap their meaning during the loop. Use + * defines to keep their name constant. + */ +#define fix x2 +#define data x1 +#undef phase /* phase has a default definition to x4 */ +#define phase x3 + + +USB_INTR_VECTOR: +;order of registers pushed: YL, SREG [sofError], YH, shift, x1, x2, x3, cnt, r0 + push YL ;2 push only what is necessary to sync with edge ASAP + in YL, SREG ;1 + push YL ;2 +;---------------------------------------------------------------------------- +; Synchronize with sync pattern: +;---------------------------------------------------------------------------- +;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K] +;sync up with J to K edge during sync pattern -- use fastest possible loops +;The first part waits at most 1 bit long since we must be in sync pattern. +;YL is guarenteed to be < 0x80 because I flag is clear. When we jump to +;waitForJ, ensure that this prerequisite is met. +waitForJ: + inc YL + sbis USBIN, USBMINUS + brne waitForJ ; just make sure we have ANY timeout +waitForK: +;The following code results in a sampling window of 1/4 bit which meets the spec. + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS ;[0] + rjmp foundK ;[1] +#if USB_COUNT_SOF + lds YL, usbSofCount + inc YL + sts usbSofCount, YL +#endif /* USB_COUNT_SOF */ +#ifdef USB_SOF_HOOK + USB_SOF_HOOK +#endif + rjmp sofError + +foundK: +;{3, 5} after falling D- edge, average delay: 4 cycles [we want 4 for center sampling] +;we have 1 bit time for setup purposes, then sample again. Numbers in brackets +;are cycles from center of first sync (double K) bit after the instruction + push YH ;[2] + lds YL, usbInputBufOffset;[4] + clr YH ;[6] + subi YL, lo8(-(usbRxBuf));[7] + sbci YH, hi8(-(usbRxBuf));[8] + + sbis USBIN, USBMINUS ;[9] we want two bits K [we want to sample at 8 + 4 - 1.5 = 10.5] + rjmp haveTwoBitsK ;[10] + pop YH ;[11] undo the push from before + rjmp waitForK ;[13] this was not the end of sync, retry +haveTwoBitsK: +;---------------------------------------------------------------------------- +; push more registers and initialize values while we sample the first bits: +;---------------------------------------------------------------------------- +#define fix x2 +#define data x1 + + push shift ;[12] + push x1 ;[14] + push x2 ;[16] + ldi shift, 0x80 ;[18] prevent bit-unstuffing but init low bits to 0 + ifioset USBIN, USBMINUS ;[19] [01] <--- bit 0 [10.5 + 8 = 18.5] + ori shift, 1<<0 ;[02] + push x3 ;[03] + push cnt ;[05] + push r0 ;[07] + ifioset USBIN, USBMINUS ;[09] <--- bit 1 + ori shift, 1<<1 ;[10] + ser fix ;[11] + ldi cnt, USB_BUFSIZE ;[12] + mov data, shift ;[13] + lsl shift ;[14] + nop2 ;[15] + ifioset USBIN, USBMINUS ;[17] <--- bit 2 + ori data, 3<<2 ;[18] store in bit 2 AND bit 3 + eor shift, data ;[19] do nrzi decoding + andi data, 1<<3 ;[20] + in phase, USBIN ;[21] <- phase + brne jumpToEntryAfterSet ;[22] if USBMINS at bit 3 was 1 + nop ;[23] + rjmp entryAfterClr ;[24] +jumpToEntryAfterSet: + rjmp entryAfterSet ;[24] + +;---------------------------------------------------------------------------- +; Receiver loop (numbers in brackets are cycles within byte after instr) +;---------------------------------------------------------------------------- +#undef fix +#define fix x1 +#undef data +#define data x2 + +bit7IsSet: + ifrclr phase, USBMINUS ;[62] check phase only if D- changed + lpm ;[63] + in phase, USBIN ;[64] <- phase (one cycle too late) + ori shift, 1 << 7 ;[65] + nop ;[66] +;;;;rjmp bit0AfterSet ; -> [00] == [67] moved block up to save jump +bit0AfterSet: + eor fix, shift ;[00] +#undef fix +#define fix x2 +#undef data +#define data x1 /* we now have result in data, fix is reset to 0xff */ + ifioclr USBIN, USBMINUS ;[01] <--- sample 0 + rjmp bit0IsClr ;[02] + andi shift, ~(7 << 0) ;[03] + breq unstuff0s ;[04] + in phase, USBIN ;[05] <- phase + rjmp bit1AfterSet ;[06] +unstuff0s: + in phase, USBIN ;[06] <- phase (one cycle too late) + andi fix, ~(1 << 0) ;[07] + ifioclr USBIN, USBMINUS ;[00] + ifioset USBIN, USBPLUS ;[01] + rjmp bit0IsClr ;[02] executed if first expr false or second true +jumpToSe0AndStore: + rjmp se0AndStore ;[03] executed only if both bits 0 +bit0IsClr: + ifrset phase, USBMINUS ;[04] check phase only if D- changed + lpm ;[05] + in phase, USBIN ;[06] <- phase (one cycle too late) + ori shift, 1 << 0 ;[07] +bit1AfterClr: + andi phase, USBMASK ;[08] + ifioset USBIN, USBMINUS ;[09] <--- sample 1 + rjmp bit1IsSet ;[10] + breq jumpToSe0AndStore ;[11] + andi shift, ~(7 << 1) ;[12] + in phase, USBIN ;[13] <- phase + breq unstuff1c ;[14] + rjmp bit2AfterClr ;[15] +unstuff1c: + andi fix, ~(1 << 1) ;[16] + nop2 ;[08] + nop2 ;[10] +bit1IsSet: + ifrclr phase, USBMINUS ;[12] check phase only if D- changed + lpm ;[13] + in phase, USBIN ;[14] <- phase (one cycle too late) + ori shift, 1 << 1 ;[15] + nop ;[16] +bit2AfterSet: + ifioclr USBIN, USBMINUS ;[17] <--- sample 2 + rjmp bit2IsClr ;[18] + andi shift, ~(7 << 2) ;[19] + breq unstuff2s ;[20] + in phase, USBIN ;[21] <- phase + rjmp bit3AfterSet ;[22] +unstuff2s: + in phase, USBIN ;[22] <- phase (one cycle too late) + andi fix, ~(1 << 2) ;[23] + nop2 ;[16] + nop2 ;[18] +bit2IsClr: + ifrset phase, USBMINUS ;[20] check phase only if D- changed + lpm ;[21] + in phase, USBIN ;[22] <- phase (one cycle too late) + ori shift, 1 << 2 ;[23] +bit3AfterClr: + st y+, data ;[24] +entryAfterClr: + ifioset USBIN, USBMINUS ;[26] <--- sample 3 + rjmp bit3IsSet ;[27] + andi shift, ~(7 << 3) ;[28] + breq unstuff3c ;[29] + in phase, USBIN ;[30] <- phase + rjmp bit4AfterClr ;[31] +unstuff3c: + in phase, USBIN ;[31] <- phase (one cycle too late) + andi fix, ~(1 << 3) ;[32] + nop2 ;[25] + nop2 ;[27] +bit3IsSet: + ifrclr phase, USBMINUS ;[29] check phase only if D- changed + lpm ;[30] + in phase, USBIN ;[31] <- phase (one cycle too late) + ori shift, 1 << 3 ;[32] +bit4AfterSet: + mov data, fix ;[33] undo this move by swapping defines +#undef fix +#define fix x1 +#undef data +#define data x2 + ifioclr USBIN, USBMINUS ;[34] <--- sample 4 + rjmp bit4IsClr ;[35] + andi shift, ~(7 << 4) ;[36] + breq unstuff4s ;[37] + in phase, USBIN ;[38] <- phase + rjmp bit5AfterSet ;[39] +unstuff4s: + in phase, USBIN ;[39] <- phase (one cycle too late) + andi fix, ~(1 << 4) ;[40] + nop2 ;[33] + nop2 ;[35] +bit4IsClr: + ifrset phase, USBMINUS ;[37] check phase only if D- changed + lpm ;[38] + in phase, USBIN ;[39] <- phase (one cycle too late) + ori shift, 1 << 4 ;[40] +bit5AfterClr: + ser data ;[41] + ifioset USBIN, USBMINUS ;[42] <--- sample 5 + rjmp bit5IsSet ;[43] + andi shift, ~(7 << 5) ;[44] + breq unstuff5c ;[45] + in phase, USBIN ;[46] <- phase + rjmp bit6AfterClr ;[47] +unstuff5c: + in phase, USBIN ;[47] <- phase (one cycle too late) + andi fix, ~(1 << 5) ;[48] + nop2 ;[41] + nop2 ;[43] +bit5IsSet: + ifrclr phase, USBMINUS ;[45] check phase only if D- changed + lpm ;[46] + in phase, USBIN ;[47] <- phase (one cycle too late) + ori shift, 1 << 5 ;[48] +bit6AfterSet: + subi cnt, 1 ;[49] + brcs jumpToOverflow ;[50] + ifioclr USBIN, USBMINUS ;[51] <--- sample 6 + rjmp bit6IsClr ;[52] + andi shift, ~(3 << 6) ;[53] + cpi shift, 2 ;[54] + in phase, USBIN ;[55] <- phase + brlt unstuff6s ;[56] + rjmp bit7AfterSet ;[57] + +jumpToOverflow: + rjmp overflow + +unstuff6s: + andi fix, ~(1 << 6) ;[50] + lpm ;[51] +bit6IsClr: + ifrset phase, USBMINUS ;[54] check phase only if D- changed + lpm ;[55] + in phase, USBIN ;[56] <- phase (one cycle too late) + ori shift, 1 << 6 ;[57] + nop ;[58] +bit7AfterClr: + ifioset USBIN, USBMINUS ;[59] <--- sample 7 + rjmp bit7IsSet ;[60] + andi shift, ~(1 << 7) ;[61] + cpi shift, 4 ;[62] + in phase, USBIN ;[63] <- phase + brlt unstuff7c ;[64] + rjmp bit0AfterClr ;[65] -> [00] == [67] +unstuff7c: + andi fix, ~(1 << 7) ;[58] + nop ;[59] + rjmp bit7IsSet ;[60] + +se0AndStore: + st y+, x1 ;[15/17] cycles after start of byte + rjmp se0 ;[17/19] + +bit7IsClr: + ifrset phase, USBMINUS ;[62] check phase only if D- changed + lpm ;[63] + in phase, USBIN ;[64] <- phase (one cycle too late) + ori shift, 1 << 7 ;[65] + nop ;[66] +;;;;rjmp bit0AfterClr ; -> [00] == [67] moved block up to save jump +bit0AfterClr: + eor fix, shift ;[00] +#undef fix +#define fix x2 +#undef data +#define data x1 /* we now have result in data, fix is reset to 0xff */ + ifioset USBIN, USBMINUS ;[01] <--- sample 0 + rjmp bit0IsSet ;[02] + andi shift, ~(7 << 0) ;[03] + breq unstuff0c ;[04] + in phase, USBIN ;[05] <- phase + rjmp bit1AfterClr ;[06] +unstuff0c: + in phase, USBIN ;[06] <- phase (one cycle too late) + andi fix, ~(1 << 0) ;[07] + ifioclr USBIN, USBMINUS ;[00] + ifioset USBIN, USBPLUS ;[01] + rjmp bit0IsSet ;[02] executed if first expr false or second true + rjmp se0AndStore ;[03] executed only if both bits 0 +bit0IsSet: + ifrclr phase, USBMINUS ;[04] check phase only if D- changed + lpm ;[05] + in phase, USBIN ;[06] <- phase (one cycle too late) + ori shift, 1 << 0 ;[07] +bit1AfterSet: + andi phase, USBMASK ;[08] + ifioclr USBIN, USBMINUS ;[09] <--- sample 1 + rjmp bit1IsClr ;[10] + andi shift, ~(7 << 1) ;[11] + breq unstuff1s ;[12] + in phase, USBIN ;[13] <- phase + nop ;[14] + rjmp bit2AfterSet ;[15] +unstuff1s: + in phase, USBIN ;[14] <- phase (one cycle too late) + andi fix, ~(1 << 1) ;[15] + nop2 ;[08] + nop2 ;[10] +bit1IsClr: + ifrset phase, USBMINUS ;[12] check phase only if D- changed + lpm ;[13] + in phase, USBIN ;[14] <- phase (one cycle too late) + breq se0AndStore ;[15] if we come from unstuff1s, Z bit is never set + ori shift, 1 << 1 ;[16] +bit2AfterClr: + ifioset USBIN, USBMINUS ;[17] <--- sample 2 + rjmp bit2IsSet ;[18] + andi shift, ~(7 << 2) ;[19] + breq unstuff2c ;[20] + in phase, USBIN ;[21] <- phase + rjmp bit3AfterClr ;[22] +unstuff2c: + in phase, USBIN ;[22] <- phase (one cycle too late) + andi fix, ~(1 << 2) ;[23] + nop2 ;[16] + nop2 ;[18] +bit2IsSet: + ifrclr phase, USBMINUS ;[20] check phase only if D- changed + lpm ;[21] + in phase, USBIN ;[22] <- phase (one cycle too late) + ori shift, 1 << 2 ;[23] +bit3AfterSet: + st y+, data ;[24] +entryAfterSet: + ifioclr USBIN, USBMINUS ;[26] <--- sample 3 + rjmp bit3IsClr ;[27] + andi shift, ~(7 << 3) ;[28] + breq unstuff3s ;[29] + in phase, USBIN ;[30] <- phase + rjmp bit4AfterSet ;[31] +unstuff3s: + in phase, USBIN ;[31] <- phase (one cycle too late) + andi fix, ~(1 << 3) ;[32] + nop2 ;[25] + nop2 ;[27] +bit3IsClr: + ifrset phase, USBMINUS ;[29] check phase only if D- changed + lpm ;[30] + in phase, USBIN ;[31] <- phase (one cycle too late) + ori shift, 1 << 3 ;[32] +bit4AfterClr: + mov data, fix ;[33] undo this move by swapping defines +#undef fix +#define fix x1 +#undef data +#define data x2 + ifioset USBIN, USBMINUS ;[34] <--- sample 4 + rjmp bit4IsSet ;[35] + andi shift, ~(7 << 4) ;[36] + breq unstuff4c ;[37] + in phase, USBIN ;[38] <- phase + rjmp bit5AfterClr ;[39] +unstuff4c: + in phase, USBIN ;[39] <- phase (one cycle too late) + andi fix, ~(1 << 4) ;[40] + nop2 ;[33] + nop2 ;[35] +bit4IsSet: + ifrclr phase, USBMINUS ;[37] check phase only if D- changed + lpm ;[38] + in phase, USBIN ;[39] <- phase (one cycle too late) + ori shift, 1 << 4 ;[40] +bit5AfterSet: + ser data ;[41] + ifioclr USBIN, USBMINUS ;[42] <--- sample 5 + rjmp bit5IsClr ;[43] + andi shift, ~(7 << 5) ;[44] + breq unstuff5s ;[45] + in phase, USBIN ;[46] <- phase + rjmp bit6AfterSet ;[47] +unstuff5s: + in phase, USBIN ;[47] <- phase (one cycle too late) + andi fix, ~(1 << 5) ;[48] + nop2 ;[41] + nop2 ;[43] +bit5IsClr: + ifrset phase, USBMINUS ;[45] check phase only if D- changed + lpm ;[46] + in phase, USBIN ;[47] <- phase (one cycle too late) + ori shift, 1 << 5 ;[48] +bit6AfterClr: + subi cnt, 1 ;[49] + brcs overflow ;[50] + ifioset USBIN, USBMINUS ;[51] <--- sample 6 + rjmp bit6IsSet ;[52] + andi shift, ~(3 << 6) ;[53] + cpi shift, 2 ;[54] + in phase, USBIN ;[55] <- phase + brlt unstuff6c ;[56] + rjmp bit7AfterClr ;[57] +unstuff6c: + andi fix, ~(1 << 6) ;[50] + lpm ;[51] +bit6IsSet: + ifrclr phase, USBMINUS ;[54] check phase only if D- changed + lpm ;[55] + in phase, USBIN ;[56] <- phase (one cycle too late) + ori shift, 1 << 6 ;[57] +bit7AfterSet: + ifioclr USBIN, USBMINUS ;[59] <--- sample 7 + rjmp bit7IsClr ;[60] + andi shift, ~(1 << 7) ;[61] + cpi shift, 4 ;[62] + in phase, USBIN ;[63] <- phase + brlt unstuff7s ;[64] + rjmp bit0AfterSet ;[65] -> [00] == [67] +unstuff7s: + andi fix, ~(1 << 7) ;[58] + nop ;[59] + rjmp bit7IsClr ;[60] + +macro POP_STANDARD ; 14 cycles + pop r0 + pop cnt + pop x3 + pop x2 + pop x1 + pop shift + pop YH + endm +macro POP_RETI ; 5 cycles + pop YL + out SREG, YL + pop YL + endm + +#include "asmcommon.inc" + +;---------------------------------------------------------------------------- +; Transmitting data +;---------------------------------------------------------------------------- + +txByteLoop: +txBitloop: +stuffN1Delay: ; [03] + ror shift ;[-5] [11] [63] + brcc doExorN1 ;[-4] [64] + subi x3, 1 ;[-3] + brne commonN1 ;[-2] + lsl shift ;[-1] compensate ror after rjmp stuffDelay + nop ;[00] stuffing consists of just waiting 8 cycles + rjmp stuffN1Delay ;[01] after ror, C bit is reliably clear + +sendNakAndReti: + ldi cnt, USBPID_NAK ;[-19] + rjmp sendCntAndReti ;[-18] +sendAckAndReti: + ldi cnt, USBPID_ACK ;[-17] +sendCntAndReti: + mov r0, cnt ;[-16] + ldi YL, 0 ;[-15] R0 address is 0 + ldi YH, 0 ;[-14] + ldi cnt, 2 ;[-13] +; rjmp usbSendAndReti fallthrough + +; USB spec says: +; idle = J +; J = (D+ = 0), (D- = 1) or USBOUT = 0x01 +; K = (D+ = 1), (D- = 0) or USBOUT = 0x02 +; Spec allows 7.5 bit times from EOP to SOP for replies (= 60 cycles) + +;usbSend: +;pointer to data in 'Y' +;number of bytes in 'cnt' -- including sync byte +;uses: x1...x3, shift, cnt, Y [x1 = mirror USBOUT, x2 = USBMASK, x3 = bitstuff cnt] +;Numbers in brackets are time since first bit of sync pattern is sent (start of instruction) +usbSendAndReti: + in x2, USBDDR ;[-10] 10 cycles until SOP + ori x2, USBMASK ;[-9] + sbi USBOUT, USBMINUS ;[-8] prepare idle state; D+ and D- must have been 0 (no pullups) + out USBDDR, x2 ;[-6] <--- acquire bus + in x1, USBOUT ;[-5] port mirror for tx loop + ldi shift, 0x40 ;[-4] sync byte is first byte sent (we enter loop after ror) + ldi x2, USBMASK ;[-3] +doExorN1: + eor x1, x2 ;[-2] [06] [62] + ldi x3, 6 ;[-1] [07] [63] +commonN1: +stuffN2Delay: + out USBOUT, x1 ;[00] [08] [64] <--- set bit + ror shift ;[01] + brcc doExorN2 ;[02] + subi x3, 1 ;[03] + brne commonN2 ;[04] + lsl shift ;[05] compensate ror after rjmp stuffDelay + rjmp stuffN2Delay ;[06] after ror, C bit is reliably clear +doExorN2: + eor x1, x2 ;[04] [12] + ldi x3, 6 ;[05] [13] +commonN2: + nop2 ;[06] [14] + subi cnt, 171 ;[08] [16] trick: (3 * 171) & 0xff = 1 + out USBOUT, x1 ;[09] [17] <--- set bit + brcs txBitloop ;[10] [27] [44] + +stuff6Delay: + ror shift ;[45] [53] + brcc doExor6 ;[46] + subi x3, 1 ;[47] + brne common6 ;[48] + lsl shift ;[49] compensate ror after rjmp stuffDelay + nop ;[50] stuffing consists of just waiting 8 cycles + rjmp stuff6Delay ;[51] after ror, C bit is reliably clear +doExor6: + eor x1, x2 ;[48] [56] + ldi x3, 6 ;[49] +common6: +stuff7Delay: + ror shift ;[50] [58] + out USBOUT, x1 ;[51] <--- set bit + brcc doExor7 ;[52] + subi x3, 1 ;[53] + brne common7 ;[54] + lsl shift ;[55] compensate ror after rjmp stuffDelay + rjmp stuff7Delay ;[56] after ror, C bit is reliably clear +doExor7: + eor x1, x2 ;[54] [62] + ldi x3, 6 ;[55] +common7: + ld shift, y+ ;[56] + nop ;[58] + tst cnt ;[59] + out USBOUT, x1 ;[60] [00]<--- set bit + brne txByteLoop ;[61] [01] +;make SE0: + cbr x1, USBMASK ;[02] prepare SE0 [spec says EOP may be 15 to 18 cycles] + lds x2, usbNewDeviceAddr;[03] + lsl x2 ;[05] we compare with left shifted address + subi YL, 2 + 0 ;[06] Only assign address on data packets, not ACK/NAK in r0 + sbci YH, 0 ;[07] + out USBOUT, x1 ;[00] <-- out SE0 -- from now 2 bits = 16 cycles until bus idle +;2006-03-06: moved transfer of new address to usbDeviceAddr from C-Code to asm: +;set address only after data packet was sent, not after handshake + breq skipAddrAssign ;[01] + sts usbDeviceAddr, x2 ; if not skipped: SE0 is one cycle longer +skipAddrAssign: +;end of usbDeviceAddress transfer + ldi x2, 1< 0) + echo "$s\n"; + } +} + +function printBit($isAfterSet, $bitNum) +{ + ob_start(); + if($isAfterSet){ +?> + ifioclr USBIN, USBMINUS ;[00] <--- sample + rjmp bit#IsClr ;[01] + andi shift, ~(7 << #) ;[02] + breq unstuff#s ;[03] + in phase, USBIN ;[04] <- phase + rjmp bit@AfterSet ;[05] +unstuff#s: + in phase, USBIN ;[05] <- phase (one cycle too late) + andi fix, ~(1 << #) ;[06] + nop2 ;[-1] + nop2 ;[01] +bit#IsClr: + ifrset phase, USBMINUS ;[03] check phase only if D- changed + lpm ;[04] + in phase, USBIN ;[05] <- phase (one cycle too late) + ori shift, 1 << # ;[06] + + ifioset USBIN, USBMINUS ;[00] <--- sample + rjmp bit#IsSet ;[01] + andi shift, ~(7 << #) ;[02] + breq unstuff#c ;[03] + in phase, USBIN ;[04] <- phase + rjmp bit@AfterClr ;[05] +unstuff#c: + in phase, USBIN ;[05] <- phase (one cycle too late) + andi fix, ~(1 << #) ;[06] + nop2 ;[-1] + nop2 ;[01] +bit#IsSet: + ifrclr phase, USBMINUS ;[03] check phase only if D- changed + lpm ;[04] + in phase, USBIN ;[05] <- phase (one cycle too late) + ori shift, 1 << # ;[06] + +*****************************************************************************/ diff --git a/firmware/usbdrv/usbdrvasm15.inc b/firmware/usbdrv/usbdrvasm15.inc new file mode 100644 index 000000000..29edee5d4 --- /dev/null +++ b/firmware/usbdrv/usbdrvasm15.inc @@ -0,0 +1,423 @@ +/* Name: usbdrvasm15.inc + * Project: AVR USB driver + * Author: contributed by V. Bosch + * Creation Date: 2007-08-06 + * Tabsize: 4 + * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * Revision: $Id: usbdrvasm15.inc 692 2008-11-07 15:07:40Z cs $ + */ + +/* Do not link this file! Link usbdrvasm.S instead, which includes the + * appropriate implementation! + */ + +/* +General Description: +This file is the 15 MHz version of the asssembler part of the USB driver. It +requires a 15 MHz crystal (not a ceramic resonator and not a calibrated RC +oscillator). + +See usbdrv.h for a description of the entire driver. + +Since almost all of this code is timing critical, don't change unless you +really know what you are doing! Many parts require not only a maximum number +of CPU cycles, but even an exact number of cycles! +*/ + +;max stack usage: [ret(2), YL, SREG, YH, bitcnt, shift, x1, x2, x3, x4, cnt] = 12 bytes +;nominal frequency: 15 MHz -> 10.0 cycles per bit, 80.0 cycles per byte +; Numbers in brackets are clocks counted from center of last sync bit +; when instruction starts + +;---------------------------------------------------------------------------- +; order of registers pushed: +; YL, SREG [sofError] YH, shift, x1, x2, x3, bitcnt, cnt, x4 +;---------------------------------------------------------------------------- +USB_INTR_VECTOR: + push YL ;2 push only what is necessary to sync with edge ASAP + in YL, SREG ;1 + push YL ;2 +;---------------------------------------------------------------------------- +; Synchronize with sync pattern: +; +; sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K] +; sync up with J to K edge during sync pattern -- use fastest possible loops +;The first part waits at most 1 bit long since we must be in sync pattern. +;YL is guarenteed to be < 0x80 because I flag is clear. When we jump to +;waitForJ, ensure that this prerequisite is met. +waitForJ: + inc YL + sbis USBIN, USBMINUS + brne waitForJ ; just make sure we have ANY timeout +;------------------------------------------------------------------------------- +; The following code results in a sampling window of < 1/4 bit +; which meets the spec. +;------------------------------------------------------------------------------- +waitForK: ;- + sbis USBIN, USBMINUS ;1 [00] <-- sample + rjmp foundK ;2 [01] + sbis USBIN, USBMINUS ; <-- sample + rjmp foundK + sbis USBIN, USBMINUS ; <-- sample + rjmp foundK + sbis USBIN, USBMINUS ; <-- sample + rjmp foundK + sbis USBIN, USBMINUS ; <-- sample + rjmp foundK + sbis USBIN, USBMINUS ; <-- sample + rjmp foundK +#if USB_COUNT_SOF + lds YL, usbSofCount + inc YL + sts usbSofCount, YL +#endif /* USB_COUNT_SOF */ +#ifdef USB_SOF_HOOK + USB_SOF_HOOK +#endif + rjmp sofError +;------------------------------------------------------------------------------ +; {3, 5} after falling D- edge, average delay: 4 cycles [we want 5 for +; center sampling] +; we have 1 bit time for setup purposes, then sample again. +; Numbers in brackets are cycles from center of first sync (double K) +; bit after the instruction +;------------------------------------------------------------------------------ +foundK: ;- [02] + lds YL, usbInputBufOffset;2 [03+04] tx loop + push YH ;2 [05+06] + clr YH ;1 [07] + subi YL, lo8(-(usbRxBuf)) ;1 [08] [rx loop init] + sbci YH, hi8(-(usbRxBuf)) ;1 [09] [rx loop init] + push shift ;2 [10+11] + ser shift ;1 [12] + sbis USBIN, USBMINUS ;1 [-1] [13] <--sample:we want two bits K (sample 1 cycle too early) + rjmp haveTwoBitsK ;2 [00] [14] + pop shift ;2 [15+16] undo the push from before + pop YH ;2 [17+18] undo the push from before + rjmp waitForK ;2 [19+20] this was not the end of sync, retry +; The entire loop from waitForK until rjmp waitForK above must not exceed two +; bit times (= 20 cycles). + +;---------------------------------------------------------------------------- +; push more registers and initialize values while we sample the first bits: +;---------------------------------------------------------------------------- +haveTwoBitsK: ;- [01] + push x1 ;2 [02+03] + push x2 ;2 [04+05] + push x3 ;2 [06+07] + push bitcnt ;2 [08+09] + in x1, USBIN ;1 [00] [10] <-- sample bit 0 + bst x1, USBMINUS ;1 [01] + bld shift, 0 ;1 [02] + push cnt ;2 [03+04] + ldi cnt, USB_BUFSIZE ;1 [05] + push x4 ;2 [06+07] tx loop + rjmp rxLoop ;2 [08] +;---------------------------------------------------------------------------- +; Receiver loop (numbers in brackets are cycles within byte after instr) +;---------------------------------------------------------------------------- +unstuff0: ;- [07] (branch taken) + andi x3, ~0x01 ;1 [08] + mov x1, x2 ;1 [09] x2 contains last sampled (stuffed) bit + in x2, USBIN ;1 [00] [10] <-- sample bit 1 again + andi x2, USBMASK ;1 [01] + breq se0Hop ;1 [02] SE0 check for bit 1 + ori shift, 0x01 ;1 [03] 0b00000001 + nop ;1 [04] + rjmp didUnstuff0 ;2 [05] +;----------------------------------------------------- +unstuff1: ;- [05] (branch taken) + mov x2, x1 ;1 [06] x1 contains last sampled (stuffed) bit + andi x3, ~0x02 ;1 [07] + ori shift, 0x02 ;1 [08] 0b00000010 + nop ;1 [09] + in x1, USBIN ;1 [00] [10] <-- sample bit 2 again + andi x1, USBMASK ;1 [01] + breq se0Hop ;1 [02] SE0 check for bit 2 + rjmp didUnstuff1 ;2 [03] +;----------------------------------------------------- +unstuff2: ;- [05] (branch taken) + andi x3, ~0x04 ;1 [06] + ori shift, 0x04 ;1 [07] 0b00000100 + mov x1, x2 ;1 [08] x2 contains last sampled (stuffed) bit + nop ;1 [09] + in x2, USBIN ;1 [00] [10] <-- sample bit 3 + andi x2, USBMASK ;1 [01] + breq se0Hop ;1 [02] SE0 check for bit 3 + rjmp didUnstuff2 ;2 [03] +;----------------------------------------------------- +unstuff3: ;- [00] [10] (branch taken) + in x2, USBIN ;1 [01] [11] <-- sample stuffed bit 3 one cycle too late + andi x2, USBMASK ;1 [02] + breq se0Hop ;1 [03] SE0 check for stuffed bit 3 + andi x3, ~0x08 ;1 [04] + ori shift, 0x08 ;1 [05] 0b00001000 + rjmp didUnstuff3 ;2 [06] +;---------------------------------------------------------------------------- +; extra jobs done during bit interval: +; +; bit 0: store, clear [SE0 is unreliable here due to bit dribbling in hubs], +; overflow check, jump to the head of rxLoop +; bit 1: SE0 check +; bit 2: SE0 check, recovery from delay [bit 0 tasks took too long] +; bit 3: SE0 check, recovery from delay [bit 0 tasks took too long] +; bit 4: SE0 check, none +; bit 5: SE0 check, none +; bit 6: SE0 check, none +; bit 7: SE0 check, reconstruct: x3 is 0 at bit locations we changed, 1 at others +;---------------------------------------------------------------------------- +rxLoop: ;- [09] + in x2, USBIN ;1 [00] [10] <-- sample bit 1 (or possibly bit 0 stuffed) + andi x2, USBMASK ;1 [01] + brne SkipSe0Hop ;1 [02] +se0Hop: ;- [02] + rjmp se0 ;2 [03] SE0 check for bit 1 +SkipSe0Hop: ;- [03] + ser x3 ;1 [04] + andi shift, 0xf9 ;1 [05] 0b11111001 + breq unstuff0 ;1 [06] +didUnstuff0: ;- [06] + eor x1, x2 ;1 [07] + bst x1, USBMINUS ;1 [08] + bld shift, 1 ;1 [09] + in x1, USBIN ;1 [00] [10] <-- sample bit 2 (or possibly bit 1 stuffed) + andi x1, USBMASK ;1 [01] + breq se0Hop ;1 [02] SE0 check for bit 2 + andi shift, 0xf3 ;1 [03] 0b11110011 + breq unstuff1 ;1 [04] do remaining work for bit 1 +didUnstuff1: ;- [04] + eor x2, x1 ;1 [05] + bst x2, USBMINUS ;1 [06] + bld shift, 2 ;1 [07] + nop2 ;2 [08+09] + in x2, USBIN ;1 [00] [10] <-- sample bit 3 (or possibly bit 2 stuffed) + andi x2, USBMASK ;1 [01] + breq se0Hop ;1 [02] SE0 check for bit 3 + andi shift, 0xe7 ;1 [03] 0b11100111 + breq unstuff2 ;1 [04] +didUnstuff2: ;- [04] + eor x1, x2 ;1 [05] + bst x1, USBMINUS ;1 [06] + bld shift, 3 ;1 [07] +didUnstuff3: ;- [07] + andi shift, 0xcf ;1 [08] 0b11001111 + breq unstuff3 ;1 [09] + in x1, USBIN ;1 [00] [10] <-- sample bit 4 + andi x1, USBMASK ;1 [01] + breq se0Hop ;1 [02] SE0 check for bit 4 + eor x2, x1 ;1 [03] + bst x2, USBMINUS ;1 [04] + bld shift, 4 ;1 [05] +didUnstuff4: ;- [05] + andi shift, 0x9f ;1 [06] 0b10011111 + breq unstuff4 ;1 [07] + nop2 ;2 [08+09] + in x2, USBIN ;1 [00] [10] <-- sample bit 5 + andi x2, USBMASK ;1 [01] + breq se0 ;1 [02] SE0 check for bit 5 + eor x1, x2 ;1 [03] + bst x1, USBMINUS ;1 [04] + bld shift, 5 ;1 [05] +didUnstuff5: ;- [05] + andi shift, 0x3f ;1 [06] 0b00111111 + breq unstuff5 ;1 [07] + nop2 ;2 [08+09] + in x1, USBIN ;1 [00] [10] <-- sample bit 6 + andi x1, USBMASK ;1 [01] + breq se0 ;1 [02] SE0 check for bit 6 + eor x2, x1 ;1 [03] + bst x2, USBMINUS ;1 [04] + bld shift, 6 ;1 [05] +didUnstuff6: ;- [05] + cpi shift, 0x02 ;1 [06] 0b00000010 + brlo unstuff6 ;1 [07] + nop2 ;2 [08+09] + in x2, USBIN ;1 [00] [10] <-- sample bit 7 + andi x2, USBMASK ;1 [01] + breq se0 ;1 [02] SE0 check for bit 7 + eor x1, x2 ;1 [03] + bst x1, USBMINUS ;1 [04] + bld shift, 7 ;1 [05] +didUnstuff7: ;- [05] + cpi shift, 0x04 ;1 [06] 0b00000100 + brlo unstuff7 ;1 [07] + eor x3, shift ;1 [08] reconstruct: x3 is 0 at bit locations we changed, 1 at others + nop ;1 [09] + in x1, USBIN ;1 [00] [10] <-- sample bit 0 + st y+, x3 ;2 [01+02] store data + eor x2, x1 ;1 [03] + bst x2, USBMINUS ;1 [04] + bld shift, 0 ;1 [05] + subi cnt, 1 ;1 [06] + brcs overflow ;1 [07] + rjmp rxLoop ;2 [08] +;----------------------------------------------------- +unstuff4: ;- [08] + andi x3, ~0x10 ;1 [09] + in x1, USBIN ;1 [00] [10] <-- sample stuffed bit 4 + andi x1, USBMASK ;1 [01] + breq se0 ;1 [02] SE0 check for stuffed bit 4 + ori shift, 0x10 ;1 [03] + rjmp didUnstuff4 ;2 [04] +;----------------------------------------------------- +unstuff5: ;- [08] + ori shift, 0x20 ;1 [09] + in x2, USBIN ;1 [00] [10] <-- sample stuffed bit 5 + andi x2, USBMASK ;1 [01] + breq se0 ;1 [02] SE0 check for stuffed bit 5 + andi x3, ~0x20 ;1 [03] + rjmp didUnstuff5 ;2 [04] +;----------------------------------------------------- +unstuff6: ;- [08] + andi x3, ~0x40 ;1 [09] + in x1, USBIN ;1 [00] [10] <-- sample stuffed bit 6 + andi x1, USBMASK ;1 [01] + breq se0 ;1 [02] SE0 check for stuffed bit 6 + ori shift, 0x40 ;1 [03] + rjmp didUnstuff6 ;2 [04] +;----------------------------------------------------- +unstuff7: ;- [08] + andi x3, ~0x80 ;1 [09] + in x2, USBIN ;1 [00] [10] <-- sample stuffed bit 7 + andi x2, USBMASK ;1 [01] + breq se0 ;1 [02] SE0 check for stuffed bit 7 + ori shift, 0x80 ;1 [03] + rjmp didUnstuff7 ;2 [04] + +macro POP_STANDARD ; 16 cycles + pop x4 + pop cnt + pop bitcnt + pop x3 + pop x2 + pop x1 + pop shift + pop YH + endm +macro POP_RETI ; 5 cycles + pop YL + out SREG, YL + pop YL + endm + +#include "asmcommon.inc" + +;--------------------------------------------------------------------------- +; USB spec says: +; idle = J +; J = (D+ = 0), (D- = 1) +; K = (D+ = 1), (D- = 0) +; Spec allows 7.5 bit times from EOP to SOP for replies +;--------------------------------------------------------------------------- +bitstuffN: ;- [04] + eor x1, x4 ;1 [05] + clr x2 ;1 [06] + nop ;1 [07] + rjmp didStuffN ;1 [08] +;--------------------------------------------------------------------------- +bitstuff6: ;- [04] + eor x1, x4 ;1 [05] + clr x2 ;1 [06] + rjmp didStuff6 ;1 [07] +;--------------------------------------------------------------------------- +bitstuff7: ;- [02] + eor x1, x4 ;1 [03] + clr x2 ;1 [06] + nop ;1 [05] + rjmp didStuff7 ;1 [06] +;--------------------------------------------------------------------------- +sendNakAndReti: ;- [-19] + ldi x3, USBPID_NAK ;1 [-18] + rjmp sendX3AndReti ;1 [-17] +;--------------------------------------------------------------------------- +sendAckAndReti: ;- [-17] + ldi cnt, USBPID_ACK ;1 [-16] +sendCntAndReti: ;- [-16] + mov x3, cnt ;1 [-15] +sendX3AndReti: ;- [-15] + ldi YL, 20 ;1 [-14] x3==r20 address is 20 + ldi YH, 0 ;1 [-13] + ldi cnt, 2 ;1 [-12] +; rjmp usbSendAndReti fallthrough +;--------------------------------------------------------------------------- +;usbSend: +;pointer to data in 'Y' +;number of bytes in 'cnt' -- including sync byte [range 2 ... 12] +;uses: x1...x4, btcnt, shift, cnt, Y +;Numbers in brackets are time since first bit of sync pattern is sent +;We need not to match the transfer rate exactly because the spec demands +;only 1.5% precision anyway. +usbSendAndReti: ;- [-13] 13 cycles until SOP + in x2, USBDDR ;1 [-12] + ori x2, USBMASK ;1 [-11] + sbi USBOUT, USBMINUS ;2 [-09-10] prepare idle state; D+ and D- must have been 0 (no pullups) + in x1, USBOUT ;1 [-08] port mirror for tx loop + out USBDDR, x2 ;1 [-07] <- acquire bus + ; need not init x2 (bitstuff history) because sync starts with 0 + ldi x4, USBMASK ;1 [-06] exor mask + ldi shift, 0x80 ;1 [-05] sync byte is first byte sent + ldi bitcnt, 6 ;1 [-04] +txBitLoop: ;- [-04] [06] + sbrs shift, 0 ;1 [-03] [07] + eor x1, x4 ;1 [-02] [08] + ror shift ;1 [-01] [09] +didStuffN: ;- [09] + out USBOUT, x1 ;1 [00] [10] <-- out N + ror x2 ;1 [01] + cpi x2, 0xfc ;1 [02] + brcc bitstuffN ;1 [03] + dec bitcnt ;1 [04] + brne txBitLoop ;1 [05] + sbrs shift, 0 ;1 [06] + eor x1, x4 ;1 [07] + ror shift ;1 [08] +didStuff6: ;- [08] + nop ;1 [09] + out USBOUT, x1 ;1 [00] [10] <-- out 6 + ror x2 ;1 [01] + cpi x2, 0xfc ;1 [02] + brcc bitstuff6 ;1 [03] + sbrs shift, 0 ;1 [04] + eor x1, x4 ;1 [05] + ror shift ;1 [06] + ror x2 ;1 [07] +didStuff7: ;- [07] + ldi bitcnt, 6 ;1 [08] + cpi x2, 0xfc ;1 [09] + out USBOUT, x1 ;1 [00] [10] <-- out 7 + brcc bitstuff7 ;1 [01] + ld shift, y+ ;2 [02+03] + dec cnt ;1 [04] + brne txBitLoop ;1 [05] +makeSE0: + cbr x1, USBMASK ;1 [06] prepare SE0 [spec says EOP may be 19 to 23 cycles] + lds x2, usbNewDeviceAddr;2 [07+08] + lsl x2 ;1 [09] we compare with left shifted address +;2006-03-06: moved transfer of new address to usbDeviceAddr from C-Code to asm: +;set address only after data packet was sent, not after handshake + out USBOUT, x1 ;1 [00] [10] <-- out SE0-- from now 2 bits==20 cycl. until bus idle + subi YL, 20 + 2 ;1 [01] Only assign address on data packets, not ACK/NAK in x3 + sbci YH, 0 ;1 [02] + breq skipAddrAssign ;1 [03] + sts usbDeviceAddr, x2 ;2 [04+05] if not skipped: SE0 is one cycle longer +;---------------------------------------------------------------------------- +;end of usbDeviceAddress transfer +skipAddrAssign: ;- [03/04] + ldi x2, 1< 13.333333 cycles per bit, 106.666667 cycles per byte +; Numbers in brackets are clocks counted from center of last sync bit +; when instruction starts +;register use in receive loop: +; shift assembles the byte currently being received +; x1 holds the D+ and D- line state +; x2 holds the previous line state +; x4 (leap) is used to add a leap cycle once every three bytes received +; X3 (leap2) is used to add a leap cycle once every three stuff bits received +; bitcnt is used to determine when a stuff bit is due +; cnt holds the number of bytes left in the receive buffer + +USB_INTR_VECTOR: +;order of registers pushed: YL, SREG YH, [sofError], bitcnt, shift, x1, x2, x3, x4, cnt + push YL ;[-28] push only what is necessary to sync with edge ASAP + in YL, SREG ;[-26] + push YL ;[-25] + push YH ;[-23] +;---------------------------------------------------------------------------- +; Synchronize with sync pattern: +;---------------------------------------------------------------------------- +;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K] +;sync up with J to K edge during sync pattern -- use fastest possible loops +;The first part waits at most 1 bit long since we must be in sync pattern. +;YL is guarenteed to be < 0x80 because I flag is clear. When we jump to +;waitForJ, ensure that this prerequisite is met. +waitForJ: + inc YL + sbis USBIN, USBMINUS + brne waitForJ ; just make sure we have ANY timeout +waitForK: +;The following code results in a sampling window of < 1/4 bit which meets the spec. + sbis USBIN, USBMINUS ;[-19] + rjmp foundK ;[-18] + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK +#if USB_COUNT_SOF + lds YL, usbSofCount + inc YL + sts usbSofCount, YL +#endif /* USB_COUNT_SOF */ +#ifdef USB_SOF_HOOK + USB_SOF_HOOK +#endif + rjmp sofError +foundK: ;[-16] +;{3, 5} after falling D- edge, average delay: 4 cycles +;bit0 should be at 34 for center sampling. Currently at 4 so 30 cylces till bit 0 sample +;use 1 bit time for setup purposes, then sample again. Numbers in brackets +;are cycles from center of first sync (double K) bit after the instruction + push bitcnt ;[-16] +; [---] ;[-15] + lds YL, usbInputBufOffset;[-14] +; [---] ;[-13] + clr YH ;[-12] + subi YL, lo8(-(usbRxBuf));[-11] [rx loop init] + sbci YH, hi8(-(usbRxBuf));[-10] [rx loop init] + push shift ;[-9] +; [---] ;[-8] + ldi shift,0x40 ;[-7] set msb to "1" so processing bit7 can be detected + nop2 ;[-6] +; [---] ;[-5] + ldi bitcnt, 5 ;[-4] [rx loop init] + sbis USBIN, USBMINUS ;[-3] we want two bits K (sample 3 cycles too early) + rjmp haveTwoBitsK ;[-2] + pop shift ;[-1] undo the push from before + pop bitcnt ;[1] + rjmp waitForK ;[3] this was not the end of sync, retry +; The entire loop from waitForK until rjmp waitForK above must not exceed two +; bit times (= 27 cycles). + +;---------------------------------------------------------------------------- +; push more registers and initialize values while we sample the first bits: +;---------------------------------------------------------------------------- +haveTwoBitsK: + push x1 ;[0] + push x2 ;[2] + push x3 ;[4] (leap2) + ldi leap2, 0x55 ;[6] add leap cycle on 2nd,5th,8th,... stuff bit + push x4 ;[7] == leap + ldi leap, 0x55 ;[9] skip leap cycle on 2nd,5th,8th,... byte received + push cnt ;[10] + ldi cnt, USB_BUFSIZE ;[12] [rx loop init] + ldi x2, 1< +#ifndef __IAR_SYSTEMS_ASM__ +# include +#endif + +#define __attribute__(arg) /* not supported on IAR */ + +#ifdef __IAR_SYSTEMS_ASM__ +# define __ASSEMBLER__ /* IAR does not define standard macro for asm */ +#endif + +#ifdef __HAS_ELPM__ +# define PROGMEM __farflash +#else +# define PROGMEM __flash +#endif + +#define USB_READ_FLASH(addr) (*(PROGMEM char *)(addr)) + +/* The following definitions are not needed by the driver, but may be of some + * help if you port a gcc based project to IAR. + */ +#define cli() __disable_interrupt() +#define sei() __enable_interrupt() +#define wdt_reset() __watchdog_reset() +#define _BV(x) (1 << (x)) + +/* assembler compatibility macros */ +#define nop2 rjmp $+2 /* jump to next instruction */ +#define XL r26 +#define XH r27 +#define YL r28 +#define YH r29 +#define ZL r30 +#define ZH r31 +#define lo8(x) LOW(x) +#define hi8(x) (((x)>>8) & 0xff) /* not HIGH to allow XLINK to make a proper range check */ + +/* Depending on the device you use, you may get problems with the way usbdrv.h + * handles the differences between devices. Since IAR does not use #defines + * for MCU registers, we can't check for the existence of a particular + * register with an #ifdef. If the autodetection mechanism fails, include + * definitions for the required USB_INTR_* macros in your usbconfig.h. See + * usbconfig-prototype.h and usbdrv.h for details. + */ + +/* ------------------------------------------------------------------------- */ +#elif __CODEVISIONAVR__ /* check for CodeVision AVR */ +/* ------------------------------------------------------------------------- */ +/* This port is not working (yet) */ + +/* #define F_CPU _MCU_CLOCK_FREQUENCY_ seems to be defined automatically */ + +#include +#include + +#define __attribute__(arg) /* not supported on IAR */ + +#define PROGMEM __flash +#define USB_READ_FLASH(addr) (*(PROGMEM char *)(addr)) + +#ifndef __ASSEMBLER__ +static inline void cli(void) +{ + #asm("cli"); +} +static inline void sei(void) +{ + #asm("sei"); +} +#endif +#define _delay_ms(t) delay_ms(t) +#define _BV(x) (1 << (x)) +#define USB_CFG_USE_SWITCH_STATEMENT 1 /* macro for if() cascase fails for unknown reason */ + +#define macro .macro +#define endm .endmacro +#define nop2 rjmp .+0 /* jump to next instruction */ + +/* ------------------------------------------------------------------------- */ +#else /* default development environment is avr-gcc/avr-libc */ +/* ------------------------------------------------------------------------- */ + +#include +#ifdef __ASSEMBLER__ +# define _VECTOR(N) __vector_ ## N /* io.h does not define this for asm */ +#else +# include +#endif + +#define USB_READ_FLASH(addr) pgm_read_byte(addr) + +#define macro .macro +#define endm .endm +#define nop2 rjmp .+0 /* jump to next instruction */ + +#endif /* development environment */ + +/* for conveniecne, ensure that PRG_RDB exists */ +#ifndef PRG_RDB +# define PRG_RDB(addr) USB_READ_FLASH(addr) +#endif +#endif /* __usbportability_h_INCLUDED__ */ -- 2.11.0