projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Python test script using pywinusb for the Class Driver Generic HID Device demo...
[pub/USBasp.git]
/
Demos
/
Device
/
ClassDriver
/
AudioInput
/
AudioInput.c
diff --git
a/Demos/Device/ClassDriver/AudioInput/AudioInput.c
b/Demos/Device/ClassDriver/AudioInput/AudioInput.c
index
382446a
..
9eec39c
100644
(file)
--- a/
Demos/Device/ClassDriver/AudioInput/AudioInput.c
+++ b/
Demos/Device/ClassDriver/AudioInput/AudioInput.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
2
.
+ Copyright (C) Dean Camera, 201
3
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
2
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
3
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
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-18,7
+18,7
@@
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
- The author disclaim all warranties with regard to this
+ The author disclaim
s
all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
@@
-46,9
+46,12
@@
USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
{
.ControlInterfaceNumber = 0,
.StreamingInterfaceNumber = 1,
{
.ControlInterfaceNumber = 0,
.StreamingInterfaceNumber = 1,
-
- .DataINEndpointNumber = AUDIO_STREAM_EPNUM,
- .DataINEndpointSize = AUDIO_STREAM_EPSIZE,
+ .DataINEndpoint =
+ {
+ .Address = AUDIO_STREAM_EPADDR,
+ .Size = AUDIO_STREAM_EPSIZE,
+ .Banks = 2,
+ },
},
};
},
};
@@
-64,7
+67,7
@@
int main(void)
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
-
sei
();
+
GlobalInterruptEnable
();
for (;;)
{
for (;;)
{
@@
-76,12
+79,14
@@
int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
/* Hardware Initialization */
LEDs_Init();
@@
-91,7
+96,7
@@
void SetupHardware(void)
USB_Init();
/* Start the ADC conversion in free running mode */
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. */
}
/** ISR to handle the reloading of the data endpoint with the next sample. */
@@
-172,7
+177,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
*
* 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 retr
ei
ved data.
+ * to indicate the size of the retr
ie
ved 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.
*
* \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.
@@
-197,7
+202,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 */
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)
{
/* Check the requested control to see if a supported control is being manipulated */
if (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)
@@
-240,7
+245,7
@@
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
*
* 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 retr
ei
ved data.
+ * to indicate the size of the retr
ie
ved 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.
*
* \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.
@@
-262,7
+267,7
@@
bool CALLBACK_Audio_Device_GetSetInterfaceProperty(USB_ClassInfo_Audio_Device_t*
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
- uint8_t* Data)
+ uint8_t* Data)
{
/* No audio interface entities in the device descriptor, thus no properties to get or set. */
return false;
{
/* No audio interface entities in the device descriptor, thus no properties to get or set. */
return false;