3      Copyright (C) Dean Camera, 2009. 
   5   dean [at] fourwalledcubicle [dot] com 
   6       www.fourwalledcubicle.com 
  10   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  12   Permission to use, copy, modify, and distribute this software 
  13   and its documentation for any purpose and without fee is hereby 
  14   granted, provided that the above copyright notice appear in all 
  15   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 AudioOutput.c. 
  36 #ifndef _AUDIO_OUTPUT_H_ 
  37 #define _AUDIO_OUTPUT_H_ 
  42                 #include <avr/power.h> 
  44                 #include "Descriptors.h" 
  46                 #include <LUFA/Version.h>                      // Library Version Information 
  47                 #include <LUFA/Drivers/USB/USB.h>              // USB Functionality 
  48                 #include <LUFA/Drivers/Board/LEDs.h>           // LEDs driver 
  49                 #include <LUFA/Drivers/Peripheral/ADC.h>       // ADC driver 
  50                 #include <LUFA/Scheduler/Scheduler.h>          // Simple scheduler for task management 
  53                 /** ADC channel number for the microphone input. */ 
  54                 #define MIC_IN_ADC_CHANNEL               2 
  56                 /** Maximum ADC sample value for the microphone input. */ 
  57                 #define SAMPLE_MAX_RANGE                 0xFFFF 
  59                 /** Maximum ADC range for the microphone input. */ 
  60                 #define ADC_MAX_RANGE                    0x3FF 
  63                 /** Enum for the possible status codes for passing to the UpdateStatus() function. */ 
  64                 enum AudioInput_StatusCodes_t
 
  66                         Status_USBNotReady    
= 0, /**< USB is not ready (disconnected from a USB host) */ 
  67                         Status_USBEnumerating 
= 1, /**< USB interface is enumerating */ 
  68                         Status_USBReady       
= 2, /**< USB interface is connected and ready */ 
  71         /* Task Definitions: */ 
  74         /* Function Prototypes: */ 
  75                 void EVENT_USB_Connect(void); 
  76                 void EVENT_USB_Disconnect(void); 
  77                 void EVENT_USB_ConfigurationChanged(void); 
  78                 void EVENT_USB_UnhandledControlPacket(void); 
  80                 void UpdateStatus(uint8_t CurrentStatus
);