aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lufa/Demos/Device/ClassDriver/AudioInput/AudioInput.h
blob: 1deaa76885689e81e085a06c9fec3aac426752ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
generated by cgit v1.2.3 (git 2.25.1) at 2025-11-28 22:04:11 +0000
 


 <avr/io.h>
		#include <avr/wdt.h>
		#include <avr/power.h>
		#include <avr/interrupt.h>

		#include <LUFA/Drivers/Board/LEDs.h>
		#include <LUFA/Drivers/Board/Buttons.h>
		#include <LUFA/Drivers/Peripheral/ADC.h>
		#include <LUFA/Drivers/USB/USB.h>
		#include <LUFA/Platform/Platform.h>

		#include "Descriptors.h"
		#include "Config/AppConfig.h"

	/* Macros: */
		/** Maximum audio sample value for the microphone input. */
		#define SAMPLE_MAX_RANGE          0xFFFF

		/** Maximum ADC range for the microphone input. */
		#define ADC_MAX_RANGE             0x3FF

		/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
		#define LEDMASK_USB_NOTREADY      LEDS_LED1

		/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
		#define LEDMASK_USB_ENUMERATING  (LEDS_LED2 | LEDS_LED3)

		/** 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 EVENT_USB_Device_Connect(void);
		void EVENT_USB_Device_Disconnect(void);
		void EVENT_USB_Device_ConfigurationChanged(void);
		void EVENT_USB_Device_ControlRequest(void);

		bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
		                                                  const uint8_t EndpointProperty,
		                                                  const uint8_t EndpointAddress,
		                                                  const uint8_t EndpointControl,
		                                                  uint16_t* const DataLength,
		                                                  uint8_t* Data) ATTR_NON_NULL_PTR_ARG(1);
		bool CALLBACK_Audio_Device_GetSetInterfaceProperty(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
		                                                   const uint8_t Property,
		                                                   const uint8_t EntityAddress,
		                                                   const uint16_t Parameter,
		                                                   uint16_t* const DataLength,
		                                                   uint8_t* Data);
#endif