Updated LUFA to SVN r1992.
This commit is contained in:
		| @@ -43,9 +43,6 @@ | ||||
| 		 | ||||
| 		#include <LUFA/Common/Common.h> | ||||
| 	 | ||||
| 	/* External Variables: */ | ||||
| 		extern uint8_t* BootloaderAPI_JumpTable; | ||||
| 	 | ||||
| 	/* Function Prototypes: */ | ||||
| 		void    BootloaderAPI_ErasePage(uint32_t Address); | ||||
| 		void    BootloaderAPI_WritePage(uint32_t Address); | ||||
|   | ||||
| @@ -1,250 +0,0 @@ | ||||
| :020000021000EC | ||||
| :10E000004BC0000066C0000064C0000062C0000099 | ||||
| :10E0100060C000005EC000005CC000005AC000008C | ||||
| :10E0200058C0000056C00000BEC4000052C000002E | ||||
| :10E0300050C000004EC000004CC000004AC00000AC | ||||
| :10E0400048C0000046C0000044C0000042C00000BC | ||||
| :10E0500041C000003EC000003CC000003AC00000CB | ||||
| :10E0600038C0000036C0000034C0000032C00000DC | ||||
| :10E0700030C000002EC000002CC000002AC00000EC | ||||
| :10E0800028C0000026C0000024C0000022C00000FC | ||||
| :10E0900020C000001EC0000011241FBECFEFD0E240 | ||||
| :10E0A000DEBFCDBF11E0A0E0B1E0E8EBFEEE01E0A5 | ||||
| :10E0B0000BBF02C007900D92AC38B107D9F711E041 | ||||
| :10E0C000ACE8B1E001C01D92AA39B107E1F734D341 | ||||
| :10E0D000F1C696CF1F920F920FB60F9211240F9098 | ||||
| :10E0E0000FBE0F901F90189584E08093E9000DC03B | ||||
| :10E0F0008091E8008B778093E80003C08EB388237B | ||||
| :10E1000051F08091E80082FFF9CF8091E80085FF0F | ||||
| :10E11000EFCF8091F1000895982F83E08093E9007C | ||||
| :10E120008091E80085FD0DC08091E8008E77809396 | ||||
| :10E13000E80003C08EB3882331F08091E80080FFAF | ||||
| :10E14000F9CF9093F10008954F925F926F927F9272 | ||||
| :10E150008F929F92AF92BF92CF92DF92EF92FF92F7 | ||||
| :10E160000F931F93CF93DF9384E08093E900809116 | ||||
| :10E17000E80082FF73C2B8DF182F853419F41092BB | ||||
| :10E18000080103C0843519F4AFDF8DE03DC28C3443 | ||||
| :10E19000E1F38035D1F3843711F484E495C08136FE | ||||
| :10E1A00011F489E531C28134B1F49EDF182F9CDF70 | ||||
| :10E1B00090E0880F991FAA2797FDA095BA2F312FBD | ||||
| :10E1C000330F20E0442737FD4095542F822B932BAB | ||||
| :10E1D000A42BB52BEAC1803711F483E515C2833532 | ||||
| :10E1E00049F4C0E0D1E0899197DF41E0C730D4071E | ||||
| :10E1F000D1F70BC2863521F481E38EDF80E304C2C0 | ||||
| :10E20000833731F482E888DF87E986DF8EE1FCC15D | ||||
| :10E21000853629F580E090E0A0E0B0E033E025E02D | ||||
| :10E22000FC01A0935B0030935700E89507B600FC13 | ||||
| :10E23000FDCFFC01A0935B0020935700E89507B643 | ||||
| :10E2400000FCFDCF80509F4FAF4FBF4F803040EE5E | ||||
| :10E25000940741E0A40740E0B40711F796CF8C364D | ||||
| :10E2600051F442DF809599E0E1E0F0E0082E9093D0 | ||||
| :10E270005700E8958ACF823739F4E1E0F0E089E091 | ||||
| :10E28000809357008491C0C1863439F4E0E0F0E017 | ||||
| :10E2900089E0809357008491B7C18E3439F4E3E06C | ||||
| :10E2A000F0E089E0809357008491AEC1813539F464 | ||||
| :10E2B000E2E0F0E089E0809357008491A5C18236C6 | ||||
| :10E2C00031F489E529DF81E027DF80E09DC18234D8 | ||||
| :10E2D00019F0873609F0E6C007DF082F05DFF82EB2 | ||||
| :10E2E00003DF682E8554823008F08DC1902F80E0C6 | ||||
| :10E2F000CF2DD0E0C82BD92B173609F050C081E1C3 | ||||
| :10E3000080935700E895DD24CC24C39444C0E0906A | ||||
| :10E310008C01F0908D0100918E0110918F0186E4A7 | ||||
| :10E32000681601F58D2D90E0A0E0B0E08E299F29C0 | ||||
| :10E33000A02BB12BABBFFC018791EEDEDD2081F07D | ||||
| :10E3400082E090E0A0E0B0E0E80EF91E0A1F1B1F7B | ||||
| :10E35000E0928C01F0928D0100938E0110938F0159 | ||||
| :10E36000DC2418C0D801C701B695A7959795879565 | ||||
| :10E370008BD5D2DE82E090E0A0E0B0E0E80EF91E9E | ||||
| :10E380000A1F1B1FE0928C01F0928D0100938E01F9 | ||||
| :10E3900010938F012197209709F0B9CF36C1809053 | ||||
| :10E3A0008C0190908D01A0908E01B0908F0196E429 | ||||
| :10E3B000691609F061C083E0F401A0925B008093CC | ||||
| :10E3C0005700E89507B600FCFDCF56C0A6E46A16D4 | ||||
| :10E3D00071F5772041F1E0908C01F0908D01009172 | ||||
| :10E3E0008E0110918F0180DED82ECC24852D90E0F7 | ||||
| :10E3F0008C299D290C01F70100935B004092570086 | ||||
| :10E40000E895112482E090E0A0E0B0E0E80EF91E6B | ||||
| :10E410000A1F1B1FE0928C01F0928D0100938E0168 | ||||
| :10E4200010938F0102C060DE582E742423C0E09048 | ||||
| :10E430008C01F0908D0100918E0110918F01169545 | ||||
| :10E440000795F794E79450DE682FC70125D5809192 | ||||
| :10E450008C0190918D01A0918E01B0918F01029657 | ||||
| :10E46000A11DB11D80938C0190938D01A0938E010D | ||||
| :10E47000B0938F01219704C05524772444244394FA | ||||
| :10E48000209709F0A3CF96E4691609F07ECE85E0C7 | ||||
| :10E49000F401A0925B0080935700E89507B600FC5A | ||||
| :10E4A000FDCF73CE8334A1F4E0908C01F0908D0108 | ||||
| :10E4B00000918E0110918F0117DE90E021E00C0198 | ||||
| :10E4C000F70100935B0020935700E89511245DCE7F | ||||
| :10E4D000833639F5E0908C01F0908D0100918E012A | ||||
| :10E4E00010918F0101DEA8019701216090E061E0A9 | ||||
| :10E4F0000C01F90140935B0060935700E8951124EB | ||||
| :10E5000082E090E0A0E0B0E0E80EF91E0A1F1B1FB9 | ||||
| :10E51000E0928C01F0928D0100938E0110938F0197 | ||||
| :10E5200034CE8D3699F480918C0190918D01A0911B | ||||
| :10E530008E01B0918F0125E0FC01A0935B00209338 | ||||
| :10E540005700E89507B600FCFDCF1FCE823581F459 | ||||
| :10E55000E0908C01F0908D0100918E0110918F015F | ||||
| :10E560000BBFF701E790F6908F2DD6DD8E2D4CC0B6 | ||||
| :10E57000843421F5E0908C01F0908D0100918E01A2 | ||||
| :10E5800010918F0116950795F794E794ADDD682FEC | ||||
| :10E59000C70182D480918C0190918D01A0918E0150 | ||||
| :10E5A000B0918F010296A11DB11D80938C019093B3 | ||||
| :10E5B0008D01A0938E01B0938F01E7CD843609F5CC | ||||
| :10E5C000E0908C01F0908D0100918E0110918F01EF | ||||
| :10E5D000D801C701B695A7959795879555D49CDD29 | ||||
| :10E5E00082E090E0A0E0B0E0E80EF91E0A1F1B1FD9 | ||||
| :10E5F000E0928C01F0928D0100938E0110938F01B7 | ||||
| :10E6000004C08B3111F08FE387DD83E08093E90054 | ||||
| :10E610009091E8008091E8008E778093E80095FF64 | ||||
| :10E6200004C010C08EB38823C9F08091E80080FF39 | ||||
| :10E63000F9CF8091E8008E778093E80003C08EB315 | ||||
| :10E64000882361F08091E80080FFF9CF84E0809317 | ||||
| :10E65000E9008091E8008B778093E800DF91CF910B | ||||
| :10E660001F910F91FF90EF90DF90CF90BF90AF90F0 | ||||
| :10E670009F908F907F906F905F904F9008959091B2 | ||||
| :10E680009201892F8F77813249F5809193018032F1 | ||||
| :10E69000A1F0813219F5913A09F58091E800877F60 | ||||
| :10E6A0008093E80089E091E067E070E031D28091EA | ||||
| :10E6B000E8008B778093E8000895913279F4809197 | ||||
| :10E6C000E800877F8093E80089E091E067E070E0F0 | ||||
| :10E6D0007BD28091E8008E778093E800089582E0F5 | ||||
| :10E6E00061EC42E0D4D083E061E842E1D0D084E044 | ||||
| :10E6F00060E842E1CCC01F9384B7877F84BF88E184 | ||||
| :10E700000FB6F89480936000109260000FBE90E006 | ||||
| :10E7100080E80FB6F89480936100909361000FBE7B | ||||
| :10E7200011E015BF82E085BF28D110936F0083E010 | ||||
| :10E73000809381001F910895DF93CF9300D0CDB7D0 | ||||
| :10E74000DEB78091E0FF9091E1FF9A838983898110 | ||||
| :10E750009A81D1DF789402C0F7DC84D380910801DC | ||||
| :10E760008823D1F78091E00081608093E0002CE065 | ||||
| :10E7700088E190E00FB6F894A895809360000FBEF2 | ||||
| :10E7800020936000FFCF9B01AC0107B600FCFDCFDA | ||||
| :10E79000F999FECF83E0F90140935B008093570025 | ||||
| :10E7A000E89581E180935700E89508959B01AC01BD | ||||
| :10E7B00007B600FCFDCFF999FECF85E0F901409343 | ||||
| :10E7C0005B0080935700E89581E180935700E895BE | ||||
| :10E7D00008950F931F938B019C0107B600FCFDCF9A | ||||
| :10E7E000F999FECF81E00A01F80120935B00809344 | ||||
| :10E7F0005700E89511241F910F91089521E2FC0123 | ||||
| :10E80000209357002491822F089529E0FC01209342 | ||||
| :10E8100057002491822F0895E1E0F0E089E0809391 | ||||
| :10E82000570084910895982F07B600FCFDCFF99901 | ||||
| :10E83000FECF909589E0E1E0F0E0092E809357004B | ||||
| :10E84000E8950895FA01923071F0933089F0913093 | ||||
| :10E8500029F480E191E022E130E015C080E090E011 | ||||
| :10E8600020E030E010C082E291E02EE330E00BC007 | ||||
| :10E87000882329F480E691E024E030E004C084E6B7 | ||||
| :10E8800091E026E230E091838083C901089580936E | ||||
| :10E89000E9008091EB0081608093EB001092ED0025 | ||||
| :10E8A0006093EC004093ED008091EE00881F882774 | ||||
| :10E8B000881F08958091920188238CF403C08EB341 | ||||
| :10E8C0008823B1F08091E80082FFF9CF8091E800C1 | ||||
| :10E8D0008B778093E80008958EB3882349F0809168 | ||||
| :10E8E000E80080FFF9CF8091E8008E778093E80000 | ||||
| :10E8F0000895EF92FF920F931F9348D04FD008EDE9 | ||||
| :10E9000010E0F80180818F77808380818068808328 | ||||
| :10E9100080818F7D8083E7EDF0E080818068808357 | ||||
| :10E9200019BC1EBA1092900180EEE82EF12CF7016E | ||||
| :10E9300080818B7F8083F80180818160808380E08B | ||||
| :10E9400060E042E0A4DFE1EEF0E080818E7F808332 | ||||
| :10E95000E2EEF0E080818160808380818860808346 | ||||
| :10E96000F70180818E7F8083F801808180618083C0 | ||||
| :10E970001F910F91FF90EF900895E7EDF0E08081F7 | ||||
| :10E980008160808381E080939101B3CFE8EDF0E076 | ||||
| :10E9900080818C7F80831092E20008951092DA00CB | ||||
| :10E9A0001092E10008951F920F920FB60F920BB6CE | ||||
| :10E9B0000F9211242F933F934F935F936F937F9305 | ||||
| :10E9C0008F939F93AF93BF93EF93FF938091DA0060 | ||||
| :10E9D00080FF1BC08091D80080FF17C08091DA00B3 | ||||
| :10E9E0008E7F8093DA008091D90080FF0BC084E194 | ||||
| :10E9F00089BD86E189BD09B400FEFDCF81E08EBBF3 | ||||
| :10EA000030D203C019BC1EBA2CD28091E10080FF25 | ||||
| :10EA100017C08091E20080FF13C08091E2008E7FDA | ||||
| :10EA20008093E2008091E20080618093E200809117 | ||||
| :10EA3000D80080628093D80019BC85E08EBB11D2CB | ||||
| :10EA40008091E10084FF2CC08091E20084FF28C007 | ||||
| :10EA500084E189BD86E189BD09B400FEFDCF8091C6 | ||||
| :10EA6000D8008F7D8093D8008091E1008F7E8093C5 | ||||
| :10EA7000E1008091E2008F7E8093E2008091E200CD | ||||
| :10EA800081608093E20080919001882331F480912D | ||||
| :10EA9000E30087FD02C081E001C084E08EBBE1D1CC | ||||
| :10EAA0008091E10083FF21C08091E20083FF1DC0BF | ||||
| :10EAB0008091E100877F8093E10082E08EBB10921D | ||||
| :10EAC00090018091E1008E7F8093E1008091E200CF | ||||
| :10EAD0008E7F8093E2008091E20080618093E2006B | ||||
| :10EAE00080E060E042E0D3DEBCD1FF91EF91BF91C6 | ||||
| :10EAF000AF919F918F917F916F915F914F913F91D6 | ||||
| :10EB00002F910F900BBE0F900FBE0F901F90189576 | ||||
| :10EB10009C0140919801509199014617570718F4AC | ||||
| :10EB2000F90190E03CC06115710511F0AB01F8CF1F | ||||
| :10EB30008091E8008E778093E80040E050E0F0CFCD | ||||
| :10EB40008EB38823E9F18530E9F18091E80083FFF5 | ||||
| :10EB500002C081E008958091E80082FD2BC0809181 | ||||
| :10EB6000E80080FF1CC02091F2003091F30007C044 | ||||
| :10EB700081918093F100415050402F5F3F4F4115EC | ||||
| :10EB8000510519F02830310598F390E0283031050F | ||||
| :10EB900009F491E08091E8008E778093E8004115B8 | ||||
| :10EBA000510571F6992361F605C08EB3882341F0B3 | ||||
| :10EBB000853041F08091E80082FFF7CF80E0089532 | ||||
| :10EBC00082E0089583E008959C016115710529F4A0 | ||||
| :10EBD0008091E8008B778093E800F90121C08EB323 | ||||
| :10EBE000882369F1853069F18091E80083FF02C0D4 | ||||
| :10EBF00081E008958091E80082FFF1CF06C0809106 | ||||
| :10EC0000F10081936150704031F08091F200909159 | ||||
| :10EC1000F300892BA1F78091E8008B778093E800BF | ||||
| :10EC200061157105E1F605C08EB3882341F085308A | ||||
| :10EC300041F08091E80080FFF7CF80E0089582E006 | ||||
| :10EC4000089583E008950F931F93DF93CF9300D02F | ||||
| :10EC5000CDB7DEB7E2E9F1E08091F100819381E088 | ||||
| :10EC6000EA39F807C9F70BDD8091E80083FFE4C0BB | ||||
| :10EC70008091920190919301953009F46DC0963086 | ||||
| :10EC800040F4913081F1913070F0933009F0D4C0AC | ||||
| :10EC90002AC0983009F4A3C0993009F4B2C0963064 | ||||
| :10ECA00009F0CAC07CC0803809F4C6C0823809F0B7 | ||||
| :10ECB000C3C08091960187708093E9008091EB003A | ||||
| :10ECC0001092E9002091E800277F2093E80090E06F | ||||
| :10ECD00025E0969587952A95E1F781708093F1005C | ||||
| :10ECE0001092F10087C0882319F0823009F0A4C087 | ||||
| :10ECF0008F71823009F0A0C080919401882331F592 | ||||
| :10ED000020919601277009F497C02093E900809123 | ||||
| :10ED1000EB0080FF1BC0933021F48091EB008062F8 | ||||
| :10ED200013C08091EB0080618093EB0081E090E064 | ||||
| :10ED300002C0880F991F2A95E2F78093EA0010928B | ||||
| :10ED4000EA008091EB0088608093EB001092E9006C | ||||
| :10ED50008091E800877F51C0882309F06DC0109131 | ||||
| :10ED600094011F770FB7F8948091E800877F809314 | ||||
| :10ED7000E800A0DD8091E80080FFFCCF8091E300F7 | ||||
| :10ED80008078812B8093E30080688093E3001123D7 | ||||
| :10ED900011F482E001C083E08EBB0FBF4DC08058EC | ||||
| :10EDA000823008F049C08091940190919501609162 | ||||
| :10EDB0009601AE014F5F5F4F45DDBC01009709F43E | ||||
| :10EDC0003BC08091E800877F8093E80089819A8129 | ||||
| :10EDD0009FDE8091E8008B778093E8002DC080381B | ||||
| :10EDE00059F58091E800877F8093E8008091900139 | ||||
| :10EDF0008093F1008091E8008E778093E8005ADDDF | ||||
| :10EE00001BC08823C9F4909194019230A8F480919A | ||||
| :10EE1000E800877F8093E800909390014BDD80911C | ||||
| :10EE20009001882331F48091E30087FD02C081E0E6 | ||||
| :10EE300001C084E08EBB53DC8091E80083FF0AC0F0 | ||||
| :10EE40008091EB0080628093EB008091E800877FE7 | ||||
| :10EE50008093E8000F900F90CF91DF911F910F9159 | ||||
| :10EE6000089508951F938EB3882361F01091E900EF | ||||
| :10EE70001092E9008091E80083FF01C0E4DE177082 | ||||
| :10EE80001093E9001F910895F999FECF92BD81BDBD | ||||
| :10EE9000F89A992780B50895262FF999FECF1FBAC1 | ||||
| :10EEA00092BD81BD20BD0FB6F894FA9AF99A0FBEB3 | ||||
| :08EEB00001960895F894FFCFCC | ||||
| :10EEB8004C5546414344430001000000000000084F | ||||
| :10EEC8001201100102000008EB034A2001000001B2 | ||||
| :10EED800000109023E00020100803209040000011D | ||||
| :10EEE800020201000524001001042402040524067E | ||||
| :10EEF8000001070582030800FF09040100020A0057 | ||||
| :10EF08000000070504021000010705830210000134 | ||||
| :10EF18000403090426034100560052002000430060 | ||||
| :10EF280044004300200042006F006F0074006C0032 | ||||
| :0CEF38006F0061006400650072000000C2 | ||||
| :10FFE0000C94C3F30C94D6F30C94E9F30C94FEF345 | ||||
| :0CFFF0000C9405F40C940CF40C9413F425 | ||||
| :040000031000E00009 | ||||
| :00000001FF | ||||
| @@ -63,10 +63,6 @@ static bool RunBootloader = true; | ||||
|  */ | ||||
| int main(void) | ||||
| { | ||||
| 	/* Force a reference to the API jump table to prevent the linker from discarding it */ | ||||
| 	uint8_t* volatile Dummy = BootloaderAPI_JumpTable; | ||||
| 	(void)Dummy; | ||||
|  | ||||
| 	/* Setup hardware required for the bootloader */ | ||||
| 	SetupHardware(); | ||||
|  | ||||
|   | ||||
| @@ -191,9 +191,9 @@ const USB_Descriptor_String_t LanguageString = | ||||
|  */ | ||||
| const USB_Descriptor_String_t ProductString = | ||||
| { | ||||
| 	.Header                 = {.Size = USB_STRING_LEN(22), .Type = DTYPE_String}, | ||||
| 	.Header                 = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String}, | ||||
|  | ||||
| 	.UnicodeString          = L"AVR CDC API Bootloader" | ||||
| 	.UnicodeString          = L"AVR CDC Bootloader" | ||||
| }; | ||||
|  | ||||
| /** This function is called by the library when in device mode, and must be overridden (see LUFA library "USB Descriptors" | ||||
|   | ||||
| @@ -47,48 +47,9 @@ | ||||
| #---------------------------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| # Select MCU name and bootloader start address - uncomment _ONE_ of the following pairs | ||||
| # | ||||
| # Starting byte address of the bootloader, as a byte address - computed via the formula | ||||
| #   BOOT_START = ((TOTAL_FLASH_BYTES - BOOTLOADER_SECTION_SIZE_BYTES) * 1024) | ||||
| # | ||||
| # The Boot API Table is meant to go at the very end (last 32 bytes) of FLASH memory | ||||
| # for code compatibility among all the USB AVRs.  For more information refer to the | ||||
| # following FAQ; "14. Can the application use code built into the bootloader?" | ||||
| #   http://blog.schicks.net/wp-content/uploads/2009/09/bootloader_faq.pdf | ||||
| # | ||||
| #   BOOT_API_TABLESTART = ((TOTAL_FLASH_BYTES * 1024) - 32) | ||||
| # | ||||
| # Note that the bootloader size and start address given in AVRStudio is in words and not | ||||
| # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. | ||||
|  | ||||
| #MCU = at90usb162 | ||||
| #BOOT_START = 0x3000 | ||||
| #BOOT_API_TABLESTART = 0x3FE0 | ||||
|  | ||||
| #MCU = atmega32u2 | ||||
| #BOOT_START = 0x3000 | ||||
| #BOOT_API_TABLESTART = 0x7FE0 | ||||
|  | ||||
| #MCU = atmega32u4 | ||||
| #BOOT_START = 0x7000 | ||||
| #BOOT_API_TABLESTART = 0x7FE0 | ||||
|  | ||||
| #MCU = at90usb646 | ||||
| #BOOT_START = 0xF000 | ||||
| #BOOT_API_TABLESTART = 0xFFE0 | ||||
|  | ||||
| #MCU = at90usb647 | ||||
| #BOOT_START = 0xF000 | ||||
| #BOOT_API_TABLESTART = 0xFFE0 | ||||
|  | ||||
| #MCU = at90usb1286 | ||||
| #BOOT_START = 0x1E000 | ||||
| #BOOT_API_TABLESTART = 0x1FFE0 | ||||
|  | ||||
| # MCU name | ||||
| MCU = at90usb1287 | ||||
| BOOT_START = 0x1E000 | ||||
| BOOT_API_TABLESTART = 0x1FFE0 | ||||
|  | ||||
|  | ||||
| # Target architecture (see library "Board Types" documentation). | ||||
| ARCH = AVR8 | ||||
| @@ -97,7 +58,7 @@ ARCH = AVR8 | ||||
| # Target board (see library "Board Types" documentation, NONE for projects not requiring | ||||
| # LUFA board drivers). If USER is selected, put custom board drivers in a directory called | ||||
| # "Board" inside the application directory. | ||||
| BOARD = NONE | ||||
| BOARD = USBKEY | ||||
|  | ||||
|  | ||||
| # Processor frequency. | ||||
| @@ -111,7 +72,7 @@ BOARD = NONE | ||||
| #     does not *change* the processor frequency - it should merely be updated to | ||||
| #     reflect the processor speed set externally so that the code can use accurate | ||||
| #     software delays. | ||||
| F_CPU = 16000000 | ||||
| F_CPU = 8000000 | ||||
|  | ||||
|  | ||||
| # Input clock frequency. | ||||
| @@ -128,6 +89,17 @@ F_CPU = 16000000 | ||||
| F_USB = $(F_CPU) | ||||
|  | ||||
|  | ||||
| # Starting byte address of the bootloader, as a byte address - computed via the formula | ||||
| #   BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024) | ||||
| # | ||||
| # Note that the bootloader size and start address given in AVRStudio is in words and not | ||||
| # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. | ||||
| FLASH_SIZE_KB        = 128 | ||||
| BOOT_SECTION_SIZE_KB = 4 | ||||
| BOOT_START           = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc) | ||||
| BOOT_API_TABLESTART  = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 32)" | bc) | ||||
|  | ||||
|  | ||||
| # Output format. (can be srec, ihex, binary) | ||||
| FORMAT = ihex | ||||
|  | ||||
| @@ -368,11 +340,9 @@ EXTMEMOPTS = | ||||
| #    -Map:      create map file | ||||
| #    --cref:    add cross reference to  map file | ||||
| LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref | ||||
| LDFLAGS += -Wl,--section-start=.text=$(BOOT_START) -Wl,--section-start=.apitable=$(BOOT_API_TABLESTART) | ||||
| LDFLAGS += -Wl,--section-start=.text=$(BOOT_START) -Wl,--section-start=.apitable=$(BOOT_API_TABLESTART) -Wl,--undefined=BootloaderAPI_JumpTable | ||||
| LDFLAGS += -Wl,--relax | ||||
| LDFLAGS += -Wl,--gc-sections | ||||
| # need --undefined=.apitable to make sure the API table is not optimized out | ||||
| LDFLAGS += -Wl,--undefined=.apitable | ||||
| LDFLAGS += $(EXTMEMOPTS) | ||||
| LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) | ||||
| LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) | ||||
| @@ -386,7 +356,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) | ||||
| # Type: avrdude -c ? | ||||
| # to get a full listing. | ||||
| # | ||||
| AVRDUDE_PROGRAMMER = avrispmkII | ||||
| AVRDUDE_PROGRAMMER = jtagmkII | ||||
|  | ||||
| # com1 = serial port. Use lpt1 to connect to parallel port. | ||||
| AVRDUDE_PORT = usb | ||||
| @@ -407,7 +377,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex | ||||
| # Increase verbosity level.  Please use this when submitting bug | ||||
| # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> | ||||
| # to submit bug reports. | ||||
| AVRDUDE_VERBOSE = -v -v | ||||
| #AVRDUDE_VERBOSE = -v -v | ||||
|  | ||||
| AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) | ||||
| AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) | ||||
|   | ||||
| @@ -43,9 +43,6 @@ | ||||
| 		 | ||||
| 		#include <LUFA/Common/Common.h> | ||||
| 	 | ||||
| 	/* External Variables: */ | ||||
| 		extern uint8_t* BootloaderAPI_JumpTable; | ||||
| 	 | ||||
| 	/* Function Prototypes: */ | ||||
| 		void    BootloaderAPI_ErasePage(uint32_t Address); | ||||
| 		void    BootloaderAPI_WritePage(uint32_t Address); | ||||
|   | ||||
| @@ -99,10 +99,6 @@ static uint16_t EndAddr = 0x0000; | ||||
|  */ | ||||
| int main(void) | ||||
| { | ||||
| 	/* Force a reference to the API jump table to prevent the linker from discarding it */ | ||||
| 	uint8_t* volatile Dummy = BootloaderAPI_JumpTable; | ||||
| 	(void)Dummy; | ||||
|  | ||||
| 	/* Configure hardware required by the bootloader */ | ||||
| 	SetupHardware(); | ||||
|  | ||||
|   | ||||
| @@ -132,9 +132,9 @@ const USB_Descriptor_String_t LanguageString = | ||||
|  */ | ||||
| const USB_Descriptor_String_t ProductString = | ||||
| { | ||||
| 	.Header                 = {.Size = USB_STRING_LEN(22), .Type = DTYPE_String}, | ||||
| 	.Header                 = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String}, | ||||
|  | ||||
| 	.UnicodeString          = L"AVR DFU API Bootloader" | ||||
| 	.UnicodeString          = L"AVR DFU Bootloader" | ||||
| }; | ||||
|  | ||||
| /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" | ||||
|   | ||||
| @@ -47,48 +47,8 @@ | ||||
| #---------------------------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| # Select MCU name and bootloader start address - uncomment _ONE_ of the following pairs | ||||
| # | ||||
| # Starting byte address of the bootloader, as a byte address - computed via the formula | ||||
| #   BOOT_START = ((TOTAL_FLASH_BYTES - BOOTLOADER_SECTION_SIZE_BYTES) * 1024) | ||||
| # | ||||
| # The Boot API Table is meant to go at the very end (last 32 bytes) of FLASH memory | ||||
| # for code compatibility among all the USB AVRs.  For more information refer to the | ||||
| # following FAQ; "14. Can the application use code built into the bootloader?" | ||||
| #   http://blog.schicks.net/wp-content/uploads/2009/09/bootloader_faq.pdf | ||||
| # | ||||
| #   BOOT_API_TABLESTART = ((TOTAL_FLASH_BYTES * 1024) - 32) | ||||
| # | ||||
| # Note that the bootloader size and start address given in AVRStudio is in words and not | ||||
| # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. | ||||
|  | ||||
| #MCU = at90usb162 | ||||
| #BOOT_START = 0x3000 | ||||
| #BOOT_API_TABLESTART = 0x3FE0 | ||||
|  | ||||
| #MCU = atmega32u2 | ||||
| #BOOT_START = 0x3000 | ||||
| #BOOT_API_TABLESTART = 0x7FE0 | ||||
|  | ||||
| #MCU = atmega32u4 | ||||
| #BOOT_START = 0x7000 | ||||
| #BOOT_API_TABLESTART = 0x7FE0 | ||||
|  | ||||
| #MCU = at90usb646 | ||||
| #BOOT_START = 0xF000 | ||||
| #BOOT_API_TABLESTART = 0xFFE0 | ||||
|  | ||||
| #MCU = at90usb647 | ||||
| #BOOT_START = 0xF000 | ||||
| #BOOT_API_TABLESTART = 0xFFE0 | ||||
|  | ||||
| #MCU = at90usb1286 | ||||
| #BOOT_START = 0x1E000 | ||||
| #BOOT_API_TABLESTART = 0x1FFE0 | ||||
|  | ||||
| # MCU name | ||||
| MCU = at90usb1287 | ||||
| BOOT_START = 0x1E000 | ||||
| BOOT_API_TABLESTART = 0x1FFE0 | ||||
|  | ||||
|  | ||||
| # Target architecture (see library "Board Types" documentation). | ||||
| @@ -98,7 +58,7 @@ ARCH = AVR8 | ||||
| # Target board (see library "Board Types" documentation, NONE for projects not requiring | ||||
| # LUFA board drivers). If USER is selected, put custom board drivers in a directory called | ||||
| # "Board" inside the application directory. | ||||
| BOARD = NONE | ||||
| BOARD = USBKEY | ||||
|  | ||||
|  | ||||
| # Processor frequency. | ||||
| @@ -112,7 +72,7 @@ BOARD = NONE | ||||
| #     does not *change* the processor frequency - it should merely be updated to | ||||
| #     reflect the processor speed set externally so that the code can use accurate | ||||
| #     software delays. | ||||
| F_CPU = 16000000 | ||||
| F_CPU = 8000000 | ||||
|  | ||||
|  | ||||
| # Input clock frequency. | ||||
| @@ -129,6 +89,17 @@ F_CPU = 16000000 | ||||
| F_USB = $(F_CPU) | ||||
|  | ||||
|  | ||||
| # Starting byte address of the bootloader, as a byte address - computed via the formula | ||||
| #   BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024) | ||||
| # | ||||
| # Note that the bootloader size and start address given in AVRStudio is in words and not | ||||
| # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. | ||||
| FLASH_SIZE_KB        = 128 | ||||
| BOOT_SECTION_SIZE_KB = 4 | ||||
| BOOT_START           = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc) | ||||
| BOOT_API_TABLESTART  = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 32)" | bc) | ||||
|  | ||||
|  | ||||
| # Output format. (can be srec, ihex, binary) | ||||
| FORMAT = ihex | ||||
|  | ||||
| @@ -364,11 +335,9 @@ EXTMEMOPTS = | ||||
| #    -Map:      create map file | ||||
| #    --cref:    add cross reference to  map file | ||||
| LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref | ||||
| LDFLAGS += -Wl,--section-start=.text=$(BOOT_START) -Wl,--section-start=.apitable=$(BOOT_API_TABLESTART) | ||||
| LDFLAGS += -Wl,--section-start=.text=$(BOOT_START) -Wl,--section-start=.apitable=$(BOOT_API_TABLESTART) -Wl,--undefined=BootloaderAPI_JumpTable | ||||
| LDFLAGS += -Wl,--relax | ||||
| LDFLAGS += -Wl,--gc-sections | ||||
| # need --undefined=.apitable to make sure the API table is not optimized out | ||||
| LDFLAGS += -Wl,--undefined=.apitable | ||||
| LDFLAGS += $(EXTMEMOPTS) | ||||
| LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) | ||||
| LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) | ||||
| @@ -382,7 +351,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) | ||||
| # Type: avrdude -c ? | ||||
| # to get a full listing. | ||||
| # | ||||
| AVRDUDE_PROGRAMMER = avrispmkII | ||||
| AVRDUDE_PROGRAMMER = jtagmkII | ||||
|  | ||||
| # com1 = serial port. Use lpt1 to connect to parallel port. | ||||
| AVRDUDE_PORT = usb | ||||
| @@ -403,7 +372,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex | ||||
| # Increase verbosity level.  Please use this when submitting bug | ||||
| # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> | ||||
| # to submit bug reports. | ||||
| AVRDUDE_VERBOSE = -v -v | ||||
| #AVRDUDE_VERBOSE = -v -v | ||||
|  | ||||
| AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) | ||||
| AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) | ||||
|   | ||||
| @@ -169,7 +169,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn | ||||
| 	  KeyboardReport->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_F; | ||||
|  | ||||
| 	if (UsedKeyCodes) | ||||
| 	  KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; | ||||
| 	  KeyboardReport->Modifier = HID_KEYBOARD_MODIFIER_LEFTSHIFT; | ||||
|  | ||||
| 	*ReportSize = sizeof(USB_KeyboardReport_Data_t); | ||||
| 	return false; | ||||
|   | ||||
| @@ -84,7 +84,7 @@ BOARD = USBKEY | ||||
| #     does not *change* the processor frequency - it should merely be updated to | ||||
| #     reflect the processor speed set externally so that the code can use accurate | ||||
| #     software delays. | ||||
| F_CPU = 16000000 | ||||
| F_CPU = 8000000 | ||||
|  | ||||
|  | ||||
| # Input clock frequency. | ||||
| @@ -519,7 +519,6 @@ program: $(TARGET).hex $(TARGET).eep | ||||
| 	$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) | ||||
|  | ||||
| flip: $(TARGET).hex | ||||
|  | ||||
| 	batchisp -hardware usb -device $(MCU) -operation erase f | ||||
| 	batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program | ||||
| 	batchisp -hardware usb -device $(MCU) -operation start reset 0 | ||||
| @@ -540,12 +539,6 @@ dfu-ee: $(TARGET).hex $(TARGET).eep | ||||
| 	dfu-programmer $(MCU) eeprom-flash $(TARGET).eep | ||||
| 	dfu-programmer $(MCU) reset | ||||
|  | ||||
| cdc-lin: $(TARGET).hex | ||||
| 	avrdude -c AVR109 -p at90usb1287 -P /dev/ttyACM0 -U flash:w:$(TARGET).hex | ||||
|  | ||||
| cdc-win: $(TARGET).hex | ||||
| 	avrdude -c AVR109 -p at90usb1287 -P COM5 -U flash:w:$(TARGET).hex | ||||
|  | ||||
|  | ||||
| # Generate avr-gdb config/init file which does the following: | ||||
| #     define the reset signal, load the target file, connect to target, and set | ||||
|   | ||||
| @@ -183,7 +183,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn | ||||
| 		if (!(ButtonStatus_LCL & BUTTONS_BUTTON1)) | ||||
| 		  return 0; | ||||
|  | ||||
| 		KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; | ||||
| 		KeyboardReport->Modifier = HID_KEYBOARD_MODIFIER_LEFTSHIFT; | ||||
|  | ||||
| 		if (JoyStatus_LCL & JOY_UP) | ||||
| 		  KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_A; | ||||
|   | ||||
| @@ -151,7 +151,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn | ||||
| 	{		 | ||||
| 		USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData; | ||||
|  | ||||
| 		KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; | ||||
| 		KeyboardReport->Modifier = HID_KEYBOARD_MODIFIER_LEFTSHIFT; | ||||
|  | ||||
| 		if (JoyStatus_LCL & JOY_UP) | ||||
| 		  KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_A; | ||||
|   | ||||
| @@ -195,7 +195,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn | ||||
| 	uint8_t JoyStatus_LCL    = Joystick_GetStatus(); | ||||
| 	uint8_t ButtonStatus_LCL = Buttons_GetStatus(); | ||||
|  | ||||
| 	KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; | ||||
| 	KeyboardReport->Modifier = HID_KEYBOARD_MODIFIER_LEFTSHIFT; | ||||
|  | ||||
| 	if (JoyStatus_LCL & JOY_UP) | ||||
| 	  KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_A; | ||||
|   | ||||
| @@ -40,7 +40,7 @@ | ||||
| 		#include <avr/io.h> | ||||
| 		#include <string.h> | ||||
|  | ||||
| 		#include <LUFA/Drivers/USB/Class/RNDIS.h> | ||||
| 		#include <LUFA/Drivers/USB/USB.h> | ||||
|  | ||||
| 		#include "EthernetProtocols.h" | ||||
| 		#include "ProtocolDecoders.h" | ||||
|   | ||||
| @@ -38,7 +38,7 @@ | ||||
| #define _ETHERNET_PROTOCOLS_H_ | ||||
|  | ||||
| 	/* Includes: */ | ||||
| 		#include <LUFA/Drivers/USB/Class/RNDIS.h> | ||||
| 		#include <LUFA/Drivers/USB/USB.h> | ||||
|  | ||||
| 	/* Macros: */ | ||||
| 		#define ETHERTYPE_IPV4                   0x0800 | ||||
|   | ||||
| @@ -107,8 +107,6 @@ void SetupHardware(void) | ||||
| 	USB_Init(); | ||||
| } | ||||
|  | ||||
| #define BUTTONS_BUTTON1      (1 << 2) | ||||
|  | ||||
| /** Checks for changes in the position of the board joystick, sending strings to the host upon each change. */ | ||||
| void CheckJoystickMovement(void) | ||||
| { | ||||
| @@ -129,13 +127,10 @@ void CheckJoystickMovement(void) | ||||
| 	else | ||||
| 	  ActionSent = false; | ||||
|  | ||||
| 	if (((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1)) | ||||
| 	if ((ReportString != NULL) && (ActionSent == false)) | ||||
| 	{ | ||||
| 		DDRE  &= ~BUTTONS_BUTTON1; | ||||
| 		PORTE |=  BUTTONS_BUTTON1; | ||||
| 		 | ||||
| 		ActionSent = true; | ||||
| 		ReportString = "Joystick Pressed\r\n"; | ||||
|  | ||||
| 		/* Write the string to the virtual COM port via the created character stream */ | ||||
| 		fputs(ReportString, &USBSerialStream); | ||||
|  | ||||
|   | ||||
| @@ -60,7 +60,7 @@ | ||||
|  | ||||
|  | ||||
| # MCU name | ||||
| MCU = atmega32u4 | ||||
| MCU = at90usb1287 | ||||
|  | ||||
|  | ||||
| # Target architecture (see library "Board Types" documentation). | ||||
|   | ||||
| @@ -251,7 +251,7 @@ void CreateKeyboardReport(USB_KeyboardReport_Data_t* const ReportData) | ||||
| 	memset(ReportData, 0, sizeof(USB_KeyboardReport_Data_t)); | ||||
|  | ||||
| 	/* Make sent key uppercase by indicating that the left shift key is pressed */ | ||||
| 	ReportData->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; | ||||
| 	ReportData->Modifier = HID_KEYBOARD_MODIFIER_LEFTSHIFT; | ||||
|  | ||||
| 	if (JoyStatus_LCL & JOY_UP) | ||||
| 	  ReportData->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_A; | ||||
|   | ||||
| @@ -219,7 +219,7 @@ void Keyboard_HID_Task(void) | ||||
| 	if (!(Buttons_GetStatus() & BUTTONS_BUTTON1)) | ||||
| 	{ | ||||
| 		/* Make sent key uppercase by indicating that the left shift key is pressed */ | ||||
| 		KeyboardReportData.Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; | ||||
| 		KeyboardReportData.Modifier = HID_KEYBOARD_MODIFIER_LEFTSHIFT; | ||||
|  | ||||
| 		if (JoyStatus_LCL & JOY_UP) | ||||
| 		  KeyboardReportData.KeyCode[0] = HID_KEYBOARD_SC_A; | ||||
|   | ||||
| @@ -0,0 +1 @@ | ||||
| <AVRStudio><MANAGEMENT><ProjectName>AndroidAccessoryHost</ProjectName><Created>09-Jun-2011 14:10:10</Created><LastEdit>09-Jun-2011 14:10:10</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>09-Jun-2011 14:10:10</Created><Version>4</Version><Build>4, 18, 0, 685</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\Host\ClassDriver\AndroidAccessoryHost\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR ONE!</CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>AndroidAccessoryHost.c</SOURCEFILE><HEADERFILE>AndroidAccessoryHost.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>AndroidAccessoryHost.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20100110\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20100110\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> | ||||
| @@ -0,0 +1,227 @@ | ||||
| /* | ||||
|              LUFA Library | ||||
|      Copyright (C) Dean Camera, 2011. | ||||
|  | ||||
|   dean [at] fourwalledcubicle [dot] com | ||||
|            www.lufa-lib.org | ||||
| */ | ||||
|  | ||||
| /* | ||||
|   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||||
|  | ||||
|   Permission to use, copy, modify, distribute, and sell this | ||||
|   software and its documentation for any purpose is hereby granted | ||||
|   without fee, provided that the above copyright notice appear in | ||||
|   all copies and that both that the copyright notice and this | ||||
|   permission notice and warranty disclaimer appear in supporting | ||||
|   documentation, and that the name of the author not be used in | ||||
|   advertising or publicity pertaining to distribution of the | ||||
|   software without specific, written prior permission. | ||||
|  | ||||
|   The author disclaim all warranties with regard to this | ||||
|   software, including all implied warranties of merchantability | ||||
|   and fitness.  In no event shall the author be liable for any | ||||
|   special, indirect or consequential damages or any damages | ||||
|   whatsoever resulting from loss of use, data or profits, whether | ||||
|   in an action of contract, negligence or other tortious action, | ||||
|   arising out of or in connection with the use or performance of | ||||
|   this software. | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  * | ||||
|  *  Main source file for the AndroidAccessoryHost demo. This file contains the main tasks of | ||||
|  *  the demo and is responsible for the initial application hardware configuration. | ||||
|  */ | ||||
|  | ||||
| #include "AndroidAccessoryHost.h" | ||||
|  | ||||
| /** LUFA Android Open Accessory Class driver interface configuration and state information. This | ||||
|  *  structure is passed to all Android Open Accessory Class driver functions, so that multiple | ||||
|  *  instances of the same class within a device can be differentiated from one another. | ||||
|  */ | ||||
| USB_ClassInfo_AOA_Host_t AndroidDevice_AOA_Interface = | ||||
| 	{ | ||||
| 		.Config = | ||||
| 			{ | ||||
| 				.DataINPipeNumber           = 1, | ||||
| 				.DataINPipeDoubleBank       = false, | ||||
|  | ||||
| 				.DataOUTPipeNumber          = 2, | ||||
| 				.DataOUTPipeDoubleBank      = false, | ||||
| 				 | ||||
| 				.PropertyStrings = | ||||
| 					{ | ||||
| 						.Manufacturer       = "Dean Camera", | ||||
| 						.Model              = "LUFA Android Demo", | ||||
| 						.Description        = "LUFA Android Demo", | ||||
| 						.Version            = "1.0", | ||||
| 						.URI                = "http://www.lufa-lib.org", | ||||
| 						.Serial             = "0000000012345678", | ||||
| 					}, | ||||
| 			}, | ||||
| 	}; | ||||
|  | ||||
|  | ||||
| /** Main program entry point. This routine configures the hardware required by the application, then | ||||
|  *  enters a loop to run the application tasks in sequence. | ||||
|  */ | ||||
| int main(void) | ||||
| { | ||||
| 	SetupHardware(); | ||||
| 	 | ||||
| 	puts_P(PSTR(ESC_FG_CYAN "Android Accessory Host Demo running.\r\n" ESC_FG_WHITE)); | ||||
|  | ||||
| 	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); | ||||
| 	sei(); | ||||
|  | ||||
| 	for (;;) | ||||
| 	{ | ||||
| 		AOAHost_Task(); | ||||
|  | ||||
| 		AOA_Host_USBTask(&AndroidDevice_AOA_Interface); | ||||
| 		USB_USBTask(); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /** Configures the board hardware and chip peripherals for the demo's functionality. */ | ||||
| void SetupHardware(void) | ||||
| { | ||||
| 	/* Disable watchdog if enabled by bootloader/fuses */ | ||||
| 	MCUSR &= ~(1 << WDRF); | ||||
| 	wdt_disable(); | ||||
|  | ||||
| 	/* Disable clock division */ | ||||
| 	clock_prescale_set(clock_div_1); | ||||
|  | ||||
| 	/* Hardware Initialization */ | ||||
| 	Serial_Init(9600, false); | ||||
| 	LEDs_Init(); | ||||
| 	USB_Init(); | ||||
|  | ||||
| 	/* Create a stdio stream for the serial port for stdin and stdout */ | ||||
| 	Serial_CreateStream(NULL); | ||||
| } | ||||
|  | ||||
| /** Task to manage an enumerated USB Android Accessory device once connected, to print received data | ||||
|  *  from the device to the serial port. | ||||
|  */ | ||||
| void AOAHost_Task(void) | ||||
| { | ||||
| 	if (USB_HostState != HOST_STATE_Configured) | ||||
| 	  return; | ||||
|  | ||||
| 	if (AOA_Host_BytesReceived(&AndroidDevice_AOA_Interface)) | ||||
| 	{ | ||||
| 		/* Echo received bytes from the attached device through the USART */ | ||||
| 		int16_t ReceivedByte = AOA_Host_ReceiveByte(&AndroidDevice_AOA_Interface); | ||||
| 		if (!(ReceivedByte < 0)) | ||||
| 		  putchar(ReceivedByte); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and | ||||
|  *  starts the library USB task to begin the enumeration and USB management process. | ||||
|  */ | ||||
| void EVENT_USB_Host_DeviceAttached(void) | ||||
| { | ||||
| 	puts_P(PSTR("Device Attached.\r\n")); | ||||
| 	LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); | ||||
| } | ||||
|  | ||||
| /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and | ||||
|  *  stops the library USB task management process. | ||||
|  */ | ||||
| void EVENT_USB_Host_DeviceUnattached(void) | ||||
| { | ||||
| 	puts_P(PSTR("\r\nDevice Unattached.\r\n")); | ||||
| 	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); | ||||
| } | ||||
|  | ||||
| /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully | ||||
|  *  enumerated by the host and is now ready to be used by the application. | ||||
|  */ | ||||
| void EVENT_USB_Host_DeviceEnumerationComplete(void) | ||||
| { | ||||
| 	LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); | ||||
|  | ||||
| 	USB_Descriptor_Device_t DeviceDescriptor; | ||||
|  | ||||
| 	if (USB_Host_GetDeviceDescriptor(&DeviceDescriptor) != HOST_SENDCONTROL_Successful) | ||||
| 	{ | ||||
| 		puts_P(PSTR("Error Retrieving Device Descriptor.\r\n")); | ||||
| 		LEDs_SetAllLEDs(LEDMASK_USB_ERROR); | ||||
| 		return;	 | ||||
| 	} | ||||
|  | ||||
| 	bool NeedModeSwitch; | ||||
| 	if (!(AOA_Host_ValidateAccessoryDevice(&AndroidDevice_AOA_Interface, &DeviceDescriptor, &NeedModeSwitch))) | ||||
| 	{ | ||||
| 		puts_P(PSTR("Not an Android device.\r\n")); | ||||
| 		LEDs_SetAllLEDs(LEDMASK_USB_ERROR); | ||||
| 		return; | ||||
| 	} | ||||
| 	 | ||||
| 	if (NeedModeSwitch) | ||||
| 	{ | ||||
| 		puts_P(PSTR("Not in Accessory mode, switching...\r\n")); | ||||
| 		AOA_Host_StartAccessoryMode(&AndroidDevice_AOA_Interface); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	uint16_t ConfigDescriptorSize; | ||||
| 	uint8_t  ConfigDescriptorData[512]; | ||||
|  | ||||
| 	if (USB_Host_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData, | ||||
| 	                                       sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful) | ||||
| 	{ | ||||
| 		puts_P(PSTR("Error Retrieving Configuration Descriptor.\r\n")); | ||||
| 		LEDs_SetAllLEDs(LEDMASK_USB_ERROR); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	if (AOA_Host_ConfigurePipes(&AndroidDevice_AOA_Interface, | ||||
| 	                            ConfigDescriptorSize, ConfigDescriptorData) != AOA_ENUMERROR_NoError) | ||||
| 	{ | ||||
| 		puts_P(PSTR("Attached Device Not a Valid Android Accessory Class Device.\r\n")); | ||||
| 		LEDs_SetAllLEDs(LEDMASK_USB_ERROR); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	if (USB_Host_SetDeviceConfiguration(1) != HOST_SENDCONTROL_Successful) | ||||
| 	{ | ||||
| 		puts_P(PSTR("Error Setting Device Configuration.\r\n")); | ||||
| 		LEDs_SetAllLEDs(LEDMASK_USB_ERROR); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	puts_P(PSTR("Android Device Enumerated.\r\n")); | ||||
| 	LEDs_SetAllLEDs(LEDMASK_USB_READY); | ||||
| } | ||||
|  | ||||
| /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */ | ||||
| void EVENT_USB_Host_HostError(const uint8_t ErrorCode) | ||||
| { | ||||
| 	USB_Disable(); | ||||
|  | ||||
| 	printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n" | ||||
| 	                         " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode); | ||||
|  | ||||
| 	LEDs_SetAllLEDs(LEDMASK_USB_ERROR); | ||||
| 	for(;;); | ||||
| } | ||||
|  | ||||
| /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while | ||||
|  *  enumerating an attached USB device. | ||||
|  */ | ||||
| void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, | ||||
|                                             const uint8_t SubErrorCode) | ||||
| { | ||||
| 	printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" | ||||
| 	                         " -- Error Code %d\r\n" | ||||
| 	                         " -- Sub Error Code %d\r\n" | ||||
| 	                         " -- In State %d\r\n" ESC_FG_WHITE), ErrorCode, SubErrorCode, USB_HostState); | ||||
|  | ||||
| 	LEDs_SetAllLEDs(LEDMASK_USB_ERROR); | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,78 @@ | ||||
| /* | ||||
|              LUFA Library | ||||
|      Copyright (C) Dean Camera, 2011. | ||||
|  | ||||
|   dean [at] fourwalledcubicle [dot] com | ||||
|            www.lufa-lib.org | ||||
| */ | ||||
|  | ||||
| /* | ||||
|   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||||
|  | ||||
|   Permission to use, copy, modify, distribute, and sell this | ||||
|   software and its documentation for any purpose is hereby granted | ||||
|   without fee, provided that the above copyright notice appear in | ||||
|   all copies and that both that the copyright notice and this | ||||
|   permission notice and warranty disclaimer appear in supporting | ||||
|   documentation, and that the name of the author not be used in | ||||
|   advertising or publicity pertaining to distribution of the | ||||
|   software without specific, written prior permission. | ||||
|  | ||||
|   The author disclaim all warranties with regard to this | ||||
|   software, including all implied warranties of merchantability | ||||
|   and fitness.  In no event shall the author be liable for any | ||||
|   special, indirect or consequential damages or any damages | ||||
|   whatsoever resulting from loss of use, data or profits, whether | ||||
|   in an action of contract, negligence or other tortious action, | ||||
|   arising out of or in connection with the use or performance of | ||||
|   this software. | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  * | ||||
|  *  Header file for AndroidAccessoryHost.c. | ||||
|  */ | ||||
|  | ||||
| #ifndef _ANDROIDACCESSORY_HOST_H_ | ||||
| #define _ANDROIDACCESSORY_HOST_H_ | ||||
|  | ||||
| 	/* Includes: */ | ||||
| 		#include <avr/io.h> | ||||
| 		#include <avr/wdt.h> | ||||
| 		#include <avr/pgmspace.h> | ||||
| 		#include <avr/power.h> | ||||
| 		#include <avr/interrupt.h> | ||||
| 		#include <stdio.h> | ||||
|  | ||||
| 		#include <LUFA/Version.h> | ||||
| 		#include <LUFA/Drivers/Misc/TerminalCodes.h> | ||||
| 		#include <LUFA/Drivers/Peripheral/Serial.h> | ||||
| 		#include <LUFA/Drivers/Board/LEDs.h> | ||||
| 		#include <LUFA/Drivers/USB/USB.h> | ||||
|  | ||||
| 	/* Macros: */ | ||||
| 		/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ | ||||
| 		#define LEDMASK_USB_NOTREADY      LEDS_LED1 | ||||
|  | ||||
| 		/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ | ||||
| 		#define LEDMASK_USB_ENUMERATING  (LEDS_LED2 | LEDS_LED3) | ||||
|  | ||||
| 		/** LED mask for the library LED driver, to indicate that the USB interface is ready. */ | ||||
| 		#define LEDMASK_USB_READY        (LEDS_LED2 | LEDS_LED4) | ||||
|  | ||||
| 		/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ | ||||
| 		#define LEDMASK_USB_ERROR        (LEDS_LED1 | LEDS_LED3) | ||||
|  | ||||
| 	/* Function Prototypes: */ | ||||
| 		void SetupHardware(void); | ||||
| 		void AOAHost_Task(void); | ||||
|  | ||||
| 		void EVENT_USB_Host_HostError(const uint8_t ErrorCode); | ||||
| 		void EVENT_USB_Host_DeviceAttached(void); | ||||
| 		void EVENT_USB_Host_DeviceUnattached(void); | ||||
| 		void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, | ||||
| 		                                            const uint8_t SubErrorCode); | ||||
| 		void EVENT_USB_Host_DeviceEnumerationComplete(void); | ||||
|  | ||||
| #endif | ||||
|  | ||||
| @@ -0,0 +1,62 @@ | ||||
| /** \file | ||||
|  * | ||||
|  *  This file contains special DoxyGen information for the generation of the main page and other special | ||||
|  *  documentation pages. It is not a project source file. | ||||
|  */ | ||||
|  | ||||
| /** \mainpage Android Accessory Host Demo | ||||
|  * | ||||
|  *  \section Sec_Compat Demo Compatibility: | ||||
|  * | ||||
|  *  The following list indicates what microcontrollers are compatible with this demo. | ||||
|  * | ||||
|  *  - Series 7 USB AVRs (AT90USBxxx7) | ||||
|  * | ||||
|  *  \section Sec_Info USB Information: | ||||
|  * | ||||
|  *  The following table gives a rundown of the USB utilization of this demo. | ||||
|  * | ||||
|  *  <table> | ||||
|  *   <tr> | ||||
|  *    <td><b>USB Mode:</b></td> | ||||
|  *    <td>Host</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>USB Class:</b></td> | ||||
|  *    <td>Android Accessory Host Class</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>USB Subclass:</b></td> | ||||
|  *    <td>N/A</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>Relevant Standards:</b></td> | ||||
|  *    <td>Android Accessory Host Specification</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>Usable Speeds:</b></td> | ||||
|  *    <td>Full Speed Mode</td> | ||||
|  *   </tr> | ||||
|  *  </table> | ||||
|  * | ||||
|  *  \section Sec_Description Project Description: | ||||
|  * | ||||
|  *  Android Accessory Host demonstration application. This gives a simple reference | ||||
|  *  application for implementing an Android Accessory Host device capable of hosting | ||||
|  *  Android powered mobile devices to send and receive data. | ||||
|  * | ||||
|  *  Data sent from the Android device will be sent out the AVR's serial port. | ||||
|  * | ||||
|  *  \section Sec_Options Project Options | ||||
|  * | ||||
|  *  The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value. | ||||
|  * | ||||
|  *  <table> | ||||
|  *   <tr> | ||||
|  *    <td> | ||||
|  *     None | ||||
|  *    </td> | ||||
|  *   </tr> | ||||
|  *  </table> | ||||
|  */ | ||||
|  | ||||
| @@ -0,0 +1,723 @@ | ||||
| # Hey Emacs, this is a -*- makefile -*- | ||||
| #---------------------------------------------------------------------------- | ||||
| # WinAVR Makefile Template written by Eric B. Weddington, J<>rg Wunsch, et al. | ||||
| #  >> Modified for use with the LUFA project. << | ||||
| # | ||||
| # Released to the Public Domain | ||||
| # | ||||
| # Additional material for this makefile was written by: | ||||
| # Peter Fleury | ||||
| # Tim Henigan | ||||
| # Colin O'Flynn | ||||
| # Reiner Patommel | ||||
| # Markus Pfaff | ||||
| # Sander Pool | ||||
| # Frederik Rouleau | ||||
| # Carlos Lamas | ||||
| # Dean Camera | ||||
| # Opendous Inc. | ||||
| # Denver Gingerich | ||||
| # | ||||
| #---------------------------------------------------------------------------- | ||||
| # On command line: | ||||
| # | ||||
| # make all = Make software. | ||||
| # | ||||
| # make clean = Clean out built project files. | ||||
| # | ||||
| # make coff = Convert ELF to AVR COFF. | ||||
| # | ||||
| # make extcoff = Convert ELF to AVR Extended COFF. | ||||
| # | ||||
| # make program = Download the hex file to the device, using avrdude. | ||||
| #                Please customize the avrdude settings below first! | ||||
| # | ||||
| # make dfu = Download the hex file to the device, using dfu-programmer (must | ||||
| #            have dfu-programmer installed). | ||||
| # | ||||
| # make flip = Download the hex file to the device, using Atmel FLIP (must | ||||
| #             have Atmel FLIP installed). | ||||
| # | ||||
| # make dfu-ee = Download the eeprom file to the device, using dfu-programmer | ||||
| #               (must have dfu-programmer installed). | ||||
| # | ||||
| # make flip-ee = Download the eeprom file to the device, using Atmel FLIP | ||||
| #                (must have Atmel FLIP installed). | ||||
| # | ||||
| # make doxygen = Generate DoxyGen documentation for the project (must have | ||||
| #                DoxyGen installed) | ||||
| # | ||||
| # make debug = Start either simulavr or avarice as specified for debugging, | ||||
| #              with avr-gdb or avr-insight as the front end for debugging. | ||||
| # | ||||
| # make filename.s = Just compile filename.c into the assembler code only. | ||||
| # | ||||
| # make filename.i = Create a preprocessed source file for use in submitting | ||||
| #                   bug reports to the GCC project. | ||||
| # | ||||
| # To rebuild project do "make clean" then "make all". | ||||
| #---------------------------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| # MCU name | ||||
| MCU = at90usb1287 | ||||
|  | ||||
|  | ||||
| # Target architecture (see library "Board Types" documentation). | ||||
| ARCH = AVR8 | ||||
|  | ||||
|  | ||||
| # Target board (see library "Board Types" documentation, NONE for projects not requiring | ||||
| # LUFA board drivers). If USER is selected, put custom board drivers in a directory called | ||||
| # "Board" inside the application directory. | ||||
| BOARD = USBKEY | ||||
|  | ||||
|  | ||||
| # Processor frequency. | ||||
| #     This will define a symbol, F_CPU, in all source code files equal to the | ||||
| #     processor frequency in Hz. You can then use this symbol in your source code to | ||||
| #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||||
| #     automatically to create a 32-bit value in your source code. | ||||
| # | ||||
| #     This will be an integer division of F_USB below, as it is sourced by | ||||
| #     F_USB after it has run through any CPU prescalers. Note that this value | ||||
| #     does not *change* the processor frequency - it should merely be updated to | ||||
| #     reflect the processor speed set externally so that the code can use accurate | ||||
| #     software delays. | ||||
| F_CPU = 8000000 | ||||
|  | ||||
|  | ||||
| # Input clock frequency. | ||||
| #     This will define a symbol, F_USB, in all source code files equal to the | ||||
| #     input clock frequency (before any prescaling is performed) in Hz. This value may | ||||
| #     differ from F_CPU if prescaling is used on the latter, and is required as the | ||||
| #     raw input clock is fed directly to the PLL sections of the AVR for high speed | ||||
| #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||||
| #     at the end, this will be done automatically to create a 32-bit value in your | ||||
| #     source code. | ||||
| # | ||||
| #     If no clock division is performed on the input clock inside the AVR (via the | ||||
| #     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||||
| F_USB = $(F_CPU) | ||||
|  | ||||
|  | ||||
| # Output format. (can be srec, ihex, binary) | ||||
| FORMAT = ihex | ||||
|  | ||||
|  | ||||
| # Target file name (without extension). | ||||
| TARGET = AndroidAccessoryHost | ||||
|  | ||||
|  | ||||
| # Object files directory | ||||
| #     To put object files in current directory, use a dot (.), do NOT make | ||||
| #     this an empty or blank macro! | ||||
| OBJDIR = . | ||||
|  | ||||
|  | ||||
| # Path to the LUFA library | ||||
| LUFA_PATH = ../../../.. | ||||
|  | ||||
|  | ||||
| # LUFA library compile-time options and predefined tokens | ||||
| LUFA_OPTS  = -D USB_HOST_ONLY | ||||
| LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" | ||||
| LUFA_OPTS += -D HOST_DEVICE_SETTLE_DELAY_MS=0 | ||||
|  | ||||
|  | ||||
| # Create the LUFA source path variables by including the LUFA root makefile | ||||
| include $(LUFA_PATH)/LUFA/makefile | ||||
|  | ||||
|  | ||||
| # List C source files here. (C dependencies are automatically generated.) | ||||
| SRC = $(TARGET).c                                                 \ | ||||
| 	  $(LUFA_SRC_USB)                                             \ | ||||
| 	  $(LUFA_SRC_USBCLASS)                                        \ | ||||
| 	  $(LUFA_SRC_SERIAL) | ||||
|  | ||||
|  | ||||
| # List C++ source files here. (C dependencies are automatically generated.) | ||||
| CPPSRC = | ||||
|  | ||||
|  | ||||
| # List Assembler source files here. | ||||
| #     Make them always end in a capital .S.  Files ending in a lowercase .s | ||||
| #     will not be considered source files but generated files (assembler | ||||
| #     output from the compiler), and will be deleted upon "make clean"! | ||||
| #     Even though the DOS/Win* filesystem matches both .s and .S the same, | ||||
| #     it will preserve the spelling of the filenames, and gcc itself does | ||||
| #     care about how the name is spelled on its command-line. | ||||
| ASRC = | ||||
|  | ||||
|  | ||||
| # Optimization level, can be [0, 1, 2, 3, s]. | ||||
| #     0 = turn off optimization. s = optimize for size. | ||||
| #     (Note: 3 is not always the best optimization level. See avr-libc FAQ.) | ||||
| OPT = s | ||||
|  | ||||
|  | ||||
| # Debugging format. | ||||
| #     Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. | ||||
| #     AVR Studio 4.10 requires dwarf-2. | ||||
| #     AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. | ||||
| DEBUG = dwarf-2 | ||||
|  | ||||
|  | ||||
| # List any extra directories to look for include files here. | ||||
| #     Each directory must be seperated by a space. | ||||
| #     Use forward slashes for directory separators. | ||||
| #     For a directory that has spaces, enclose it in quotes. | ||||
| EXTRAINCDIRS = $(LUFA_PATH)/ | ||||
|  | ||||
|  | ||||
| # Compiler flag to set the C Standard level. | ||||
| #     c89   = "ANSI" C | ||||
| #     gnu89 = c89 plus GCC extensions | ||||
| #     c99   = ISO C99 standard (not yet fully implemented) | ||||
| #     gnu99 = c99 plus GCC extensions | ||||
| CSTANDARD = -std=c99 | ||||
|  | ||||
|  | ||||
| # Place -D or -U options here for C sources | ||||
| CDEFS  = -DF_CPU=$(F_CPU)UL | ||||
| CDEFS += -DF_USB=$(F_USB)UL | ||||
| CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) | ||||
| CDEFS += $(LUFA_OPTS) | ||||
|  | ||||
|  | ||||
| # Place -D or -U options here for ASM sources | ||||
| ADEFS  = -DF_CPU=$(F_CPU) | ||||
| ADEFS += -DF_USB=$(F_USB)UL | ||||
| ADEFS += -DBOARD=BOARD_$(BOARD) | ||||
| ADEFS += $(LUFA_OPTS) | ||||
|  | ||||
| # Place -D or -U options here for C++ sources | ||||
| CPPDEFS  = -DF_CPU=$(F_CPU)UL | ||||
| CPPDEFS += -DF_USB=$(F_USB)UL | ||||
| CPPDEFS += -DBOARD=BOARD_$(BOARD) | ||||
| CPPDEFS += $(LUFA_OPTS) | ||||
| #CPPDEFS += -D__STDC_LIMIT_MACROS | ||||
| #CPPDEFS += -D__STDC_CONSTANT_MACROS | ||||
|  | ||||
|  | ||||
|  | ||||
| #---------------- Compiler Options C ---------------- | ||||
| #  -g*:          generate debugging information | ||||
| #  -O*:          optimization level | ||||
| #  -f...:        tuning, see GCC manual and avr-libc documentation | ||||
| #  -Wall...:     warning level | ||||
| #  -Wa,...:      tell GCC to pass this to the assembler. | ||||
| #    -adhlns...: create assembler listing | ||||
| CFLAGS = -g$(DEBUG) | ||||
| CFLAGS += $(CDEFS) | ||||
| CFLAGS += -O$(OPT) | ||||
| CFLAGS += -funsigned-char | ||||
| CFLAGS += -funsigned-bitfields | ||||
| CFLAGS += -ffunction-sections | ||||
| CFLAGS += -fno-inline-small-functions | ||||
| CFLAGS += -fpack-struct | ||||
| CFLAGS += -fshort-enums | ||||
| CFLAGS += -fno-strict-aliasing | ||||
| CFLAGS += -Wall | ||||
| CFLAGS += -Wstrict-prototypes | ||||
| #CFLAGS += -mshort-calls | ||||
| #CFLAGS += -fno-unit-at-a-time | ||||
| #CFLAGS += -Wundef | ||||
| #CFLAGS += -Wunreachable-code | ||||
| #CFLAGS += -Wsign-compare | ||||
| CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) | ||||
| CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) | ||||
| CFLAGS += $(CSTANDARD) | ||||
|  | ||||
|  | ||||
| #---------------- Compiler Options C++ ---------------- | ||||
| #  -g*:          generate debugging information | ||||
| #  -O*:          optimization level | ||||
| #  -f...:        tuning, see GCC manual and avr-libc documentation | ||||
| #  -Wall...:     warning level | ||||
| #  -Wa,...:      tell GCC to pass this to the assembler. | ||||
| #    -adhlns...: create assembler listing | ||||
| CPPFLAGS = -g$(DEBUG) | ||||
| CPPFLAGS += $(CPPDEFS) | ||||
| CPPFLAGS += -O$(OPT) | ||||
| CPPFLAGS += -funsigned-char | ||||
| CPPFLAGS += -funsigned-bitfields | ||||
| CPPFLAGS += -fpack-struct | ||||
| CPPFLAGS += -fshort-enums | ||||
| CPPFLAGS += -fno-exceptions | ||||
| CPPFLAGS += -Wall | ||||
| CPPFLAGS += -Wundef | ||||
| #CPPFLAGS += -mshort-calls | ||||
| #CPPFLAGS += -fno-unit-at-a-time | ||||
| #CPPFLAGS += -Wstrict-prototypes | ||||
| #CPPFLAGS += -Wunreachable-code | ||||
| #CPPFLAGS += -Wsign-compare | ||||
| CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) | ||||
| CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) | ||||
| #CPPFLAGS += $(CSTANDARD) | ||||
|  | ||||
|  | ||||
| #---------------- Assembler Options ---------------- | ||||
| #  -Wa,...:   tell GCC to pass this to the assembler. | ||||
| #  -adhlns:   create listing | ||||
| #  -gstabs:   have the assembler create line number information; note that | ||||
| #             for use in COFF files, additional information about filenames | ||||
| #             and function names needs to be present in the assembler source | ||||
| #             files -- see avr-libc docs [FIXME: not yet described there] | ||||
| #  -listing-cont-lines: Sets the maximum number of continuation lines of hex | ||||
| #       dump that will be displayed for a given single line of source input. | ||||
| ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 | ||||
|  | ||||
|  | ||||
| #---------------- Library Options ---------------- | ||||
| # Minimalistic printf version | ||||
| PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min | ||||
|  | ||||
| # Floating point printf version (requires MATH_LIB = -lm below) | ||||
| PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt | ||||
|  | ||||
| # If this is left blank, then it will use the Standard printf version. | ||||
| PRINTF_LIB = | ||||
| #PRINTF_LIB = $(PRINTF_LIB_MIN) | ||||
| #PRINTF_LIB = $(PRINTF_LIB_FLOAT) | ||||
|  | ||||
|  | ||||
| # Minimalistic scanf version | ||||
| SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min | ||||
|  | ||||
| # Floating point + %[ scanf version (requires MATH_LIB = -lm below) | ||||
| SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt | ||||
|  | ||||
| # If this is left blank, then it will use the Standard scanf version. | ||||
| SCANF_LIB = | ||||
| #SCANF_LIB = $(SCANF_LIB_MIN) | ||||
| #SCANF_LIB = $(SCANF_LIB_FLOAT) | ||||
|  | ||||
|  | ||||
| MATH_LIB = -lm | ||||
|  | ||||
|  | ||||
| # List any extra directories to look for libraries here. | ||||
| #     Each directory must be seperated by a space. | ||||
| #     Use forward slashes for directory separators. | ||||
| #     For a directory that has spaces, enclose it in quotes. | ||||
| EXTRALIBDIRS = | ||||
|  | ||||
|  | ||||
|  | ||||
| #---------------- External Memory Options ---------------- | ||||
|  | ||||
| # 64 KB of external RAM, starting after internal RAM (ATmega128!), | ||||
| # used for variables (.data/.bss) and heap (malloc()). | ||||
| #EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff | ||||
|  | ||||
| # 64 KB of external RAM, starting after internal RAM (ATmega128!), | ||||
| # only used for heap (malloc()). | ||||
| #EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff | ||||
|  | ||||
| EXTMEMOPTS = | ||||
|  | ||||
|  | ||||
|  | ||||
| #---------------- Linker Options ---------------- | ||||
| #  -Wl,...:     tell GCC to pass this to linker. | ||||
| #    -Map:      create map file | ||||
| #    --cref:    add cross reference to  map file | ||||
| LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref | ||||
| LDFLAGS += -Wl,--relax | ||||
| LDFLAGS += -Wl,--gc-sections | ||||
| LDFLAGS += $(EXTMEMOPTS) | ||||
| LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) | ||||
| LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) | ||||
| #LDFLAGS += -T linker_script.x | ||||
|  | ||||
|  | ||||
|  | ||||
| #---------------- Programming Options (avrdude) ---------------- | ||||
|  | ||||
| # Programming hardware | ||||
| # Type: avrdude -c ? | ||||
| # to get a full listing. | ||||
| # | ||||
| AVRDUDE_PROGRAMMER = jtagmkII | ||||
|  | ||||
| # com1 = serial port. Use lpt1 to connect to parallel port. | ||||
| AVRDUDE_PORT = usb | ||||
|  | ||||
| AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex | ||||
| #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep | ||||
|  | ||||
|  | ||||
| # Uncomment the following if you want avrdude's erase cycle counter. | ||||
| # Note that this counter needs to be initialized first using -Yn, | ||||
| # see avrdude manual. | ||||
| #AVRDUDE_ERASE_COUNTER = -y | ||||
|  | ||||
| # Uncomment the following if you do /not/ wish a verification to be | ||||
| # performed after programming the device. | ||||
| #AVRDUDE_NO_VERIFY = -V | ||||
|  | ||||
| # Increase verbosity level.  Please use this when submitting bug | ||||
| # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> | ||||
| # to submit bug reports. | ||||
| #AVRDUDE_VERBOSE = -v -v | ||||
|  | ||||
| AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) | ||||
| AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) | ||||
| AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) | ||||
| AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) | ||||
|  | ||||
|  | ||||
|  | ||||
| #---------------- Debugging Options ---------------- | ||||
|  | ||||
| # For simulavr only - target MCU frequency. | ||||
| DEBUG_MFREQ = $(F_CPU) | ||||
|  | ||||
| # Set the DEBUG_UI to either gdb or insight. | ||||
| # DEBUG_UI = gdb | ||||
| DEBUG_UI = insight | ||||
|  | ||||
| # Set the debugging back-end to either avarice, simulavr. | ||||
| DEBUG_BACKEND = avarice | ||||
| #DEBUG_BACKEND = simulavr | ||||
|  | ||||
| # GDB Init Filename. | ||||
| GDBINIT_FILE = __avr_gdbinit | ||||
|  | ||||
| # When using avarice settings for the JTAG | ||||
| JTAG_DEV = /dev/com1 | ||||
|  | ||||
| # Debugging port used to communicate between GDB / avarice / simulavr. | ||||
| DEBUG_PORT = 4242 | ||||
|  | ||||
| # Debugging host used to communicate between GDB / avarice / simulavr, normally | ||||
| #     just set to localhost unless doing some sort of crazy debugging when | ||||
| #     avarice is running on a different computer. | ||||
| DEBUG_HOST = localhost | ||||
|  | ||||
|  | ||||
|  | ||||
| #============================================================================ | ||||
|  | ||||
|  | ||||
| # Define programs and commands. | ||||
| SHELL = sh | ||||
| CC = avr-gcc | ||||
| OBJCOPY = avr-objcopy | ||||
| OBJDUMP = avr-objdump | ||||
| SIZE = avr-size | ||||
| AR = avr-ar rcs | ||||
| NM = avr-nm | ||||
| AVRDUDE = avrdude | ||||
| REMOVE = rm -f | ||||
| REMOVEDIR = rm -rf | ||||
| COPY = cp | ||||
| WINSHELL = cmd | ||||
|  | ||||
|  | ||||
| # Define Messages | ||||
| # English | ||||
| MSG_ERRORS_NONE = Errors: none | ||||
| MSG_BEGIN = -------- begin -------- | ||||
| MSG_END = --------  end  -------- | ||||
| MSG_SIZE_BEFORE = Size before: | ||||
| MSG_SIZE_AFTER = Size after: | ||||
| MSG_COFF = Converting to AVR COFF: | ||||
| MSG_EXTENDED_COFF = Converting to AVR Extended COFF: | ||||
| MSG_FLASH = Creating load file for Flash: | ||||
| MSG_EEPROM = Creating load file for EEPROM: | ||||
| MSG_EXTENDED_LISTING = Creating Extended Listing: | ||||
| MSG_SYMBOL_TABLE = Creating Symbol Table: | ||||
| MSG_LINKING = Linking: | ||||
| MSG_COMPILING = Compiling C: | ||||
| MSG_COMPILING_CPP = Compiling C++: | ||||
| MSG_ASSEMBLING = Assembling: | ||||
| MSG_CLEANING = Cleaning project: | ||||
| MSG_CREATING_LIBRARY = Creating library: | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| # Define all object files. | ||||
| OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) | ||||
|  | ||||
| # Define all listing files. | ||||
| LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) | ||||
|  | ||||
|  | ||||
| # Compiler flags to generate dependency files. | ||||
| GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d | ||||
|  | ||||
|  | ||||
| # Combine all necessary flags and optional flags. | ||||
| # Add target processor to flags. | ||||
| ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) | ||||
| ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) | ||||
| ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| # Default target. | ||||
| all: begin gccversion sizebefore build sizeafter end | ||||
|  | ||||
| # Change the build target to build a HEX file or a library. | ||||
| build: elf hex eep lss sym | ||||
| #build: lib | ||||
|  | ||||
|  | ||||
| elf: $(TARGET).elf | ||||
| hex: $(TARGET).hex | ||||
| eep: $(TARGET).eep | ||||
| lss: $(TARGET).lss | ||||
| sym: $(TARGET).sym | ||||
| LIBNAME=lib$(TARGET).a | ||||
| lib: $(LIBNAME) | ||||
|  | ||||
|  | ||||
|  | ||||
| # Eye candy. | ||||
| # AVR Studio 3.x does not check make's exit code but relies on | ||||
| # the following magic strings to be generated by the compile job. | ||||
| begin: | ||||
| 	@echo | ||||
| 	@echo $(MSG_BEGIN) | ||||
|  | ||||
| end: | ||||
| 	@echo $(MSG_END) | ||||
| 	@echo | ||||
|  | ||||
|  | ||||
| # Display size of file. | ||||
| HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex | ||||
| ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf | ||||
| MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) | ||||
| FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) | ||||
|  | ||||
|  | ||||
| sizebefore: | ||||
| 	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ | ||||
| 	2>/dev/null; echo; fi | ||||
|  | ||||
| sizeafter: | ||||
| 	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ | ||||
| 	2>/dev/null; echo; fi | ||||
|  | ||||
|  | ||||
|  | ||||
| # Display compiler version information. | ||||
| gccversion : | ||||
| 	@$(CC) --version | ||||
|  | ||||
|  | ||||
| # Program the device. | ||||
| program: $(TARGET).hex $(TARGET).eep | ||||
| 	$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) | ||||
|  | ||||
| flip: $(TARGET).hex | ||||
| 	batchisp -hardware usb -device $(MCU) -operation erase f | ||||
| 	batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program | ||||
| 	batchisp -hardware usb -device $(MCU) -operation start reset 0 | ||||
|  | ||||
| dfu: $(TARGET).hex | ||||
| 	dfu-programmer $(MCU) erase | ||||
| 	dfu-programmer $(MCU) flash $(TARGET).hex | ||||
| 	dfu-programmer $(MCU) reset | ||||
|  | ||||
| flip-ee: $(TARGET).hex $(TARGET).eep | ||||
| 	$(COPY) $(TARGET).eep $(TARGET)eep.hex | ||||
| 	batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase | ||||
| 	batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program | ||||
| 	batchisp -hardware usb -device $(MCU) -operation start reset 0 | ||||
| 	$(REMOVE) $(TARGET)eep.hex | ||||
|  | ||||
| dfu-ee: $(TARGET).hex $(TARGET).eep | ||||
| 	dfu-programmer $(MCU) eeprom-flash $(TARGET).eep | ||||
| 	dfu-programmer $(MCU) reset | ||||
|  | ||||
|  | ||||
| # Generate avr-gdb config/init file which does the following: | ||||
| #     define the reset signal, load the target file, connect to target, and set | ||||
| #     a breakpoint at main(). | ||||
| gdb-config: | ||||
| 	@$(REMOVE) $(GDBINIT_FILE) | ||||
| 	@echo define reset >> $(GDBINIT_FILE) | ||||
| 	@echo SIGNAL SIGHUP >> $(GDBINIT_FILE) | ||||
| 	@echo end >> $(GDBINIT_FILE) | ||||
| 	@echo file $(TARGET).elf >> $(GDBINIT_FILE) | ||||
| 	@echo target remote $(DEBUG_HOST):$(DEBUG_PORT)  >> $(GDBINIT_FILE) | ||||
| ifeq ($(DEBUG_BACKEND),simulavr) | ||||
| 	@echo load  >> $(GDBINIT_FILE) | ||||
| endif | ||||
| 	@echo break main >> $(GDBINIT_FILE) | ||||
|  | ||||
| debug: gdb-config $(TARGET).elf | ||||
| ifeq ($(DEBUG_BACKEND), avarice) | ||||
| 	@echo Starting AVaRICE - Press enter when "waiting to connect" message displays. | ||||
| 	@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \ | ||||
| 	$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT) | ||||
| 	@$(WINSHELL) /c pause | ||||
|  | ||||
| else | ||||
| 	@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \ | ||||
| 	$(DEBUG_MFREQ) --port $(DEBUG_PORT) | ||||
| endif | ||||
| 	@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE) | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. | ||||
| COFFCONVERT = $(OBJCOPY) --debugging | ||||
| COFFCONVERT += --change-section-address .data-0x800000 | ||||
| COFFCONVERT += --change-section-address .bss-0x800000 | ||||
| COFFCONVERT += --change-section-address .noinit-0x800000 | ||||
| COFFCONVERT += --change-section-address .eeprom-0x810000 | ||||
|  | ||||
|  | ||||
|  | ||||
| coff: $(TARGET).elf | ||||
| 	@echo | ||||
| 	@echo $(MSG_COFF) $(TARGET).cof | ||||
| 	$(COFFCONVERT) -O coff-avr $< $(TARGET).cof | ||||
|  | ||||
|  | ||||
| extcoff: $(TARGET).elf | ||||
| 	@echo | ||||
| 	@echo $(MSG_EXTENDED_COFF) $(TARGET).cof | ||||
| 	$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof | ||||
|  | ||||
|  | ||||
|  | ||||
| # Create final output files (.hex, .eep) from ELF output file. | ||||
| %.hex: %.elf | ||||
| 	@echo | ||||
| 	@echo $(MSG_FLASH) $@ | ||||
| 	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ | ||||
|  | ||||
| %.eep: %.elf | ||||
| 	@echo | ||||
| 	@echo $(MSG_EEPROM) $@ | ||||
| 	-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ | ||||
| 	--change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0 | ||||
|  | ||||
| # Create extended listing file from ELF output file. | ||||
| %.lss: %.elf | ||||
| 	@echo | ||||
| 	@echo $(MSG_EXTENDED_LISTING) $@ | ||||
| 	$(OBJDUMP) -h -S -z $< > $@ | ||||
|  | ||||
| # Create a symbol table from ELF output file. | ||||
| %.sym: %.elf | ||||
| 	@echo | ||||
| 	@echo $(MSG_SYMBOL_TABLE) $@ | ||||
| 	$(NM) -n $< > $@ | ||||
|  | ||||
|  | ||||
|  | ||||
| # Create library from object files. | ||||
| .SECONDARY : $(TARGET).a | ||||
| .PRECIOUS : $(OBJ) | ||||
| %.a: $(OBJ) | ||||
| 	@echo | ||||
| 	@echo $(MSG_CREATING_LIBRARY) $@ | ||||
| 	$(AR) $@ $(OBJ) | ||||
|  | ||||
|  | ||||
| # Link: create ELF output file from object files. | ||||
| .SECONDARY : $(TARGET).elf | ||||
| .PRECIOUS : $(OBJ) | ||||
| %.elf: $(OBJ) | ||||
| 	@echo | ||||
| 	@echo $(MSG_LINKING) $@ | ||||
| 	$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS) | ||||
|  | ||||
|  | ||||
| # Compile: create object files from C source files. | ||||
| $(OBJDIR)/%.o : %.c | ||||
| 	@echo | ||||
| 	@echo $(MSG_COMPILING) $< | ||||
| 	$(CC) -c $(ALL_CFLAGS) $< -o $@ | ||||
|  | ||||
|  | ||||
| # Compile: create object files from C++ source files. | ||||
| $(OBJDIR)/%.o : %.cpp | ||||
| 	@echo | ||||
| 	@echo $(MSG_COMPILING_CPP) $< | ||||
| 	$(CC) -c $(ALL_CPPFLAGS) $< -o $@ | ||||
|  | ||||
|  | ||||
| # Compile: create assembler files from C source files. | ||||
| %.s : %.c | ||||
| 	$(CC) -S $(ALL_CFLAGS) $< -o $@ | ||||
|  | ||||
|  | ||||
| # Compile: create assembler files from C++ source files. | ||||
| %.s : %.cpp | ||||
| 	$(CC) -S $(ALL_CPPFLAGS) $< -o $@ | ||||
|  | ||||
|  | ||||
| # Assemble: create object files from assembler source files. | ||||
| $(OBJDIR)/%.o : %.S | ||||
| 	@echo | ||||
| 	@echo $(MSG_ASSEMBLING) $< | ||||
| 	$(CC) -c $(ALL_ASFLAGS) $< -o $@ | ||||
|  | ||||
|  | ||||
| # Create preprocessed source for use in sending a bug report. | ||||
| %.i : %.c | ||||
| 	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ | ||||
|  | ||||
|  | ||||
| # Target: clean project. | ||||
| clean: begin clean_list end | ||||
|  | ||||
| clean_list : | ||||
| 	@echo | ||||
| 	@echo $(MSG_CLEANING) | ||||
| 	$(REMOVE) $(TARGET).hex | ||||
| 	$(REMOVE) $(TARGET).eep | ||||
| 	$(REMOVE) $(TARGET).cof | ||||
| 	$(REMOVE) $(TARGET).elf | ||||
| 	$(REMOVE) $(TARGET).map | ||||
| 	$(REMOVE) $(TARGET).sym | ||||
| 	$(REMOVE) $(TARGET).lss | ||||
| 	$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) | ||||
| 	$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) | ||||
| 	$(REMOVE) $(SRC:.c=.s) | ||||
| 	$(REMOVE) $(SRC:.c=.d) | ||||
| 	$(REMOVE) $(SRC:.c=.i) | ||||
| 	$(REMOVEDIR) .dep | ||||
|  | ||||
| doxygen: | ||||
| 	@echo Generating Project Documentation \($(TARGET)\)... | ||||
| 	@doxygen Doxygen.conf | ||||
| 	@echo Documentation Generation Complete. | ||||
|  | ||||
| clean_doxygen: | ||||
| 	rm -rf Documentation | ||||
|  | ||||
| checksource: | ||||
| 	@for f in $(SRC) $(CPPSRC) $(ASRC); do \ | ||||
| 		if [ -f $$f ]; then \ | ||||
| 			echo "Found Source File: $$f" ; \ | ||||
| 		else \ | ||||
| 			echo "Source File Not Found: $$f" ; \ | ||||
| 		fi; done  | ||||
|  | ||||
|  | ||||
| # Create object files directory | ||||
| $(shell mkdir $(OBJDIR) 2>/dev/null) | ||||
|  | ||||
|  | ||||
| # Include the dependency files. | ||||
| -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) | ||||
|  | ||||
|  | ||||
| # Listing of phony targets. | ||||
| .PHONY : all begin finish end sizebefore sizeafter gccversion \ | ||||
| build elf hex eep lss sym coff extcoff doxygen clean          \ | ||||
| clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \ | ||||
| debug gdb-config checksource | ||||
| @@ -14,6 +14,9 @@ | ||||
| # code. | ||||
|  | ||||
| all: | ||||
| 	$(MAKE) -C AndroidAccessoryHost clean | ||||
| 	$(MAKE) -C AndroidAccessoryHost all | ||||
|  | ||||
| 	$(MAKE) -C AudioInputHost clean | ||||
| 	$(MAKE) -C AudioInputHost all | ||||
|  | ||||
| @@ -54,6 +57,7 @@ all: | ||||
| 	$(MAKE) -C VirtualSerialHost all | ||||
|  | ||||
| %: | ||||
| 	$(MAKE) -C AndroidAccessoryHost $@ | ||||
| 	$(MAKE) -C AudioInputHost $@ | ||||
| 	$(MAKE) -C AudioOutputHost $@ | ||||
| 	$(MAKE) -C JoystickHostWithParser $@ | ||||
|   | ||||
| @@ -0,0 +1 @@ | ||||
| <AVRStudio><MANAGEMENT><ProjectName>AndroidAccessoryHost</ProjectName><Created>06-Jun-2011 19:58:20</Created><LastEdit>06-Jun-2011 19:58:20</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>06-Jun-2011 19:58:20</Created><Version>4</Version><Build>4, 18, 0, 685</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\Host\LowLevel\AndroidAccessoryHost\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR ONE!</CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>AndroidAccessoryHost.c</SOURCEFILE><SOURCEFILE>Lib/AndroidAccessoryCommands.c</SOURCEFILE><HEADERFILE>Lib/AndroidAccessoryCommands.h</HEADERFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>AndroidAccessoryHost.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>AndroidAccessoryHost.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20100110\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20100110\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> | ||||
| @@ -93,7 +93,7 @@ void AndroidHost_Task(void) | ||||
| 		/* Check if data is in the pipe */ | ||||
| 		if (Pipe_IsReadWriteAllowed()) | ||||
| 		{ | ||||
| 			uint8_t NextReceivedByte = Pipe_BytesInPipe(); | ||||
| 			uint8_t NextReceivedByte = Pipe_Read_8(); | ||||
| 			uint8_t LEDMask          = LEDS_NO_LEDS; | ||||
| 
 | ||||
| 			if (NextReceivedByte & 0x01) | ||||
| @@ -183,7 +183,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) | ||||
| 		} | ||||
| 		 | ||||
| 		/* Validate the returned protocol version */ | ||||
| 		if (AndroidProtocol != ANDROID_PROTOCOL_Accessory) | ||||
| 		if (AndroidProtocol != AOA_PROTOCOL_AccessoryV1) | ||||
| 		{ | ||||
| 			puts_P(PSTR(ESC_FG_RED "Accessory Mode Not Supported.")); | ||||
| 
 | ||||
| @@ -192,12 +192,12 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) | ||||
| 		} | ||||
| 	 | ||||
| 		/* Send the device strings and start the Android Accessory Mode */ | ||||
| 		Android_SendString(ANDROID_STRING_Manufacturer, "Dean Camera"); | ||||
| 		Android_SendString(ANDROID_STRING_Model,        "LUFA Android Demo"); | ||||
| 		Android_SendString(ANDROID_STRING_Description,  "LUFA Android Demo"); | ||||
| 		Android_SendString(ANDROID_STRING_Version,      "1.0"); | ||||
| 		Android_SendString(ANDROID_STRING_URI,          "http://www.lufa-lib.org"); | ||||
| 		Android_SendString(ANDROID_STRING_Serial,       "0000000012345678"); | ||||
| 		Android_SendString(AOA_STRING_Manufacturer, "Dean Camera"); | ||||
| 		Android_SendString(AOA_STRING_Model,        "LUFA Android Demo"); | ||||
| 		Android_SendString(AOA_STRING_Description,  "LUFA Android Demo"); | ||||
| 		Android_SendString(AOA_STRING_Version,      "1.0"); | ||||
| 		Android_SendString(AOA_STRING_URI,          "http://www.lufa-lib.org"); | ||||
| 		Android_SendString(AOA_STRING_Serial,       "0000000012345678"); | ||||
| 
 | ||||
