X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d0806c817cbf0c1b5c5362d1577eac6075c94dfc..dc42c5eb6b663b0b117b5660ba5818186744efd5:/Demos/Device/AudioInput/AudioInput.h diff --git a/Demos/Device/AudioInput/AudioInput.h b/Demos/Device/AudioInput/AudioInput.h index a394492f0..e4dd7fe66 100644 --- a/Demos/Device/AudioInput/AudioInput.h +++ b/Demos/Device/AudioInput/AudioInput.h @@ -43,40 +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 + #define ADC_MAX_RANGE 0x3FF + + /* Macros: */ + /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ + #define LEDMASK_USB_NOTREADY LEDS_LED1 - /* 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 */ - }; + /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ + #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) - /* Task Definitions: */ - TASK(USB_Audio_Task); + /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ + #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) + /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ + #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) + /* Function Prototypes: */ + void SetupHardware(void); + void ProcessNextSample(void); + void EVENT_USB_Connect(void); void EVENT_USB_Disconnect(void); void EVENT_USB_ConfigurationChanged(void); void EVENT_USB_UnhandledControlPacket(void); - void UpdateStatus(uint8_t CurrentStatus); - #endif