X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/a147cee95f5373902242e7b34b92f7103fc05ae4..a5abb0eb3f368f0f090ebfd7f9fc22e94466f31e:/Demos/Device/ClassDriver/AudioInput/AudioInput.c diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index 65e7f7923..66d78b8c8 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -44,10 +44,14 @@ USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface = { .Config = { + .ControlInterfaceNumber = 0, .StreamingInterfaceNumber = 1, - - .DataINEndpointNumber = AUDIO_STREAM_EPNUM, - .DataINEndpointSize = AUDIO_STREAM_EPSIZE, + .DataINEndpoint = + { + .Address = AUDIO_STREAM_EPADDR, + .Size = AUDIO_STREAM_EPSIZE, + .Banks = 2, + }, }, }; @@ -90,7 +94,7 @@ void SetupHardware(void) USB_Init(); /* Start the ADC conversion in free running mode */ - ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | MIC_IN_ADC_MUX_MASK); + ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL)); } /** ISR to handle the reloading of the data endpoint with the next sample. */ @@ -171,7 +175,7 @@ void EVENT_USB_Device_ControlRequest(void) * * When the DataLength parameter is NULL, this callback should only indicate whether the specified operation is valid for * the given endpoint index, and should return as fast as possible. When non-NULL, this value may be altered for GET operations - * to indicate the size of the retreived data. + * to indicate the size of the retrieved data. * * \note The length of the retrieved data stored into the Data buffer on GET operations should not exceed the initial value * of the \c DataLength parameter. @@ -196,7 +200,7 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* uint8_t* Data) { /* Check the requested endpoint to see if a supported endpoint is being manipulated */ - if (EndpointAddress == (ENDPOINT_DIR_IN | Microphone_Audio_Interface.Config.DataINEndpointNumber)) + if (EndpointAddress == Microphone_Audio_Interface.Config.DataINEndpoint.Address) { /* Check the requested control to see if a supported control is being manipulated */ if (EndpointControl == AUDIO_EPCONTROL_SamplingFreq) @@ -239,13 +243,13 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* * * When the DataLength parameter is NULL, this callback should only indicate whether the specified operation is valid for * the given entity and should return as fast as possible. When non-NULL, this value may be altered for GET operations - * to indicate the size of the retreived data. + * to indicate the size of the retrieved data. * * \note The length of the retrieved data stored into the Data buffer on GET operations should not exceed the initial value * of the \c DataLength parameter. * * \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state. - * \param[in] Property Property of the interface to get or set, a value from \ref Audio_ClassRequests_t. + * \param[in] Property Property of the interface to get or set, a value from Audio_ClassRequests_t. * \param[in] EntityAddress Address of the audio entity whose property is being referenced. * \param[in] Parameter Parameter of the entity to get or set, specific to each type of entity (see USB Audio specification). * \param[in,out] DataLength For SET operations, the length of the parameter data to set. For GET operations, the maximum