| 		Android_StartAccessoryMode();	 | ||||
| 		return; | ||||
| @@ -0,0 +1,62 @@ | ||||
| /** \file | ||||
|  * | ||||
|  *  This file contains special DoxyGen information for the generation of the main page and other special | ||||
|  *  documentation pages. It is not a project source file. | ||||
|  */ | ||||
|  | ||||
| /** \mainpage Android Accessory Host Demo | ||||
|  * | ||||
|  *  \section Sec_Compat Demo Compatibility: | ||||
|  * | ||||
|  *  The following list indicates what microcontrollers are compatible with this demo. | ||||
|  * | ||||
|  *  - Series 7 USB AVRs (AT90USBxxx7) | ||||
|  * | ||||
|  *  \section Sec_Info USB Information: | ||||
|  * | ||||
|  *  The following table gives a rundown of the USB utilization of this demo. | ||||
|  * | ||||
|  *  <table> | ||||
|  *   <tr> | ||||
|  *    <td><b>USB Mode:</b></td> | ||||
|  *    <td>Host</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>USB Class:</b></td> | ||||
|  *    <td>Android Accessory Host Class</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>USB Subclass:</b></td> | ||||
|  *    <td>N/A</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>Relevant Standards:</b></td> | ||||
|  *    <td>Android Accessory Host Specification</td> | ||||
|  *   </tr> | ||||
|  *   <tr> | ||||
|  *    <td><b>Usable Speeds:</b></td> | ||||
|  *    <td>Full Speed Mode</td> | ||||
|  *   </tr> | ||||
|  *  </table> | ||||
|  * | ||||
|  *  \section Sec_Description Project Description: | ||||
|  * | ||||
|  *  Android Accessory Host demonstration application. This gives a simple reference | ||||
|  *  application for implementing an Android Accessory Host device capable of hosting | ||||
|  *  Android powered mobile devices to send and receive data. | ||||
|  * | ||||
|  *  Sent data from the Android device will be indicated onto the board's LEDs. | ||||
|  * | ||||
|  *  \section Sec_Options Project Options | ||||
|  * | ||||
|  *  The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value. | ||||
|  * | ||||
|  *  <table> | ||||
|  *   <tr> | ||||
|  *    <td> | ||||
|  *     None | ||||
|  *    </td> | ||||
|  *   </tr> | ||||
|  *  </table> | ||||
|  */ | ||||
|  | ||||
| @@ -123,9 +123,9 @@ uint8_t DCOMP_NextAndroidAccessoryInterface(void* const CurrentDescriptor) | ||||
| 	{ | ||||
| 		USB_Descriptor_Interface_t* Interface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); | ||||
| 
 | ||||
| 		if ((Interface->Class    == ANDROID_INTERFACE_CLASS)    && | ||||
| 		    (Interface->SubClass == ANDROID_INTERFACE_SUBCLASS) && | ||||
| 		    (Interface->Protocol == ANDROID_INTERFACE_PROTOCOL)) | ||||
| 		if ((Interface->Class    == AOA_CSCP_AOADataClass)    && | ||||
| 		    (Interface->SubClass == AOA_CSCP_AOADataSubclass) && | ||||
| 		    (Interface->Protocol == AOA_CSCP_AOADataProtocol)) | ||||
| 		{ | ||||
| 			return DESCRIPTOR_SEARCH_Found; | ||||
| 		} | ||||
| @@ -43,10 +43,6 @@ | ||||
| 		#define ANDROID_DATA_IN_PIPE         1 | ||||
| 		#define ANDROID_DATA_OUT_PIPE        2 | ||||
| 
 | ||||
| 		#define ANDROID_INTERFACE_CLASS      0xFF | ||||
| 		#define ANDROID_INTERFACE_SUBCLASS   0x42 | ||||
| 		#define ANDROID_INTERFACE_PROTOCOL   0x01		 | ||||
| 
 | ||||
| 	/* Enums: */ | ||||
| 		/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ | ||||
| 		enum AndroidHost_GetConfigDescriptorDataCodes_t | ||||
| @@ -41,11 +41,6 @@ | ||||
| 
 | ||||
