📄 audioclass.h
字号:
/*----------------------------------------------------------------------------------
*
* COPYRIGHT (c) 2001 by Singing Electrons, Inc. All rights reserved.
*
*
* Module Name : C:\se\adi\hidclass\Source\HidClass.h
*
* Description : Contains prototypes and definitions for the Audio Class implementation
*
*
* Revision History : At bottom of the file.
*
*---------------------------------------------------------------------------------*/
#ifndef _AUDIOCLASS_H
#define _AUDIOCLASS_H
#define USB_AUDIO_CLASS 1
#define USB_AUDIO_SUBCLASS_AUDIOCONTROL 1
#define USB_AUDIO_SUBCLASS_AUDIOSTREAMING 2
#define USB_AUDIO_PROTOCOL_NONE 0
#define USB_AUDIO_DESCRIPTOR_INTERFACE 0x24
#define USB_AUDIO_DESCRIPTOR_ENDPOINT 0x25
//For AudioControl
#define USB_AUDIO_DESCRIPTOR_SUBTYPE_HEADER 0x01
#define USB_AUDIO_DESCRIPTOR_SUBTYPE_INPUT_TERMINAL 0x02
#define USB_AUDIO_DESCRIPTOR_SUBTYPE_OUTPUT_TERMINAL 0x03
#define USB_AUDIO_DESCRIPTOR_SUBTYPE_FEATURE_UNIT 0x06
#define USB_AUDIO_TERMINALTYPE_USBSTREAMING 0x0101
#define USB_AUDIO_TERMINALTYPE_SPEAKER 0x0301
#define USB_AUDIO_TERMINALTYPE_LINE 0x0603
#define USB_AUDIO_CONTROL_SELECTOR_MUTE_CONTROL 0x01
#define USB_AUDIO_CONTROL_SELECTOR_VOLUME_CONTROL 0x02
//For AudioStreaming
#define USB_AUDIO_DESCRIPTOR_SUBTYPE_GENERAL 0x01
#define USB_AUDIO_DESCRIPTOR_SUBTYPE_FORMAT 0x02
#define USB_AUDIO_FORMAT_TYPE_I 0x01
#define USB_AUDIO_FORMAT_TAG_PCM 0x01
#define USB_AUDIO_SAMPLING_FREQ_DISCREET 0x01
#define USB_AUDIO_EP_ATTRIB_ASYNC 0x04
#define USB_AUDIO_EP_ATTRIB_ADAPTIVE 0x80
#define USB_AUDIO_EP_ATTRIB_SYNC 0xC0
#define USB_AUDIO_EP_ATTRIB_ISOCH 0x01
//Audio Class Requests (bRequest)
#define SET_CUR 0x01
#define GET_CUR 0x81
#define SET_MIN 0x02
#define GET_MIN 0x82
#define SET_MAX 0x03
#define GET_MAX 0x83
#define SET_RES 0x04
#define GET_RES 0x84
#define SET_MEM 0x05
#define GET_MEM 0x85
#define GET_STAT 0xFF
bool AUDIOCLASS_Init (uint16 vid, uint16 pid, uint16 rel, PSUSPENDPROC pOnSuspendProc,
PRESUMEPROC pOnResumeProc, PRESETPROC pOnResetProc);
void AUDIOCLASS_DoForegroundTasks (void);
extern bool gIsPlaybackActive;
#endif //end of _AUDIOCLASS_H
/*----------------------------------------------------------------------------------
* $Log: AudioClass.h,v $
* Revision 1.3 2003/01/16 23:51:30 Devendra
* Added defines for control selectors
*
* Revision 1.2 2003/01/16 19:07:55 Devendra
* - Added support for AudioClass to perform non-ISR(foreground) tasks.
* - Exposed playback active state variable.
*
* Revision 1.1 2003/01/09 01:16:35 Devendra
* First Rev of AudioClass - have the device enumerated as audio device, and the volume control and mute are functional!
*
* Revision 1.1 2002/10/31 00:30:59 Devendra
* Moved all files in one folder to avoid IDE related problems.
*
* Revision 1.2 2002/10/30 02:36:41 Devendra
* - Added more abstraction to HIDCLASS. So that it's possible to build
* different devices without making any changes to the HIDCLASS module.
* - Added proper support for handling USB SUSPEND, RESUME, and RESET events.
*
* Revision 1.1 2002/10/22 17:23:39 Devendra
* Rearranged file locations.
*
* Revision 1.4 2002/10/14 05:16:04 Devendra
* - Custom Device now using Feature reports for I/O
* - Added compiler define/project configuration to switch between mouse and custom device.
*
* Revision 1.3 2002/10/14 01:33:15 Devendra
* Got "custom" device functional with buttons and lights!
*
* Revision 1.2 2002/10/09 17:09:32 Devendra
* - Added support for handling IN endpoints.
* - Added HID descriptors (HID and HID Report)
* - Modified the Interface descriptors to comply to HID Class Spec.
* - Added functionality to use the push-buttons on the Eagle-35 as a mouse (for buttons as well as for movement).
* - The device is now a fully functioning USB Mouse!
*
* Revision 1.1 2002/09/20 06:51:30 Devendra
* First Rev.
*
*
*---------------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -