3      Copyright (C) Dean Camera, 2010. 
   5   dean [at] fourwalledcubicle [dot] com 
   6       www.fourwalledcubicle.com 
  10   Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  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. 
  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 
  33  *  Header file for XPLAINBridge.c. 
  36 #ifndef _XPLAIN_BRIDGE_H_ 
  37 #define _XPLAIN_BRIDGE_H_ 
  42                 #include <avr/power.h> 
  44                 #include "AVRISPDescriptors.h" 
  45                 #include "USARTDescriptors.h" 
  47                 #include "Lib/RingBuff.h" 
  48                 #include "Lib/SoftUART.h"                
  49                 #include <Lib/V2Protocol.h> 
  51                 #include <LUFA/Version.h> 
  52                 #include <LUFA/Drivers/Board/LEDs.h> 
  53                 #include <LUFA/Drivers/USB/USB.h> 
  54                 #include <LUFA/Drivers/USB/Class/CDC.h> 
  57                 /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ 
  58                 #define LEDMASK_USB_NOTREADY     LEDS_LED1 
  60                 /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ 
  61                 #define LEDMASK_USB_ENUMERATING  LEDS_LED1 
  63                 /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ 
  64                 #define LEDMASK_USB_READY        LEDS_NO_LEDS 
  66                 /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ 
  67                 #define LEDMASK_USB_ERROR        LEDS_LED1 
  69                 /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ 
  70                 #define LEDMASK_BUSY             LEDS_LED1 
  72                 /** Firmware mode define for the USART Bridge mode. */ 
  73                 #define MODE_USART_BRIDGE        false 
  75                 /** Firmware mode define for the AVRISP Programmer mode. */ 
  76                 #define MODE_PDI_PROGRAMMER      true            
  78         /* External Variables: */ 
  79                 extern bool CurrentFirmwareMode
; 
  81         /* Function Prototypes: */ 
  82                 void SetupHardware(void); 
  83                 void AVRISP_Task(void); 
  84                 void USARTBridge_Task(void); 
  86                 void EVENT_USB_Device_ConfigurationChanged(void); 
  87                 void EVENT_USB_Device_UnhandledControlRequest(void); 
  89                 void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t
* const CDCInterfaceInfo
); 
  91                 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue
, const uint8_t wIndex
, void** const DescriptorAddress
);