| 		#include "AndroidAccessoryHost.h" | ||||
| 
 | ||||
| 	/* Macros: */ | ||||
| 		#define ANDROID_VENDOR_ID                   0x18D1 | ||||
| 		#define ANDROID_ACCESSORY_PRODUCT_ID        0x2D00 | ||||
| 		#define ANDROID_ACCESSORY_ADB_PRODUCT_ID    0x2D01 | ||||
| 
 | ||||
| 	/* Enums: */ | ||||
| 		/** Enum for the possible return codes of the \ref ProcessDeviceDescriptor() function. */ | ||||
| 		enum AndroidHost_GetDeviceDescriptorDataCodes_t | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -41,7 +41,7 @@ uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol) | ||||
| 	USB_ControlRequest = (USB_Request_Header_t) | ||||
| 	{ | ||||
| 		.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE), | ||||
| 		.bRequest      = ANDROID_Req_GetAccessoryProtocol, | ||||
| 		.bRequest      = AOA_REQ_GetAccessoryProtocol, | ||||
| 		.wValue        = 0, | ||||
| 		.wIndex        = 0, | ||||
| 		.wLength       = sizeof(uint16_t), | ||||
| @@ -52,19 +52,19 @@ uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol) | ||||
| } | ||||
| 
 | ||||
