资源简介
NXP 最新MCU LPC1788 USB 驱动程序。可模拟USB声卡
代码片段和文件信息
/*----------------------------------------------------------------------------
* U S B - K e r n e l
*----------------------------------------------------------------------------
* Name: ADCUSER.C
* Purpose: Audio Device Class Custom User Module
* Version: V1.10
*----------------------------------------------------------------------------
* This software is supplied “AS IS“ without any warranties express
* implied or statutory including but not limited to the implied
* warranties of fitness for purpose satisfactory quality and
* noninfringement. Keil extends you a royalty-free right to reproduce
* and distribute executable files created using this software for use
* on NXP Semiconductors LPC family microcontroller devices only. Nothing
* else gives you the right to use this software.
*
* Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/
#include “type.h“
#include “usb.h“
#include “audio.h“
#include “usbcfg.h“
#include “usbcore.h“
#include “adcuser.h“
#include “usbaudio.h“
uint16_t VolCur = 0x0100; /* Volume Current Value */
const uint16_t VolMin = 0x0000; /* Volume Minimum Value */
const uint16_t VolMax = 0x0100; /* Volume Maximum Value */
const uint16_t VolRes = 0x0004; /* Volume Resolution */
/*
* Audio Device Class Interface Get Request Callback
* Called automatically on ADC Interface Get Request
* Parameters: None (global SetupPacket and EP0Buf)
* Return Value: TRUE - Success FALSE - Error
*/
uint32_t ADC_IF_GetRequest (void) {
/*
Interface = SetupPacket.wIndex.WB.L;
EntityID = SetupPacket.wIndex.WB.H;
Request = SetupPacket.bRequest;
Value = SetupPacket.wValue.W;
...
*/
if (SetupPacket.wIndex.W == 0x0200) {
/* Feature Unit: Interface = 0 ID = 2 */
if (SetupPacket.wValue.WB.L == 0) {
/* Master Channel */
switch (SetupPacket.wValue.WB.H) {
case AUDIO_MUTE_CONTROL:
switch (SetupPacket.bRequest) {
case AUDIO_REQUEST_GET_CUR:
EP0Buf[0] = Mute;
return (TRUE);
}
break;
case AUDIO_VOLUME_CONTROL:
switch (SetupPacket.bRequest) {
case AUDIO_REQUEST_GET_CUR:
*((__packed uint16_t *)EP0Buf) = VolCur;
return (TRUE);
case AUDIO_REQUEST_GET_MIN:
*((__packed uint16_t *)EP0Buf) = VolMin;
return (TRUE);
case AUDIO_REQUEST_GET_MAX:
*((__packed uint16_t *)EP0Buf) = VolMax;
return (TRUE);
case AUDIO_REQUEST_GET_RES:
*((__packed uint16_t *)EP0Buf) = VolRes;
return (TRUE);
}
break;
}
}
}
return (FALSE); /* Not Supported */
}
/*
* A
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 711 2010-07-28 09:01 USBAudio\Abstract.txt
文件 5044 2010-07-28 09:01 USBAudio\adcuser.c
文件 1321 2010-07-28 09:01 USBAudio\adcuser.h
文件 16863 2010-07-28 09:01 USBAudio\audio.h
文件 23500 2010-09-19 10:23 USBAudio\FLASH\adcuser.crf
文件 309 2010-09-19 10:23 USBAudio\FLASH\adcuser.d
文件 31748 2010-09-19 10:23 USBAudio\FLASH\adcuser.o
文件 3549 2010-09-19 10:23 USBAudio\FLASH\core_cm3.crf
文件 111 2010-09-19 10:23 USBAudio\FLASH\core_cm3.d
文件 10196 2010-09-19 10:23 USBAudio\FLASH\core_cm3.o
文件 66 2010-09-19 10:23 USBAudio\FLASH\startup_LPC177x_8x.d
文件 38278 2010-09-19 10:23 USBAudio\FLASH\startup_LPC177x_8x.lst
文件 5576 2010-09-19 10:23 USBAudio\FLASH\startup_LPC177x_8x.o
文件 61109 2010-09-19 10:23 USBAudio\FLASH\system_lpc177x_8x.crf
文件 314 2010-09-19 10:23 USBAudio\FLASH\system_lpc177x_8x.d
文件 43216 2010-09-19 10:23 USBAudio\FLASH\system_lpc177x_8x.o
文件 86668 2010-09-19 10:24 USBAudio\FLASH\usbaudio.axf
文件 20330 2010-09-19 10:24 USBAudio\FLASH\usbaudio.hex
文件 55024 2010-09-19 10:24 USBAudio\FLASH\usbaudio.htm
文件 453 2010-09-19 10:23 USBAudio\FLASH\usbaudio.lnp
文件 70461 2010-09-19 10:24 USBAudio\FLASH\usbaudio.map
文件 859 2010-09-19 10:24 USBAudio\FLASH\usbaudio.plg
文件 1540 2010-09-19 10:24 USBAudio\FLASH\usbaudio.tra
文件 33040 2010-09-19 10:23 USBAudio\FLASH\usbcore.crf
文件 366 2010-09-19 10:23 USBAudio\FLASH\usbcore.d
文件 52328 2010-09-19 10:23 USBAudio\FLASH\usbcore.o
文件 22733 2010-09-19 10:23 USBAudio\FLASH\usbdesc.crf
文件 248 2010-09-19 10:23 USBAudio\FLASH\usbdesc.d
文件 26888 2010-09-19 10:23 USBAudio\FLASH\usbdesc.o
文件 72713 2010-09-19 10:23 USBAudio\FLASH\usbdmain.crf
............此处省略173个文件信息
相关资源
- usb-can labview 二次开发
- THINKPAD写号软件usbfmtpw.exe.rar
- USB转LAN口驱动程序
- USB3125T芯片使用说明
- usb-ohci中文规范
- linux usb core driver源码分析
- 广成usb can软件ECANtools canusb技术
- 安川SigmaWin+ USB驱动64bitwin10可用
- USB调试助手(20191028).rar
- STM32F429 USB HID
- STM32F407 USB 自定义HID实现代码
- cyusb3014开发板入门记录
- NRF24L01 无线模块 串口转USBLabview上位机
- USB调试助手2.0(20191108).rar
- STM32 USB通信上、下位机
- 深度Linux 15.8下安装RTL8192EU驱动,亲测
- 华为3G/4G模块USB驱动方法
- FE1.1s和FE2.1 USB2.0 Hub中英文使用手册及
- USB外壳模具图
- 官方FT-232USB转串口驱动
- USB CCID 规范
- 华为眼图知识good
- 亚辰电通2.0串口驱动.rar
- 树莓派人脸识别USB摄像头
- Honeywell1900模拟串口驱动 USB _Serial_Dr
- usbeam hosts editor
- usb 2.0 协议全中文
- usb转485驱动程序,win10-64,HXSP-2108F
- 科沃兹、帝豪通用安装USB导航模块图
- ehci、xhci、uhci规范
评论
共有 条评论