├── tools ├── pytools │ ├── card.txt │ ├── terminal.txt │ ├── atcmds.py │ └── utils.py ├── README └── lufa_cdc_driver_windows.inf ├── avrsrc ├── LUFA │ ├── ManPages │ │ ├── LUFA.png │ │ ├── Author.jpg │ │ ├── ChangeLog.txt │ │ ├── Groups.txt │ │ ├── AboutLUFA.txt │ │ ├── DevelopingWithLUFA.txt │ │ ├── LicenseInfo.txt │ │ ├── Donating.txt │ │ ├── LibraryResources.txt │ │ ├── BuildingLinkableLibraries.txt │ │ ├── GettingStarted.txt │ │ ├── DeviceSupport.txt │ │ ├── WritingBoardDrivers.txt │ │ ├── ProgrammingApps.txt │ │ ├── FutureChanges.txt │ │ ├── CompilingApps.txt │ │ ├── WhyUseLUFA.txt │ │ ├── SoftwareBootloaderJump.txt │ │ ├── MainPage.txt │ │ └── LUFAvsAtmelStack.txt │ ├── CodeTemplates │ │ ├── makefile_template │ │ └── DriverStubs │ │ │ ├── Buttons.h │ │ │ └── Joystick.h │ ├── License.txt │ ├── Drivers │ │ ├── USB │ │ │ ├── HighLevel │ │ │ │ ├── Template │ │ │ │ │ ├── Template_Endpoint_Control_R.c │ │ │ │ │ ├── Template_Endpoint_Control_W.c │ │ │ │ │ ├── Template_Endpoint_RW.c │ │ │ │ │ └── Template_Pipe_RW.c │ │ │ │ ├── Events.c │ │ │ │ ├── USBTask.c │ │ │ │ └── StreamCallbacks.h │ │ │ ├── LowLevel │ │ │ │ └── Device.c │ │ │ └── Class │ │ │ │ ├── Audio.h │ │ │ │ ├── StillImage.h │ │ │ │ ├── CDC.h │ │ │ │ ├── RNDIS.h │ │ │ │ ├── MassStorage.h │ │ │ │ ├── HID.h │ │ │ │ ├── Printer.h │ │ │ │ ├── Device │ │ │ │ └── Audio.c │ │ │ │ └── MIDI.h │ │ ├── Peripheral │ │ │ ├── TWI.c │ │ │ ├── Serial.c │ │ │ ├── SerialStream.c │ │ │ ├── ADC.h │ │ │ └── TWI.h │ │ └── Board │ │ │ ├── Temperature.c │ │ │ ├── USBKEY │ │ │ └── Buttons.h │ │ │ ├── MINIMUS │ │ │ └── Buttons.h │ │ │ ├── UDIP │ │ │ └── Buttons.h │ │ │ ├── ATAVRUSBRF01 │ │ │ └── Buttons.h │ │ │ ├── CULV3 │ │ │ └── Buttons.h │ │ │ ├── BENITO │ │ │ └── Buttons.h │ │ │ ├── JMDBU2 │ │ │ └── Buttons.h │ │ │ ├── USBTINYMKII │ │ │ └── Buttons.h │ │ │ ├── MICROSIN162 │ │ │ └── Buttons.h │ │ │ ├── USBFOO │ │ │ └── Buttons.h │ │ │ ├── OLIMEX162 │ │ │ └── Buttons.h │ │ │ ├── EVK527 │ │ │ └── Buttons.h │ │ │ ├── STK525 │ │ │ └── Buttons.h │ │ │ ├── STK526 │ │ │ ├── Buttons.h │ │ │ └── Joystick.h │ │ │ └── BUMBLEB │ │ │ └── Buttons.h │ ├── Version.h │ ├── Scheduler │ │ └── Scheduler.c │ └── makefile ├── lufa_usb_virtual_serial │ ├── makefile │ ├── VirtualSerial.txt │ ├── VirtualSerial.h │ ├── Descriptors.h │ ├── Board │ │ └── Buttons.h │ └── LUFA VirtualSerial.inf ├── ISSUES ├── counter.h ├── scd.S ├── utils.h ├── CHANGELOG ├── emv_values.h ├── scd_hal.S ├── scd_values.h ├── scd.h └── serial.h └── README /tools/pytools/card.txt: -------------------------------------------------------------------------------- 1 | 6500002063CB6600 2 | 6A82 3 | 0000000000 4 | 5 | -------------------------------------------------------------------------------- /tools/pytools/terminal.txt: -------------------------------------------------------------------------------- 1 | 00A4040007A0000000048002 2 | 80A80000028300 3 | 0000000000 4 | 5 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/LUFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchoudary/smartcarddetective/HEAD/avrsrc/LUFA/ManPages/LUFA.png -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/Author.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchoudary/smartcarddetective/HEAD/avrsrc/LUFA/ManPages/Author.jpg -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/ChangeLog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchoudary/smartcarddetective/HEAD/avrsrc/LUFA/ManPages/ChangeLog.txt -------------------------------------------------------------------------------- /avrsrc/lufa_usb_virtual_serial/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchoudary/smartcarddetective/HEAD/avrsrc/lufa_usb_virtual_serial/makefile -------------------------------------------------------------------------------- /avrsrc/LUFA/CodeTemplates/makefile_template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mchoudary/smartcarddetective/HEAD/avrsrc/LUFA/CodeTemplates/makefile_template -------------------------------------------------------------------------------- /tools/README: -------------------------------------------------------------------------------- 1 | This folder contains tools useful in combination with the SCD. 2 | 3 | Currently there are the following tools: 4 | - pytools/: several python scripts useful in using the SCD and 5 | visualising the EEPROM data. 6 | See pytools/README for more details. 7 | - lufa_cdc_driver_windows.inf: driver needed for the Virtual Serial to work in Windows. 8 | If you are using Windows you should install this driver to communicate with the 9 | SCD after selecting the Virtual Serial application. 10 | 11 | -------------------------------------------------------------------------------- /tools/pytools/atcmds.py: -------------------------------------------------------------------------------- 1 | 2 | class AT_CMD: 3 | """Defines the AT Commands used for serial communications with the SCD""" 4 | AT_NONE = 'AT+CNONE\r\n' 5 | AT_CRST = 'AT+CRST\r\n' 6 | AT_CTERM = 'AT+CTERM\r\n' 7 | AT_CTUSB = 'AT+CTUSB\r\n' 8 | AT_CLET = 'AT+CLET\r\n' 9 | AT_CDPIN = 'AT+CDPIN\r\n' 10 | AT_CGEE = 'AT+CGEE\r\n' 11 | AT_CEEE = 'AT+CEEE\r\n' 12 | AT_CGBM = 'AT+CGBM\r\n' 13 | AT_CCINIT = 'AT+CCINIT\r\n' 14 | AT_CCAPDU = 'AT+CCAPDU\r\n' 15 | AT_CTWAIT = 'AT+CTWAIT\r\n' 16 | AT_CUDATA = 'AT+UDATA\r\n' 17 | AT_CCEND = 'AT+CCEND\r\n' 18 | 19 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/Groups.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** @defgroup Group_BoardDrivers Board Drivers 8 | * 9 | * Functions, macros, variables, enums and types related to the control of physical board hardware. 10 | */ 11 | 12 | /** @defgroup Group_PeripheralDrivers On-chip Peripheral Drivers 13 | * 14 | * Functions, macros, variables, enums and types related to the control of AVR subsystems. 15 | */ 16 | 17 | /** @defgroup Group_MiscDrivers Miscellaneous Drivers 18 | * 19 | * Miscellaneous driver Functions, macros, variables, enums and types. 20 | */ 21 | 22 | -------------------------------------------------------------------------------- /avrsrc/ISSUES: -------------------------------------------------------------------------------- 1 | Known issues for The Smart Card Detective. 2 | 3 | Author: Omar Choudary (omar.choudary@cl.cam.ac.uk) 4 | Copyright @ 2013 5 | 6 | Current software version: 2.4.2 7 | 8 | Issue 1: There is no implementation for the T=1 communication protocol. 9 | I just don't have time to do that yet. Any volunteers welcome. 10 | 11 | Issue 2: Some readers (e.g. Barclays CAP reader) do not properly deactivate 12 | the smartcard contacts. The current implementation of the SCD waits forever 13 | for a terminal reset when using the ForwardData app. 14 | Current solution: disconnect and re-connect the reader to complete the 15 | data recording. 16 | 17 | Issue 3: Need to rewrite SendHostData method so that it automatically adds the return characters and makes the buffer copy. 18 | 19 | 20 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/AboutLUFA.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_AboutLUFA About LUFA 9 | * 10 | * This section of the manual contains information about the library as a whole, including its supported targets, 11 | * past and planned changes, and links to other projects incorporating LUFA. 12 | * 13 | * Subsections: 14 | * \li \subpage Page_DeviceSupport - Current Device and Hardware Support 15 | * \li \subpage Page_Resources - LUFA and USB Related Resources 16 | * \li \subpage Page_ChangeLog - Project Changelog 17 | * \li \subpage Page_FutureChanges - Planned Changes to the Library 18 | * \li \subpage Page_LUFAPoweredProjects - Other Projects Using LUFA 19 | */ 20 | 21 | -------------------------------------------------------------------------------- /tools/pytools/utils.py: -------------------------------------------------------------------------------- 1 | import platform 2 | import string 3 | 4 | ## Windows PCSC compatibility flag 5 | if platform.system() in [ 'Windows', 'Microsoft' ]: 6 | windows = True 7 | else: 8 | windows = False 9 | 10 | def fixPathForPlatform(path): 11 | if not path: return None 12 | 13 | '''fixes up a path to be appropriate for the platform''' 14 | if windows: 15 | return path.replace('/','\\') 16 | else: 17 | return path.replace('\\','/') 18 | 19 | UTILS_valid_ascii = string.digits + \ 20 | string.letters + \ 21 | string.punctuation 22 | 23 | def to_ascii(s,short=False): 24 | l=[] 25 | for c in s: 26 | if c in UTILS_valid_ascii: 27 | l.append(c) 28 | if not short: l.append(' ') 29 | else: 30 | l.append(".") 31 | if not short: l.append('.') 32 | return "".join(l) 33 | -------------------------------------------------------------------------------- /avrsrc/LUFA/License.txt: -------------------------------------------------------------------------------- 1 | Permission to use, copy, modify, and distribute this software 2 | and its documentation for any purpose is hereby granted without 3 | fee, provided that the above copyright notice appear in all 4 | copies and that both that the copyright notice and this 5 | permission notice and warranty disclaimer appear in supporting 6 | documentation, and that the name of the author not be used in 7 | advertising or publicity pertaining to distribution of the 8 | software without specific, written prior permission. 9 | 10 | The author disclaim all warranties with regard to this 11 | software, including all implied warranties of merchantability 12 | and fitness. In no event shall the author be liable for any 13 | special, indirect or consequential damages or any damages 14 | whatsoever resulting from loss of use, data or profits, whether 15 | in an action of contract, negligence or other tortious action, 16 | arising out of or in connection with the use or performance of 17 | this software. 18 | 19 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/DevelopingWithLUFA.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_DevelopingWithLUFA Developing With LUFA 9 | * 10 | * This section of the manual contains information on LUFA development, such as Getting Started information, 11 | * information on compile-time tuning of the library and other developer-related sections. 12 | * 13 | * Subsections: 14 | * \li \subpage Page_TokenSummary - Summary of Compile Time Tokens 15 | * \li \subpage Page_Migration - Migrating from an Older LUFA Version 16 | * \li \subpage Page_VIDPID - Allocated USB VID and PID Values 17 | * \li \subpage Page_BuildLibrary - Building as a Linkable Library 18 | * \li \subpage Page_WritingBoardDrivers - How to Write Custom Board Drivers 19 | * \li \subpage Page_SoftwareBootloaderStart - How to jump to the bootloader in software 20 | */ 21 | 22 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/LicenseInfo.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_LicenseInfo Source Code License 9 | * 10 | * The LUFA library is currently released under the MIT license, included below. 11 | * 12 | * Commercial entities can opt out of the public disclosure clause in this license 13 | * for a one-time US$1500 payment. This provides a non-exclusive modified MIT licensed which 14 | * allows for the free use of the LUFA library, bootloaders and (where the sole copyright 15 | * is attributed to Dean Camera) demos without public disclosure within an organization, in 16 | * addition to three free hours of consultation with the library author, and priority support. 17 | * Please visit the Commercial License link on \ref Page_Resources for more information on 18 | * ordering a commercial license for your company. 19 | * 20 | * \verbinclude License.txt 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | The files provided along with this README are part of the Smart Card Detective 2 | (SCD). The SCD is meant to provide an open framework for EMV research and digital 3 | forensics, enabling users to analyze transactions. 4 | 5 | LICENSE 6 | The software is given under the 2-clause BSD (new BSD, or FreeBSD) license: 7 | http://www.opensource.org/licenses/bsd-license.php 8 | 9 | VERSION 10 | Current version of the software is 2.5.0. 11 | Last updated: August 2013. 12 | 13 | SCD SOFTWARE 14 | 15 | The software for the SCD board is located in the avrsrc/ folder. Please see the 16 | avrsrc/README for information about how to build, program and debug the SCD 17 | application. 18 | 19 | SCD TOOLS 20 | There are several tools useful for use with the SCD in the tools/ folder. 21 | Please see the tools/README file for more information. 22 | 23 | DOCUMENTATION 24 | For more information about the software and how to get the SCD check the forum 25 | of the Smart Card Detective at: 26 | http://www.smartcarddetective.com/forum/ 27 | 28 | Copyright (C) Omar Choudary (omar.choudary@cl.cam.ac.uk) 29 | http://cl.cam.ac.uk/~osc22/scd/ 30 | 31 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/Donating.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_Donating Donating to Support This Project 9 | * 10 | * \image html Author.jpg "Dean Camera, LUFA Developer" 11 | * 12 | * I am a 21 year old University student studying for a double degree in Computer Science and Electronics Engineering. 13 | * The development and support of this library requires much effort from myself, as I am the sole developer, maintainer 14 | * and supporter. Please consider donating a small amount to support this and my future Open Source projects - All 15 | * donations are greatly appreciated. 16 | * 17 | * Note that commercial entities can remove the attribution portion of the LUFA license by a one-time fee - see 18 | * \ref Page_LicenseInfo for more details (Note: Please do NOT pay this in advance through the donation link below - 19 | * contact author for payment details.). 20 | * 21 | * \image html "http://www.pledgie.com/campaigns/6927.png?skin_name=chrome" 22 | * Donate to this project via PayPal - Thanks in Advance! 23 | */ 24 | 25 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/LibraryResources.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_Resources Library Resources 9 | * 10 | * \section Sec_ProjectPages LUFA Related Webpages 11 | * Project Homepage: http://www.lufa-lib.org \n 12 | * Commercial Licenses: http://www.lufa-lib.org/license \n 13 | * Author's Website: http://www.fourwalledcubicle.com \n 14 | * Development Blog: http://www.fourwalledcubicle.com/blog \n 15 | * 16 | * \section Sec_ProjectHelp Assistance With LUFA 17 | * Discussion Group: http://www.lufa-lib.org/support \n 18 | * Author's Email: dean [at] fourwalledcubicle [dot] com 19 | * Author's Skype: abcminiuser 20 | * 21 | * \section Sec_InDevelopment Latest In-Development Source Code 22 | * Issue Tracker: http://www.lufa-lib.org/tracker \n 23 | * Bazaar Access: http://www.lufa-lib.org/bzr \n 24 | * SVN Access: http://www.lufa-lib.org/svn \n 25 | * Git Access: http://www.lufa-lib.org/git \n 26 | * Latest Repository Source Archive: http://www.lufa-lib.org/latest-archive \n 27 | * Commit RSS Feed: http://www.lufa-lib.org/rss \n 28 | * 29 | * \section Sec_USBResources USB Resources 30 | * USB-IF Website: http://www.usb.org \n 31 | */ 32 | 33 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/BuildingLinkableLibraries.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_BuildLibrary Building as a Linkable Library 8 | * 9 | * The LUFA library can be built as a proper linkable library (with the extention .a) under AVR-GCC, so that 10 | * the library does not need to be recompiled with each revision of a user project. Instructions for creating 11 | * a library from a given source tree can be found in the AVR-GCC user manual included in the WinAVR install 12 | * /Docs/ directory. 13 | * 14 | * However, building the library is not recommended, as the static (compile-time) options will be 15 | * unable to be changed without a recompilation of the LUFA code. Therefore, if the library is to be built 16 | * from the LUFA source, it should be made to be application-specific and compiled with the static options 17 | * that are required for each project (which should be recorded along with the library). 18 | * 19 | * Normal library use has the library components compiled in at the same point as the application code, as 20 | * demonstrated in the library demos and applications. This is the preferred method, as the library is recompiled 21 | * each time to ensure that all static options for a particular application are applied. 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_R.c: -------------------------------------------------------------------------------- 1 | uint8_t TEMPLATE_FUNC_NAME (void* Buffer, 2 | uint16_t Length) 3 | { 4 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 5 | 6 | if (!(Length)) 7 | Endpoint_ClearOUT(); 8 | 9 | while (Length) 10 | { 11 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 12 | 13 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 14 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 15 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 16 | return ENDPOINT_RWCSTREAM_BusSuspended; 17 | else if (Endpoint_IsSETUPReceived()) 18 | return ENDPOINT_RWCSTREAM_HostAborted; 19 | 20 | if (Endpoint_IsOUTReceived()) 21 | { 22 | while (Length && Endpoint_BytesInEndpoint()) 23 | { 24 | TEMPLATE_TRANSFER_BYTE(DataStream); 25 | Length--; 26 | } 27 | 28 | Endpoint_ClearOUT(); 29 | } 30 | } 31 | 32 | while (!(Endpoint_IsINReady())) 33 | { 34 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 35 | 36 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 37 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 38 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 39 | return ENDPOINT_RWCSTREAM_BusSuspended; 40 | } 41 | 42 | return ENDPOINT_RWCSTREAM_NoError; 43 | } 44 | 45 | 46 | #undef TEMPLATE_BUFFER_OFFSET 47 | #undef TEMPLATE_FUNC_NAME 48 | #undef TEMPLATE_TRANSFER_BYTE 49 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/HighLevel/Events.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_EVENTS_C 32 | #define __INCLUDE_FROM_USB_DRIVER 33 | #include "Events.h" 34 | 35 | void USB_Event_Stub(void) 36 | { 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /avrsrc/counter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Omar Choudary 3 | * 4 | * File used to combine both C and assembler to use a relative timer/counter. 5 | * 6 | * Hepful hints provided by Joerg Wunsch: 7 | * http://www.nongnu.org/avr-libc/user-manual/group__asmdemo.html 8 | * 9 | * --------------------------------------------------------------------------- 10 | * "THE BEER-WARE LICENSE" (Revision 42): 11 | * Joerg Wunsch wrote this file. As long as you retain this notice you 12 | * can do whatever you want with this stuff. If we meet some day, and you think 13 | * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch 14 | * --------------------------------------------------------------------------- 15 | */ 16 | 17 | #ifndef _COUNTER_H_ 18 | #define _COUNTER_H_ 19 | 20 | /* 21 | * Global register variables. 22 | */ 23 | #ifdef __ASSEMBLER__ 24 | 25 | // Syncronization counter, 32 bit value accessed through 4 CONSECUTIVE registers 26 | // In the code, these values should be loaded using the C global variable as follows 27 | # define counter_b0 r18 28 | # define counter_b1 r19 29 | # define counter_b2 r20 30 | # define counter_b3 r21 31 | 32 | // Variables used in asm subroutines to store temporary values 33 | # define counter_inc r26 34 | # define counter_sreg r27 35 | 36 | #else /* !ASSEMBLER */ 37 | 38 | #include 39 | 40 | volatile uint32_t counter_t2; // this will be updated and used in both C and asm code 41 | #define counter_res_us 1024 // each counter unit represents 1024 micro-seconds 42 | #define SYNC_COUNTER_SIZE (sizeof(counter_t2)) // size of counter variable in bytes 43 | 44 | #endif /* ASSEMBLER */ 45 | 46 | #endif // _COUNTER_H_ 47 | 48 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Peripheral/TWI.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) Dean Camera, 2010. 3 | 4 | dean [at] fourwalledcubicle [dot] com 5 | www.lufa-lib.org 6 | */ 7 | 8 | #include "TWI.h" 9 | 10 | bool TWI_StartTransmission(const uint8_t SlaveAddress, 11 | const uint8_t TimeoutMS) 12 | { 13 | for (;;) 14 | { 15 | bool BusCaptured = false; 16 | uint16_t TimeoutRemaining; 17 | 18 | TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN)); 19 | 20 | TimeoutRemaining = (TimeoutMS * 100); 21 | while (TimeoutRemaining-- && !(BusCaptured)) 22 | { 23 | if (TWCR & (1 << TWINT)) 24 | { 25 | switch (TWSR & TW_STATUS_MASK) 26 | { 27 | case TW_START: 28 | case TW_REP_START: 29 | BusCaptured = true; 30 | break; 31 | case TW_MT_ARB_LOST: 32 | TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN)); 33 | continue; 34 | default: 35 | TWCR = (1 << TWEN); 36 | return false; 37 | } 38 | } 39 | 40 | _delay_us(10); 41 | } 42 | 43 | if (!(BusCaptured)) 44 | { 45 | TWCR = (1 << TWEN); 46 | return false; 47 | } 48 | 49 | TWDR = SlaveAddress; 50 | TWCR = ((1 << TWINT) | (1 << TWEN)); 51 | 52 | TimeoutRemaining = (TimeoutMS * 100); 53 | while (TimeoutRemaining--) 54 | { 55 | if (TWCR & (1 << TWINT)) 56 | break; 57 | 58 | _delay_us(10); 59 | } 60 | 61 | if (!(TimeoutRemaining)) 62 | return false; 63 | 64 | switch (TWSR & TW_STATUS_MASK) 65 | { 66 | case TW_MT_SLA_ACK: 67 | case TW_MR_SLA_ACK: 68 | return true; 69 | default: 70 | TWCR = ((1 << TWINT) | (1 << TWSTO) | (1 << TWEN)); 71 | return false; 72 | } 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/GettingStarted.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_GettingStarted Getting Started 8 | * 9 | * Out of the box, LUFA contains a large number of pre-made class demos for you to test, experiment with and 10 | * ultimately build upon for your own projects. All the demos (where possible) come pre-configured to build and 11 | * run correctly on the AT90USB1287 AVR microcontroller, mounted on the Atmel USBKEY board and running at an 8MHz 12 | * master clock. This is due to two reasons; one, it is the hardware the author possesses, and two, it is the most 13 | * popular Atmel USB demonstration board to date. To learn how to reconfigure, recompile and program the included 14 | * LUFA applications using different settings, see the subsections below. 15 | * 16 | * Most of the included demos in the /Demos/ folder come in both ClassDriver and LowLevel varieties. If you are new 17 | * to LUFA, it is highly recommended that you look at the ClassDriver versions first, which use the pre-made USB 18 | * Class Drivers (\ref Group_USBClassDrivers) to simplify the use of the standard USB classes in user applications. 19 | * 20 | * For an overview of the included library applications, bootloaders and demos, see \ref Page_LibraryApps. 21 | * 22 | * Subsections: 23 | * \li \subpage Page_ConfiguringApps - How to Configure the Included Demos, Projects and Bootloaders 24 | * \li \subpage Page_CompilingApps - How to Compile the Included Demos, Projects and Bootloaders 25 | * \li \subpage Page_ProgrammingApps - How to Program an AVR with the Included Demos, Projects and Bootloaders 26 | */ 27 | 28 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/LowLevel/Device.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../HighLevel/USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_DEVICE) 35 | 36 | #include "Device.h" 37 | 38 | void USB_Device_SendRemoteWakeup(void) 39 | { 40 | if (!(USB_Options & USB_OPT_MANUAL_PLL)) 41 | { 42 | USB_PLL_On(); 43 | while (!(USB_PLL_IsReady())); 44 | } 45 | 46 | USB_CLK_Unfreeze(); 47 | 48 | UDCON |= (1 << RMWKUP); 49 | while (!(UDCON & (1 << RMWKUP))); 50 | } 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /avrsrc/scd.S: -------------------------------------------------------------------------------- 1 | // Assembler file for the main program of the Smartcard Defender 2 | // 3 | // This file should contain functions such as intrerrupt handlers that 4 | // may be better done in assembler for efficiency of speed and space 5 | // 6 | // Author: Omar Choudary 7 | // 8 | // for information see: 9 | // http://www.nongnu.org/avr-libc/user-manual/group__asmdemo.html 10 | 11 | #include 12 | 13 | #include "counter.h" 14 | 15 | 16 | /* 17 | * Timer 2 COMPA hit. 18 | * Used to update our sync counter. 19 | * The variable counter (see counter.h) can be accessed in 20 | * C code, and is stored as 32-bit integer little-endian. 21 | */ 22 | .global TIMER2_COMPA_vect 23 | TIMER2_COMPA_vect: 24 | push counter_sreg ; used for SREG 25 | in counter_sreg, _SFR_IO_ADDR(SREG) ; save SREG 26 | cli ; disable interrupts 27 | push counter_b0 28 | push counter_b1 29 | push counter_b2 30 | push counter_b3 31 | push counter_inc 32 | push r30 33 | push r31 34 | 35 | ldi r30, lo8(counter_t2) 36 | ldi r31, hi8(counter_t2) 37 | ld counter_b0, Z 38 | ldd counter_b1, Z+1 39 | ldd counter_b2, Z+2 40 | ldd counter_b3, Z+3 41 | ldi counter_inc, 1 ; use to increment with carry 42 | add counter_b0, counter_inc 43 | adc counter_b1, r1 44 | adc counter_b2, r1 45 | adc counter_b3, r1 46 | st Z, counter_b0 47 | std Z+1, counter_b1 48 | std Z+2, counter_b2 49 | std Z+3, counter_b3 50 | 51 | pop r31 52 | pop r30 53 | pop counter_inc 54 | pop counter_b3 55 | pop counter_b2 56 | pop counter_b1 57 | pop counter_b0 58 | 59 | out _SFR_IO_ADDR(SREG), counter_sreg 60 | pop counter_sreg 61 | reti 62 | 63 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Peripheral/Serial.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "Serial.h" 32 | 33 | void Serial_TxString_P(const char* FlashStringPtr) 34 | { 35 | uint8_t CurrByte; 36 | 37 | while ((CurrByte = pgm_read_byte(FlashStringPtr)) != 0x00) 38 | { 39 | Serial_TxByte(CurrByte); 40 | FlashStringPtr++; 41 | } 42 | } 43 | 44 | void Serial_TxString(const char* StringPtr) 45 | { 46 | uint8_t CurrByte; 47 | 48 | while ((CurrByte = *StringPtr) != 0x00) 49 | { 50 | Serial_TxByte(CurrByte); 51 | StringPtr++; 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_W.c: -------------------------------------------------------------------------------- 1 | uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, 2 | uint16_t Length) 3 | { 4 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 5 | bool LastPacketFull = false; 6 | 7 | if (Length > USB_ControlRequest.wLength) 8 | Length = USB_ControlRequest.wLength; 9 | else if (!(Length)) 10 | Endpoint_ClearIN(); 11 | 12 | while (Length || LastPacketFull) 13 | { 14 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 15 | 16 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 17 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 18 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 19 | return ENDPOINT_RWCSTREAM_BusSuspended; 20 | else if (Endpoint_IsSETUPReceived()) 21 | return ENDPOINT_RWCSTREAM_HostAborted; 22 | else if (Endpoint_IsOUTReceived()) 23 | break; 24 | 25 | if (Endpoint_IsINReady()) 26 | { 27 | uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); 28 | 29 | while (Length && (BytesInEndpoint < USB_ControlEndpointSize)) 30 | { 31 | TEMPLATE_TRANSFER_BYTE(DataStream); 32 | Length--; 33 | BytesInEndpoint++; 34 | } 35 | 36 | LastPacketFull = (BytesInEndpoint == USB_ControlEndpointSize); 37 | Endpoint_ClearIN(); 38 | } 39 | } 40 | 41 | while (!(Endpoint_IsOUTReceived())) 42 | { 43 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 44 | 45 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 46 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 47 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 48 | return ENDPOINT_RWCSTREAM_BusSuspended; 49 | } 50 | 51 | return ENDPOINT_RWCSTREAM_NoError; 52 | } 53 | 54 | #undef TEMPLATE_BUFFER_OFFSET 55 | #undef TEMPLATE_FUNC_NAME 56 | #undef TEMPLATE_TRANSFER_BYTE 57 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Peripheral/SerialStream.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_SERIALSTREAM_C 32 | #include "SerialStream.h" 33 | 34 | FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW); 35 | 36 | static int SerialStream_TxByte(char DataByte, 37 | FILE *Stream) 38 | { 39 | (void)Stream; 40 | 41 | Serial_TxByte(DataByte); 42 | return 0; 43 | } 44 | 45 | static int SerialStream_RxByte(FILE *Stream) 46 | { 47 | (void)Stream; 48 | 49 | if (!(Serial_IsCharReceived())) 50 | return _FDEV_EOF; 51 | 52 | return Serial_RxByte(); 53 | } 54 | 55 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/DeviceSupport.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_DeviceSupport Device and Hardware Support 9 | * 10 | * Currently supported AVR models: 11 | * - AT90USB82 (USB Device Only) 12 | * - ATMEGA8U2 (USB Device Only) 13 | * - AT90USB162 (USB Device Only) 14 | * - ATMEGA16U2 (USB Device Only) 15 | * - ATMEGA16U4 (USB Device Only) 16 | * - ATMEGA32U2 (USB Device Only) 17 | * - ATMEGA32U4 (USB Device Only) 18 | * - ATMEGA32U6 (USB Device Only) 19 | * - AT90USB646 (USB Device Only) 20 | * - AT90USB647 (USB Host and Device) 21 | * - AT90USB1286 (USB Device Only) 22 | * - AT90USB1287 (USB Host and Device) 23 | * 24 | * Currently supported Atmel boards (see \ref Group_BoardTypes): 25 | * - AT90USBKEY 26 | * - ATAVRUSBRF01 27 | * - EVK527 28 | * - RZUSBSTICK 29 | * - STK525 30 | * - STK526 31 | * - XPLAIN (Both original first revision board, and newer boards with a different Dataflash model) 32 | * 33 | * Currently supported third-party boards (see \ref Group_BoardTypes for makefile BOARD constant names): 34 | * - Adafruit U4 Breakout Board 35 | * - Arduino Uno 36 | * - Busware BUI 37 | * - Busware CUL V3 38 | * - Fletchtronics Bumble-B (using officially recommended peripheral layout) 39 | * - Kernel Concepts USBFOO 40 | * - Linnix UDIP 41 | * - MattairTech JM-DB-U2 42 | * - Maximus USB 43 | * - Minimus USB 44 | * - Olimex AVR-USB-162 45 | * - PJRC Teensy (all revisions and versions) 46 | * - TCNISO Blackcat USB JTAG 47 | * - Tempusdictum Benito 48 | * - Tom's USBTINY-MKII (all revisions and versions) 49 | * - Any Other Custom User Boards (with Board Drivers if desired, see \ref Page_WritingBoardDrivers) 50 | */ 51 | 52 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/WritingBoardDrivers.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_WritingBoardDrivers Writing LUFA Board Drivers 8 | * 9 | * LUFA ships with several basic pre-made board drivers, to control hardware present on the supported board 10 | * hardware - such as Dataflash ICs, LEDs, Joysticks, or other hardware peripherals. When compiling an application 11 | * which makes use of one or more board drivers located in LUFA/Drivers/Board, you must also indicate what board 12 | * hardware you are using in your project makefile. This is done by defining the BOARD macro using the -D switch 13 | * passed to the compiler, with a constant of BOARD_{Name}. For example -DBOARD=BOARD_USBKEY instructs the 14 | * compiler to use the USBKEY board hardware drivers. 15 | * 16 | * If your application does not use *any* board level drivers, you can omit the definition of the BOARD macro. 17 | * However, some users may wish to write their own custom board hardware drivers which are to remain compatible 18 | * with the LUFA hardware API. To do this, the BOARD macro should be defined to the value BOARD_USER. This indicates 19 | * that the board level drivers should be located in a folder named "Board" located inside the application's folder. 20 | * 21 | * When used, the driver stub files located in the LUFA/CodeTemplates/DriverStubs folder should be copied to the user 22 | * Board/ directory, and fleshed out to include the values and code needed to control the custom board hardware. Once 23 | * done, the existing LUFA board level APIs (accessed in the regular LUFA/Drivers/Board/ folder) will redirect to the 24 | * user board drivers, maintaining code compatibility and allowing for a different board to be selected through the 25 | * project makefile with no code changes. 26 | */ 27 | 28 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Version.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * \brief LUFA library version constants. 34 | * 35 | * Version constants for informational purposes and version-specific macro creation. This header file contains the 36 | * current LUFA version number in several forms, for use in the user-application (for example, for printing out 37 | * whilst debugging, or for testing for version compatibility). 38 | */ 39 | 40 | #ifndef __LUFA_VERSION_H__ 41 | #define __LUFA_VERSION_H__ 42 | 43 | /* Public Interface - May be used in end-application: */ 44 | /* Macros: */ 45 | /** Indicates the version number of the library, as an integer. */ 46 | #define LUFA_VERSION_INTEGER 0x101122 47 | 48 | /** Indicates the version number of the library, as a string. */ 49 | #define LUFA_VERSION_STRING "101122" 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/ProgrammingApps.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_ProgrammingApps Programming an Application into a USB AVR 8 | * 9 | * Once you have built an application, you will need a way to program in the resulting ".HEX" file (and, if your 10 | * application uses EEPROM variables with initial values, also a ".EEP" file) into your USB AVR. Normally, the 11 | * reprogramming of an AVR device must be performed using a special piece of programming hardware, through one of the 12 | * supported AVR programming protocols - ISP, HVSP, HVPP, JTAG or dW. This can be done through a custom programmer, 13 | * a third party programmer, or an official Atmel AVR tool - for more information, see the Atmel.com website. 14 | * 15 | * Alternatively, you can use the bootloader. From the Atmel factory, each USB AVR comes preloaded with the Atmel 16 | * DFU (Device Firmware Update) class bootloader, a small piece of AVR firmware which allows the remainder of the 17 | * AVR to be programmed through a non-standard interface such as the serial USART port, SPI, or (in this case) USB. 18 | * Bootloaders have the advantage of not requiring any special hardware for programming, and cannot usually be erased 19 | * or broken without an external programming device. They have disadvantages however; they cannot change the fuses of 20 | * the AVR (special configuration settings that control the operation of the chip itself) and a small portion of the 21 | * AVR's FLASH program memory must be reserved to contain the bootloader firmware, and thus cannot be used by the 22 | * loaded application. Atmel's DFU bootloader is either 4KB (for the smaller USB AVRs) or 8KB (for the larger USB AVRs). 23 | * 24 | * If you wish to use the DFU bootloader to program in your application, refer to your DFU programmer's documentation. 25 | * Atmel provides a free utility called FLIP which is USB AVR compatible, and an open source (Linux compatible) 26 | * alternative exists called "dfu-programmer". 27 | */ 28 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/FutureChanges.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_FutureChanges Future Changes 8 | * 9 | * Below is a list of future changes which are proposed for the LUFA library, but not yet started/complete. 10 | * This gives an unordered list of future changes which may be available in future releases of the library. 11 | * If you have an item to add to this list, please contact the library author via email, the LUFA mailing list, 12 | * or post your suggestion as an enhancement request to the project bug tracker. 13 | * 14 | * Targeted for Future Releases: 15 | * - Code Features 16 | * -# Add hub support when in Host mode for multiple devices 17 | * -# Investigate virtual hubs when in device mode instead of composite devices 18 | * -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error 19 | * -# Change makefiles to allow for absolute LUFA location to be used 20 | * -# Re-add interrupt Pipe/Endpoint support 21 | * -# Add HID report macros to make HID report editing easier 22 | * -# Investigate dynamically created device descriptors 23 | * - Documentation/Support 24 | * -# Add detailed overviews of how each demo works 25 | * -# Add board overviews 26 | * -# Write LUFA tutorials 27 | * - Demos/Projects 28 | * -# Multiple-Report HID device 29 | * -# Device/Host USB bridge 30 | * -# Alternative (USB-IF endorsed) USB-CDC Ethernet Class 31 | * -# Finish Test and Measurement Class demo 32 | * -# Finish BluetoothHost demo 33 | * -# Finish SideShow demo 34 | * -# Finish StandaloneProgrammer project 35 | * -# Arduino Uno compatible USB-MIDI, USB-HID 36 | * -# Make Webserver project work in RNDIS device mode 37 | * - Ports 38 | * -# AVR32 UC3B series microcontrollers 39 | * -# Atmel ARM7 series microcontrollers 40 | * -# Other (commercial) C compilers 41 | */ 42 | 43 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/CompilingApps.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_CompilingApps Compiling the Demos, Bootloaders and Projects 8 | * 9 | * The following details how to compile the included LUFA demos, applications and bootloaders using AVR-GCC. 10 | * 11 | * \section Sec_Prerequisites Prerequisites 12 | * Before you can compile any of the LUFA library code or demos, you will need a recent distribution of avr-libc (1.6.2+) 13 | * and the AVR-GCC (4.2+) compiler. For Windows users, the best way to obtain these is the WinAVR project 14 | * (http://winavr.sourceforge.net) as this provides a single-file setup for everything required to compile your 15 | * own AVR projects. 16 | * 17 | * \section Sec_Compiling Compiling a LUFA Application 18 | * Compiling the LUFA demos, applications and/or bootloaders is very simple. LUFA comes with makefile scripts for 19 | * each individual demo, bootloader and project folder, as well as scripts in the /Demos/, /Bootloaders/, /Projects/ 20 | * and the LUFA root directory. This means that compilation can be started from any of the above directories, with 21 | * a build started from an upper directory in the directory structure executing build of all child directories under it. 22 | * This means that while a build inside a particular demo directory will build only that particular demo, a build stated 23 | * from the /Demos/ directory will build all LUFA demo projects sequentially. 24 | * 25 | * To build a project from the source via the command line, the command "make all" should be executed from the command line in the directory 26 | * of interest. To remove compiled files (including the binary output, all intermediately files and all diagnostic output 27 | * files), execute "make clean". Once a "make all" has been run and no errors were encountered, the resulting binary will 28 | * be located in the generated ".HEX" file. If your project makes use of pre-initialized EEPROM variables, the generated ".EEP" 29 | * file will contain the project's EEPROM data. 30 | */ 31 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_RW.c: -------------------------------------------------------------------------------- 1 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer, 2 | uint16_t Length 3 | __CALLBACK_PARAM) 4 | { 5 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 6 | uint8_t ErrorCode; 7 | 8 | if ((ErrorCode = Endpoint_WaitUntilReady())) 9 | return ErrorCode; 10 | 11 | #if defined(FAST_STREAM_TRANSFERS) 12 | uint8_t BytesRemToAlignment = (Endpoint_BytesInEndpoint() & 0x07); 13 | 14 | if (Length >= 8) 15 | { 16 | Length -= BytesRemToAlignment; 17 | 18 | switch (BytesRemToAlignment) 19 | { 20 | default: 21 | do 22 | { 23 | if (!(Endpoint_IsReadWriteAllowed())) 24 | { 25 | TEMPLATE_CLEAR_ENDPOINT(); 26 | 27 | #if !defined(NO_STREAM_CALLBACKS) 28 | if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort)) 29 | return ENDPOINT_RWSTREAM_CallbackAborted; 30 | #endif 31 | 32 | if ((ErrorCode = Endpoint_WaitUntilReady())) 33 | return ErrorCode; 34 | } 35 | 36 | Length -= 8; 37 | 38 | TEMPLATE_TRANSFER_BYTE(DataStream); 39 | case 7: TEMPLATE_TRANSFER_BYTE(DataStream); 40 | case 6: TEMPLATE_TRANSFER_BYTE(DataStream); 41 | case 5: TEMPLATE_TRANSFER_BYTE(DataStream); 42 | case 4: TEMPLATE_TRANSFER_BYTE(DataStream); 43 | case 3: TEMPLATE_TRANSFER_BYTE(DataStream); 44 | case 2: TEMPLATE_TRANSFER_BYTE(DataStream); 45 | case 1: TEMPLATE_TRANSFER_BYTE(DataStream); 46 | } while (Length >= 8); 47 | } 48 | } 49 | #endif 50 | 51 | while (Length) 52 | { 53 | if (!(Endpoint_IsReadWriteAllowed())) 54 | { 55 | TEMPLATE_CLEAR_ENDPOINT(); 56 | 57 | #if !defined(NO_STREAM_CALLBACKS) 58 | if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort)) 59 | return ENDPOINT_RWSTREAM_CallbackAborted; 60 | #endif 61 | 62 | if ((ErrorCode = Endpoint_WaitUntilReady())) 63 | return ErrorCode; 64 | } 65 | else 66 | { 67 | TEMPLATE_TRANSFER_BYTE(DataStream); 68 | Length--; 69 | } 70 | } 71 | 72 | return ENDPOINT_RWSTREAM_NoError; 73 | } 74 | 75 | #undef TEMPLATE_FUNC_NAME 76 | #undef TEMPLATE_BUFFER_TYPE 77 | #undef TEMPLATE_TRANSFER_BYTE 78 | #undef TEMPLATE_CLEAR_ENDPOINT 79 | #undef TEMPLATE_BUFFER_OFFSET 80 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/HighLevel/Template/Template_Pipe_RW.c: -------------------------------------------------------------------------------- 1 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer, 2 | uint16_t Length 3 | __CALLBACK_PARAM) 4 | { 5 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 6 | uint8_t ErrorCode; 7 | 8 | Pipe_SetPipeToken(TEMPLATE_TOKEN); 9 | 10 | if ((ErrorCode = Pipe_WaitUntilReady())) 11 | return ErrorCode; 12 | 13 | #if defined(FAST_STREAM_TRANSFERS) 14 | uint8_t BytesRemToAlignment = (Pipe_BytesInPipe() & 0x07); 15 | 16 | if (Length >= 8) 17 | { 18 | Length -= BytesRemToAlignment; 19 | 20 | switch (BytesRemToAlignment) 21 | { 22 | default: 23 | do 24 | { 25 | if (!(Pipe_IsReadWriteAllowed())) 26 | { 27 | TEMPLATE_CLEAR_PIPE(); 28 | 29 | #if !defined(NO_STREAM_CALLBACKS) 30 | if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort)) 31 | return PIPE_RWSTREAM_CallbackAborted; 32 | #endif 33 | 34 | if ((ErrorCode = Pipe_WaitUntilReady())) 35 | return ErrorCode; 36 | } 37 | 38 | Length -= 8; 39 | 40 | TEMPLATE_TRANSFER_BYTE(DataStream); 41 | case 7: TEMPLATE_TRANSFER_BYTE(DataStream); 42 | case 6: TEMPLATE_TRANSFER_BYTE(DataStream); 43 | case 5: TEMPLATE_TRANSFER_BYTE(DataStream); 44 | case 4: TEMPLATE_TRANSFER_BYTE(DataStream); 45 | case 3: TEMPLATE_TRANSFER_BYTE(DataStream); 46 | case 2: TEMPLATE_TRANSFER_BYTE(DataStream); 47 | case 1: TEMPLATE_TRANSFER_BYTE(DataStream); 48 | } while (Length >= 8); 49 | } 50 | } 51 | #endif 52 | 53 | while (Length) 54 | { 55 | if (!(Pipe_IsReadWriteAllowed())) 56 | { 57 | TEMPLATE_CLEAR_PIPE(); 58 | 59 | #if !defined(NO_STREAM_CALLBACKS) 60 | if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort)) 61 | return PIPE_RWSTREAM_CallbackAborted; 62 | #endif 63 | 64 | if ((ErrorCode = Pipe_WaitUntilReady())) 65 | return ErrorCode; 66 | } 67 | else 68 | { 69 | TEMPLATE_TRANSFER_BYTE(DataStream); 70 | Length--; 71 | } 72 | } 73 | 74 | return PIPE_RWSTREAM_NoError; 75 | } 76 | 77 | #undef TEMPLATE_FUNC_NAME 78 | #undef TEMPLATE_BUFFER_TYPE 79 | #undef TEMPLATE_TOKEN 80 | #undef TEMPLATE_TRANSFER_BYTE 81 | #undef TEMPLATE_CLEAR_PIPE 82 | #undef TEMPLATE_BUFFER_OFFSET 83 | 84 | -------------------------------------------------------------------------------- /avrsrc/utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief utils.h header file 4 | * 5 | * This file defines some utility functions used in several parts 6 | * of the code for this project 7 | * 8 | * These functions are not microcontroller dependent but they are intended 9 | * for the AVR 8-bit architecture 10 | * 11 | * Copyright (C) 2013 Omar Choudary (omar.choudary@cl.cam.ac.uk) 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * - Redistributions of source code must retain the above copyright notice, this 17 | * list of conditions and the following disclaimer. 18 | * 19 | * - Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #ifndef _UTILS_H_ 37 | #define _UTILS_H_ 38 | 39 | #include 40 | #include 41 | 42 | extern uint8_t lcdAvailable; 43 | 44 | /// Write a 16-bit value 45 | void Write16bitRegister(volatile uint16_t *reg, uint16_t value); 46 | 47 | /// Read a 16-bit value 48 | uint16_t Read16bitRegister(volatile uint16_t *reg); 49 | 50 | /// Puts the SCD to sleep until receives clock from terminal 51 | void SleepUntilTerminalClock(); 52 | 53 | /// Puts the SCD to sleep until card is inserted or removed 54 | void SleepUntilCardInserted(); 55 | 56 | /// Retrieve relative time value and writes it to log 57 | uint8_t LogCurrentTime(log_struct_t *logger); 58 | 59 | #endif // _UTILS_H_ 60 | 61 | -------------------------------------------------------------------------------- /avrsrc/lufa_usb_virtual_serial/VirtualSerial.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \mainpage Communications Device Class (Virtual Serial Port) Demo 8 | * 9 | * \section SSec_Compat Demo Compatibility: 10 | * 11 | * The following list indicates what microcontrollers are compatible with this demo. 12 | * 13 | * - Series 7 USB AVRs (AT90USBxxx7) 14 | * - Series 6 USB AVRs (AT90USBxxx6) 15 | * - Series 4 USB AVRs (ATMEGAxxU4) 16 | * - Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) 17 | * 18 | * \section SSec_Info USB Information: 19 | * 20 | * The following table gives a rundown of the USB utilization of this demo. 21 | * 22 | * 23 | * 24 | * 25 | * 26 | * 27 | * 28 | * 29 | * 30 | * 31 | * 32 | * 33 | * 34 | * 35 | * 36 | * 37 | * 38 | * 39 | * 40 | * 41 | * 42 | * 43 | *
USB Mode:Device
USB Class:Communications Device Class (CDC)
USB Subclass:Abstract Control Model (ACM)
Relevant Standards:USBIF CDC Class Standard
Usable Speeds:Full Speed Mode
44 | * 45 | * \section SSec_Description Project Description: 46 | * 47 | * Communications Device Class demonstration application. 48 | * This gives a simple reference application for implementing 49 | * a CDC device acting as a virtual serial port. Joystick 50 | * actions are transmitted to the host as strings. The device 51 | * does not respond to serial data sent from the host. 52 | * 53 | * After running this demo for the first time on a new computer, 54 | * you will need to supply the .INF file located in this demo 55 | * project's directory as the device's driver when running under 56 | * Windows. This will enable Windows to use its inbuilt CDC drivers, 57 | * negating the need for custom drivers for the device. Other 58 | * Operating Systems should automatically use their own inbuilt 59 | * CDC-ACM drivers. 60 | * 61 | * \section SSec_Options Project Options 62 | * 63 | * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value. 64 | * 65 | * 66 | * 67 | * 70 | * 71 | *
68 | * None 69 | *
72 | */ 73 | 74 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/Temperature.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "Temperature.h" 32 | 33 | static const uint16_t PROGMEM Temperature_Lookup[] = { 34 | 0x3B4, 0x3B0, 0x3AB, 0x3A6, 0x3A0, 0x39A, 0x394, 0x38E, 0x388, 0x381, 0x37A, 0x373, 35 | 0x36B, 0x363, 0x35B, 0x353, 0x34A, 0x341, 0x338, 0x32F, 0x325, 0x31B, 0x311, 0x307, 36 | 0x2FC, 0x2F1, 0x2E6, 0x2DB, 0x2D0, 0x2C4, 0x2B8, 0x2AC, 0x2A0, 0x294, 0x288, 0x27C, 37 | 0x26F, 0x263, 0x256, 0x24A, 0x23D, 0x231, 0x225, 0x218, 0x20C, 0x200, 0x1F3, 0x1E7, 38 | 0x1DB, 0x1CF, 0x1C4, 0x1B8, 0x1AC, 0x1A1, 0x196, 0x18B, 0x180, 0x176, 0x16B, 0x161, 39 | 0x157, 0x14D, 0x144, 0x13A, 0x131, 0x128, 0x11F, 0x117, 0x10F, 0x106, 0x0FE, 0x0F7, 40 | 0x0EF, 0x0E8, 0x0E1, 0x0DA, 0x0D3, 0x0CD, 0x0C7, 0x0C0, 0x0BA, 0x0B5, 0x0AF, 0x0AA, 41 | 0x0A4, 0x09F, 0x09A, 0x096, 0x091, 0x08C, 0x088, 0x084, 0x080, 0x07C, 0x078, 0x074, 42 | 0x071, 0x06D, 0x06A, 0x067, 0x064, 0x061, 0x05E, 0x05B, 0x058, 0x055, 0x053, 0x050, 43 | 0x04E, 0x04C, 0x049, 0x047, 0x045, 0x043, 0x041, 0x03F, 0x03D, 0x03C, 0x03A, 0x038 44 | }; 45 | 46 | int8_t Temperature_GetTemperature(void) 47 | { 48 | uint16_t Temp_ADC = ADC_GetChannelReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | TEMP_ADC_CHANNEL_MASK); 49 | 50 | if (Temp_ADC > pgm_read_word(&Temperature_Lookup[0])) 51 | return TEMP_MIN_TEMP; 52 | 53 | for (uint16_t Index = 0; Index < TEMP_TABLE_SIZE; Index++) 54 | { 55 | if (Temp_ADC > pgm_read_word(&Temperature_Lookup[Index])) 56 | return (Index + TEMP_TABLE_OFFSET); 57 | } 58 | 59 | return TEMP_MAX_TEMP; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Peripheral/ADC.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the ADC peripheral driver. 33 | * 34 | * This file is the master dispatch header file for the device-specific ADC driver, for AVRs containing an ADC. 35 | * 36 | * User code should include this file, which will in turn include the correct ADC driver header file for the 37 | * currently selected AVR model. 38 | */ 39 | 40 | /** \ingroup Group_PeripheralDrivers 41 | * @defgroup Group_ADC ADC Driver - LUFA/Drivers/Peripheral/ADC.h 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - None 46 | * 47 | * \section Module Description 48 | * Hardware ADC driver. This module provides an easy to use driver for the hardware 49 | * ADC present on many AVR models, for the conversion of analogue signals into the 50 | * digital domain. 51 | */ 52 | 53 | #ifndef __ADC_H__ 54 | #define __ADC_H__ 55 | 56 | /* Macros: */ 57 | #if !defined(__DOXYGEN__) 58 | #define __INCLUDE_FROM_ADC_H 59 | #endif 60 | 61 | /* Includes: */ 62 | #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \ 63 | defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \ 64 | defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \ 65 | defined(__AVR_ATmega32U6__)) 66 | #include "AVRU4U6U7/ADC.h" 67 | #else 68 | #error "ADC is not available for the currently selected AVR model." 69 | #endif 70 | 71 | #endif 72 | 73 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/HighLevel/USBTask.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USBTASK_C 32 | #define __INCLUDE_FROM_USB_DRIVER 33 | #include "USBTask.h" 34 | 35 | volatile bool USB_IsInitialized; 36 | USB_Request_Header_t USB_ControlRequest; 37 | 38 | #if defined(USB_CAN_BE_HOST) && !defined(HOST_STATE_AS_GPIOR) 39 | volatile uint8_t USB_HostState; 40 | #endif 41 | 42 | #if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR) 43 | volatile uint8_t USB_DeviceState; 44 | #endif 45 | 46 | void USB_USBTask(void) 47 | { 48 | #if defined(USB_HOST_ONLY) 49 | USB_HostTask(); 50 | #elif defined(USB_DEVICE_ONLY) 51 | USB_DeviceTask(); 52 | #else 53 | if (USB_CurrentMode == USB_MODE_Device) 54 | USB_DeviceTask(); 55 | else if (USB_CurrentMode == USB_MODE_Host) 56 | USB_HostTask(); 57 | #endif 58 | } 59 | 60 | #if defined(USB_CAN_BE_DEVICE) 61 | static void USB_DeviceTask(void) 62 | { 63 | if (USB_DeviceState != DEVICE_STATE_Unattached) 64 | { 65 | uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); 66 | 67 | Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); 68 | 69 | if (Endpoint_IsSETUPReceived()) 70 | USB_Device_ProcessControlRequest(); 71 | 72 | Endpoint_SelectEndpoint(PrevEndpoint); 73 | } 74 | } 75 | #endif 76 | 77 | #if defined(USB_CAN_BE_HOST) 78 | static void USB_HostTask(void) 79 | { 80 | uint8_t PrevPipe = Pipe_GetCurrentPipe(); 81 | 82 | Pipe_SelectPipe(PIPE_CONTROLPIPE); 83 | 84 | USB_Host_ProcessNextHostState(); 85 | 86 | Pipe_SelectPipe(PrevPipe); 87 | } 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /avrsrc/CHANGELOG: -------------------------------------------------------------------------------- 1 | Changelog file for The Smart Card Detective. 2 | 3 | Author: Omar Choudary (omar.choudary@cl.cam.ac.uk) 4 | Copyright @ 2013 5 | 6 | Current software version: 2.5.0 7 | 8 | ****************************************** 9 | CHANGES from 2.4.2: 10 | ****************************************** 11 | - Made some updates to the way in which the terminal reset is handled at the end of a transaction 12 | - Updated the Descriptors file in LUFA to avoid errors from newer compilers. 13 | - Modified the InitSCDTransaction method to allow a more robust check of the terminal reset line. 14 | - Added functionality to act as a card and reply to a Terminal from a host connected via USB. 15 | See the method TerminalUSB() in avrsrc/serial.c. 16 | Note that unfortunately I did not test this method too much so you might encounter problems. 17 | 18 | ****************************************** 19 | CHANGES from 2.4.0: 20 | ****************************************** 21 | - Fixed bug that made not possible the update of the software with version 4 of 22 | the SCD sold by Smart Architects (release 2012). There was an incomplete 23 | handling of the inverted card detector. 24 | - Fixed problems that required the SCD to be restarted between recording logs 25 | and acquiring traces using the Python tools. Now you can use the Python tool 26 | to start recording logs (i.e. running the Forward Data application) and then 27 | immediately retrieving them without having to restart the SCD. 28 | - Removed Serial Iface and Forward LogAC applications from menu as they are 29 | either incomplete or buggy and not generally useful. 30 | - Changed default card inserted switch flag in Makefile for SCD v4. Recompile 31 | the code with the Makefile line commented for previous versions or use 32 | the *prev4.hex files provided in the tgz file. 33 | 34 | ****************************************** 35 | CHANGES from 2.3.4: 36 | ****************************************** 37 | - Introduced a millisecond counter that can be used to trace events. 38 | - Rewritten the logging mechanism completely. Now every byte sent or received by 39 | either the card or the terminal can be logged independently, including the 40 | bytes in the ATR. Also the counter is used to put timestamps into the log. 41 | The limitation of the current hardware is the 8KB available of EEPROM which 42 | effectively limits the logging capability to just a few full traces. 43 | See the file scd_logger.h for the memory allocation. Change this with care, 44 | since the malloc library uses the same memory as the log buffer (8KB of SRAM). 45 | - Sleep mode disabled in most of the applications, in order to enable an 46 | accurate time-stamp of events even after many successive applications. 47 | - Fixed many bugs I found along the way (hopefully I didn't introduce many new 48 | ones). 49 | - Affected files: all. 50 | - New files: scd_logger.h, scd_logger.c, counter.h 51 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Peripheral/TWI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the TWI peripheral driver. 33 | * 34 | * This file is the master dispatch header file for the device-specific ADC driver, for AVRs containing an ADC. 35 | * 36 | * User code should include this file, which will in turn include the correct ADC driver header file for the 37 | * currently selected AVR model. 38 | */ 39 | 40 | /** \ingroup Group_PeripheralDrivers 41 | * @defgroup Group_TWI TWI Driver - LUFA/Drivers/Peripheral/TWI.h 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/Peripheral/TWI.c (Makefile source module name: LUFA_SRC_TWI) 46 | * 47 | * 48 | * \section Module Description 49 | * Master Mode Hardware TWI driver. This module provides an easy to use driver for the hardware 50 | * TWI present on many AVR models, for the transmission and reception of data on a TWI bus. 51 | */ 52 | 53 | #ifndef __TWI_H__ 54 | #define __TWI_H__ 55 | 56 | /* Macros: */ 57 | #if !defined(__DOXYGEN__) 58 | #define __INCLUDE_FROM_TWI_H 59 | #endif 60 | 61 | /* Includes: */ 62 | #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \ 63 | defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \ 64 | defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \ 65 | defined(__AVR_ATmega32U6__)) 66 | #include "AVRU4U6U7/TWI.h" 67 | #else 68 | #error "TWI is not available for the currently selected AVR model." 69 | #endif 70 | 71 | #endif 72 | 73 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/WhyUseLUFA.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_WhyUseLUFA Why Use LUFA? 9 | * 10 | * The LUFA Library has many advantages over implementing the code required to drive the USB AVRs directly. 11 | * It is much more preferable to incorporate LUFA into your existing projects - or even make a new project 12 | * using LUFA - than it is to start from scratch and use the USB AVR registers directly. Some of these reasons 13 | * are: 14 | * 15 | * - Portability: 16 | * The LUFA stack is designed to run (at some capacity) on the entire Atmel range of USB AVRs, regardless of the 17 | * exact USB controller revision used. If you decide to implement your own USB stack, you will either need to 18 | * code around the differences between each USB AVR controller's implementation between different chip models, or 19 | * require your code to run on only one specific USB AVR model series. 20 | * 21 | * - Speed of Development: 22 | * LUFA ships with a wide range of pre-made demos, bootloaders and projects for you to try, learn and extend. Each 23 | * of these demos are tested (where possible) across as many USB AVRs and Operating Systems as possible, to ensure 24 | * that they work under as many conditions as possible. In addition, there are inbuilt class drivers for several of 25 | * the USB classes which you can make use of in your projects with minimal effort. 26 | * 27 | * - Maintainability: 28 | * As LUFA takes care of much of the USB implementation, you can be left to focusing on your actual project's 29 | * functionality, rather than being held back developing and debugging the USB stack code. Since LUFA uses clear APIs 30 | * for USB development, your code will be more readable than if it had the low level USB stack code integrated into 31 | * it directly. Updating the LUFA library is a simple folder-replacement and gives new features and bug fixes in 32 | * seconds each time a new release is made. 33 | * 34 | * - Size: 35 | * Not just requiring less code to make complex USB devices, LUFA (under most cases with the correct compile options) 36 | * requires less FLASH space than Atmel's stack, meaning more space for the user application*. 37 | * 38 | * - Support: 39 | * Since many people are now using LUFA in their own projects, you can take advantage of other's knowledge when you run 40 | * into difficulties or need some advice. In addition, you can also email the library author to receive personalized 41 | * support when you need it (subject to author's schedule). 42 | * 43 | * * Atmel Stack Mouse Device Demo 4292 bytes, LUFA Mouse Low Level Device Demo 3332 bytes, under identical build 44 | * environments 45 | */ 46 | 47 | -------------------------------------------------------------------------------- /avrsrc/emv_values.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief emv_values.h Header file 4 | * 5 | * Contains definitions of bytes used in EMV 6 | * 7 | * Copyright (C) 2013 Omar Choudary (omar.choudary@cl.cam.ac.uk) 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * - Redistributions of source code must retain the above copyright notice, this 13 | * list of conditions and the following disclaimer. 14 | * 15 | * - Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef _EMV_VALUES_H_ 33 | #define _EMV_VALUES_H_ 34 | 35 | 36 | // ------------------------------------------------------------------- 37 | // Structures definining the different values used by EMV 38 | 39 | /** 40 | * Enum defining the different values for byte 1 of tag 41 | */ 42 | typedef enum { 43 | EMV_TAG1_CDOL_1 = 0x8C, 44 | EMV_TAG1_CDOL_2 = 0x8D, 45 | EMV_TAG1_CA_PK_INDEX = 0x8F, 46 | EMV_TAG1_ISSUER_PK_CERT = 0x90, 47 | EMV_TAG1_ISSUER_PK_REMINDER = 0x92, 48 | EMV_TAG1_ISSUER_PK_EXPONENT = 0x9F, 49 | EMV_TAG1_SIGNED_STATIC_DATA = 0x93, 50 | EMV_TAG1_APPLICATION_TEMPLATE = 0x61 51 | }EMV_TAG_BYTE1; 52 | 53 | /** 54 | * Enum defining the different values for byte 2 of tag 55 | */ 56 | typedef enum { 57 | EMV_TAG2_CDOL_1 = 0, 58 | EMV_TAG2_CDOL_2 = 0, 59 | EMV_TAG2_CA_PK_INDEX = 0, 60 | EMV_TAG2_ISSUER_PK_CERT = 0, 61 | EMV_TAG2_ISSUER_PK_REMINDER = 0, 62 | EMV_TAG2_ISSUER_PK_EXPONENT = 0x32, 63 | EMV_TAG2_SIGNED_STATIC_DATA = 0, 64 | EMV_TAG2_APPLICATION_TEMPLATE = 0 65 | }EMV_TAG_BYTE2; 66 | 67 | 68 | /** 69 | * Enum defining the different types of values for the status byte SW1 70 | */ 71 | typedef enum { 72 | SW1_COMPLETED = 0x90, 73 | SW1_MORE_TIME = 0x60, 74 | SW1_MORE_DATA = 0x61, 75 | SW1_WARNING1 = 0x62, 76 | SW1_WARNING2 = 0x63, 77 | SW1_WRONG_LENGTH = 0x6C 78 | }APDU_RESPONSE; 79 | 80 | #endif // _EMV_VALUES_H_ 81 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/SoftwareBootloaderJump.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_SoftwareBootloaderStart Entering the Bootloader via Software 9 | * 10 | * A common requirement of many applications is the ability to jump to the programmed bootloader of a chip 11 | * on demand, via the code's firmware (i.e. not as a result of any physical user interaction with the 12 | * hardware). This might be required because the device does not have any physical user input, or simply 13 | * just to streamline the device upgrade process on the host PC. 14 | * 15 | * The following C code snippet may be used to enter the bootloader upon request by the user application. 16 | * By using the watchdog to physically reset the controller, it is ensured that all system hardware is 17 | * completely reset to their defaults before the bootloader is run. This is important; since bootloaders 18 | * are written to occupy a very limited space, they usually make assumptions about the register states based 19 | * on the default values after a hard-reset of the chip. 20 | * 21 | * \code 22 | * #include 23 | * #include 24 | * #include 25 | * 26 | * #include 27 | * #include 28 | * 29 | * uint32_t Boot_Key ATTR_NO_INIT; 30 | * 31 | * #define MAGIC_BOOT_KEY 0xDC42ACCA 32 | * #define BOOTLOADER_START_ADDRESS (FLASH_SIZE_BYTES - BOOTLOADER_SEC_SIZE_BYTES) 33 | * 34 | * void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3); 35 | * void Bootloader_Jump_Check(void) 36 | * { 37 | * // If the reset source was the bootloader and the key is correct, clear it and jump to the bootloader 38 | * if ((MCUSR & (1 << WDRF)) && (Boot_Key == MAGIC_BOOT_KEY)) 39 | * { 40 | * Boot_Key = 0; 41 | * ((void (*)(void))BOOTLOADER_START_ADDRESS)(); 42 | * } 43 | * } 44 | * 45 | * void Jump_To_Bootloader(void) 46 | * { 47 | * // If USB is used, detach from the bus 48 | * USB_ShutDown(); 49 | * 50 | * // Disable all interrupts 51 | * cli(); 52 | * 53 | * // Wait two seconds for the USB detachment to register on the host 54 | * for (uint8_t i = 0; i < 128; i++) 55 | * _delay_ms(16); 56 | * 57 | * // Set the bootloader key to the magic value and force a reset 58 | * Boot_Key = MAGIC_BOOT_KEY; 59 | * wdt_enable(WDTO_250MS); 60 | * for (;;); 61 | * } 62 | * \endcode 63 | * 64 | * Note that the bootloader magic key can be any arbitrary value. The FLASH_SIZE_BYTES and 65 | * BOOTLOADER_SEC_SIZE_BYTES tokens should be replaced with the total flash size of the AVR 66 | * in bytes, and the allocated size of the bootloader section for the target AVR. 67 | * 68 | */ 69 | 70 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/MainPage.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \mainpage 9 | * 10 | * \image html LUFA.png 11 | *
Logo design by Ryo Photography
12 | * \n 13 | * 14 | * \n 15 | * 16 | * LUFA is donationware. For author and donation information, see \ref Page_Donating. 17 | * 18 | * LUFA is an open-source USB library for the USB-enabled AVR microcontrollers, released under the MIT license (see \ref Page_LicenseInfo). 19 | * It supports a large number of USB AVR models and boards (see \ref Page_DeviceSupport). It is designed to provide an easy to use, 20 | * feature rich framework for the development of USB peripherals and hosts. 21 | * 22 | * LUFA focuses on the microcontroller side of USB development only; it includes no PC host USB driver development facilities - other projects 23 | * such as the Windows Driver Development Kit, Windows USB Device Mode Framework and libusb may be of interest for developing custom OS drivers. 24 | * While custom USB devices can be made with LUFA using such tools, the included demos all use the inbuilt OS drivers for each USB class for 25 | * simplicity. 26 | * 27 | * The library is currently in a stable release, suitable for download and incorporation into user projects for 28 | * both host and device modes. For information about the project progression, see the blog link at \ref Page_Resources. 29 | * 30 | * LUFA is written specifically for the free AVR-GCC compiler, and uses several GCC-only extensions to make the 31 | * library API more streamlined and robust. You can download AVR-GCC for free in a convenient windows package, 32 | * from the the WinAVR website (see \ref Page_Resources). 33 | * 34 | * The only required AVR peripherals for LUFA is the USB controller itself and interrupts - LUFA does not require the use of the 35 | * microcontroller's timers or other hardware, leaving more hardware to the application developer. 36 | * 37 | * Accompanying LUFA in the download package is a set of example demo applications, plus several Bootloaders of different classes 38 | * and open source LUFA powered projects. 39 | * 40 | * Subsections: 41 | * \li \subpage Page_WhyUseLUFA - What are the advantages of using LUFA? 42 | * \li \subpage Page_LUFAvsAtmelStack - How does LUFA compare to the Atmel USB AVR stack? 43 | * \li \subpage Page_AlternativeStacks - Alternative USB AVR Stacks 44 | * \li \subpage Page_LicenseInfo - Project source license and commercial use information 45 | * \li \subpage Page_Donating - Donating to support this project 46 | * \li \subpage Page_LibraryApps - Overview of included Demos, Bootloaders and Projects 47 | */ 48 | 49 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/Audio.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Audio Class driver. 33 | * 34 | * Master include file for the library USB Audio Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassAudio Audio Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/Audio.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * 47 | * \section Module Description 48 | * Audio Class Driver module. This module contains an internal implementation of the USB Audio 1.0 Class, for Device 49 | * USB mode only. User applications can use this class driver instead of implementing the Audio class manually via 50 | * the low-level LUFA APIs. 51 | * 52 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 53 | * Hosts or Devices using the USB Audio Class. 54 | * 55 | * @{ 56 | */ 57 | 58 | #ifndef _AUDIO_CLASS_H_ 59 | #define _AUDIO_CLASS_H_ 60 | 61 | /* Macros: */ 62 | #define __INCLUDE_FROM_USB_DRIVER 63 | #define __INCLUDE_FROM_AUDIO_DRIVER 64 | 65 | /* Includes: */ 66 | #include "../HighLevel/USBMode.h" 67 | 68 | #if defined(USB_CAN_BE_DEVICE) 69 | #include "Device/Audio.h" 70 | #endif 71 | 72 | #endif 73 | 74 | /** @} */ 75 | 76 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/StillImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Still Image Class driver. 33 | * 34 | * Master include file for the library USB Still Image Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassSI Still Image Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Host/StillImage.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * 47 | * \section Module Description 48 | * Still Image Class Driver module. This module contains an internal implementation of the USB Still Image Class, 49 | * for USB Host mode only. User applications can use this class driver instead of implementing the Still Image class 50 | * manually via the low-level LUFA APIs. 51 | * 52 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 53 | * Devices using the USB Still Image Class. 54 | * 55 | * @{ 56 | */ 57 | 58 | #ifndef _SI_CLASS_H_ 59 | #define _SI_CLASS_H_ 60 | 61 | /* Macros: */ 62 | #define __INCLUDE_FROM_USB_DRIVER 63 | #define __INCLUDE_FROM_SI_DRIVER 64 | 65 | /* Includes: */ 66 | #include "../HighLevel/USBMode.h" 67 | 68 | #if defined(USB_CAN_BE_HOST) 69 | #include "Host/StillImage.h" 70 | #endif 71 | 72 | #endif 73 | 74 | /** @} */ 75 | 76 | -------------------------------------------------------------------------------- /avrsrc/lufa_usb_virtual_serial/VirtualSerial.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | * File modified for the Smart Card Detective by Omar Choudary 11 | */ 12 | 13 | /* 14 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 15 | 16 | Permission to use, copy, modify, distribute, and sell this 17 | software and its documentation for any purpose is hereby granted 18 | without fee, provided that the above copyright notice appear in 19 | all copies and that both that the copyright notice and this 20 | permission notice and warranty disclaimer appear in supporting 21 | documentation, and that the name of the author not be used in 22 | advertising or publicity pertaining to distribution of the 23 | software without specific, written prior permission. 24 | 25 | The author disclaim all warranties with regard to this 26 | software, including all implied warranties of merchantability 27 | and fitness. In no event shall the author be liable for any 28 | special, indirect or consequential damages or any damages 29 | whatsoever resulting from loss of use, data or profits, whether 30 | in an action of contract, negligence or other tortious action, 31 | arising out of or in connection with the use or performance of 32 | this software. 33 | */ 34 | 35 | /** \file 36 | * 37 | * Header file for VirtualSerial.c. 38 | */ 39 | 40 | #ifndef _VIRTUALSERIAL_H_ 41 | #define _VIRTUALSERIAL_H_ 42 | 43 | /* Includes: */ 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | #include "Descriptors.h" 51 | 52 | #include <../LUFA/Version.h> 53 | #include <../LUFA/Drivers/USB/USB.h> 54 | #include <../LUFA/Drivers/Board/Joystick.h> 55 | #include <../LUFA/Drivers/Board/LEDs.h> 56 | 57 | /* Macros: */ 58 | /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ 59 | #define LEDMASK_USB_NOTREADY LEDS_LED1 60 | 61 | /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ 62 | #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) 63 | 64 | /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ 65 | #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) 66 | 67 | /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ 68 | #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) 69 | 70 | /* Function Prototypes: */ 71 | void SetupUSBHardware(void); 72 | void StopUSBHardware(void); 73 | void CDC_Task(void); 74 | char* GetHostData(uint16_t len); 75 | uint8_t SendHostData(const char *data); 76 | 77 | void EVENT_USB_Device_Connect(void); 78 | void EVENT_USB_Device_Disconnect(void); 79 | void EVENT_USB_Device_ConfigurationChanged(void); 80 | void EVENT_USB_Device_ControlRequest(void); 81 | 82 | #endif 83 | 84 | -------------------------------------------------------------------------------- /avrsrc/LUFA/CodeTemplates/DriverStubs/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /* 32 | This is a stub driver header file, for implementing custom board 33 | layout hardware with compatible LUFA board specific drivers. If 34 | the library is configured to use the BOARD_USER board mode, this 35 | driver file should be completed and copied into the "/Board/" folder 36 | inside the application's folder. 37 | 38 | This stub is for the board-specific component of the LUFA Buttons driver, 39 | for the control of physical board-mounted GPIO pushbuttons. 40 | */ 41 | 42 | #ifndef __BUTTONS_USER_H__ 43 | #define __BUTTONS_USER_H__ 44 | 45 | /* Includes: */ 46 | #include 47 | #include 48 | 49 | // TODO: Add any required includes here 50 | 51 | /* Enable C linkage for C++ Compilers: */ 52 | #if defined(__cplusplus) 53 | extern "C" { 54 | #endif 55 | 56 | /* Preprocessor Checks: */ 57 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 58 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 59 | #endif 60 | 61 | /* Public Interface - May be used in end-application: */ 62 | /* Macros: */ 63 | /** Button mask for the first button on the board. */ 64 | #define BUTTONS_BUTTON1 // TODO: Add mask for first board button here 65 | 66 | /* Inline Functions: */ 67 | #if !defined(__DOXYGEN__) 68 | static inline void Buttons_Init(void) 69 | { 70 | // TODO: Initialize the appropriate port pins as an inputs here, with pull-ups 71 | } 72 | 73 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 74 | static inline uint8_t Buttons_GetStatus(void) 75 | { 76 | // TODO: Return current button status here, debounced if required 77 | } 78 | #endif 79 | 80 | /* Disable C linkage for C++ Compilers: */ 81 | #if defined(__cplusplus) 82 | } 83 | #endif 84 | 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Scheduler/Scheduler.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "Scheduler.h" 32 | 33 | volatile SchedulerDelayCounter_t Scheduler_TickCounter; 34 | volatile uint8_t Scheduler_TotalTasks; 35 | 36 | bool Scheduler_HasDelayElapsed(const uint16_t Delay, 37 | SchedulerDelayCounter_t* const DelayCounter) 38 | { 39 | SchedulerDelayCounter_t CurrentTickValue_LCL; 40 | SchedulerDelayCounter_t DelayCounter_LCL; 41 | 42 | ATOMIC_BLOCK(ATOMIC_RESTORESTATE) 43 | { 44 | CurrentTickValue_LCL = Scheduler_TickCounter; 45 | } 46 | 47 | DelayCounter_LCL = *DelayCounter; 48 | 49 | if (CurrentTickValue_LCL >= DelayCounter_LCL) 50 | { 51 | if ((CurrentTickValue_LCL - DelayCounter_LCL) >= Delay) 52 | { 53 | *DelayCounter = CurrentTickValue_LCL; 54 | return true; 55 | } 56 | } 57 | else 58 | { 59 | if (((MAX_DELAYCTR_COUNT - DelayCounter_LCL) + CurrentTickValue_LCL) >= Delay) 60 | { 61 | *DelayCounter = CurrentTickValue_LCL; 62 | return true; 63 | } 64 | } 65 | 66 | return false; 67 | } 68 | 69 | void Scheduler_SetTaskMode(const TaskPtr_t Task, 70 | const bool TaskStatus) 71 | { 72 | TaskEntry_t* CurrTask = &Scheduler_TaskList[0]; 73 | 74 | while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks]) 75 | { 76 | if (CurrTask->Task == Task) 77 | { 78 | CurrTask->TaskStatus = TaskStatus; 79 | break; 80 | } 81 | 82 | CurrTask++; 83 | } 84 | } 85 | 86 | void Scheduler_SetGroupTaskMode(const uint8_t GroupID, 87 | const bool TaskStatus) 88 | { 89 | TaskEntry_t* CurrTask = &Scheduler_TaskList[0]; 90 | 91 | while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks]) 92 | { 93 | if (CurrTask->GroupID == GroupID) 94 | CurrTask->TaskStatus = TaskStatus; 95 | 96 | CurrTask++; 97 | } 98 | } 99 | 100 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/CDC.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB CDC-ACM Class driver. 33 | * 34 | * Master include file for the library USB CDC Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassCDC CDC-ACM (Virtual Serial) Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/CDC.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/CDC.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Module Description 49 | * CDC Class Driver module. This module contains an internal implementation of the USB CDC-ACM class Virtual Serial 50 | * Ports, for both Device and Host USB modes. User applications can use this class driver instead of implementing the 51 | * CDC class manually via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts or Devices using the USB CDC Class. 55 | * 56 | * @{ 57 | */ 58 | 59 | #ifndef _CDC_CLASS_H_ 60 | #define _CDC_CLASS_H_ 61 | 62 | /* Macros: */ 63 | #define __INCLUDE_FROM_USB_DRIVER 64 | #define __INCLUDE_FROM_CDC_DRIVER 65 | 66 | /* Includes: */ 67 | #include "../HighLevel/USBMode.h" 68 | 69 | #if defined(USB_CAN_BE_DEVICE) 70 | #include "Device/CDC.h" 71 | #endif 72 | 73 | #if defined(USB_CAN_BE_HOST) 74 | #include "Host/CDC.h" 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/RNDIS.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB RNDIS Class driver. 33 | * 34 | * Master include file for the library USB RNDIS Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassRNDIS RNDIS (Networking) Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/RNDIS.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/RNDIS.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Module Description 49 | * RNDIS Class Driver module. This module contains an internal implementation of the Microsoft USB RNDIS Networking 50 | * Class, for both Device and Host USB modes. User applications can use this class driver instead of implementing the 51 | * RNDIS class manually via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts using the USB RNDIS Class. 55 | * 56 | * @{ 57 | */ 58 | 59 | #ifndef _RNDIS_CLASS_H_ 60 | #define _RNDIS_CLASS_H_ 61 | 62 | /* Macros: */ 63 | #define __INCLUDE_FROM_USB_DRIVER 64 | #define __INCLUDE_FROM_RNDIS_DRIVER 65 | 66 | /* Includes: */ 67 | #include "../HighLevel/USBMode.h" 68 | 69 | #if defined(USB_CAN_BE_DEVICE) 70 | #include "Device/RNDIS.h" 71 | #endif 72 | 73 | #if defined(USB_CAN_BE_HOST) 74 | #include "Host/RNDIS.h" 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/MassStorage.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Mass Storage Class driver. 33 | * 34 | * Master include file for the library USB Mass Storage Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassMS Mass Storage Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/MassStorage.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/MassStorage.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Module Description 49 | * Mass Storage Class Driver module. This module contains an internal implementation of the USB Mass Storage Class, for both 50 | * Device and Host USB modes. User applications can use this class driver instead of implementing the Mass Storage class 51 | * manually via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts or Devices using the USB Mass Storage Class. 55 | * 56 | * @{ 57 | */ 58 | 59 | #ifndef _MS_CLASS_H_ 60 | #define _MS_CLASS_H_ 61 | 62 | /* Macros: */ 63 | #define __INCLUDE_FROM_USB_DRIVER 64 | #define __INCLUDE_FROM_MS_DRIVER 65 | 66 | /* Includes: */ 67 | #include "../HighLevel/USBMode.h" 68 | 69 | #if defined(USB_CAN_BE_DEVICE) 70 | #include "Device/MassStorage.h" 71 | #endif 72 | 73 | #if defined(USB_CAN_BE_HOST) 74 | #include "Host/MassStorage.h" 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/HID.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB HID Class driver. 33 | * 34 | * Master include file for the library USB HID Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassHID HID Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/HID.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/HID.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * - LUFA/Drivers/USB/Class/Host/HIDParser.c (Makefile source module name: LUFA_SRC_USB) 48 | * 49 | * \section Module Description 50 | * HID Class Driver module. This module contains an internal implementation of the USB HID Class, for both Device 51 | * and Host USB modes. User applications can use this class driver instead of implementing the HID class manually 52 | * via the low-level LUFA APIs. 53 | * 54 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 55 | * Hosts or Devices using the USB HID Class. 56 | * 57 | * @{ 58 | */ 59 | 60 | #ifndef _HID_CLASS_H_ 61 | #define _HID_CLASS_H_ 62 | 63 | /* Macros: */ 64 | #define __INCLUDE_FROM_USB_DRIVER 65 | #define __INCLUDE_FROM_HID_DRIVER 66 | 67 | /* Includes: */ 68 | #include "../HighLevel/USBMode.h" 69 | 70 | #if defined(USB_CAN_BE_DEVICE) 71 | #include "Device/HID.h" 72 | #endif 73 | 74 | #if defined(USB_CAN_BE_HOST) 75 | #include "Host/HID.h" 76 | #endif 77 | 78 | #endif 79 | 80 | /** @} */ 81 | 82 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/Printer.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Printer Class driver. 33 | * 34 | * Master include file for the library USB Printer Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassPrinter Printer Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Host/Printer.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * 47 | * \section Module Description 48 | * Printer Class Driver module. This module contains an internal implementation of the USB Printer Class, for the base 49 | * USB Printer transport layer for USB Host mode only. Note that printers are free to implement whatever printer language 50 | * they choose on top of this (e.g. Postscript), and so this driver exposes low level data transport functions only rather 51 | * than high level raster or text functions. User applications can use this class driver instead of implementing the Printer 52 | * class manually via the low-level LUFA APIs. 53 | * 54 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 55 | * Devices using the USB Printer Class. 56 | * 57 | * @{ 58 | */ 59 | 60 | #ifndef _PRINTER_CLASS_H_ 61 | #define _PRINTER_CLASS_H_ 62 | 63 | /* Macros: */ 64 | #define __INCLUDE_FROM_USB_DRIVER 65 | #define __INCLUDE_FROM_PRINTER_DRIVER 66 | 67 | /* Includes: */ 68 | #include "../HighLevel/USBMode.h" 69 | 70 | #if defined(USB_CAN_BE_HOST) 71 | #include "Host/Printer.h" 72 | #endif 73 | 74 | #endif 75 | 76 | /** @} */ 77 | 78 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/Device/Audio.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../../HighLevel/USBMode.h" 33 | #if defined(USB_CAN_BE_DEVICE) 34 | 35 | #define __INCLUDE_FROM_AUDIO_DRIVER 36 | #define __INCLUDE_FROM_AUDIO_DEVICE_C 37 | #include "Audio.h" 38 | 39 | void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) 40 | { 41 | if (!(Endpoint_IsSETUPReceived())) 42 | return; 43 | 44 | if (USB_ControlRequest.wIndex != AudioInterfaceInfo->Config.StreamingInterfaceNumber) 45 | return; 46 | 47 | switch (USB_ControlRequest.bRequest) 48 | { 49 | case REQ_SetInterface: 50 | if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE)) 51 | { 52 | Endpoint_ClearSETUP(); 53 | Endpoint_ClearStatusStage(); 54 | 55 | AudioInterfaceInfo->State.InterfaceEnabled = ((USB_ControlRequest.wValue & 0xFF) != 0); 56 | } 57 | 58 | break; 59 | } 60 | } 61 | 62 | bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) 63 | { 64 | memset(&AudioInterfaceInfo->State, 0x00, sizeof(AudioInterfaceInfo->State)); 65 | 66 | for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++) 67 | { 68 | uint16_t Size; 69 | uint8_t Type; 70 | uint8_t Direction; 71 | 72 | if (EndpointNum == AudioInterfaceInfo->Config.DataINEndpointNumber) 73 | { 74 | Size = AudioInterfaceInfo->Config.DataINEndpointSize; 75 | Direction = ENDPOINT_DIR_IN; 76 | Type = EP_TYPE_ISOCHRONOUS; 77 | } 78 | else if (EndpointNum == AudioInterfaceInfo->Config.DataOUTEndpointNumber) 79 | { 80 | Size = AudioInterfaceInfo->Config.DataOUTEndpointSize; 81 | Direction = ENDPOINT_DIR_OUT; 82 | Type = EP_TYPE_ISOCHRONOUS; 83 | } 84 | else 85 | { 86 | continue; 87 | } 88 | 89 | if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size, ENDPOINT_BANK_DOUBLE))) 90 | { 91 | return false; 92 | } 93 | } 94 | 95 | return true; 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/USBKEY/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel USBKEY. 33 | * 34 | * Board specific Buttons driver header for the Atmel USBKEY. 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_USBKEY USBKEY 42 | * 43 | * Board specific Buttons driver header for the Atmel USBKEY. 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_USBKEY_H__ 52 | #define __BUTTONS_USBKEY_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 2) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRE &= ~BUTTONS_BUTTON1; 80 | PORTE |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/ManPages/LUFAvsAtmelStack.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_LUFAvsAtmelStack LUFA vs the Atmel Stack 9 | * 10 | * Atmel offers an official USB AVR stack, which may be incorporated into user projects and products. As LUFA and the Atmel 11 | * stack aims to give roughly the same functionality to a design, it is often asked what advantages LUFA carries over the 12 | * official Atmel USB stack. Below are just some of the advantages to choosing LUFA over the official stack. 13 | * 14 | * - Licensing: 15 | * LUFA is released under a very permissive MIT license (see \ref Page_LicenseInfo), while the Atmel stack carries several 16 | * restrictions as to how and where it can be used. LUFA's licensing should be suitable for both Commercial and Non-Commercial 17 | * entities alike. 18 | * 19 | * - Demos and Projects: 20 | * Unlike the Atmel stack, LUFA comes with many different Device and Host mode Demos and Projects ready to run out of the box. 21 | * Atmel favors separate downloads for each of their (small set) of USB AVR demos, which requires more time and offers less 22 | * to the end-user. LUFA also contains several open source Bootloaders, which can be modified as the user wishes to suit his or 23 | * her application, instead of being forced to use Atmel's single prebuilt (closed-source) DFU bootloader. 24 | * 25 | * - Central Library Code: 26 | * LUFA is designed to allow the central library core code to be shared amongst several projects, so long as the compiled object 27 | * files are cleaned between different projects. This is in direct contrast to the Atmel library, which is strongly coupled to the 28 | * project it is integrated with. Using LUFA allows for only one copy of the library core to be needed for all applications, and 29 | * makes updating the library used in all projects a trivial copy-and-paste process. 30 | * 31 | * - Clean API: 32 | * One of the main design goals of LUFA is to make the API easy to use. While LUFA is a fluid project which has undergone many 33 | * API improvements, the API is arguably much nicer to use and easier to understand than the equivalent Atmel stack code. LUFA's 34 | * API is also more complete than the Atmel stack, and contains many features to speed up application development. 35 | * 36 | * - Full Hardware Support: 37 | * LUFA supports the full range of Atmel's USB AVR microcontrollers (see \ref Page_DeviceSupport), with porting between chips being 38 | * as simple as a single compile switch in many cases. Atmel's stack requires different libraries to be used based on the USB AVR 39 | * microcontroller series, complicating the process of moving between USB AVR models. In addition, LUFA contains drivers for all the 40 | * hardware contained on Atmel's USB AVR based boards, so you can get started quickly and easily. 41 | * 42 | * - Better Library Support: 43 | * As many people are now using LUFA, there is a community being built around it. You can get answers to your LUFA related questions 44 | * quickly by either emailing the library author (subject to author's schedule) or by posting to the official LUFA support mailing list. 45 | */ 46 | 47 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/MINIMUS/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the MINIMUS. 33 | * 34 | * Board specific Buttons driver header for the MINIMUS. 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_MINIMUS MINIMUS 42 | * 43 | * Board specific Buttons driver header for the MINIMUS. 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_MINIMUS_H__ 52 | #define __BUTTONS_MINIMUS_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 8) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/UDIP/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the UDIP. 33 | * 34 | * Board specific Buttons driver header for the Linnix UDIP (http://linnix.com/udip/). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_UDIP UDIP 42 | * 43 | * Board specific Buttons driver header for the Linnix UDIP (http://linnix.com/udip/). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_UDIP_H__ 52 | #define __BUTTONS_UDIP_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel ATAVRUSBRF01. 33 | * 34 | * Board specific Buttons driver header for the Atmel ATAVRUSBRF01. 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_ATAVRUSBRF01 ATAVRUSBRF01 42 | * 43 | * Board specific Buttons driver header for the Atmel ATAVRUSBRF01. 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_ATAVRUSBRF01_H__ 52 | #define __BUTTONS_ATAVRUSBRF01_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/CULV3/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific LED driver header for the Busware CULV3. 33 | * 34 | * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the LEDs driver 37 | * dispatch header located in LUFA/Drivers/Board/LEDs.h. 38 | */ 39 | 40 | /** \ingroup Group_LEDs 41 | * @defgroup Group_LEDs_CULV3 CULV3 42 | * 43 | * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the LEDs driver 46 | * dispatch header located in LUFA/Drivers/Board/LEDs.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_CULV3_H__ 52 | #define __BUTTONS_CULV3_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 2) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRE &= ~BUTTONS_BUTTON1; 80 | PORTE |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/Class/MIDI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB MIDI Class driver. 33 | * 34 | * Master include file for the library USB MIDI Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * @defgroup Group_USBClassMIDI MIDI Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/MIDI.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/MIDI.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Module Description 49 | * MIDI Class Driver module. This module contains an internal implementation of the USB MIDI Class, for both Device 50 | * and Host USB modes. User applications can use this class driver instead of implementing the MIDI class manually 51 | * via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts or Devices using the USB MIDI Class. 55 | * 56 | * \note The USB MIDI class is actually a special case of the regular Audio class, thus this module depends on 57 | * structure definitions from the \ref Group_USBClassAudioDevice class driver module. 58 | * 59 | * @{ 60 | */ 61 | 62 | #ifndef _MIDI_CLASS_H_ 63 | #define _MIDI_CLASS_H_ 64 | 65 | /* Macros: */ 66 | #define __INCLUDE_FROM_USB_DRIVER 67 | #define __INCLUDE_FROM_MIDI_DRIVER 68 | 69 | /* Includes: */ 70 | #include "../HighLevel/USBMode.h" 71 | 72 | #if defined(USB_CAN_BE_DEVICE) 73 | #include "Device/MIDI.h" 74 | #endif 75 | 76 | #if defined(USB_CAN_BE_HOST) 77 | #include "Host/MIDI.h" 78 | #endif 79 | 80 | #endif 81 | 82 | /** @} */ 83 | 84 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/BENITO/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Tempusdictum Benito. 33 | * 34 | * Board specific Buttons driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_BENITO BENITO 42 | * 43 | * Board specific Buttons driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_BENITO_H__ 52 | #define __BUTTONS_BENITO_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/JMDBU2/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Mattairtech JM-DB-U2. 33 | * 34 | * Board specific Buttons driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_JMDBU2 JMDBU2 42 | * 43 | * Board specific Buttons driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_JMDBU2_H__ 52 | #define __BUTTONS_JMDBU2_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/USBTINYMKII/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for Tom's USBTINY MKII. 33 | * 34 | * Board specific Buttons driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_USBTINYMKII USBTINYMKII 42 | * 43 | * Board specific Buttons driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_USBTINYMKII_H__ 52 | #define __BUTTONS_USBTINYMKII_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/MICROSIN162/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Microsin AVR-USB162 board. 33 | * 34 | * Board specific Buttons driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_MICROSIN162 MICROSIN162 42 | * 43 | * Board specific Buttons driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_MICROSIN162_H__ 52 | #define __BUTTONS_MICROSIN162_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/USBFOO/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Kernel Concepts USBFOO. 33 | * 34 | * Board specific Buttons driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_USBFOO USBFOO 42 | * 43 | * Board specific Buttons driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_USBFOO_H__ 52 | #define __BUTTONS_USBFOO_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/OLIMEX162/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Olimex AVR-USB-162 Development Board. 33 | * 34 | * Board specific Buttons driver header for the Olimex AVR-USB-162 Development Board (http://www.olimex.com/dev/avr-usb-162.html). 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_OLIMEX162 OLIMEX162 42 | * 43 | * Board specific Buttons driver header for the Olimex AVR-USB-162 Development Board (http://www.olimex.com/dev/avr-usb-162.html). 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_OLIMEX162_H__ 52 | #define __BUTTONS_OLIMEX162_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Enable C linkage for C++ Compilers: */ 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | 65 | /* Preprocessor Checks: */ 66 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 67 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 68 | #endif 69 | 70 | /* Public Interface - May be used in end-application: */ 71 | /* Macros: */ 72 | /** Button mask for the first button on the board. */ 73 | #define BUTTONS_BUTTON1 (1 << 7) 74 | 75 | /* Inline Functions: */ 76 | #if !defined(__DOXYGEN__) 77 | static inline void Buttons_Init(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD |= BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/lufa_usb_virtual_serial/Descriptors.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for Descriptors.c. 34 | */ 35 | 36 | #ifndef _DESCRIPTORS_H_ 37 | #define _DESCRIPTORS_H_ 38 | 39 | /* Includes: */ 40 | #include <../LUFA/Drivers/USB/USB.h> 41 | 42 | #include 43 | 44 | /* Macros: */ 45 | /** Endpoint number of the CDC device-to-host notification IN endpoint. */ 46 | #define CDC_NOTIFICATION_EPNUM 2 47 | 48 | /** Endpoint number of the CDC device-to-host data IN endpoint. */ 49 | #define CDC_TX_EPNUM 3 50 | 51 | /** Endpoint number of the CDC host-to-device data OUT endpoint. */ 52 | #define CDC_RX_EPNUM 4 53 | 54 | /** Size in bytes of the CDC device-to-host notification IN endpoint. */ 55 | #define CDC_NOTIFICATION_EPSIZE 8 56 | 57 | /** Size in bytes of the CDC data IN and OUT endpoints. */ 58 | #define CDC_TXRX_EPSIZE 16 59 | 60 | /* Type Defines: */ 61 | /** Type define for the device configuration descriptor structure. This must be defined in the 62 | * application code, as the configuration descriptor contains several sub-descriptors which 63 | * vary between devices, and which describe the device's usage to the host. 64 | */ 65 | typedef struct 66 | { 67 | USB_Descriptor_Configuration_Header_t Config; 68 | USB_Descriptor_Interface_t CDC_CCI_Interface; 69 | USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; 70 | USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; 71 | USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; 72 | USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; 73 | USB_Descriptor_Interface_t CDC_DCI_Interface; 74 | USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; 75 | USB_Descriptor_Endpoint_t CDC_DataInEndpoint; 76 | } USB_Descriptor_Configuration_t; 77 | 78 | /* Function Prototypes: */ 79 | uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, 80 | const uint8_t wIndex, 81 | const void** const DescriptorAddress) 82 | ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); 83 | 84 | #endif 85 | 86 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/EVK527/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel EVK527. 33 | * 34 | * Board specific Buttons driver header for the Atmel EVK527. 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_EVK527 EVK527 42 | * 43 | * Board specific Buttons driver header for the Atmel EVK527. 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_EVK527_H__ 52 | #define __BUTTONS_EVK527_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Includes: */ 61 | #include 62 | #include 63 | 64 | #include "../../../Common/Common.h" 65 | 66 | /* Enable C linkage for C++ Compilers: */ 67 | #if defined(__cplusplus) 68 | extern "C" { 69 | #endif 70 | 71 | /* Preprocessor Checks: */ 72 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 73 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 74 | #endif 75 | 76 | /* Public Interface - May be used in end-application: */ 77 | /* Macros: */ 78 | /** Button mask for the first button on the board. */ 79 | #define BUTTONS_BUTTON1 (1 << 2) 80 | 81 | /* Inline Functions: */ 82 | #if !defined(__DOXYGEN__) 83 | static inline void Buttons_Init(void) 84 | { 85 | DDRE &= ~BUTTONS_BUTTON1; 86 | PORTE |= BUTTONS_BUTTON1; 87 | } 88 | 89 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 90 | static inline uint8_t Buttons_GetStatus(void) 91 | { 92 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 93 | } 94 | #endif 95 | 96 | /* Disable C linkage for C++ Compilers: */ 97 | #if defined(__cplusplus) 98 | } 99 | #endif 100 | 101 | #endif 102 | 103 | /** @} */ 104 | 105 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/STK525/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel STK525. 33 | * 34 | * Board specific Buttons driver header for the Atmel STK525. 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_STK525 STK525 42 | * 43 | * Board specific Buttons driver header for the Atmel STK525. 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_STK525_H__ 52 | #define __BUTTONS_STK525_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Includes: */ 61 | #include 62 | #include 63 | 64 | #include "../../../Common/Common.h" 65 | 66 | /* Enable C linkage for C++ Compilers: */ 67 | #if defined(__cplusplus) 68 | extern "C" { 69 | #endif 70 | 71 | /* Preprocessor Checks: */ 72 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 73 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 74 | #endif 75 | 76 | /* Public Interface - May be used in end-application: */ 77 | /* Macros: */ 78 | /** Button mask for the first button on the board. */ 79 | #define BUTTONS_BUTTON1 (1 << 2) 80 | 81 | /* Inline Functions: */ 82 | #if !defined(__DOXYGEN__) 83 | static inline void Buttons_Init(void) 84 | { 85 | DDRE &= ~BUTTONS_BUTTON1; 86 | PORTE |= BUTTONS_BUTTON1; 87 | } 88 | 89 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 90 | static inline uint8_t Buttons_GetStatus(void) 91 | { 92 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 93 | } 94 | #endif 95 | 96 | /* Disable C linkage for C++ Compilers: */ 97 | #if defined(__cplusplus) 98 | } 99 | #endif 100 | 101 | #endif 102 | 103 | /** @} */ 104 | 105 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/STK526/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel STK526. 33 | * 34 | * Board specific Buttons driver header for the Atmel STK526. 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 37 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 38 | */ 39 | 40 | /** \ingroup Group_Buttons 41 | * @defgroup Group_Buttons_STK526 STK526 42 | * 43 | * Board specific Buttons driver header for the Atmel STK526. 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 46 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __BUTTONS_STK526_H__ 52 | #define __BUTTONS_STK526_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | #include 57 | 58 | #include "../../../Common/Common.h" 59 | 60 | /* Includes: */ 61 | #include 62 | #include 63 | 64 | #include "../../../Common/Common.h" 65 | 66 | /* Enable C linkage for C++ Compilers: */ 67 | #if defined(__cplusplus) 68 | extern "C" { 69 | #endif 70 | 71 | /* Preprocessor Checks: */ 72 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 73 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 74 | #endif 75 | 76 | /* Public Interface - May be used in end-application: */ 77 | /* Macros: */ 78 | /** Button mask for the first button on the board. */ 79 | #define BUTTONS_BUTTON1 (1 << 7) 80 | 81 | /* Inline Functions: */ 82 | #if !defined(__DOXYGEN__) 83 | static inline void Buttons_Init(void) 84 | { 85 | DDRD &= ~BUTTONS_BUTTON1; 86 | PORTD |= BUTTONS_BUTTON1; 87 | } 88 | 89 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 90 | static inline uint8_t Buttons_GetStatus(void) 91 | { 92 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 93 | } 94 | #endif 95 | 96 | /* Disable C linkage for C++ Compilers: */ 97 | #if defined(__cplusplus) 98 | } 99 | #endif 100 | 101 | #endif 102 | 103 | /** @} */ 104 | 105 | -------------------------------------------------------------------------------- /avrsrc/scd_hal.S: -------------------------------------------------------------------------------- 1 | // Assembler file for the Smart Card Detective Hardware Abstraction Layer 2 | // 3 | // This file should contain functions such as timer increments that 4 | // may be better done in assembler for efficiency of speed and space 5 | // 6 | // Author: Omar Choudary 7 | // 8 | // for information see: 9 | // http://www.nongnu.org/avr-libc/user-manual/group__asmdemo.html 10 | 11 | #include 12 | 13 | #include "counter.h" 14 | 15 | 16 | /** 17 | * Increment the value of the sync counter. 18 | * This method should be called from an interrupt routine 19 | * in order to update its value regularly. 20 | * No registers are preserved in order to speed up so 21 | * we asume the calling function is doing that. 22 | * 23 | * @return the value of the sync counter, which is assumed 24 | * to be used by avr-gcc in little endian 25 | * @sa ReatTimerT2 26 | */ 27 | .global IncrementCounter 28 | IncrementCounter: 29 | ldi r30, lo8(counter_t2) 30 | ldi r31, hi8(counter_t2) 31 | ld counter_b0, Z 32 | ldd counter_b1, Z+1 33 | ldd counter_b2, Z+2 34 | ldd counter_b3, Z+3 35 | ldi counter_inc, 1 ; use to increment with carry 36 | add counter_b0, counter_inc 37 | adc counter_b1, r1 38 | adc counter_b2, r1 39 | adc counter_b3, r1 40 | st Z, counter_b0 41 | std Z+1, counter_b1 42 | std Z+2, counter_b2 43 | std Z+3, counter_b3 44 | ret 45 | 46 | 47 | /** 48 | * This method returns the value of the sync counter. 49 | * The synchronization counter is updated within an interrupt 50 | * subroutine which is dependent on a hardware timer. 51 | * 52 | * @return the value of the sync counter, assumed to be used 53 | * by avr-gcc in little endian 54 | * @sa IncrementCounter 55 | */ 56 | .global GetCounter 57 | GetCounter: 58 | push counter_sreg ; used for SREG 59 | in counter_sreg, _SFR_IO_ADDR(SREG) ; save SREG 60 | cli ; disable interrupts 61 | 62 | ldi r30, lo8(counter_t2) 63 | ldi r31, hi8(counter_t2) 64 | ld r22, Z+ 65 | ld r23, Z+ 66 | ld r24, Z+ 67 | ld r25, Z+ 68 | 69 | out _SFR_IO_ADDR(SREG), counter_sreg 70 | pop counter_sreg 71 | ret 72 | 73 | /** 74 | * This method resets to 0 the value of the sync counter. 75 | * 76 | * @sa IncrementCounter 77 | */ 78 | .global ResetCounter 79 | ResetCounter: 80 | push counter_sreg ; used for SREG 81 | in counter_sreg, _SFR_IO_ADDR(SREG) ; save SREG 82 | cli ; disable interrupts 83 | 84 | ldi r30, lo8(counter_t2) 85 | ldi r31, hi8(counter_t2) 86 | st Z, r1 87 | std Z+1, r1 88 | std Z+2, r1 89 | std Z+3, r1 90 | 91 | out _SFR_IO_ADDR(SREG), counter_sreg 92 | pop counter_sreg 93 | ret 94 | 95 | /** 96 | * This method sets the value of the sync counter to the given value 97 | * 98 | * @param value the desired value of the counter 99 | * @sa IncrementCounter 100 | */ 101 | .global SetCounter 102 | SetCounter: 103 | push counter_sreg ; used for SREG 104 | in counter_sreg, _SFR_IO_ADDR(SREG) ; save SREG 105 | cli ; disable interrupts 106 | 107 | ldi r30, lo8(counter_t2) 108 | ldi r31, hi8(counter_t2) 109 | st Z, r22 110 | std Z+1, r23 111 | std Z+2, r24 112 | std Z+3, r25 113 | 114 | out _SFR_IO_ADDR(SREG), counter_sreg 115 | pop counter_sreg 116 | ret 117 | 118 | -------------------------------------------------------------------------------- /avrsrc/scd_values.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief scd_values.h header file 4 | * 5 | * This file defines the error/success codes returned by functions 6 | * 7 | * Copyright (C) 2013 Omar Choudary (omar.choudary@cl.cam.ac.uk) 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * - Redistributions of source code must retain the above copyright notice, this 13 | * list of conditions and the following disclaimer. 14 | * 15 | * - Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef _SCD_VALUES_H_ 33 | #define _SCD_VALUES_H_ 34 | 35 | typedef enum retstat{ 36 | RET_SUCCESS = 0, 37 | 38 | // General errors 39 | RET_ERROR = 0x01, 40 | RET_ERR_CHECK = 0x02, 41 | RET_ERR_PARAM = 0x03, 42 | RET_ERR_MEMORY = 0x04, 43 | 44 | // ICC errors 45 | RET_ICC_INIT_ACTIVATE = 0x10, 46 | RET_ICC_INIT_RESPONSE = 0x11, 47 | RET_ICC_INIT_ATR_TS = 0x12, 48 | RET_ICC_INIT_ATR_T0 = 0x13, 49 | RET_ICC_INIT_ATR_TB1 = 0x14, 50 | RET_ICC_INIT_ATR_TD1 = 0x15, 51 | RET_ICC_INIT_ATR_TA2 = 0x16, 52 | RET_ICC_INIT_ATR_TB2 = 0x17, 53 | RET_ICC_INIT_ATR_TC2 = 0x18, 54 | RET_ICC_INIT_ATR_TA3 = 0x19, 55 | RET_ICC_INIT_ATR_TB3 = 0x10, 56 | RET_ICC_INIT_ATR_TC3 = 0x1A, 57 | RET_ICC_INIT_ATR_T1_CHECK = 0x1B, 58 | RET_ICC_BAD_PROTO = 0x1C, 59 | RET_ICC_TIME_OUT = 0x1D, 60 | RET_ICC_SEND_CMD = 0x1E, 61 | RET_ICC_GET_RESPONSE = 0x1F, 62 | 63 | // Terminal conditions 64 | RET_TERMINAL_RESET_LOW = 0x20, 65 | RET_TERMINAL_TIME_OUT = 0x21, 66 | RET_TERMINAL_GET_CMD = 0x22, 67 | RET_TERMINAL_SEND_RESPONSE = 0x22, 68 | RET_TERMINAL_ENCRYPTED_PIN = 0x23, 69 | RET_TERMINAL_NO_CLOCK = 0x24, 70 | 71 | // EMV protocol/command errors 72 | RET_EMV_SELECT = 0x30, 73 | RET_EMV_INIT_TRANSACTION = 0x31, 74 | RET_EMV_READ_DATA = 0x32, 75 | RET_EMV_GET_DATA = 0x33, 76 | RET_EMV_DDA = 0x34, 77 | RET_EMV_PIN_TRY_EXCEEDED = 0x35, 78 | RET_EMV_GENERATE_AC = 0x35, 79 | 80 | // USB errors 81 | RET_USB_ERR_RECEIVE = 0x40, 82 | RET_USB_ERR_SEND = 0x41, 83 | } RETURN_CODE; 84 | 85 | #endif // _SCD_VALUES_H_ 86 | -------------------------------------------------------------------------------- /tools/lufa_cdc_driver_windows.inf: -------------------------------------------------------------------------------- 1 | ;************************************************************ 2 | ; Windows USB CDC ACM Setup File 3 | ; Copyright (c) 2000 Microsoft Corporation 4 | 5 | 6 | [Version] 7 | Signature="$Windows NT$" 8 | Class=Ports 9 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 10 | Provider=%MFGNAME% 11 | LayoutFile=layout.inf 12 | CatalogFile=%MFGFILENAME%.cat 13 | DriverVer=11/15/2007,5.1.2600.0 14 | 15 | [Manufacturer] 16 | %MFGNAME%=DeviceList, NTamd64 17 | 18 | [DestinationDirs] 19 | DefaultDestDir=12 20 | 21 | 22 | ;------------------------------------------------------------------------------ 23 | ; Windows 2000/XP/Vista-32bit Sections 24 | ;------------------------------------------------------------------------------ 25 | 26 | [DriverInstall.nt] 27 | include=mdmcpq.inf 28 | CopyFiles=DriverCopyFiles.nt 29 | AddReg=DriverInstall.nt.AddReg 30 | 31 | [DriverCopyFiles.nt] 32 | usbser.sys,,,0x20 33 | 34 | [DriverInstall.nt.AddReg] 35 | HKR,,DevLoader,,*ntkern 36 | HKR,,NTMPDriver,,%DRIVERFILENAME%.sys 37 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" 38 | 39 | [DriverInstall.nt.Services] 40 | AddService=usbser, 0x00000002, DriverService.nt 41 | 42 | [DriverService.nt] 43 | DisplayName=%SERVICE% 44 | ServiceType=1 45 | StartType=3 46 | ErrorControl=1 47 | ServiceBinary=%12%\%DRIVERFILENAME%.sys 48 | 49 | ;------------------------------------------------------------------------------ 50 | ; Vista-64bit Sections 51 | ;------------------------------------------------------------------------------ 52 | 53 | [DriverInstall.NTamd64] 54 | include=mdmcpq.inf 55 | CopyFiles=DriverCopyFiles.NTamd64 56 | AddReg=DriverInstall.NTamd64.AddReg 57 | 58 | [DriverCopyFiles.NTamd64] 59 | %DRIVERFILENAME%.sys,,,0x20 60 | 61 | [DriverInstall.NTamd64.AddReg] 62 | HKR,,DevLoader,,*ntkern 63 | HKR,,NTMPDriver,,%DRIVERFILENAME%.sys 64 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" 65 | 66 | [DriverInstall.NTamd64.Services] 67 | AddService=usbser, 0x00000002, DriverService.NTamd64 68 | 69 | [DriverService.NTamd64] 70 | DisplayName=%SERVICE% 71 | ServiceType=1 72 | StartType=3 73 | ErrorControl=1 74 | ServiceBinary=%12%\%DRIVERFILENAME%.sys 75 | 76 | 77 | ;------------------------------------------------------------------------------ 78 | ; Vendor and Product ID Definitions 79 | ;------------------------------------------------------------------------------ 80 | ; When developing your USB device, the VID and PID used in the PC side 81 | ; application program and the firmware on the microcontroller must match. 82 | ; Modify the below line to use your VID and PID. Use the format as shown below. 83 | ; Note: One INF file can be used for multiple devices with different VID and PIDs. 84 | ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. 85 | ;------------------------------------------------------------------------------ 86 | [SourceDisksFiles] 87 | [SourceDisksNames] 88 | [DeviceList] 89 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 90 | 91 | [DeviceList.NTamd64] 92 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 93 | 94 | 95 | ;------------------------------------------------------------------------------ 96 | ; String Definitions 97 | ;------------------------------------------------------------------------------ 98 | ;Modify these strings to customize your device 99 | ;------------------------------------------------------------------------------ 100 | [Strings] 101 | MFGFILENAME="CDC_vista" 102 | DRIVERFILENAME ="usbser" 103 | MFGNAME="http://www.lufa-lib.org" 104 | INSTDISK="LUFA CDC Driver Installer" 105 | DESCRIPTION="Communications Port" 106 | SERVICE="USB RS-232 Emulation Driver" 107 | 108 | -------------------------------------------------------------------------------- /avrsrc/scd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief scd.h Header file 4 | * 5 | * Contains definitions of functions used by the Smart Card Detective 6 | * 7 | * Copyright (C) 2013 Omar Choudary (omar.choudary@cl.cam.ac.uk) 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * - Redistributions of source code must retain the above copyright notice, this 13 | * list of conditions and the following disclaimer. 14 | * 15 | * - Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | 33 | #ifndef _SCD_H_ 34 | #define _SCD_H_ 35 | 36 | //------------------------------------------------------------ 37 | 38 | /// This is a magic value that may be used in detecting a warm reset 39 | #define WARM_RESET_VALUE 0xAA 40 | 41 | /// Maximum number of command-response pairs recorded when logging 42 | #define MAX_EXCHANGES 50 43 | 44 | /// EEPROM address for byte used on warm reset 45 | #define EEPROM_WARM_RESET 0x0 46 | 47 | /// EEPROM address for counter value from T2 - 4 bytes little endian 48 | #define EEPROM_TIMER_T2 0x4 49 | 50 | /// Temporary space 1 - use this for any purpose, 4 bytes 51 | #define EEPROM_TEMP_1 0x8 52 | 53 | /// Temporary space 2 - use this for any purpose, 4 bytes 54 | #define EEPROM_TEMP_2 0x12 55 | 56 | /// EEPROM address for selected application 57 | #define EEPROM_APPLICATION 0x32 58 | 59 | /// EEPROM address for transaction counter 60 | #define EEPROM_COUNTER 0x40 61 | 62 | /// EEPROM address for log high address pointer 63 | #define EEPROM_TLOG_POINTER_HI 0x48 64 | 65 | /// EEPROM address for log low address pointer 66 | #define EEPROM_TLOG_POINTER_LO 0x49 67 | 68 | /// EEPROM address for transaction log data 69 | #define EEPROM_TLOG_DATA 0x80 70 | 71 | /// EEPROM maximum allowed address 72 | #define EEPROM_MAX_ADDRESS 0xFE0 73 | 74 | // External definitions 75 | extern char* appStrings[]; 76 | 77 | //------------------------------------------------------------ 78 | 79 | 80 | /// Main function 81 | int main(void); 82 | 83 | /// Initializes the SCD 84 | void InitSCD(); 85 | 86 | /// Show menu and select application 87 | uint8_t SelectApplication(); 88 | 89 | /// Jump to bootloader if required 90 | void BootloaderJumpCheck(void) __attribute__ ((naked, section (".init3"))); 91 | 92 | /** Self Test methods **/ 93 | /// Tests the SCD-Terminal communication 94 | void TestSCDTerminal(); 95 | 96 | /// Tests the SCD-ICC communication 97 | void TestSCDICC(); 98 | 99 | /// Simple application to switch some LEDs on and off 100 | void SwitchLeds(); 101 | 102 | /// Tests the hardware (LEDs, LCD and buttons) 103 | void TestHardware(); 104 | 105 | #endif // _SCD_H_ 106 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief USB endpoint/pipe stream callback management. 33 | * 34 | * This file contains definitions for the creation of optional callback routines which can be passed to the 35 | * endpoint and/or pipe stream APIs, to abort the transfer currently in progress when a condition is met. 36 | * 37 | * \note This file should not be included directly. It is automatically included as needed by the USB driver 38 | * dispatch header located in LUFA/Drivers/USB/USB.h. 39 | */ 40 | 41 | /** \ingroup Group_USB 42 | * @defgroup Group_StreamCallbacks Endpoint and Pipe Stream Callbacks 43 | * 44 | * Macros and enums for the stream callback routines. This module contains the code required to easily set up 45 | * stream callback functions which can be used to force early abort of a stream read/write process. Each callback 46 | * should take no arguments, and return a value from the \ref StreamCallback_Return_ErrorCodes_t enum. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __STREAMCALLBACK_H__ 52 | #define __STREAMCALLBACK_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | 57 | /* Preprocessor Checks: */ 58 | #if !defined(__INCLUDE_FROM_USB_DRIVER) 59 | #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. 60 | #endif 61 | 62 | /* Public Interface - May be used in end-application: */ 63 | /* Macros: */ 64 | /** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream 65 | * call has no callback function to be called between USB packets. 66 | */ 67 | #define NO_STREAM_CALLBACK NULL 68 | 69 | /* Enums: */ 70 | /** Enum for the possible error return codes of a stream callback function. */ 71 | enum StreamCallback_Return_ErrorCodes_t 72 | { 73 | STREAMCALLBACK_Continue = 0, /**< Continue sending or receiving the stream. */ 74 | STREAMCALLBACK_Abort = 1, /**< Abort the stream send or receiving process. */ 75 | }; 76 | 77 | /* Type Defines: */ 78 | /** Type define for a Stream Callback function (function taking no arguments and retuning a 79 | * uint8_t value). Stream callback functions should have an identical function signature if they 80 | * are to be used as the callback parameter of the stream functions. 81 | */ 82 | typedef uint8_t (* const StreamCallbackPtr_t)(void); 83 | 84 | #endif 85 | 86 | /** @} */ 87 | 88 | -------------------------------------------------------------------------------- /avrsrc/lufa_usb_virtual_serial/Board/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | * File modified for the Smart Card Detective by Omar Choudary 11 | */ 12 | 13 | 14 | /* 15 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 16 | 17 | Permission to use, copy, modify, distribute, and sell this 18 | software and its documentation for any purpose is hereby granted 19 | without fee, provided that the above copyright notice appear in 20 | all copies and that both that the copyright notice and this 21 | permission notice and warranty disclaimer appear in supporting 22 | documentation, and that the name of the author not be used in 23 | advertising or publicity pertaining to distribution of the 24 | software without specific, written prior permission. 25 | 26 | The author disclaim all warranties with regard to this 27 | software, including all implied warranties of merchantability 28 | and fitness. In no event shall the author be liable for any 29 | special, indirect or consequential damages or any damages 30 | whatsoever resulting from loss of use, data or profits, whether 31 | in an action of contract, negligence or other tortious action, 32 | arising out of or in connection with the use or performance of 33 | this software. 34 | */ 35 | 36 | /* 37 | This is a stub driver header file, for implementing custom board 38 | layout hardware with compatible LUFA board specific drivers. If 39 | the library is configured to use the BOARD_USER board mode, this 40 | driver file should be completed and copied into the "/Board/" folder 41 | inside the application's folder. 42 | 43 | This stub is for the board-specific component of the LUFA Buttons driver, 44 | for the control of physical board-mounted GPIO pushbuttons. 45 | */ 46 | 47 | #ifndef __BUTTONS_USER_H__ 48 | #define __BUTTONS_USER_H__ 49 | 50 | /* Includes: */ 51 | #include 52 | #include 53 | 54 | // TODO: Add any required includes here 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Button mask for the first button on the board. */ 69 | #define BUTTONS_BUTTON1 0x11 // TODO: Add mask for first board button here 70 | 71 | /* Inline Functions: */ 72 | #if !defined(__DOXYGEN__) 73 | static inline void Buttons_Init(void) 74 | { 75 | // TODO: Initialize the appropriate port pins as an inputs here, with pull-ups 76 | DDRF &= 0xF0; 77 | PORTF |= 0x0F; 78 | } 79 | 80 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 81 | static inline uint8_t Buttons_GetStatus(void) 82 | { 83 | // TODO: Return current button status here, debounced if required 84 | uint8_t result = 0; 85 | 86 | if(bit_is_clear(PINF, PF3)) result |= BUTTON_A; 87 | if(bit_is_clear(PINF, PF2)) result |= BUTTON_B; 88 | if(bit_is_clear(PINF, PF1)) result |= BUTTON_C; 89 | if(bit_is_clear(PINF, PF0)) result |= BUTTON_D; 90 | 91 | return result; 92 | } 93 | #endif 94 | 95 | /* Disable C linkage for C++ Compilers: */ 96 | #if defined(__cplusplus) 97 | } 98 | #endif 99 | 100 | #endif 101 | 102 | -------------------------------------------------------------------------------- /avrsrc/lufa_usb_virtual_serial/LUFA VirtualSerial.inf: -------------------------------------------------------------------------------- 1 | ;************************************************************ 2 | ; Windows USB CDC ACM Setup File 3 | ; Copyright (c) 2000 Microsoft Corporation 4 | 5 | 6 | [Version] 7 | Signature="$Windows NT$" 8 | Class=Ports 9 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 10 | Provider=%MFGNAME% 11 | LayoutFile=layout.inf 12 | CatalogFile=%MFGFILENAME%.cat 13 | DriverVer=11/15/2007,5.1.2600.0 14 | 15 | [Manufacturer] 16 | %MFGNAME%=DeviceList, NTamd64 17 | 18 | [DestinationDirs] 19 | DefaultDestDir=12 20 | 21 | 22 | ;------------------------------------------------------------------------------ 23 | ; Windows 2000/XP/Vista-32bit Sections 24 | ;------------------------------------------------------------------------------ 25 | 26 | [DriverInstall.nt] 27 | include=mdmcpq.inf 28 | CopyFiles=DriverCopyFiles.nt 29 | AddReg=DriverInstall.nt.AddReg 30 | 31 | [DriverCopyFiles.nt] 32 | usbser.sys,,,0x20 33 | 34 | [DriverInstall.nt.AddReg] 35 | HKR,,DevLoader,,*ntkern 36 | HKR,,NTMPDriver,,%DRIVERFILENAME%.sys 37 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" 38 | 39 | [DriverInstall.nt.Services] 40 | AddService=usbser, 0x00000002, DriverService.nt 41 | 42 | [DriverService.nt] 43 | DisplayName=%SERVICE% 44 | ServiceType=1 45 | StartType=3 46 | ErrorControl=1 47 | ServiceBinary=%12%\%DRIVERFILENAME%.sys 48 | 49 | ;------------------------------------------------------------------------------ 50 | ; Vista-64bit Sections 51 | ;------------------------------------------------------------------------------ 52 | 53 | [DriverInstall.NTamd64] 54 | include=mdmcpq.inf 55 | CopyFiles=DriverCopyFiles.NTamd64 56 | AddReg=DriverInstall.NTamd64.AddReg 57 | 58 | [DriverCopyFiles.NTamd64] 59 | %DRIVERFILENAME%.sys,,,0x20 60 | 61 | [DriverInstall.NTamd64.AddReg] 62 | HKR,,DevLoader,,*ntkern 63 | HKR,,NTMPDriver,,%DRIVERFILENAME%.sys 64 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" 65 | 66 | [DriverInstall.NTamd64.Services] 67 | AddService=usbser, 0x00000002, DriverService.NTamd64 68 | 69 | [DriverService.NTamd64] 70 | DisplayName=%SERVICE% 71 | ServiceType=1 72 | StartType=3 73 | ErrorControl=1 74 | ServiceBinary=%12%\%DRIVERFILENAME%.sys 75 | 76 | 77 | ;------------------------------------------------------------------------------ 78 | ; Vendor and Product ID Definitions 79 | ;------------------------------------------------------------------------------ 80 | ; When developing your USB device, the VID and PID used in the PC side 81 | ; application program and the firmware on the microcontroller must match. 82 | ; Modify the below line to use your VID and PID. Use the format as shown below. 83 | ; Note: One INF file can be used for multiple devices with different VID and PIDs. 84 | ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. 85 | ;------------------------------------------------------------------------------ 86 | [SourceDisksFiles] 87 | [SourceDisksNames] 88 | [DeviceList] 89 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 90 | 91 | [DeviceList.NTamd64] 92 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 93 | 94 | 95 | ;------------------------------------------------------------------------------ 96 | ; String Definitions 97 | ;------------------------------------------------------------------------------ 98 | ;Modify these strings to customize your device 99 | ;------------------------------------------------------------------------------ 100 | [Strings] 101 | MFGFILENAME="CDC_vista" 102 | DRIVERFILENAME ="usbser" 103 | MFGNAME="http://www.lufa-lib.org" 104 | INSTDISK="LUFA CDC Driver Installer" 105 | DESCRIPTION="Communications Port" 106 | SERVICE="USB RS-232 Emulation Driver" -------------------------------------------------------------------------------- /avrsrc/LUFA/CodeTemplates/DriverStubs/Joystick.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /* 32 | This is a stub driver header file, for implementing custom board 33 | layout hardware with compatible LUFA board specific drivers. If 34 | the library is configured to use the BOARD_USER board mode, this 35 | driver file should be completed and copied into the "/Board/" folder 36 | inside the application's folder. 37 | 38 | This stub is for the board-specific component of the LUFA Joystick 39 | driver, a small surface mount four-way (plus button) digital joystick 40 | on most USB AVR boards. 41 | */ 42 | 43 | #ifndef __JOYSTICK_USER_H__ 44 | #define __JOYSTICK_USER_H__ 45 | 46 | /* Includes: */ 47 | #include 48 | 49 | // TODO: Add any required includes here 50 | 51 | /* Enable C linkage for C++ Compilers: */ 52 | #if defined(__cplusplus) 53 | extern "C" { 54 | #endif 55 | 56 | /* Preprocessor Checks: */ 57 | #if !defined(__INCLUDE_FROM_JOYSTICK_H) 58 | #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. 59 | #endif 60 | 61 | /* Public Interface - May be used in end-application: */ 62 | /* Macros: */ 63 | /** Mask for the joystick being pushed in the left direction. */ 64 | #define JOY_LEFT // TODO: Add mask to indicate joystick left position here 65 | 66 | /** Mask for the joystick being pushed in the right direction. */ 67 | #define JOY_RIGHT // TODO: Add mask to indicate joystick right position here 68 | 69 | /** Mask for the joystick being pushed in the upward direction. */ 70 | #define JOY_UP // TODO: Add mask to indicate joystick up position here 71 | 72 | /** Mask for the joystick being pushed in the downward direction. */ 73 | #define JOY_DOWN // TODO: Add mask to indicate joystick down position here 74 | 75 | /** Mask for the joystick being pushed inward. */ 76 | #define JOY_PRESS // TODO: Add mask to indicate joystick pressed position here 77 | 78 | /* Inline Functions: */ 79 | #if !defined(__DOXYGEN__) 80 | static inline void Joystick_Init(void) 81 | { 82 | // TODO: Initialize joystick port pins as inputs with pull-ups 83 | } 84 | 85 | static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 86 | static inline uint8_t Joystick_GetStatus(void) 87 | { 88 | // TODO: Return current joystick position data which can be obtained by masking against the JOY_* macros 89 | } 90 | #endif 91 | 92 | /* Disable C linkage for C++ Compilers: */ 93 | #if defined(__cplusplus) 94 | } 95 | #endif 96 | 97 | #endif 98 | 99 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/BUMBLEB/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Fletchtronics BUMBLEB. 33 | * 34 | * Board specific Buttons driver header for the Fletchtronics BUMBLEB (http://fletchtronics.net/bumble-b). 35 | * 36 | * The BUMBLEB third-party board does not include any on-board peripherals, but does have an officially recommended 37 | * external peripheral layout for buttons, LEDs and a Joystick. 38 | * 39 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 40 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 41 | */ 42 | 43 | /** \ingroup Group_Buttons 44 | * @defgroup Group_Buttons_BUMBLEB BUMBLEB 45 | * 46 | * Board specific buttons driver header for the Fletchtronics BUMBLEB (http://fletchtronics.net/bumble-b). The BUMBLEB 47 | * third-party board does not include any on-board peripherals, but does have an officially recommended external peripheral 48 | * layout for buttons, LEDs and a Joystick. 49 | * 50 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 51 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 52 | * 53 | * @{ 54 | */ 55 | 56 | #ifndef __BUTTONS_BUMBLEB_H__ 57 | #define __BUTTONS_BUMBLEB_H__ 58 | 59 | /* Includes: */ 60 | #include 61 | #include 62 | 63 | #include "../../../Common/Common.h" 64 | 65 | /* Enable C linkage for C++ Compilers: */ 66 | #if defined(__cplusplus) 67 | extern "C" { 68 | #endif 69 | 70 | /* Preprocessor Checks: */ 71 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 72 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 73 | #endif 74 | 75 | /* Public Interface - May be used in end-application: */ 76 | /* Macros: */ 77 | /** Button mask for the first button on the board. */ 78 | #define BUTTONS_BUTTON1 (1 << 7) 79 | 80 | /* Inline Functions: */ 81 | #if !defined(__DOXYGEN__) 82 | static inline void Buttons_Init(void) 83 | { 84 | DDRD &= ~BUTTONS_BUTTON1; 85 | PORTD |= BUTTONS_BUTTON1; 86 | } 87 | 88 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 89 | static inline uint8_t Buttons_GetStatus(void) 90 | { 91 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 92 | } 93 | #endif 94 | 95 | /* Disable C linkage for C++ Compilers: */ 96 | #if defined(__cplusplus) 97 | } 98 | #endif 99 | 100 | #endif 101 | 102 | /** @} */ 103 | 104 | -------------------------------------------------------------------------------- /avrsrc/serial.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief serial.h header file 4 | * 5 | * This file defines the methods and commands for serial communication 6 | * between the SCD and a host. 7 | * 8 | * These functions are not microcontroller dependent but they are intended 9 | * for the AVR 8-bit architecture 10 | * 11 | * Copyright (C) 2013 Omar Choudary (omar.choudary@cl.cam.ac.uk) 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * - Redistributions of source code must retain the above copyright notice, this 17 | * list of conditions and the following disclaimer. 18 | * 19 | * - Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #ifndef _SERIAL_H_ 37 | #define _SERIAL_H_ 38 | 39 | #include 40 | 41 | #include "scd_logger.h" 42 | 43 | #define USB_BUF_SIZE 512 44 | 45 | extern uint8_t lcdAvailable; // if LCD is available 46 | extern uint16_t revision; // current SVN revision in BCD 47 | extern uint8_t selected; // ID of application selected 48 | 49 | 50 | /** 51 | * Enum defining the different types of AT commands supported 52 | */ 53 | typedef enum { 54 | AT_NONE, // No command, used for errors 55 | AT_CRST, // Reset the SCD 56 | AT_CTERM, // Start the terminal application 57 | AT_CTWAIT, // Request more time from Terminal 58 | AT_CTUSB, // Start the USB to terminal application 59 | AT_CLET, // Log an EMV transaction 60 | AT_CDPIN, // Log an EMV transaction with dummy PIN 61 | AT_CGEE, // Get EEPROM contents 62 | AT_CEEE, // Erase EEPROM contents 63 | AT_CGBM, // Go into bootloader mode 64 | AT_CCINIT, // Initialise a card transaction 65 | AT_CCAPDU, // Send raw terminal CAPDU 66 | AT_CCEND, // Ends the current card transaction 67 | AT_UDATA, // Send USB data to SCD 68 | AT_DUMMY 69 | }AT_CMD; 70 | 71 | 72 | /// Process serial data received from the host 73 | char* ProcessSerialData(const char* data, log_struct_t *logger); 74 | 75 | /// Parse an AT command received from the host 76 | uint8_t ParseATCommand(const char *data, AT_CMD *command, char **atparams); 77 | 78 | /// Send EEPROM content as Intel Hex format to the virtual serial port 79 | uint8_t SendEEPROMHexVSerial(); 80 | 81 | /// Virtual Serial Terminal application 82 | uint8_t TerminalVSerial(log_struct_t *logger); 83 | 84 | /// USB to Terminal communication 85 | uint8_t TerminalUSB(log_struct_t *logger); 86 | 87 | /// Convert bytes to hex chars 88 | void BytesToHexChars(char* dest, uint8_t *data, uint32_t len); 89 | 90 | /// Convert two hex digit characters into a byte 91 | uint8_t hexCharsToByte(char c1, char c2); 92 | 93 | /// Convert a nibble into a hex char 94 | char nibbleToHexChar(uint8_t b, uint8_t high); 95 | 96 | #endif // _SERIAL_H_ 97 | 98 | -------------------------------------------------------------------------------- /avrsrc/LUFA/Drivers/Board/STK526/Joystick.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific joystick driver header for the Atmel STK526. 33 | * 34 | * Board specific joystick driver header for the Atmel STK526. 35 | * 36 | * \note This file should not be included directly. It is automatically included as needed by the joystick driver 37 | * dispatch header located in LUFA/Drivers/Board/Joystick.h. 38 | */ 39 | 40 | /** \ingroup Group_Joystick 41 | * @defgroup Group_Joystick_STK526 STK526 42 | * 43 | * Board specific joystick driver header for the Atmel STK526. 44 | * 45 | * \note This file should not be included directly. It is automatically included as needed by the joystick driver 46 | * dispatch header located in LUFA/Drivers/Board/Joystick.h. 47 | * 48 | * @{ 49 | */ 50 | 51 | #ifndef __JOYSTICK_STK526_H__ 52 | #define __JOYSTICK_STK526_H__ 53 | 54 | /* Includes: */ 55 | #include 56 | 57 | #include "../../../Common/Common.h" 58 | 59 | /* Enable C linkage for C++ Compilers: */ 60 | #if defined(__cplusplus) 61 | extern "C" { 62 | #endif 63 | 64 | /* Preprocessor Checks: */ 65 | #if !defined(__INCLUDE_FROM_JOYSTICK_H) 66 | #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. 67 | #endif 68 | 69 | /* Private Interface - For use in library only: */ 70 | #if !defined(__DOXYGEN__) 71 | /* Macros: */ 72 | #define JOY_BMASK ((1 << 0) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)) 73 | #endif 74 | 75 | /* Public Interface - May be used in end-application: */ 76 | /* Macros: */ 77 | /** Mask for the joystick being pushed in the left direction. */ 78 | #define JOY_LEFT (1 << 4) 79 | 80 | /** Mask for the joystick being pushed in the right direction. */ 81 | #define JOY_RIGHT (1 << 6) 82 | 83 | /** Mask for the joystick being pushed in the upward direction. */ 84 | #define JOY_UP (1 << 5) 85 | 86 | /** Mask for the joystick being pushed in the downward direction. */ 87 | #define JOY_DOWN (1 << 7) 88 | 89 | /** Mask for the joystick being pushed inward. */ 90 | #define JOY_PRESS (1 << 0) 91 | 92 | /* Inline Functions: */ 93 | #if !defined(__DOXYGEN__) 94 | static inline void Joystick_Init(void) 95 | { 96 | DDRB &= ~JOY_BMASK; 97 | 98 | PORTB |= JOY_BMASK; 99 | } 100 | 101 | static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 102 | static inline uint8_t Joystick_GetStatus(void) 103 | { 104 | return ((uint8_t)~PINB & JOY_BMASK); 105 | } 106 | #endif 107 | 108 | /* Disable C linkage for C++ Compilers: */ 109 | #if defined(__cplusplus) 110 | } 111 | #endif 112 | 113 | #endif 114 | 115 | /** @} */ 116 | 117 | -------------------------------------------------------------------------------- /avrsrc/LUFA/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2010. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | # Makefile for the LUFA library itself. This can be used to generate the library documentation. 10 | 11 | 12 | # Check to see if the LUFA_PATH variable has not been set (the makefile is not being included from a project makefile) 13 | ifeq ($(origin LUFA_PATH), undefined) 14 | LUFA_ROOT_PATH = . 15 | else 16 | LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA 17 | endif 18 | 19 | # Define module source file lists 20 | LUFA_SRC_USB = $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Device.c \ 21 | $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Endpoint.c \ 22 | $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Host.c \ 23 | $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Pipe.c \ 24 | $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/USBController.c \ 25 | $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/USBInterrupt.c \ 26 | $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/ConfigDescriptor.c \ 27 | $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/DeviceStandardReq.c \ 28 | $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/Events.c \ 29 | $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/EndpointStream.c \ 30 | $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/HostStandardReq.c \ 31 | $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/PipeStream.c \ 32 | $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/USBTask.c \ 33 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HIDParser.c 34 | LUFA_SRC_USBCLASS = $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/Audio.c \ 35 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDC.c \ 36 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/HID.c \ 37 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MassStorage.c \ 38 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDI.c \ 39 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/RNDIS.c \ 40 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/CDC.c \ 41 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HID.c \ 42 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MassStorage.c \ 43 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MIDI.c \ 44 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/Printer.c \ 45 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/RNDIS.c \ 46 | $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/StillImage.c 47 | LUFA_SRC_TEMPERATURE = $(LUFA_ROOT_PATH)/Drivers/Board/Temperature.c 48 | LUFA_SRC_SERIAL = $(LUFA_ROOT_PATH)/Drivers/Peripheral/Serial.c 49 | LUFA_SRC_SERIALSTREAM = $(LUFA_ROOT_PATH)/Drivers/Peripheral/SerialStream.c 50 | LUFA_SRC_TWI = $(LUFA_ROOT_PATH)/Drivers/Peripheral/TWI.c 51 | LUFA_SRC_SCHEDULER = $(LUFA_ROOT_PATH)/Scheduler/Scheduler.c 52 | 53 | 54 | # Check to see if the LUFA_PATH variable has not been set (the makefile is not being included from a project makefile) 55 | ifeq ($(origin LUFA_PATH), undefined) 56 | LUFA_SRC_ALL_FILES = $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) \ 57 | $(LUFA_SRC_TEMPERATURE) $(LUFA_SRC_SERIAL) \ 58 | $(LUFA_SRC_SERIALSTREAM) $(LUFA_SRC_TWI) \ 59 | $(LUFA_SRC_SCHEDULER) 60 | 61 | all: 62 | 63 | clean: 64 | rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o) 65 | 66 | clean_list: 67 | 68 | doxygen: 69 | @echo Generating Library Documentation... 70 | ( cat Doxygen.conf ; echo "PROJECT_NUMBER=`grep LUFA_VERSION_STRING Version.h | cut -d'"' -f2`" ) | doxygen - 71 | @echo Documentation Generation Complete. 72 | 73 | clean_doxygen: 74 | rm -rf Documentation 75 | 76 | .PHONY: all clean clean_list doxygen clean_doxygen 77 | endif 78 | --------------------------------------------------------------------------------