| uint8_t Android_SendString(const uint8_t StringIndex, | ||||
|                            char* String) | ||||
|                            const char* const String) | ||||
| { | ||||
| 	USB_ControlRequest = (USB_Request_Header_t) | ||||
| 	{ | ||||
| 		.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_VENDOR | REQREC_DEVICE), | ||||
| 		.bRequest      = ANDROID_Req_SendString, | ||||
| 		.bRequest      = AOA_REQ_SendString, | ||||
| 		.wValue        = 0, | ||||
| 		.wIndex        = StringIndex, | ||||
| 		.wLength       = (strlen(String) + 1), | ||||
| 	}; | ||||
| 
 | ||||
| 	Pipe_SelectPipe(PIPE_CONTROLPIPE); | ||||
| 	return USB_Host_SendControlRequest(String); | ||||
| 	return USB_Host_SendControlRequest((char*)String); | ||||
| } | ||||
| 
 | ||||
| uint8_t Android_StartAccessoryMode(void) | ||||
| @@ -72,7 +72,7 @@ uint8_t Android_StartAccessoryMode(void) | ||||
| 	USB_ControlRequest = (USB_Request_Header_t) | ||||
| 	{ | ||||
| 		.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_VENDOR | REQREC_DEVICE), | ||||
| 		.bRequest      = ANDROID_Req_StartAccessoryMode, | ||||
| 		.bRequest      = AOA_REQ_StartAccessoryMode, | ||||
| 		.wValue        = 0, | ||||
| 		.wIndex        = 0, | ||||
| 		.wLength       = 0, | ||||
| @@ -42,33 +42,10 @@ | ||||
| 
 | ||||
| 		#include <LUFA/Drivers/USB/USB.h> | ||||
| 	 | ||||
| 	/* Enums: */ | ||||
| 		enum Android_Requests_t | ||||
| 		{ | ||||
| 			ANDROID_Req_GetAccessoryProtocol    = 51, | ||||
| 			ANDROID_Req_SendString              = 52, | ||||
| 			ANDROID_Req_StartAccessoryMode      = 53, | ||||
| 		}; | ||||
| 
 | ||||
| 		enum Android_Strings_t | ||||
| 		{ | ||||
| 			ANDROID_STRING_Manufacturer         = 0, | ||||
| 			ANDROID_STRING_Model                = 1, | ||||
| 			ANDROID_STRING_Description          = 2, | ||||
| 			ANDROID_STRING_Version              = 3, | ||||
| 			ANDROID_STRING_URI                  = 4, | ||||
| 			ANDROID_STRING_Serial               = 5, | ||||
| 		}; | ||||
| 		 | ||||
| 		enum Android_Protocols_t | ||||
| 		{ | ||||
| 			ANDROID_PROTOCOL_Accessory          = 0x0001, | ||||
| 		}; | ||||
| 	 | ||||
| 	/* Function Prototypes: */ | ||||
| 		uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol); | ||||
| 		uint8_t Android_SendString(const uint8_t StringIndex, | ||||
| 		                           char* String); | ||||
| 		                           const char* const String); | ||||
| 		uint8_t Android_StartAccessoryMode(void);	 | ||||
| 	 | ||||
| #endif | ||||
| @@ -14,6 +14,9 @@ | ||||
| # code. | ||||
|  | ||||
| all: | ||||
| 	$(MAKE) -C AndroidAccessoryHost clean | ||||
| 	$(MAKE) -C AndroidAccessoryHost all | ||||
|  | ||||
| 	$(MAKE) -C AudioInputHost clean | ||||
| 	$(MAKE) -C AudioInputHost all | ||||
|  | ||||
| @@ -54,6 +57,7 @@ all: | ||||
| 	$(MAKE) -C VirtualSerialHost all | ||||
|  | ||||
| %: | ||||
| 	$(MAKE) -C AndroidAccessoryHost $@ | ||||
| 	$(MAKE) -C AudioInputHost $@ | ||||
| 	$(MAKE) -C AudioOutputHost $@ | ||||
| 	$(MAKE) -C GenericHIDHost $@ | ||||
|   | ||||
| @@ -6,7 +6,7 @@ with the following modifications: | ||||
| Files Added: | ||||
|  | ||||
| * Defines missing from certain versions of avr-gcc | ||||
|   ./MissingDefines.h | ||||
|   ./LUFA/Common/MissingDefines.h | ||||
|  | ||||
| * Defines related to various Micropendous boards | ||||
|   ./LUFA/Drivers/Board/AVR8/MICROPENDOUS_A/... | ||||
| @@ -19,7 +19,7 @@ Files Added: | ||||
| Files Changed: | ||||
|  | ||||
| * Include MissingDefines.h with all source | ||||
|   ./Version.h | ||||
|   ./LUFA/Common/Common.h | ||||
|  | ||||
| * Allow Micropendous-related board defines to be included: | ||||
|   ./LUFA/Drivers/Board/Buttons.h | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -88,6 +88,38 @@ | ||||
| 				DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				return SPI_TransferByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				SPI_SendByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				return SPI_ReceiveByte(); | ||||
| 			} | ||||
|  | ||||
| 			/** Determines the currently selected dataflash chip. | ||||
| 			 * | ||||
| 			 *  \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected | ||||
|   | ||||
| @@ -84,6 +84,38 @@ | ||||
| //		#define USB_HOST_TIMEOUT_MS              {Insert Value Here} | ||||
| //		#define HOST_DEVICE_SETTLE_DELAY_MS	     {Insert Value Here} | ||||
|  | ||||
| 	#elif (ARCH == ARCH_XMEGA) | ||||
| 	 | ||||
| 		/* Non-USB Related Configuration Tokens: */ | ||||
| //		#define DISABLE_TERMINAL_CODES | ||||
|  | ||||
| 		/* USB Class Driver Related Tokens: */ | ||||
| //		#define HID_HOST_BOOT_PROTOCOL_ONLY | ||||
| //		#define HID_STATETABLE_STACK_DEPTH       {Insert Value Here} | ||||
| //		#define HID_USAGE_STACK_DEPTH            {Insert Value Here} | ||||
| //		#define HID_MAX_COLLECTIONS              {Insert Value Here} | ||||
| //		#define HID_MAX_REPORTITEMS              {Insert Value Here} | ||||
| //		#define HID_MAX_REPORT_IDS               {Insert Value Here} | ||||
| //		#define NO_CLASS_DRIVER_AUTOFLUSH | ||||
|  | ||||
| 		/* General USB Driver Related Tokens: */ | ||||
| //		#define USE_STATIC_OPTIONS               {Insert Value Here} | ||||
| //		#define USB_STREAM_TIMEOUT_MS            {Insert Value Here} | ||||
| //		#define NO_LIMITED_CONTROLLER_CONNECT | ||||
| //		#define NO_SOF_EVENTS | ||||
|  | ||||
| 		/* USB Device Mode Driver Related Tokens: */ | ||||
| //		#define USE_RAM_DESCRIPTORS | ||||
| //		#define USE_FLASH_DESCRIPTORS | ||||
| //		#define USE_EEPROM_DESCRIPTORS | ||||
| //		#define NO_INTERNAL_SERIAL | ||||
| //		#define FIXED_CONTROL_ENDPOINT_SIZE      {Insert Value Here} | ||||
| //		#define DEVICE_STATE_AS_GPIOR            {Insert Value Here} | ||||
| //		#define FIXED_NUM_CONFIGURATION          {Insert Value Here} | ||||
| //		#define CONTROL_ONLY_DEVICE | ||||
| //		#define NO_DEVICE_REMOTE_WAKEUP | ||||
| //		#define NO_DEVICE_SELF_POWER | ||||
|  | ||||
| 	#elif (ARCH == ARCH_UC3) | ||||
|  | ||||
| 		/* Non-USB Related Configuration Tokens: */ | ||||
|   | ||||
| @@ -120,7 +120,7 @@ LUFA_PATH = ### INSERT PATH TO LUFA LIBRARY RELATIVE TO PROJECT DIRECTORY HERE # | ||||
|  | ||||
|  | ||||
| # LUFA library compile-time options and predefined tokens (add '-D' before each token) | ||||
| LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKES HERE ### | ||||
| LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKENS HERE ### | ||||
|  | ||||
|  | ||||
| # Create the LUFA source path variables by including the LUFA root makefile | ||||
|   | ||||
| @@ -95,7 +95,7 @@ LUFA_PATH = ### INSERT PATH TO LUFA LIBRARY RELATIVE TO PROJECT DIRECTORY HERE # | ||||
|  | ||||
|  | ||||
| # LUFA library compile-time options and predefined tokens (add '-D' before each token) | ||||
| LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKES HERE ### | ||||
| LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKENS HERE ### | ||||
|  | ||||
|  | ||||
| # Create the LUFA source path variables by including the LUFA root makefile | ||||
|   | ||||
| @@ -112,7 +112,7 @@ LUFA_PATH = ### INSERT PATH TO LUFA LIBRARY RELATIVE TO PROJECT DIRECTORY HERE # | ||||
|  | ||||
|  | ||||
| # LUFA library compile-time options and predefined tokens (add '-D' before each token) | ||||
| LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKES HERE ### | ||||
| LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKENS HERE ### | ||||
|  | ||||
|  | ||||
| # Create the LUFA source path variables by including the LUFA root makefile | ||||
|   | ||||
| @@ -112,15 +112,15 @@ | ||||
| 				 *  identical name (in which case the weak reference is discarded at link time). | ||||
| 				 */ | ||||
| 				#define ATTR_WEAK                   __attribute__ ((weak)) | ||||
|  | ||||
| 				/** Forces the compiler to not automatically zero the given global variable on startup, so that the | ||||
| 				 *  current RAM contents is retained. Under most conditions this value will be random due to the | ||||
| 				 *  behaviour of volatile memory once power is removed, but may be used in some specific circumstances, | ||||
| 				 *  like the passing of values back after a system watchdog reset. | ||||
| 				 */ | ||||
| 				#define ATTR_NO_INIT                __attribute__ ((section (".noinit"))) | ||||
| 			#endif | ||||
|  | ||||
| 			/** Forces the compiler to not automatically zero the given global variable on startup, so that the | ||||
| 			 *  current RAM contents is retained. Under most conditions this value will be random due to the | ||||
| 			 *  behaviour of volatile memory once power is removed, but may be used in some specific circumstances, | ||||
| 			 *  like the passing of values back after a system watchdog reset. | ||||
| 			 */ | ||||
| 			#define ATTR_NO_INIT                    __attribute__ ((section (".noinit"))) | ||||
|  | ||||
| 			/** Places the function in one of the initialization sections, which execute before the main function | ||||
| 			 *  of the application. Refer to the avr-libc manual for more information on the initialization sections. | ||||
| 			 * | ||||
|   | ||||
| @@ -59,124 +59,114 @@ | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 		/* Macros: */ | ||||
| 			/** Selects the USBKEY specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers. */ | ||||
| 			#define BOARD_USBKEY		0 | ||||
| 			#define BOARD_USBKEY        0 | ||||
|  | ||||
| 			/** Selects the STK525 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers. */ | ||||
| 			#define BOARD_STK525		1 | ||||
| 			#define BOARD_STK525        1 | ||||
|  | ||||
| 			/** Selects the STK526 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers. */ | ||||
| 			#define BOARD_STK526		2 | ||||
| 			#define BOARD_STK526        2 | ||||
|  | ||||
| 			/** Selects the RZUSBSTICK specific board drivers, including the driver for the boards LEDs. */ | ||||
| 			#define BOARD_RZUSBSTICK	3 | ||||
| 			#define BOARD_RZUSBSTICK    3 | ||||
|  | ||||
| 			/** Selects the ATAVRUSBRF01 specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_ATAVRUSBRF01	4 | ||||
| 			#define BOARD_ATAVRUSBRF01  4 | ||||
|  | ||||
| 			/** Selects the user-defined board drivers, which should be placed in the user project's folder | ||||
| 			 *  under a directory named \c /Board/. Each board driver should be named identically to the LUFA | ||||
| 			 *  master board driver (i.e., driver in the \c LUFA/Drivers/Board directory) so that the library | ||||
| 			 *  can correctly identify it. | ||||
| 			 */ | ||||
| 			#define BOARD_USER		5 | ||||
| 			#define BOARD_USER          5 | ||||
|  | ||||
| 			/** Selects the BUMBLEB specific board drivers, using the officially recommended peripheral layout. */ | ||||
| 			#define BOARD_BUMBLEB		6 | ||||
| 			#define BOARD_BUMBLEB       6 | ||||
|  | ||||
| 			/** Selects the XPLAIN (Revision 2 or newer) specific board drivers, including LED and Dataflash driver. */ | ||||
| 			#define BOARD_XPLAIN		7 | ||||
| 			/** Selects the XPLAIN (Revision 2 or newer) specific board drivers, including LED and Dataflash drivers. */ | ||||
| 			#define BOARD_XPLAIN        7 | ||||
|  | ||||
| 			/** Selects the XPLAIN (Revision 1) specific board drivers, including LED and Dataflash driver. */ | ||||
| 			#define BOARD_XPLAIN_REV1	8 | ||||
| 			/** Selects the XPLAIN (Revision 1) specific board drivers, including LED and Dataflash drivers. */ | ||||
| 			#define BOARD_XPLAIN_REV1   8 | ||||
|  | ||||
| 			/** Selects the EVK527 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers. */ | ||||
| 			#define BOARD_EVK527		9 | ||||
| 			#define BOARD_EVK527        9 | ||||
|  | ||||
| 			/** Disables board drivers when operation will not be adversely affected (e.g. LEDs) - use of board drivers | ||||
| 			 *  such as the Joystick driver, where the removal would adversely affect the code's operation is still disallowed. */ | ||||
| 			#define BOARD_NONE		10 | ||||
| 			#define BOARD_NONE          10 | ||||
|  | ||||
| 			/** Selects the Teensy (all versions) specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_TEENSY		11 | ||||
| 			/** Selects the Teensy version 1.x specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_TEENSY        11 | ||||
|  | ||||
| 			/** Selects the USBTINY MKII specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_USBTINYMKII	12 | ||||
| 			#define BOARD_USBTINYMKII   12 | ||||
|  | ||||
| 			/** Selects the Benito specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_BENITO		13 | ||||
| 			#define BOARD_BENITO        13 | ||||
|  | ||||
| 			/** Selects the JM-DB-U2 specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_JMDBU2		14 | ||||
| 			#define BOARD_JMDBU2        14 | ||||
|  | ||||
| 			/** Selects the Olimex AVR-USB-162 specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_OLIMEX162		15 | ||||
| 			#define BOARD_OLIMEX162     15 | ||||
|  | ||||
| 			/** Selects the UDIP specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_UDIP		16 | ||||
| 			#define BOARD_UDIP          16 | ||||
|  | ||||
| 			/** Selects the BUI specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_BUI		17 | ||||
| 			#define BOARD_BUI           17 | ||||
|  | ||||
| 			/** Selects the Arduino Uno specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_UNO		18 | ||||
| 			#define BOARD_UNO           18 | ||||
|  | ||||
| 			/** Selects the Busware CUL V3 specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_CULV3		19 | ||||
| 			#define BOARD_CULV3         19 | ||||
|  | ||||
| 			/** Selects the Blackcat USB JTAG specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_BLACKCAT		20 | ||||
| 			#define BOARD_BLACKCAT      20 | ||||
|  | ||||
| 			/** Selects the Maximus specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_MAXIMUS		21 | ||||
| 			#define BOARD_MAXIMUS       21 | ||||
|  | ||||
| 			/** Selects the Minimus specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_MINIMUS		22 | ||||
| 			#define BOARD_MINIMUS       22 | ||||
|  | ||||
| 			/** Selects the Adafruit U4 specific board drivers, including the Button driver. */ | ||||
| 			#define BOARD_ADAFRUITU4	23 | ||||
| 			#define BOARD_ADAFRUITU4    23 | ||||
|  | ||||
| 			/** Selects the Microsin AVR-USB162 specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_MICROSIN162	24 | ||||
| 			#define BOARD_MICROSIN162   24 | ||||
|  | ||||
| 			/** Selects the Kernel Concepts USBFOO specific board drivers, including the Button and LEDs drivers. */ | ||||
| 			#define BOARD_USBFOO		25 | ||||
| 			#define BOARD_USBFOO        25 | ||||
| 			 | ||||
| 			/** Selects the Sparkfun ATMEGA8U2 specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_SPARKFUN8U2	26 | ||||
| 			#define BOARD_SPARKFUN8U2   26 | ||||
|  | ||||
| 			/** Selects the Atmel EVK1101 specific board drivers, including the Button, Joystick and LED drivers. */ | ||||
| 			#define BOARD_EVK1101		27 | ||||
| 			#define BOARD_EVK1101       27 | ||||
| 			 | ||||
| 			/** Selects the Busware TUL specific board drivers, including the Button and LED drivers. */ | ||||
| 			#define BOARD_TUL		28 | ||||
| 			#define BOARD_TUL           28 | ||||
|  | ||||
| 			/** Selects the Atmel EVK1100 specific board drivers, including the Button, Joystick and LED drivers. */ | ||||
| 			#define BOARD_EVK1100		29 | ||||
| 			#define BOARD_EVK1100       29 | ||||
|  | ||||
| 			/** Selects the Atmel EVK1104 specific board drivers, including the Button and LED drivers. */ | ||||
| 			#define BOARD_EVK1104		30 | ||||
|  | ||||
| 			/** Selects the Opendous Micropendous-32U2 specific board drivers for the HWB Button and LED. */ | ||||
| 			#define BOARD_MICROPENDOUS_32U2	31 | ||||
|  | ||||
| 			/** Selects the Opendous Micropendous-A/3/4 specific board drivers for the HWB Button and external SRAM. */ | ||||
| 			#define BOARD_MICROPENDOUS_A	32 | ||||
|  | ||||
| 			/** Selects the Opendous Micropendous Rev1 Arduino-like specific board drivers for the HWB Button, USB Connector Switch, external SRAM, and LED. */ | ||||
| 			#define BOARD_MICROPENDOUS_REV1	33 | ||||
|  | ||||
| 			/** Selects the Opendous Micropendous Rev2 Arduino-like specific board drivers for the HWB Button, USB Connector Switch, external SRAM, and LED. */ | ||||
| 			#define BOARD_MICROPENDOUS_REV2	34 | ||||
|  | ||||
|  | ||||
| 			#define BOARD_EVK1104       30 | ||||
| 			 | ||||
| 			/** Selects the Atmel XMEGA A3BU Xplained specific board drivers, including Dataflash, Button and LED drivers. */ | ||||
| 			#define BOARD_A3BU_XPLAINED 31 | ||||
|  | ||||
| 			/** Selects the Teensy version 2.x specific board drivers, including the driver for the board LEDs. */ | ||||
| 			#define BOARD_TEENSY2       32 | ||||
|  | ||||
| 			#if !defined(__DOXYGEN__) | ||||
| 				#define BOARD_		BOARD_NONE | ||||
| 				#define BOARD_          BOARD_NONE | ||||
|  | ||||
| 				#if !defined(BOARD) | ||||
| 					#define BOARD	BOARD_NONE | ||||
| 					#define BOARD       BOARD_NONE | ||||
| 				#endif | ||||
| 			#endif | ||||
|  | ||||
|   | ||||
| @@ -70,7 +70,6 @@ | ||||
| 		#include "Architectures.h" | ||||
| 		#include "Attributes.h" | ||||
| 		#include "BoardTypes.h" | ||||
| 		#include "MissingDefines.h" | ||||
| 		 | ||||
| 	/* Enable C linkage for C++ Compilers: */ | ||||
| 		#if defined(__cplusplus) | ||||
|   | ||||
| @@ -44,7 +44,7 @@ PROJECT_BRIEF          = | ||||
| # exceed 55 pixels and the maximum width should not exceed 200 pixels. | ||||
| # Doxygen will copy the logo to the output directory. | ||||
|  | ||||
| PROJECT_LOGO           = ./ManPages/LUFA_thumb.png | ||||
| PROJECT_LOGO           = ./DoxygenPages/LUFA_thumb.png | ||||
|  | ||||
| # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) | ||||
| # base path where the generated documentation will be put. | ||||
| @@ -855,7 +855,7 @@ HTML_HEADER            = | ||||
| # each generated HTML page. If it is left blank doxygen will generate a | ||||
| # standard footer. | ||||
|  | ||||
| HTML_FOOTER            = ./ManPages/footer.htm | ||||
| HTML_FOOTER            = ./DoxygenPages/footer.htm | ||||
|  | ||||
| # The HTML_STYLESHEET tag can be used to specify a user-defined cascading | ||||
| # style sheet that is used by each HTML page. It can be used to | ||||
|   | ||||
| Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB | 
| @@ -5,6 +5,39 @@ | ||||
|  */ | ||||
| 
 | ||||
