X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/1c16ae399a9f924c15d9dec54cacb1320ff0a92f..dc42c5eb6b663b0b117b5660ba5818186744efd5:/Demos/Device/AudioInput/AudioInput.h?ds=inline diff --git a/Demos/Device/AudioInput/AudioInput.h b/Demos/Device/AudioInput/AudioInput.h index b7174d1f8..e4dd7fe66 100644 --- a/Demos/Device/AudioInput/AudioInput.h +++ b/Demos/Device/AudioInput/AudioInput.h @@ -30,11 +30,11 @@ /** \file * - * Header file for AudioOutput.c. + * Header file for AudioInput.c. */ -#ifndef _AUDIO_OUTPUT_H_ -#define _AUDIO_OUTPUT_H_ +#ifndef _AUDIO_INPUT_H_ +#define _AUDIO_INPUT_H_ /* Includes: */ #include @@ -43,48 +43,43 @@ #include "Descriptors.h" - #include // Library Version Information - #include // USB Functionality - #include // LEDs driver - #include // ADC driver - #include // Simple scheduler for task management - + #include + #include + #include + #include + #include + #include + /* Macros: */ /** ADC channel number for the microphone input. */ - #define MIC_IN_ADC_CHANNEL 2 + #define MIC_IN_ADC_CHANNEL 2 /** Maximum ADC sample value for the microphone input. */ - #define SAMPLE_MAX_RANGE 0xFFFF + #define SAMPLE_MAX_RANGE 0xFFFF /** Maximum ADC range for the microphone input. */ - #define ADC_MAX_RANGE 0x3FF - - /* Enums: */ - /** Enum for the possible status codes for passing to the UpdateStatus() function. */ - enum AudioInput_StatusCodes_t - { - Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */ - Status_USBEnumerating = 1, /**< USB interface is enumerating */ - Status_USBReady = 2, /**< USB interface is connected and ready */ - }; - - /* Task Definitions: */ - TASK(USB_Audio_Task); + #define ADC_MAX_RANGE 0x3FF - /* Event Handlers: */ - /** Indicates that this module will catch the USB_Connect event when thrown by the library. */ - HANDLES_EVENT(USB_Connect); - - /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */ - HANDLES_EVENT(USB_Disconnect); + /* Macros: */ + /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ + #define LEDMASK_USB_NOTREADY LEDS_LED1 - /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */ - HANDLES_EVENT(USB_ConfigurationChanged); + /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ + #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) - /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */ - HANDLES_EVENT(USB_UnhandledControlPacket); + /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ + #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) + /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ + #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) + /* Function Prototypes: */ - void UpdateStatus(uint8_t CurrentStatus); + void SetupHardware(void); + void ProcessNextSample(void); + void EVENT_USB_Connect(void); + void EVENT_USB_Disconnect(void); + void EVENT_USB_ConfigurationChanged(void); + void EVENT_USB_UnhandledControlPacket(void); + #endif