|  /** \page Page_ChangeLog Project Changelog | ||||
|   * | ||||
|   *  \section Sec_ChangeLogXXXXXX Version XXXXXX | ||||
|   *  <b>New:</b> | ||||
|   *  - Core: | ||||
|   *   - Added support for the XMEGA A3BU Xplained board | ||||
|   *   - Added support for the new B series XMEGA devices | ||||
|   *   - Added support for version 2 of the Teensy boards (thanks to Christoph Redecker) | ||||
|   *   - Added new Android Accessory Host class driver | ||||
|   *   - Added new USB_Host_GetDescriptor(), USB_Host_GetDeviceConfiguration() and USB_Host_GetInterfaceAltSetting() functions | ||||
|   *  - Library Applications: | ||||
|   *   - Added User Application APIs to the CDC and DFU class bootloaders | ||||
|   *   - Added INVERTED_ISP_MISO compile time option to the AVRISP-MKII clone project (thanks to Chuck Rohs) | ||||
|   *   - Added new Android Accessory Host demo (thanks to Opendous Inc.) | ||||
|   * | ||||
|   *  <b>Changed:</b> | ||||
|   *  - Core: | ||||
|   *   - When automatic PLL management mode is enabled on the U4 series AVR8 chips, the PLL is now configured for 48MHz and not | ||||
|   *     a divided 96MHz, to lower power consumption and to keep the system within the datasheet specs for 3.3V operation (thanks to Scott Vitale) | ||||
|   *   - Added Class, ClassDevice, ClassHost and ClassCommon to the internal class driver source filenames to prevent ambiguities | ||||
|   *  - Library Applications: | ||||
|   *   - None | ||||
|   * | ||||
|   *  <b>Fixed:</b> | ||||
|   *  - Core: | ||||
|   *   - Fixed ring buffer size limited to 255 elements, instead of the intended 65535 elements. | ||||
|   *   - Fixed CDC class drivers not saving and sending all 16-bits of the control line states (thanks to Matthew Swabey) | ||||
|   *   - Fixed race conditions in the CDC, HID and Mass Storage class drivers when processing some control requests | ||||
|   *   - Fixed misspelled HID_KEYBOARD_MODIFIER_* macros in the HID class driver (thanks to Laszlo Monda) | ||||
|   *   - Fixed broken AVR32 endpoint/pipe communications when ORDERED_EP_CONFIG compile time option is not enabled (thanks to Matthias Jahr) | ||||
|   *   - Fixed broken compilation for the AVR32 devices if the NO_SOF_EVENTS compile time option was not enabled (thanks to Matthias Jahr) | ||||
|   *  - Library Applications: | ||||
|   *   - Added reliability patches to the AVRISP-MKII Clone project's PDI/TPI protocols (thanks to Justin Mattair) | ||||
|   *   - Fixed AVRISP-MKII Clone compile warning on AVR8 U4 targets even when NO_VTARGET_DETECT is enabled | ||||
|   * | ||||
|   *  \section Sec_ChangeLog111009 Version 111009 | ||||
|   *  <b>New:</b> | ||||
| @@ -52,7 +52,7 @@ | ||||
|  * | ||||
|  *  If you are not using any board-specific drivers in the LUFA library, or you are using a custom board layout, change this to read | ||||
|  *  "USER" (no quotes) instead of a standard board name. If the USER board type is selected and the application makes use of one or more | ||||
|  *  board-specific hardware drivers inside the LUFA library, then the appropriate stub drives files should be copied from the /BoardStubs/ | ||||
|  *  board-specific hardware drivers inside the LUFA library, then the appropriate stub drives files should be copied from the \c /CodeTemplates/DriverStubs/ | ||||
|  *  directory into a /Board/ folder inside the application directory, and the stub driver completed with the appropriate code to drive the | ||||
|  *  custom board's hardware. | ||||
|  * | ||||
| @@ -112,7 +112,7 @@ | ||||
|  *   - Microsin AVR-USB162 | ||||
|  *   - Minimus USB | ||||
|  *   - Olimex AVR-USB-162 | ||||
|  *   - PJRC Teensy (all revisions and versions) | ||||
|  *   - PJRC Teensy (1.x and 2.x versions) | ||||
|  *   - Sparkfun U2 Breakout Board | ||||
|  *   - TCNISO Blackcat USB JTAG | ||||
|  *   - Tempusdictum Benito | ||||
| @@ -343,11 +343,31 @@ | ||||
|  *   <td bgcolor="#00EE00">Yes</td> | ||||
|  *   <td bgcolor="#EE0000">No</td> | ||||
|  *  </tr> | ||||
|  *  <tr> | ||||
|  *   <td>ATXMEGA64B3</td> | ||||
|  *   <td bgcolor="#00EE00">Yes</td> | ||||
|  *   <td bgcolor="#EE0000">No</td> | ||||
|  *  </tr> | ||||
|  *  <tr> | ||||
|  *   <td>ATXMEGA128B3</td> | ||||
|  *   <td bgcolor="#00EE00">Yes</td> | ||||
|  *   <td bgcolor="#EE0000">No</td> | ||||
|  *  </tr> | ||||
|  *  <tr> | ||||
|  *   <td>ATXMEGA64B1</td> | ||||
|  *   <td bgcolor="#00EE00">Yes</td> | ||||
|  *   <td bgcolor="#EE0000">No</td> | ||||
|  *  </tr> | ||||
|  *  <tr> | ||||
|  *   <td>ATXMEGA128B1</td> | ||||
|  *   <td bgcolor="#00EE00">Yes</td> | ||||
|  *   <td bgcolor="#EE0000">No</td> | ||||
|  *  </tr> | ||||
|  *  </table> | ||||
|  * | ||||
|  *  \section Sec_XMEGASupport_Boards Supported Atmel Boards | ||||
|  *  Currently supported Atmel XMEGA boards (see \ref Group_BoardTypes): | ||||
|  *   - None | ||||
|  *   - XMEGA A3BU Xplained | ||||
|  * | ||||
|  *  \section Sec_XMEGASupport_ThirdParty Supported Third Party Models | ||||
|  *  Currently supported third-party boards (see \ref Group_BoardTypes for makefile \c BOARD constant names): | ||||
| @@ -24,8 +24,6 @@ | ||||
|   *      -# Abstract out Mass Storage byte send/receive to prevent low level API use in projects | ||||
|   *      -# Consider switch from endpoint numbers to full endpoint addresses to ease future architecture expansion | ||||
|   *      -# Fix HID report parser usage support for array types | ||||
|   *      -# Add additional standard request helper functions to host mode | ||||
|   *      -# Add Dataflash_SendCommand() | ||||
|   *      -# Make HOST_DEVICE_SETTLE_DELAY_MS a global variable that can be changed | ||||
|   *      -# Add MANDATORY_EVENT_FUNCTIONS compile time option | ||||
|   *      -# Add watchdog support to the library and apps/bootloaders | ||||
| @@ -40,8 +38,10 @@ | ||||
|   *      -# Add class driver support for Test and Measurement class | ||||
|   *      -# Add class driver support for EEM class | ||||
|   *      -# Add class driver support for ECM class | ||||
|   *      -# Port all demos to multiple architectures | ||||
|   *  - Ports | ||||
|   *      -# Complete AVR32 port for existing devices, add UC3C support | ||||
|   *      -# Finish USB XMEGA port | ||||
|   *      -# Add AVR32 UC3C support | ||||
|   *      -# Atmel ARM7 series microcontrollers | ||||
|   *      -# Other (commercial) C compilers | ||||
|   */ | ||||
| Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB | 
| @@ -56,6 +56,7 @@ | ||||
|  *  - Gamecube controller to USB adapter: https://www.facebook.com/media/set/?set=a.10150202447076304.310536.688776303&l=df53851c50  | ||||
|  *  - Garmin GPS USB to NMEA standard serial sentence translator: http://github.com/nall/garmin-transmogrifier/tree/master | ||||
|  *  - Generic HID Device Creator: http://generichid.sourceforge.net/ | ||||
|  *  - Generic HID Open Source Framework: http://www.waitingforfriday.com/index.php/USB_Generic_HID_Open_Source_Framework_for_Atmel_AVR_and_Windows | ||||
|  *  - Ghetto Drum, a MIDI drum controller: http://noisybox.net/art/gdrum/ | ||||
|  *  - Hiduino, a USB-MIDI replacement firmware for the Arduino Uno: http://code.google.com/p/hiduino/ | ||||
|  *  - Ikea RGB LED USB modification: http://slashhome.se/p/projects/id/ikea_dioder_usb/#project | ||||
| @@ -92,6 +93,7 @@ | ||||
|  *  - SmartportVHD Apple II Mass Storage adapter: http://pcedric3.free.fr/SmartportVHD/ | ||||
|  *  - Single LED Matrix Display: http://guysoft.wordpress.com/2009/10/08/bumble-b/ | ||||
|  *  - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/ | ||||
|  *  - Stylophone, with USB MIDI connectivity: http://www.waitingforfriday.com/index.php/Stylophone_Studio_5 | ||||
|  *  - Teensy SD Card .WAV file player: http://elasticsheep.com/2010/04/teensy2-usb-wav-player-part-1/ | ||||
|  *  - Touchscreen Input Device: http://capnstech.blogspot.com/2010/07/touchscreen-update.html | ||||
|  *  - Universal USB AVR Module: http://usbavr.bplaced.net/ | ||||
| @@ -135,6 +137,10 @@ | ||||
|  *  - Elektor Magazine, "20 x Open Source" by Jens Nickel, March 2010 Issue | ||||
|  *  - Circuit Cellar Magazine, "Advanced USB Design Debugging" by Collin O'Flynn, August 2010 Issue | ||||
|  * | ||||
|  *  \section Sec_PortsAndForks Non-Official LUFA Ports and Forks | ||||
|  *  - NXP's official "nxpusblib" LUFA fork, for LPC devices: http://www.lpcware.com/content/project/nxpusblib | ||||
|  *  - Kevin Mehall's LUFA port to the NXP LPC13xx: https://github.com/kevinmehall/LUFA-LPC13xx | ||||
|  * | ||||
|  *  \section Sec_LUFANotableMentions Other Notable Mentions of LUFA | ||||
|  *  - Adafruit "Ask an Engineer", 7th November 2010 | ||||
|  *  - Arduino 2010 Keynote speech | ||||
| Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB | 
| @@ -66,6 +66,7 @@ | ||||
|  *                                      Measurement class | ||||
|  *    - <b>Host</b> | ||||
|  *      - <b>ClassDriver</b> | ||||
|  *        - <b>AndroidAccessoryHost</b> - Android Accessory host demo, using the library USB Android Open Accessory Class driver framework | ||||
|  *        - <b>AudioInputHost</b> - Audio Input host demo, using the library USB Audio Class driver framework | ||||
|  *        - <b>AudioOutputHost</b> - Audio Output host demo, using the library USB Audio Class driver framework | ||||
|  *        - <b>JoystickHostWithParser</b> - Joystick host demo with HID Descriptor parser, using the library USB HID Class driver framework | ||||
| @@ -79,6 +80,7 @@ | ||||
|  *        - <b>StillImageHost</b> - Still Image Camera host demo, using the library USB Still Image Class driver framework | ||||
|  *        - <b>VirtualSerialHost</b> - Virtual Serial Port host demo, using the library USB CDC Class driver framework | ||||
|  *      - <b>LowLevel</b> | ||||
|  *        - <b>AndroidAccessoryHost</b> - Android Accessory host demo, using the low level LUFA APIs to implement the Android Open Accessory class | ||||
|  *        - <b>AudioInputHost</b> - Audio Input host demo, using the low level LUFA APIs to implement the USB Audio class | ||||
|  *        - <b>AudioOutputHost</b> - Audio Output host demo, using the low level LUFA APIs to implement the USB Audio class | ||||
|  *        - <b>GenericHIDHost</b> - Generic HID host demo, using the low level LUFA APIs to implement the USB HID class | ||||
| @@ -10,6 +10,15 @@ | ||||
|  *  to the next version released. It does not indicate all new additions to the library in each version change, only | ||||
|  *  areas relevant to making older projects compatible with the API changes of each new release. | ||||
|  * | ||||
|  *  \section Sec_MigrationXXXXXX Migrating from 111009 to XXXXXX | ||||
|  *  <b>USB Core</b> | ||||
|  *    - The HID_KEYBOARD_MODIFER_* macros in the HID class driver have been corrected to HID_KEYBOARD_MODIFIER_* (note the spelling of "modifier"). | ||||
|  *      Existing applications should switch over to the correctly spelled macro names. | ||||
|  *    - The names of the USB Device and USB Host class driver files have changed; a new "ClassDevice" and "ClassHost" postfix has been added to the | ||||
|  *      respective class driver files. Projects referencing the class driver source files by filename rather than the LUFA_SRC_USBCLASS makefile | ||||
|  *      variable should append these postfixes to the source file names. Projects including the USB class driver dispatch headers directly should either | ||||
|  *      switch to including the main USB driver header instead, or use the updated header filenames. | ||||
|  * | ||||
|  *  \section Sec_Migration111009 Migrating from 110528 to 111009 | ||||
|  *  <b>Non-USB Library Components</b> | ||||
|  *    - The \c JTAG_DEBUG_ASSERT() macro has been renamed \ref JTAG_ASSERT() to be consistent with \ref STDOUT_ASSERT(). | ||||
| @@ -92,6 +92,38 @@ | ||||
| 				DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				return SPI_TransferByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				SPI_SendByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				return SPI_ReceiveByte(); | ||||
| 			} | ||||
|  | ||||
| 			/** Determines the currently selected dataflash chip. | ||||
| 			 * | ||||
| 			 *  \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected | ||||
|   | ||||
| @@ -9,6 +9,11 @@ | ||||
| /*
 | ||||
|   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||||
| 
 | ||||
|   Modified for the Micropendous-32U2 series of boards by Opendous Inc. 2011-11-11 | ||||
|   www.Micropendous.org/Micropendous-32U2 | ||||
| 
 | ||||
|   Note there is only 1 user button on the Micropendous-32U2 boards: PD7 - HWB | ||||
| 
 | ||||
|   Permission to use, copy, modify, distribute, and sell this | ||||
|   software and its documentation for any purpose is hereby granted | ||||
|   without fee, provided that the above copyright notice appear in | ||||
| @@ -29,24 +34,24 @@ | ||||
| */ | ||||
| 
 | ||||
| /** \file
 | ||||
|  *  \brief Board specific Buttons driver header for the Atmel USBKEY. | ||||
|  *  \copydetails Group_Buttons_USBKEY | ||||
|  *  \brief Board specific Buttons driver header for the Micropendous-32U2 board (www.Micropendous.org/Micropendous-32U2). | ||||
|  *  \copydetails Group_Buttons_MICROPENDOUS_32U2 | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the Buttons driver | ||||
|  *        dispatch header located in LUFA/Drivers/Board/Buttons.h. | ||||
|  */ | ||||
| 
 | ||||
| /** \ingroup Group_Buttons
 | ||||
|  *  \defgroup Group_Buttons_USBKEY USBKEY | ||||
|  *  \brief Board specific Buttons driver header for the Atmel USBKEY. | ||||
|  *  \defgroup Group_Buttons_MICROPENDOUS_32U2 MICROPENDOUS_32U2 | ||||
|  *  \brief Board specific Buttons driver header for the Micropendous-32U2. | ||||
|  * | ||||
|  *  Board specific Buttons driver header for the Atmel USBKEY. | ||||
|  *  Board specific Buttons driver header for the Micropendous-32U2 (www.Micropendous.org/Micropendous-32U2). | ||||
|  * | ||||
|  *  @{ | ||||
|  */ | ||||
| 
 | ||||
| #ifndef __BUTTONS_USBKEY_H__ | ||||
| #define __BUTTONS_USBKEY_H__ | ||||
| #ifndef __BUTTONS_MICROPENDOUS_32U2_H__ | ||||
| #define __BUTTONS_MICROPENDOUS_32U2_H__ | ||||
| 
 | ||||
| 	/* Includes: */ | ||||
| 		#include "../../../../Common/Common.h" | ||||
| @@ -64,20 +69,20 @@ | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 		/* Macros: */ | ||||
| 			/** Button mask for the first button on the board. */ | ||||
| 			#define BUTTONS_BUTTON1      (1 << 2) | ||||
| 			#define BUTTONS_BUTTON1      (1 << 7) | ||||
| 
 | ||||
| 		/* Inline Functions: */ | ||||
| 		#if !defined(__DOXYGEN__) | ||||
| 			static inline void Buttons_Init(void) | ||||
| 			{ | ||||
| 				DDRE  &= ~BUTTONS_BUTTON1; | ||||
| 				PORTE |=  BUTTONS_BUTTON1; | ||||
| 				DDRD  &= ~BUTTONS_BUTTON1; | ||||
| 				PORTD |=  BUTTONS_BUTTON1; | ||||
| 			} | ||||
| 
 | ||||
| 			static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Buttons_GetStatus(void) | ||||
| 			{ | ||||
| 				return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); | ||||
| 				return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); | ||||
| 			} | ||||
| 		#endif | ||||
| 
 | ||||
| @@ -86,7 +91,6 @@ | ||||
| 			} | ||||
| 		#endif | ||||
| 
 | ||||
| #endif | ||||
| #endif // __BUTTONS_MICROPENDOUS_32U2_H__
 | ||||
| 
 | ||||
| /** @} */ | ||||
| 
 | ||||
| @@ -9,6 +9,12 @@ | ||||
| /*
 | ||||
|   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||||
| 
 | ||||
|   Modified for the Micropendous-32U2 series of boards by Opendous Inc. 2011-11-11 | ||||
|   www.Micropendous.org/Micropendous-32U2 | ||||
| 
 | ||||
|   Note there is only 1 User LED on the Micropendous-32U2 board: PD6 | ||||
|   The other LED is a power LED | ||||
| 
 | ||||
|   Permission to use, copy, modify, distribute, and sell this | ||||
|   software and its documentation for any purpose is hereby granted | ||||
|   without fee, provided that the above copyright notice appear in | ||||
| @@ -29,24 +35,24 @@ | ||||
| */ | ||||
| 
 | ||||
| /** \file
 | ||||
|  *  \brief Board specific LED driver header for the Atmel USBKEY. | ||||
|  *  \copydetails Group_LEDs_USBKEY | ||||
|  *  \brief Board specific LED driver header for the Micropendous-32U2 board (www.Micropendous.org/Micropendous-32U2). | ||||
|  *  \copydetails Group_MICROPENDOUS_32U2 | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the LEDs driver | ||||
|  *        dispatch header located in LUFA/Drivers/Board/LEDs.h. | ||||
|  */ | ||||
| 
 | ||||
| /** \ingroup Group_LEDs
 | ||||
|  *  \defgroup Group_LEDs_USBKEY USBKEY | ||||
|  *  \brief Board specific LED driver header for the Atmel USBKEY. | ||||
|  *  \defgroup Group_LEDs_MICROPENDOUS_32U2 MICROPENDOUS_32U2 | ||||
|  *  \brief Board specific LED driver header for the Micropendous 32U2 board. | ||||
|  * | ||||
|  *  Board specific LED driver header for the Atmel USBKEY. | ||||
|  *  Board specific LED driver header for the Micropendous-32U2 board (www.Micropendous.org/Micropendous-32U2). | ||||
|  * | ||||
|  *  @{ | ||||
|  */ | ||||
| 
 | ||||
| #ifndef __LEDS_USBKEY_H__ | ||||
| #define __LEDS_USBKEY_H__ | ||||
| #ifndef __LEDS_MICROPENDOUS_32U2_H__ | ||||
| #define __LEDS_MICROPENDOUS_32U2_H__ | ||||
| 
 | ||||
| 	/* Includes: */ | ||||
| 		#include "../../../../Common/Common.h" | ||||
| @@ -64,16 +70,16 @@ | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 		/* Macros: */ | ||||
| 			/** LED mask for the first LED on the board. */ | ||||
| 			#define LEDS_LED1        (1 << 4) | ||||
| 			#define LEDS_LED1        (1 << PD6) | ||||
| 
 | ||||
| 			/** LED mask for the second LED on the board. */ | ||||
| 			#define LEDS_LED2        (1 << 5) | ||||
| 			#define LEDS_LED2        (0 << 0) | ||||
| 
 | ||||
| 			/** LED mask for the third LED on the board. */ | ||||
| 			#define LEDS_LED3        (1 << 7) | ||||
| 			#define LEDS_LED3        (0 << 0) | ||||
| 
 | ||||
| 			/** LED mask for the fourth LED on the board. */ | ||||
| 			#define LEDS_LED4        (1 << 6) | ||||
| 			#define LEDS_LED4        (0 << 0) | ||||
| 
 | ||||
| 			/** LED mask for all the LEDs on the board. */ | ||||
| 			#define LEDS_ALL_LEDS    (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4) | ||||
| @@ -127,6 +133,6 @@ | ||||
| 			} | ||||
| 		#endif | ||||
| 
 | ||||
| #endif | ||||
| #endif // __LEDS_MICROPENDOUS_32U2_H__
 | ||||
| 
 | ||||
| /** @} */ | ||||
| @@ -0,0 +1,68 @@ | ||||
| /* | ||||
|   Copyright 2011-11-08 By Opendous Inc. | ||||
|   For use with the Micropendous Rev1 boards | ||||
|   www.Micropendous.org/Micropendous-REV1 | ||||
|   www.Micropendous.org/Micropendous-DIP | ||||
|  | ||||
|   Permission to use, copy, modify, distribute, and sell this | ||||
|   software and its documentation for any purpose is hereby granted | ||||
|   without fee, provided that the above copyright notice appear in | ||||
|   all copies and that both that the copyright notice and this | ||||
|   permission notice and warranty disclaimer appear in supporting | ||||
|   documentation, and that the name of the author not be used in | ||||
|   advertising or publicity pertaining to distribution of the | ||||
|   software without specific, written prior permission. | ||||
|  | ||||
|   The author disclaim all warranties with regard to this | ||||
|   software, including all implied warranties of merchantability | ||||
|   and fitness.  In no event shall the author be liable for any | ||||
|   special, indirect or consequential damages or any damages | ||||
|   whatsoever resulting from loss of use, data or profits, whether | ||||
|   in an action of contract, negligence or other tortious action, | ||||
|   arising out of or in connection with the use or performance of | ||||
|   this software. | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  *  \brief Board specific PORTB voltage translator driver header for the | ||||
|  *        Micropendous Rev1 board (www.Micropendous.org/Micropendous-REV1). | ||||
|  *  \copydetails Group_Buttons_MICROPENDOUS_REV1 | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included by the buttons driver | ||||
|  *        dispatch header located in LUFA/Drivers/Board/Buttons.h. | ||||
|  */ | ||||
|  | ||||
| /** \ingroup Group_Buttons | ||||
|  *  \defgroup Group_Buttons_MICROPENDOUS_REV1 MICROPENDOUS_REV1 | ||||
|  *  \brief Board specific PORTB voltage translator driver header for the Micropendous Rev2 board. | ||||
|  * | ||||
|  *  Board specific PORTB voltage translator driver header for the | ||||
|  *        Micropendous Rev2 board (www.Micropendous.org/Micropendous-REV1). | ||||
|  * | ||||
|  *  @{ | ||||
|  */ | ||||
|  | ||||
| #ifndef __VOLTAGE_TXRX_MICROPENDOUS_REV1_H__ | ||||
| #define __VOLTAGE_TXRX_MICROPENDOUS_REV1_H__ | ||||
|  | ||||
| 	/* Includes: */ | ||||
| 	#include "../../../../Common/Common.h" | ||||
|  | ||||
| 	/* Enable C linkage for C++ Compilers: */ | ||||
| 	#if defined(__cplusplus) | ||||
| 		extern "C" { | ||||
| 	#endif | ||||
|  | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 	// On Micropendous Rev1 boards the PORTB voltage translator is controlled by PE6 | ||||
| 	#define ENABLE_VOLTAGE_TXRX	DDRE |= (1 << PE6); PORTE |= (1 << PE6); | ||||
| 	#define DISABLE_VOLTAGE_TXRX	DDRE |= (1 << PE6); PORTE &= ~(1 << PE6); | ||||
|  | ||||
| 	/* Disable C linkage for C++ Compilers: */ | ||||
| 	#if defined(__cplusplus) | ||||
| 		} | ||||
| 	#endif | ||||
|  | ||||
| #endif // __VOLTAGE_TXRX_MICROPENDOUS_REV1_H__ | ||||
|  | ||||
| /** @} */ | ||||
| @@ -0,0 +1,66 @@ | ||||
| /* | ||||
|   Copyright 2011-11-08 By Opendous Inc. | ||||
|   For use with the Micropendous Rev2 board (www.Micropendous.org/Micropendous) | ||||
|  | ||||
|   Permission to use, copy, modify, distribute, and sell this | ||||
|   software and its documentation for any purpose is hereby granted | ||||
|   without fee, provided that the above copyright notice appear in | ||||
|   all copies and that both that the copyright notice and this | ||||
|   permission notice and warranty disclaimer appear in supporting | ||||
|   documentation, and that the name of the author not be used in | ||||
|   advertising or publicity pertaining to distribution of the | ||||
|   software without specific, written prior permission. | ||||
|  | ||||
|   The author disclaim all warranties with regard to this | ||||
|   software, including all implied warranties of merchantability | ||||
|   and fitness.  In no event shall the author be liable for any | ||||
|   special, indirect or consequential damages or any damages | ||||
|   whatsoever resulting from loss of use, data or profits, whether | ||||
|   in an action of contract, negligence or other tortious action, | ||||
|   arising out of or in connection with the use or performance of | ||||
|   this software. | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  *  \brief Board specific PORTB voltage translator driver header for the | ||||
|  *        Micropendous Rev2 board (www.Micropendous.org/Micropendous). | ||||
|  *  \copydetails Group_Buttons_MICROPENDOUS_REV2 | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included by the buttons driver | ||||
|  *        dispatch header located in LUFA/Drivers/Board/Buttons.h. | ||||
|  */ | ||||
|  | ||||
| /** \ingroup Group_Buttons | ||||
|  *  \defgroup Group_Buttons_MICROPENDOUS_REV2 MICROPENDOUS_REV2 | ||||
|  *  \brief Board specific PORTB voltage translator driver header for the Micropendous Rev2 board. | ||||
|  * | ||||
|  *  Board specific PORTB voltage translator driver header for the | ||||
|  *        Micropendous Rev2 board (www.Micropendous.org/Micropendous). | ||||
|  * | ||||
|  *  @{ | ||||
|  */ | ||||
|  | ||||
| #ifndef __VOLTAGE_TXRX_MICROPENDOUS_REV2_H__ | ||||
| #define __VOLTAGE_TXRX_MICROPENDOUS_REV2_H__ | ||||
|  | ||||
| 	/* Includes: */ | ||||
| 	#include "../../../../Common/Common.h" | ||||
|  | ||||
| 	/* Enable C linkage for C++ Compilers: */ | ||||
| 	#if defined(__cplusplus) | ||||
| 		extern "C" { | ||||
| 	#endif | ||||
|  | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 	// On Micropendous Rev2 boards the PORTB voltage translator is controlled by PE3 | ||||
| 	#define ENABLE_VOLTAGE_TXRX	DDRE |= (1 << PE3); PORTE |= (1 << PE3); | ||||
| 	#define DISABLE_VOLTAGE_TXRX	DDRE |= (1 << PE3); PORTE &= ~(1 << PE3); | ||||
|  | ||||
| 	/* Disable C linkage for C++ Compilers: */ | ||||
| 	#if defined(__cplusplus) | ||||
| 		} | ||||
| 	#endif | ||||
|  | ||||
| #endif // __VOLTAGE_TXRX_MICROPENDOUS_REV2_H__ | ||||
|  | ||||
| /** @} */ | ||||
| @@ -92,6 +92,38 @@ | ||||
| 				DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				return SPI_TransferByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				SPI_SendByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				return SPI_ReceiveByte(); | ||||
| 			} | ||||
|  | ||||
| 			/** Determines the currently selected dataflash chip. | ||||
| 			 * | ||||
| 			 *  \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected | ||||
|   | ||||
| @@ -92,6 +92,38 @@ | ||||
| 				DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				return SPI_TransferByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				SPI_SendByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				return SPI_ReceiveByte(); | ||||
| 			} | ||||
|  | ||||
| 			/** Determines the currently selected dataflash chip. | ||||
| 			 * | ||||
| 			 *  \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected | ||||
|   | ||||
| @@ -29,7 +29,7 @@ | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  *  \brief Board specific LED driver header for the PJRC Teensy boards. | ||||
|  *  \brief Board specific LED driver header for the PJRC Teensy 1.x/2.x boards. | ||||
|  *  \copydetails Group_LEDs_TEENSY | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the LEDs driver | ||||
| @@ -38,7 +38,9 @@ | ||||
|  | ||||
| /** \ingroup Group_LEDs | ||||
|  *  \defgroup Group_LEDs_TEENSY TEENSY | ||||
|  *  \brief Board specific LED driver header for the PJRC Teensy boards. | ||||
|  *  \brief Board specific LED driver header for the PJRC Teensy 1.x/2.x boards. | ||||
|  * | ||||
|  *  \note For version 2 Teensy boards, compile with <code>BOARD = TEENSY2</code>. | ||||
|  * | ||||
|  *  Board specific LED driver header for the PJRC Teensy boards (http://www.pjrc.com/teensy/index.html). | ||||
|  * | ||||
| @@ -77,28 +79,49 @@ | ||||
| 			static inline void LEDs_Init(void) | ||||
| 			{ | ||||
| 				DDRD  |= LEDS_ALL_LEDS; | ||||
| 				PORTD |= LEDS_ALL_LEDS; | ||||
|  | ||||
| 				#if (BOARD == BOARD_TEENSY2) | ||||
| 				PORTD &= ~LEDS_ALL_LEDS;				 | ||||
| 				#else | ||||
| 				PORTD |=  LEDS_ALL_LEDS; | ||||
| 				#endif | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) | ||||
| 			{ | ||||
| 				#if (BOARD == BOARD_TEENSY2) | ||||
| 				PORTD |=  LEDMask;				 | ||||
| 				#else | ||||
| 				PORTD &= ~LEDMask; | ||||
| 				#endif | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) | ||||
| 			{ | ||||
| 				PORTD |= LEDMask; | ||||
| 				#if (BOARD == BOARD_TEENSY2) | ||||
| 				PORTD &= ~LEDMask;				 | ||||
| 				#else | ||||
| 				PORTD |=  LEDMask; | ||||
| 				#endif | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) | ||||
| 			{ | ||||
| 				#if (BOARD == BOARD_TEENSY2) | ||||
| 				PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask); | ||||
| 				#else | ||||
| 				PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask); | ||||
| 				#endif | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, | ||||
| 			                                   const uint8_t ActiveMask) | ||||
| 			{ | ||||
| 				#if (BOARD == BOARD_TEENSY2) | ||||
| 				PORTD = ((PORTD & ~LEDMask) | ActiveMask);				 | ||||
| 				#else | ||||
| 				PORTD = ((PORTD | LEDMask) & ~ActiveMask); | ||||
| 				#endif | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) | ||||
| @@ -109,7 +132,11 @@ | ||||
| 			static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t LEDs_GetLEDs(void) | ||||
| 			{ | ||||
| 				#if (BOARD == BOARD_TEENSY2) | ||||
| 				return (PORTD & LEDS_ALL_LEDS);				 | ||||
| 				#else | ||||
| 				return (~PORTD & LEDS_ALL_LEDS); | ||||
| 				#endif | ||||
| 			} | ||||
| 		#endif | ||||
|  | ||||
|   | ||||
| @@ -95,6 +95,38 @@ | ||||
| 				DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				return SPI_TransferByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				SPI_SendByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				return SPI_ReceiveByte(); | ||||
| 			} | ||||
|  | ||||
| 			/** Determines the currently selected dataflash chip. | ||||
| 			 * | ||||
| 			 *  \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected | ||||
|   | ||||
| @@ -29,7 +29,7 @@ | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  *  \brief Board specific Dataflash driver header for the Atmel XPLAIN. | ||||
|  *  \brief Board specific Dataflash driver header for the original Atmel XPLAIN. | ||||
|  *  \copydetails Group_Dataflash_XPLAIN | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the dataflash driver | ||||
| @@ -38,7 +38,9 @@ | ||||
|  | ||||
| /** \ingroup Group_Dataflash | ||||
|  *  \defgroup Group_Dataflash_XPLAIN XPLAIN | ||||
|  *  \brief Board specific Dataflash driver header for the Atmel XPLAIN. | ||||
|  *  \brief Board specific Dataflash driver header for the original Atmel XPLAIN. | ||||
|  * | ||||
|  *  \note For the first revision XPLAIN board, compile with <code>BOARD = BOARD_XPLAIN_REV1</code>. | ||||
|  * | ||||
|  *  Board specific Dataflash driver header for the Atmel XPLAIN. | ||||
|  * | ||||
| @@ -98,6 +100,38 @@ | ||||
| 				DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				return SPI_TransferByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				SPI_SendByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				return SPI_ReceiveByte(); | ||||
| 			} | ||||
|  | ||||
| 			/** Determines the currently selected dataflash chip. | ||||
| 			 * | ||||
| 			 *  \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected | ||||
|   | ||||
| @@ -29,7 +29,7 @@ | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  *  \brief Board specific LED driver header for the Atmel XPLAIN. | ||||
|  *  \brief Board specific LED driver header for the original Atmel XPLAIN. | ||||
|  *  \copydetails Group_LEDs_XPLAIN | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the LEDs driver | ||||
| @@ -38,7 +38,7 @@ | ||||
|  | ||||
| /** \ingroup Group_LEDs | ||||
|  *  \defgroup Group_LEDs_XPLAIN XPLAIN | ||||
|  *  \brief Board specific LED driver header for the Atmel XPLAIN. | ||||
|  *  \brief Board specific LED driver header for the original Atmel XPLAIN. | ||||
|  * | ||||
|  *  Board specific LED driver header for the Atmel XPLAIN. | ||||
|  * | ||||
|   | ||||
| @@ -92,9 +92,7 @@ | ||||
| 		#include "../../Common/Common.h" | ||||
|  | ||||
| 		#if (BOARD == BOARD_NONE) | ||||
| 			#define BUTTONS_BUTTON1      (0 << 0) | ||||
| 			static inline void Buttons_Init(void) {}; | ||||
| 			static inline uint8_t Buttons_GetStatus(void) {return 0;}; | ||||
| 			#error The Board Buttons driver cannot be used if the makefile BOARD option is not set. | ||||
| 		#elif (BOARD == BOARD_USBKEY) | ||||
| 			#include "AVR8/USBKEY/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_STK525) | ||||
| @@ -133,21 +131,10 @@ | ||||
| 			#include "UC3/EVK1100/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_EVK1104) | ||||
| 			#include "UC3/EVK1104/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_MICROPENDOUS_A) | ||||
| 			#include "AVR8/MICROPENDOUS_A/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_MICROPENDOUS_REV1) | ||||
| 			#include "AVR8/MICROPENDOUS_REV1/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_MICROPENDOUS_REV2) | ||||
| 			#include "AVR8/MICROPENDOUS_REV2/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_MICROPENDOUS_32U2) | ||||
| 			#include "AVR8/MICROPENDOUS_32U2/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_USER) | ||||
| 			#include "Board/Buttons.h" | ||||
| 		#elif (BOARD == BOARD_A3BU_XPLAINED) | ||||
| 			#include "XMEGA/A3BU_XPLAINED/Buttons.h" | ||||
| 		#else | ||||
| 			// this allows BoardSupport.h to include empty LED drivers | ||||
| 			#define BUTTONS_BUTTON1      (0 << 0) | ||||
| 			static inline void Buttons_Init(void) {}; | ||||
| 			static inline uint8_t Buttons_GetStatus(void) {return 0;}; | ||||
| 			#include "Board/Buttons.h" | ||||
| 		#endif | ||||
|  | ||||
| 	/* Pseudo-Functions for Doxygen: */ | ||||
|   | ||||
| @@ -206,30 +206,18 @@ | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				return SPI_TransferByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				SPI_SendByte(Byte); | ||||
| 			} | ||||
|  | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				return SPI_ReceiveByte(); | ||||
| 			} | ||||
|  | ||||
| 		/* Includes: */ | ||||
| 			#if (BOARD == BOARD_NONE) | ||||
| @@ -244,6 +232,8 @@ | ||||
| 				#include "AVR8/XPLAIN/Dataflash.h" | ||||
| 			#elif (BOARD == BOARD_EVK527) | ||||
| 				#include "AVR8/EVK527/Dataflash.h" | ||||
| 			#elif (BOARD == BOARD_A3BU_XPLAINED) | ||||
| 				#include "XMEGA/A3BU_XPLAINED/Dataflash.h"			 | ||||
| 			#else | ||||
| 				#include "Board/Dataflash.h" | ||||
| 			#endif | ||||
|   | ||||
| @@ -100,9 +100,7 @@ | ||||
| 		#include "../../Common/Common.h" | ||||
|  | ||||
| 		#if (BOARD == BOARD_NONE) | ||||
| 			#warning The currently selected BOARD has no Joystick so the included Joystick driver does nothing. | ||||
| 				static inline void Joystick_Init(void) { __asm__ volatile ("NOP" ::); }; | ||||
| 				static inline uint_reg_t Joystick_GetStatus(void) { return 0; }; | ||||
| 			#error The Board Joystick driver cannot be used if the makefile BOARD option is not set. | ||||
| 		#elif (BOARD == BOARD_USBKEY) | ||||
| 			#include "AVR8/USBKEY/Joystick.h" | ||||
| 		#elif (BOARD == BOARD_STK525) | ||||
|   | ||||
| @@ -107,7 +107,7 @@ | ||||
| 	/* Includes: */ | ||||
| 		#include "../../Common/Common.h" | ||||
|  | ||||
| 		#if ((BOARD == BOARD_NONE) || (BOARD == BOARD_MICROPENDOUS_A)) | ||||
| 		#if (BOARD == BOARD_NONE) | ||||
| 			static inline void LEDs_Init(void) {}; | ||||
| 			static inline void LEDs_TurnOnLEDs(const uint_reg_t LEDMask) {}; | ||||
| 			static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask) {}; | ||||
| @@ -171,49 +171,30 @@ | ||||
| 			#include "UC3/EVK1100/LEDs.h" | ||||
| 		#elif (BOARD == BOARD_EVK1104) | ||||
| 			#include "UC3/EVK1104/LEDs.h" | ||||
| 		#elif (BOARD == BOARD_MICROPENDOUS_REV1) | ||||
| 			#include "AVR8/MICROPENDOUS_REV1/LEDs.h" | ||||
| 		#elif (BOARD == BOARD_MICROPENDOUS_REV2) | ||||
| 			#include "AVR8/MICROPENDOUS_REV2/LEDs.h" | ||||
| 		#elif (BOARD == BOARD_MICROPENDOUS_32U2) | ||||
| 			#include "AVR8/MICROPENDOUS_32U2/LEDs.h" | ||||
| 		#elif (BOARD == BOARD_USER) | ||||
| 			#include "Board/LEDs.h" | ||||
| 		#elif (BOARD == BOARD_A3BU_XPLAINED) | ||||
| 			#include "XMEGA/A3BU_XPLAINED/LEDs.h" | ||||
| 		#elif (BOARD == BOARD_TEENSY2) | ||||
| 			#include "AVR8/TEENSY/LEDs.h" | ||||
| 		#else | ||||
| 			// this allows BoardSupport.h to include empty LED drivers | ||||
| 			static inline void LEDs_Init(void) {}; | ||||
| 			static inline void LEDs_TurnOnLEDs(const uint_reg_t LEDMask) {}; | ||||
| 			static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask) {}; | ||||
| 			static inline void LEDs_SetAllLEDs(const uint_reg_t LEDMask) {}; | ||||
| 			static inline void LEDs_ChangeLEDs(const uint_reg_t LEDMask, const uint_reg_t ActiveMask) {}; | ||||
| 			static inline void LEDs_ToggleLEDs(const uint_reg_t LEDMask) {}; | ||||
| 			static inline uint_reg_t LEDs_GetLEDs(void) { return 0; } | ||||
| 			#include "Board/LEDs.h" | ||||
| 		#endif | ||||
|  | ||||
| 	/* Preprocessor Checks: */ | ||||
| 		#if !defined(__DOXYGEN__) | ||||
| 			#if !defined(LEDS_LED1) | ||||
| 				#define LEDS_LED1	0 | ||||
| 				#define LEDS_LED1      0 | ||||
| 			#endif | ||||
|  | ||||
| 			#if !defined(LEDS_LED2) | ||||
| 				#define LEDS_LED2	0 | ||||
| 				#define LEDS_LED2      0 | ||||
| 			#endif | ||||
|  | ||||
| 			#if !defined(LEDS_LED3) | ||||
| 				#define LEDS_LED3	0 | ||||
| 				#define LEDS_LED3      0 | ||||
| 			#endif | ||||
|  | ||||
| 			#if !defined(LEDS_LED4) | ||||
| 				#define LEDS_LED4	0 | ||||
| 			#endif | ||||
|  | ||||
| 			#if !defined(LEDS_ALL_LEDS) | ||||
| 				#define LEDS_LED4	0 | ||||
| 			#endif | ||||
|  | ||||
| 			#if !defined(LEDS_LED4) | ||||
| 				#define LEDS_NO_LEDS	0 | ||||
| 				#define LEDS_LED4      0 | ||||
| 			#endif | ||||
| 		#endif | ||||
|  | ||||
| @@ -237,7 +218,6 @@ | ||||
| 		static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask); | ||||
|  | ||||
| 		/** Turns off all LEDs not specified in the given LED mask, and turns on all the LEDs in the given LED | ||||
|  | ||||
| 		 *  mask. | ||||
| 		 * | ||||
| 		 *  \param[in] LEDMask  Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file). | ||||
|   | ||||
| @@ -0,0 +1,103 @@ | ||||
| /* | ||||
|              LUFA Library | ||||
|      Copyright (C) Dean Camera, 2011. | ||||
|                | ||||
|   dean [at] fourwalledcubicle [dot] com | ||||
|       www.fourwalledcubicle.com | ||||
| */ | ||||
|  | ||||
| /* | ||||
|   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||||
|  | ||||
|   Permission to use, copy, modify, and distribute this software | ||||
|   and its documentation for any purpose and without fee is hereby | ||||
|   granted, provided that the above copyright notice appear in all | ||||
|   copies and that both that the copyright notice and this | ||||
|   permission notice and warranty disclaimer appear in supporting | ||||
|   documentation, and that the name of the author not be used in | ||||
|   advertising or publicity pertaining to distribution of the | ||||
|   software without specific, written prior permission. | ||||
|  | ||||
|   The author disclaim all warranties with regard to this | ||||
|   software, including all implied warranties of merchantability | ||||
|   and fitness.  In no event shall the author be liable for any | ||||
|   special, indirect or consequential damages or any damages | ||||
|   whatsoever resulting from loss of use, data or profits, whether | ||||
|   in an action of contract, negligence or other tortious action, | ||||
|   arising out of or in connection with the use or performance of | ||||
|   this software. | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  *  \brief Board specific Buttons driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  *  \copydetails Group_Buttons_A3BU_XPLAINED | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the Buttons driver | ||||
|  *        dispatch header located in LUFA/Drivers/Board/Buttons.h. | ||||
|  */ | ||||
|  | ||||
| /** \ingroup Group_Buttons | ||||
|  *  \defgroup Group_Buttons_A3BU_XPLAINED A3BU_XPLAINED | ||||
|  *  \brief Board specific Buttons driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  * | ||||
|  *  Board specific Buttons driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  * | ||||
|  *  @{ | ||||
|  */ | ||||
|   | ||||
| #ifndef __BUTTONS_A3BU_XPLAINED_H__ | ||||
| #define __BUTTONS_A3BU_XPLAINED_H__ | ||||
|  | ||||
| 	/* Includes: */ | ||||
| 		#include <avr/io.h> | ||||
|  | ||||
| 	/* Enable C linkage for C++ Compilers: */ | ||||
| 		#if defined(__cplusplus) | ||||
| 			extern "C" { | ||||
| 		#endif | ||||
|  | ||||
| 	/* Preprocessor Checks: */ | ||||
| 		#if !defined(__INCLUDE_FROM_BUTTONS_H) | ||||
| 			#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. | ||||
| 		#endif | ||||
|  | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 		/* Macros: */ | ||||
| 			/** Button mask for the first button on the board. */ | ||||
| 			#define BUTTONS_BUTTON1          (1 << 5) | ||||
|  | ||||
| 			/** Button mask for the second button on the board. */ | ||||
| 			#define BUTTONS_BUTTON2          (1 << 1) | ||||
|  | ||||
| 			/** Button mask for the third button on the board. */ | ||||
| 			#define BUTTONS_BUTTON3          (1 << 2) | ||||
|  | ||||
| 		/* Inline Functions: */ | ||||
| 		#if !defined(__DOXYGEN__) | ||||
| 			static inline void Buttons_Init(void) | ||||
| 			{ | ||||
| 				PORTE_OUTCLR = BUTTONS_BUTTON1; | ||||
| 				PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3); | ||||
| 				 | ||||
| 				PORTE_PIN5CTRL = PORT_OPC_PULLUP_gc; | ||||
| 				PORTF_PIN1CTRL = PORT_OPC_PULLUP_gc; | ||||
| 				PORTF_PIN2CTRL = PORT_OPC_PULLUP_gc; | ||||
| 			} | ||||
|  | ||||
| 			static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Buttons_GetStatus(void) | ||||
| 			{ | ||||
| 				return ((~PORTE_IN & BUTTONS_BUTTON1) | (~PORTF_IN & (BUTTONS_BUTTON2 | BUTTONS_BUTTON3))); | ||||
| 			} | ||||
| 		#endif | ||||
|  | ||||
| 	/* Disable C linkage for C++ Compilers: */ | ||||
| 		#if defined(__cplusplus) | ||||
| 			} | ||||
| 		#endif | ||||
|  | ||||
| #endif | ||||
|  | ||||
| /** @} */ | ||||
|  | ||||
|  | ||||
| @@ -29,24 +29,24 @@ | ||||
| */ | ||||
| 
 | ||||
| /** \file
 | ||||
|  *  \brief Board specific Dataflash driver header for the Atmel USBKEY. | ||||
|  *  \copydetails Group_Dataflash_USBKEY | ||||
|  *  \brief Board specific Dataflash driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  *  \copydetails Group_Dataflash_A3BU_XPLAINED | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the dataflash driver | ||||
|  *        dispatch header located in LUFA/Drivers/Board/Dataflash.h. | ||||
|  */ | ||||
| 
 | ||||
| /** \ingroup Group_Dataflash
 | ||||
|  *  \defgroup Group_Dataflash_USBKEY USBKEY | ||||
|  *  \brief Board specific Dataflash driver header for the Atmel USBKEY. | ||||
|  *  \defgroup Group_Dataflash_A3BU_XPLAINED A3BU_XPLAINED | ||||
|  *  \brief Board specific Dataflash driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  * | ||||
|  *  Board specific Dataflash driver header for the Atmel USBKEY board. | ||||
|  *  Board specific Dataflash driver header for the Atmel XMEGA A3BU Xplained board. | ||||
|  * | ||||
|  *  @{ | ||||
|  */ | ||||
| 
 | ||||
| #ifndef __DATAFLASH_USBKEY_H__ | ||||
| #define __DATAFLASH_USBKEY_H__ | ||||
| #ifndef __DATAFLASH_A3BU_XPLAINED_H__ | ||||
| #define __DATAFLASH_A3BU_XPLAINED_H__ | ||||
| 
 | ||||
| 	/* Includes: */ | ||||
| 		#include "../../../../Common/Common.h" | ||||
| @@ -60,24 +60,20 @@ | ||||
| 	/* Private Interface - For use in library only: */ | ||||
| 	#if !defined(__DOXYGEN__) | ||||
| 		/* Macros: */ | ||||
| 			#define DATAFLASH_CHIPCS_MASK                ((1 << 1) | (1 << 0)) | ||||
| 			#define DATAFLASH_CHIPCS_DDR                 DDRE | ||||
| 			#define DATAFLASH_CHIPCS_PORT                PORTE | ||||
| 			#define DATAFLASH_CHIPCS_MASK                (1 << 4) | ||||
| 			#define DATAFLASH_CHIPCS_PORT                PORTF | ||||
| 	#endif | ||||
| 
 | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 		/* Macros: */ | ||||
| 			/** Constant indicating the total number of dataflash ICs mounted on the selected board. */ | ||||
| 			#define DATAFLASH_TOTALCHIPS                 2 | ||||
| 			#define DATAFLASH_TOTALCHIPS                 1 | ||||
| 
 | ||||
| 			/** Mask for no dataflash chip selected. */ | ||||
| 			#define DATAFLASH_NO_CHIP                    DATAFLASH_CHIPCS_MASK | ||||
| 
 | ||||
| 			/** Mask for the first dataflash chip selected. */ | ||||
| 			#define DATAFLASH_CHIP1                      (1 << 1) | ||||
| 
 | ||||
| 			/** Mask for the second dataflash chip selected. */ | ||||
| 			#define DATAFLASH_CHIP2                      (1 << 0) | ||||
| 			#define DATAFLASH_CHIP1                      0 | ||||
| 
 | ||||
| 			/** Internal main memory page size for the board's dataflash ICs. */ | ||||
| 			#define DATAFLASH_PAGE_SIZE                  1024 | ||||
| @@ -91,8 +87,42 @@ | ||||
| 			 */ | ||||
| 			static inline void Dataflash_Init(void) | ||||
| 			{ | ||||
| 				DATAFLASH_CHIPCS_DDR  |= DATAFLASH_CHIPCS_MASK; | ||||
| 				DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; | ||||
| 				DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK; | ||||
| 				DATAFLASH_CHIPCS_PORT.OUTSET = DATAFLASH_CHIPCS_MASK; | ||||
| 			} | ||||
| 
 | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
 | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				// TODO
 | ||||
| 				return 0; | ||||
| 			} | ||||
| 
 | ||||
| 			/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
 | ||||
| 			 * | ||||
| 			 *  \param[in] Byte of data to send to the dataflash | ||||
| 			 */ | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SendByte(const uint8_t Byte) | ||||
| 			{ | ||||
| 				// TODO
 | ||||
| 			} | ||||
| 
 | ||||
| 			/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
 | ||||
| 			 * | ||||
| 			 *  \return Last response byte from the dataflash | ||||
| 			 */ | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_ReceiveByte(void) | ||||
| 			{ | ||||
| 				// TODO
 | ||||
| 				return 0; | ||||
| 			} | ||||
| 
 | ||||
| 			/** Determines the currently selected dataflash chip.
 | ||||
| @@ -103,7 +133,7 @@ | ||||
| 			static inline uint8_t Dataflash_GetSelectedChip(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t Dataflash_GetSelectedChip(void) | ||||
| 			{ | ||||
| 				return (DATAFLASH_CHIPCS_PORT & DATAFLASH_CHIPCS_MASK); | ||||
| 				return (DATAFLASH_CHIPCS_PORT.OUT & DATAFLASH_CHIPCS_MASK); | ||||
| 			} | ||||
| 
 | ||||
| 			/** Selects the given dataflash chip.
 | ||||
| @@ -114,7 +144,7 @@ | ||||
| 			static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE; | ||||
| 			static inline void Dataflash_SelectChip(const uint8_t ChipMask) | ||||
| 			{ | ||||
| 				DATAFLASH_CHIPCS_PORT = ((DATAFLASH_CHIPCS_PORT & ~DATAFLASH_CHIPCS_MASK) | ChipMask); | ||||
| 				DATAFLASH_CHIPCS_PORT.OUT = ((DATAFLASH_CHIPCS_PORT.OUT & ~DATAFLASH_CHIPCS_MASK) | ChipMask); | ||||
| 			} | ||||
| 
 | ||||
| 			/** Deselects the current dataflash chip, so that no dataflash is selected. */ | ||||
| @@ -0,0 +1,127 @@ | ||||
| /* | ||||
|              LUFA Library | ||||
|      Copyright (C) Dean Camera, 2011. | ||||
|                | ||||
|   dean [at] fourwalledcubicle [dot] com | ||||
|       www.fourwalledcubicle.com | ||||
| */ | ||||
|  | ||||
| /* | ||||
|   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||||
|  | ||||
|   Permission to use, copy, modify, and distribute this software | ||||
|   and its documentation for any purpose and without fee is hereby | ||||
|   granted, provided that the above copyright notice appear in all | ||||
|   copies and that both that the copyright notice and this | ||||
|   permission notice and warranty disclaimer appear in supporting | ||||
|   documentation, and that the name of the author not be used in | ||||
|   advertising or publicity pertaining to distribution of the | ||||
|   software without specific, written prior permission. | ||||
|  | ||||
|   The author disclaim all warranties with regard to this | ||||
|   software, including all implied warranties of merchantability | ||||
|   and fitness.  In no event shall the author be liable for any | ||||
|   special, indirect or consequential damages or any damages | ||||
|   whatsoever resulting from loss of use, data or profits, whether | ||||
|   in an action of contract, negligence or other tortious action, | ||||
|   arising out of or in connection with the use or performance of | ||||
|   this software. | ||||
| */ | ||||
|  | ||||
| /** \file | ||||
|  *  \brief Board specific LED driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  *  \copydetails Group_LEDs_A3BU_XPLAINED | ||||
|  * | ||||
|  *  \note This file should not be included directly. It is automatically included as needed by the LEDs driver | ||||
|  *        dispatch header located in LUFA/Drivers/Board/LEDs.h. | ||||
|  */ | ||||
|  | ||||
| /** \ingroup Group_LEDs | ||||
|  *  \defgroup Group_LEDs_A3BU_XPLAINED A3BU_XPLAINED | ||||
|  *  \brief Board specific LED driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  * | ||||
|  *  Board specific LED driver header for the Atmel XMEGA A3BU Xplained. | ||||
|  * | ||||
|  *  @{ | ||||
|  */ | ||||
|  | ||||
| #ifndef __LEDS_A3BU_XPLAINED_H__ | ||||
| #define __LEDS_A3BU_XPLAINED_H__ | ||||
|  | ||||
| 	/* Includes: */ | ||||
| 		#include <avr/io.h> | ||||
|  | ||||
| 	/* Enable C linkage for C++ Compilers: */ | ||||
| 		#if defined(__cplusplus) | ||||
| 			extern "C" { | ||||
| 		#endif | ||||
|  | ||||
| 	/* Preprocessor Checks: */ | ||||
| 		#if !defined(__INCLUDE_FROM_LEDS_H) | ||||
| 			#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. | ||||
| 		#endif | ||||
|  | ||||
| 	/* Public Interface - May be used in end-application: */ | ||||
| 		/* Macros: */ | ||||
| 			/** LED mask for the first LED on the board. */ | ||||
| 			#define LEDS_LED1        (1 << 0) | ||||
|  | ||||
| 			/** LED mask for the second LED on the board. */ | ||||
| 			#define LEDS_LED2        (1 << 1) | ||||
|  | ||||
| 			/** LED mask for all the LEDs on the board. */ | ||||
| 			#define LEDS_ALL_LEDS    (LEDS_LED1 | LEDS_LED2) | ||||
|  | ||||
| 			/** LED mask for none of the board LEDs. */ | ||||
| 			#define LEDS_NO_LEDS     0 | ||||
|  | ||||
| 		/* Inline Functions: */ | ||||
| 		#if !defined(__DOXYGEN__) | ||||
| 			static inline void LEDs_Init(void) | ||||
| 			{ | ||||
| 				PORTR_DIRSET = LEDS_ALL_LEDS; | ||||
| 				PORTR_OUTSET = LEDS_ALL_LEDS; | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) | ||||
| 			{ | ||||
| 				PORTR_OUTCLR = LEDMask; | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) | ||||
| 			{ | ||||
| 				PORTR_OUTSET = LEDMask; | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) | ||||
| 			{ | ||||
| 				PORTR_OUT = (PORTR.OUT & ~LEDS_ALL_LEDS) | LEDMask; | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) | ||||
| 			{ | ||||
| 				PORTR_OUT = (PORTR.OUT & ~LEDMask) | ActiveMask; | ||||
| 			} | ||||
|  | ||||
| 			static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) | ||||
| 			{ | ||||
| 				PORTR_OUTTGL = LEDMask; | ||||
| 			} | ||||
|  | ||||
| 			static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; | ||||
| 			static inline uint8_t LEDs_GetLEDs(void) | ||||
| 			{ | ||||
| 				return (PORTR_OUT & LEDS_ALL_LEDS); | ||||
| 			} | ||||
| 		#endif | ||||
|  | ||||
| 	/* Disable C linkage for C++ Compilers: */ | ||||
| 		#if defined(__cplusplus) | ||||
| 			} | ||||
| 		#endif | ||||
|  | ||||
| #endif | ||||
|  | ||||
| /** @} */ | ||||
|  | ||||
|  | ||||
| @@ -79,7 +79,7 @@ | ||||
| 				#define ANSI_ESCAPE_SEQUENCE(EscapeSeq) | ||||
| 			#endif | ||||
|  | ||||
| 			/** \name Text Display Modifier Escape Sequences */ | ||||
| 			/** \name Text Display Modifier Control Sequences */ | ||||
| 			//@{ | ||||
| 			/** Turns on bold so that any following text is printed to the terminal in bold. */ | ||||
| 			#define ESC_BOLD_ON                     ANSI_ESCAPE_SEQUENCE("1m") | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user