реклама на сайте
подробности

 
 
19 страниц V  « < 17 18 19  
Reply to this topicStart new topic
> USB, EZ-USB FX2
IVTIVT
сообщение Jul 19 2012, 11:13
Сообщение #271





Группа: Новичок
Сообщений: 3
Регистрация: 10-04-12
Пользователь №: 71 290



Добрый все день! Имеется usb-устройство с cайпрессовским СY7C68013 . Поначалу работа с ним велась в Windows через драйвер cyusb.sys - всё работало, данные посредством FIFO передавались верные (устройство принимает данные и передает по usb в pc ). Затем встал вопрос об аналогичной работе в Линуксе. Была использована библиотека libusb.

Что происходит в данный момент : если после включения устройства ,подключенного к компьютеру с Виндоус - перезагрузить компьютер и войти в Линукс - всё работает, данные принимаются в Линуксе правильные. Но стоит только сбросить питание устройства (вне зависимости от того, подключено ли оно шнуром к компьютеру) - как при включении питания обратно - данные принимаются абсолютно левые. Под данными я подразумеваю набор байт. То есть возникло подозрение, что драйвер cyusb.sys вносит какие-то инициализационные изменения , так как если включить Виндоус - все работает - перейти в Линукс - все работает - выключить КОМПЬЮТЕР - включить компьютер - все по-прежнему работает. Перестает работать только в том случае, если сбросить питание УСТРОЙСТВА (если сбросить и включить обратно питание устройства, находясь при этом в Виндоус - всё работает).

Исходя из этого у меня вопрос - передает ли драйвер cyusb.sys какие-либо параметры в устройство ? (подчеркну еще раз, что сама передача данных идет исправно, просто сами байты становятся "левыми" - причем всегда одинаковыми, вне зависимости от тех данных, которые устройство должно передать). Такое впечатление, что где-то в какой-то регистр fx2 при сбросе питания вводится значение по умолчанию, при к-ом сами данные могут портиться. Какой (и так ли это) - выяснить не удалось.

TRM читал. Надеюсь на помощь
Go to the top of the page
 
+Quote Post
toweroff
сообщение Oct 12 2012, 12:17
Сообщение #272


Гуру
******

Группа: Свой
Сообщений: 2 957
Регистрация: 19-09-06
Из: Москва
Пользователь №: 20 514



Что-то не пойму я поведения 68013A

Подключено к арму через асинхронный интерфейс, /mpOE подключен одновременно к /SLOE и /SLRD

FIFO и точки настроены как EP2 - IN, EP6 - OUT

Когда данные гоняются малыми объемами (<512 байт), все в порядке

Когда передается большой кусок, проц вычитывает иногда лишние 2 байта (шина данных 16бит). Вычитывание лишних байтов - четко по границе 512-байтового блока

Осциллограф четко показывает, что флаг EP6EF падает еще до того, как закончится /mpCS и /mpOE. Длительность /mpCS и /mpOE как только не менял, вплоть до около 150нс - ноль эмоций. Флаг, как и описано в даташите, падает не позднее 70нс от начала /mpOE

Вот код чтения точки:

Код
void FX2_USB_ReadFIFO(U16* buf, U32 len)
{
    while(len)
    {
        while(!is_FLAGC);
        *buf++ = FX2_FIFO6;
        len -= 2;    
    }
}


сигналы все нормальные, звона нет.

Я уже не знаю, в какую сторону думать...
Go to the top of the page
 
+Quote Post
MSL
сообщение Nov 29 2012, 06:41
Сообщение #273


Частый гость
**

Группа: Участник
Сообщений: 75
Регистрация: 25-07-04
Из: Rostov-on-Don
Пользователь №: 382



Цитата(IVTIVT @ Jul 19 2012, 15:13) *
сигналы все нормальные, звона нет.
Я уже не знаю, в какую сторону думать...


Что-то мне это напоминает... http://electronix.ru/forum/index.php?showtopic=66313&hl=
Go to the top of the page
 
+Quote Post
maxis
сообщение Jul 27 2015, 08:36
Сообщение #274


Участник
*

Группа: Участник
Сообщений: 67
Регистрация: 2-06-09
Пользователь №: 49 843



Чтоб не плодить темы задам вопрос тут:
Изучаю cy7c68013a, задача принять аудио данные. Дискриптор написал, устройство определяется нормально, но данные на устройство не уходят.
Вроде всё делаю по примерам, но никак не заставить устройство принимать пакеты. В чём может быть дело?
CODE
#pragma NOIV // Do not generate interrupt vectors

#include "fx2.h"
#include "fx2regs.h"
#include "fx2sdly.h" // SYNCDELAY macro

extern BOOL GotSUD; // Received setup data flag
extern BOOL Sleep;
extern BOOL Rwuen;
extern BOOL Selfpwr;

BYTE Configuration; // Current configuration
BYTE AlternateSetting; // Alternate settings

void EZUSB_INITI2C();

//#define bmEP2IRQ 0x10


//-----------------------------------------------------------------------------
// Task Dispatcher hooks
// The following hooks are called by the task dispatcher.
//-----------------------------------------------------------------------------

void TD_Init(void) // Called once at startup
{

// set the CPU clock to 48MHz
CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1);
SYNCDELAY;

// set the slave FIFO interface to 48MHz
IFCONFIG |= 0x40;
SYNCDELAY;


// b7: Valid
// b6: DIR (0=OUT, 1=IN)
// b[5:4] Type (01=ISO, 10=BULK, 11=INT)
// b3: Size (0=512, 1=1024 bytes)
// b2: 0
// b[1:0] Buffering (00=quad, 10=double, 11=triple)
// Only using endpoint 4, zero the valid bit on all others
EP1OUTCFG = EP1INCFG = EP2CFG = EP4CFG = EP6CFG = EP8CFG = 0x00;
SYNCDELAY;
EP4CFG = 0x98; // EP4 is DIR=OUT, TYPE=ISOC, SIZE=1024, BUF=4x
SYNCDELAY;

// OUT endpoints do NOT come up armed
EP4BCL = 0x80; // arm first buffer by writing BC w/skip=1
SYNCDELAY;
EP4BCL = 0x80; // arm second buffer by writing BC w/skip=1

// enable dual autopointer feature
//AUTOPTRSETUP |= 0x01;

USBIE |= bmSOF; // Enable the SOF IRQ to serve as LED timers
//EPIE = bmEP2IRQ; // Enable EP6 and EP2 Interrupts to turn on transfer LEDS
//EPIE = bmEP4IRQ; // Enable EP6 and EP4 Interrupts to turn on transfer LEDS

OEA = 0xFF;
IOA = 0xFF;
}

void TD_Poll(void) // Called repeatedly while the device is idle
{
IOA = 0x00;
// check EP4 EMPTY(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is empty
if(!(EP2468STAT & bmEP4EMPTY))
{
EP4BCL = 0x80; // re(arm) EP4OUT
}
IOA = 0xFF;
}

BOOL TD_Suspend(void) // Called before the device goes into suspend mode
{
return(TRUE);
}

BOOL TD_Resume(void) // Called after the device resumes
{
return(TRUE);
}

//-----------------------------------------------------------------------------
// Device Request hooks
// The following hooks are called by the end point 0 device request parser.
//-----------------------------------------------------------------------------

BOOL DR_GetDescriptor(void)
{
return(TRUE);
}

BOOL DR_SetConfiguration(void) // Called when a Set Configuration command is received
{
Configuration = SETUPDAT[2];
return(TRUE); // Handled by user code
}

BOOL DR_GetConfiguration(void) // Called when a Get Configuration command is received
{
EP0BUF[0] = Configuration;
EP0BCH = 0;
EP0BCL = 1;
return(TRUE); // Handled by user code
}

BOOL DR_SetInterface(void) // Called when a Set Interface command is received
{
AlternateSetting = SETUPDAT[2];
return(TRUE); // Handled by user code
}

BOOL DR_GetInterface(void) // Called when a Set Interface command is received
{
EP0BUF[0] = AlternateSetting;
EP0BCH = 0;
EP0BCL = 1;
return(TRUE); // Handled by user code
}

BOOL DR_GetStatus(void)
{
return(TRUE);
}

BOOL DR_ClearFeature(void)
{
return(TRUE);
}

BOOL DR_SetFeature(void)
{
return(TRUE);
}

BOOL DR_VendorCmnd(void)
{
return(TRUE);
}

//-----------------------------------------------------------------------------
// USB Interrupt Handlers
// The following functions are called by the USB interrupt jump table.
//-----------------------------------------------------------------------------

// Setup Data Available Interrupt Handler
void ISR_Sudav(void) interrupt 0
{
GotSUD = TRUE; // Set flag
EZUSB_IRQ_CLEAR();
USBIRQ = bmSUDAV; // Clear SUDAV IRQ
}

// Setup Token Interrupt Handler
void ISR_Sutok(void) interrupt 0
{
EZUSB_IRQ_CLEAR();
USBIRQ = bmSUTOK; // Clear SUTOK IRQ
}

void ISR_Sof(void) interrupt 0
{
EZUSB_IRQ_CLEAR();
USBIRQ = bmSOF; // Clear SOF IRQ
}

void ISR_Ures(void) interrupt 0
{
// whenever we get a USB reset, we should revert to full speed mode
pConfigDscr = pFullSpeedConfigDscr;
((CONFIGDSCR xdata *) pConfigDscr)->type = CONFIG_DSCR;
pOtherConfigDscr = pHighSpeedConfigDscr;
((CONFIGDSCR xdata *) pOtherConfigDscr)->type = OTHERSPEED_DSCR;

EZUSB_IRQ_CLEAR();
USBIRQ = bmURES; // Clear URES IRQ
}

void ISR_Susp(void) interrupt 0
{
Sleep = TRUE;
EZUSB_IRQ_CLEAR();
USBIRQ = bmSUSP;
}

void ISR_Highspeed(void) interrupt 0
{
if (EZUSB_HIGHSPEED())
{
pConfigDscr = pHighSpeedConfigDscr;
((CONFIGDSCR xdata *) pConfigDscr)->type = CONFIG_DSCR;
pOtherConfigDscr = pFullSpeedConfigDscr;
((CONFIGDSCR xdata *) pOtherConfigDscr)->type = OTHERSPEED_DSCR;
}

EZUSB_IRQ_CLEAR();
USBIRQ = bmHSGRANT;
}
void ISR_Ep0ack(void) interrupt 0
{
}
void ISR_Stub(void) interrupt 0
{
}
void ISR_Ep0in(void) interrupt 0
{
}
void ISR_Ep0out(void) interrupt 0
{
}
void ISR_Ep1in(void) interrupt 0
{
}
void ISR_Ep1out(void) interrupt 0
{
}
void ISR_Ep2inout(void) interrupt 0
{
//BYTE dum;
//EZUSB_IRQ_CLEAR();
//EPIRQ = bmEP2IRQ; // Clear IRQ

// check EP2 EMPTY(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is empty
if(!(EP2468STAT & bmEP2EMPTY))
{
EP2BCL = 0x80; // re(arm) EP2OUT
}
}
void ISR_Ep4inout(void) interrupt 0
{
//BYTE dum;
//EZUSB_IRQ_CLEAR();
//EPIRQ = bmEP4IRQ; // Clear IRQ

// check EP4 EMPTY(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is empty
if(!(EP2468STAT & bmEP4EMPTY))
{
EP4BCL = 0x80; // re(arm) EP4OUT
}
}
void ISR_Ep6inout(void) interrupt 0
{
}
void ISR_Ep8inout(void) interrupt 0
{
}
void ISR_Ibn(void) interrupt 0
{
}
void ISR_Ep0pingnak(void) interrupt 0
{
}
void ISR_Ep1pingnak(void) interrupt 0
{
}
void ISR_Ep2pingnak(void) interrupt 0
{
}
void ISR_Ep4pingnak(void) interrupt 0
{
}
void ISR_Ep6pingnak(void) interrupt 0
{
}
void ISR_Ep8pingnak(void) interrupt 0
{
}
void ISR_Errorlimit(void) interrupt 0
{
}
void ISR_Ep2piderror(void) interrupt 0
{
}
void ISR_Ep4piderror(void) interrupt 0
{
}
void ISR_Ep6piderror(void) interrupt 0
{
}
void ISR_Ep8piderror(void) interrupt 0
{
}
void ISR_Ep2pflag(void) interrupt 0
{
}
void ISR_Ep4pflag(void) interrupt 0
{
}
void ISR_Ep6pflag(void) interrupt 0
{
}
void ISR_Ep8pflag(void) interrupt 0
{
}
void ISR_Ep2eflag(void) interrupt 0
{
}
void ISR_Ep4eflag(void) interrupt 0
{
}
void ISR_Ep6eflag(void) interrupt 0
{
}
void ISR_Ep8eflag(void) interrupt 0
{
}
void ISR_Ep2fflag(void) interrupt 0
{
}
void ISR_Ep4fflag(void) interrupt 0
{
}
void ISR_Ep6fflag(void) interrupt 0
{
}
void ISR_Ep8fflag(void) interrupt 0
{
}
void ISR_GpifComplete(void) interrupt 0
{
}
void ISR_GpifWaveform(void) interrupt 0
{
}

CODE
;;-----------------------------------------------------------------------------
;; File: dscr.a51
;; Contents: This file contains descriptor data tables.
;;
;; $Archive: /USB/Examples/Fx2lp/bulkloop/dscr.a51 $
;; $Date: 9/01/03 8:51p $
;; $Revision: 3 $
;;
;;
;;-----------------------------------------------------------------------------
;; Copyright 2003, Cypress Semiconductor Corporation
;;-----------------------------------------------------------------------------;;-----------------------------------------------------------------------------

DSCR_DEVICE equ 1 ;; Descriptor type: Device
DSCR_CONFIG equ 2 ;; Descriptor type: Configuration
DSCR_STRING equ 3 ;; Descriptor type: String
DSCR_INTRFC equ 4 ;; Descriptor type: Interface
DSCR_ENDPNT equ 5 ;; Descriptor type: Endpoint
DSCR_DEVQUAL equ 6 ;; Descriptor type: Device Qualifier

DSCR_DEVICE_LEN equ 18
DSCR_CONFIG_LEN equ 9
DSCR_INTRFC_LEN equ 9
DSCR_ENDPNT_LEN equ 7
DSCR_DEVQUAL_LEN equ 10

ET_CONTROL equ 0 ;; Endpoint type: Control
ET_ISO equ 1 ;; Endpoint type: Isochronous
ET_BULK equ 2 ;; Endpoint type: Bulk
ET_INT equ 3 ;; Endpoint type: Interrupt

public DeviceDscr, DeviceQualDscr, HighSpeedConfigDscr, FullSpeedConfigDscr, StringDscr, UserDscr

DSCR SEGMENT CODE PAGE

;;-----------------------------------------------------------------------------
;; Global Variables
;;-----------------------------------------------------------------------------
rseg DSCR ;; locate the descriptor table in on-part memory.

DeviceDscr:
db DSCR_DEVICE_LEN ;; Descriptor length
db DSCR_DEVICE ;; Decriptor type
dw 0002H ;; Specification Version (BCD)
db 00H ;; Device class
db 00H ;; Device sub-class
db 00H ;; Device sub-sub-class
db 64 ;; Maximum packet size
dw 0FF00H ;; Vendor ID
dw 0FF0H ;; Product ID (Sample Device)
dw 0000H ;; Product version ID
db 1 ;; Manufacturer string index
db 2 ;; Product string index
db 0 ;; Serial number string index
db 1 ;; Number of configurations

DeviceQualDscr:
db DSCR_DEVQUAL_LEN ;; Descriptor length
db DSCR_DEVQUAL ;; Decriptor type
dw 0002H ;; Specification Version (BCD)
db 00H ;; Device class
db 00H ;; Device sub-class
db 00H ;; Device sub-sub-class
db 64 ;; Maximum packet size
db 1 ;; Number of configurations
db 0 ;; Reserved

HighSpeedConfigDscr:

/* Configuration 1 */
db 0x09 /* bLength */
db 0x02 /* bDescriptorType */
db (HighSpeedConfigDscrEnd-HighSpeedConfigDscr) mod 256 /* wTotalLength 109 bytes*/
db (HighSpeedConfigDscrEnd-HighSpeedConfigDscr) / 256
db 0x02 /* bNumInterfaces */
db 0x01 /* bConfigurationValue */
db 0x00 /* iConfiguration */
db 0xC0 /* bmAttributes BUS Powred*/
db 0x32 /* bMaxPower = 100 mA*/
/* 09 byte*/

/* USB Speaker Standard interface descriptor */
db 0x09 /* bLength */
db 0x04 /* bDescriptorType */
db 0x00 /* bInterfaceNumber */
db 0x00 /* bAlternateSetting */
db 0x00 /* bNumEndpoints */
db 0x01 /* bInterfaceClass */
db 0x01 /* bInterfaceSubClass */
db 0x00 /* bInterfaceProtocol */
db 0x00 /* iInterface 7??????????*/

;;USB Speaker Class-specific AC Interface Descriptor */
db 0x09 ;;;;/* bLength */
db 0x24 ;;;;/* bDescriptorType */
db 0x01 ;;;;/* bDescriptorSubtype */
db 0x00, 0x01 ;;;;/* 1.00 */ ;;/* bcdADC */
db 0x27, 0x00 ;;;;/* wTotalLength = 39 30?????????*/
db 0x01 ;;;;/* bInCollection */
db 0x01 ;;;;/* baInterfaceNr */
;;;;/* 09 byte*/

;;;;/* USB Speaker Input Terminal Descriptor */
db 0x0C ;;;;/* bLength */
db 0x24 ;;;;/* bDescriptorType */
db 0x02 ;;;;/* bDescriptorSubtype */
db 0x01 ;;;;/* bTerminalID */
db 0x01, 0x01 ;;;;/* wTerminalType AUDIO_TERMINAL_USB_STREAMING 0x0101 */
db 0x00 ;;;;/* bAssocTerminal */
db 0x02, 0x03 ;;;;/* bNrChannels */
;;;;/* wChannelConfig 0x0003 Mono */
db 0x00
db 0x00 ;;;;/* iChannelNames */
db 0x00 ;;;;/* iTerminal */

;;;;/*USB Speaker Output Terminal Descriptor */
db 0x09 ;;;;/* bLength */
db 0x24 ;;;;/* bDescriptorType */
db 0x03 ;;;;/* bDescriptorSubtype */
db 0x02 ;;;;/* bTerminalID */
db 0x01 ;;/* wTerminalType 0x0301*/
db 0x03
db 0x00 ;;/* bAssocTerminal */
db 0x01 ;;/* bSourceID */
db 0x00 ;;/* iTerminal */
;;/* 09 byte*/

;;/* USB Speaker Standard AS Interface Descriptor - Audio Streaming Zero Bandwith */
;;/* Interface 1, Alternate Setting 0 */
db 0x09 ;;/* bLength */
db 0x04 ;;/* bDescriptorType */
db 0x01 ;;/* bInterfaceNumber */
db 0x00 ;;/* bAlternateSetting */
db 0x00 ;;/* bNumEndpoints */
db 0x01 ;;/* bInterfaceClass */
db 0x02 ;;/* bInterfaceSubClass */
db 0x00 ;;/* bInterfaceProtocol */
db 0x00 ;;/* iInterface */
;;/* 09 byte*/

;;/* USB Speaker Standard AS Interface Descriptor - Audio Streaming Operational */
;;/* Interface 1, Alternate Setting 1 */
db 0x09 ;;/* bLength */
db 0x04 ;;/* bDescriptorType */
db 0x01 ;;/* bInterfaceNumber */
db 0x01 ;;/* bAlternateSetting */
db 0x01 ;;/* bNumEndpoints */
db 0x01 ;;/* bInterfaceClass */
db 0x02 ;;/* bInterfaceSubClass */
db 0x00 ;;/* bInterfaceProtocol */
db 0x00 ;;/* iInterface */
;;/* 09 byte*/

;;/* USB Speaker Audio Streaming Interface Descriptor */
db 0x07 ;;/* bLength */
db 0x24 ;;/* bDescriptorType */
db 0x01 ;;/* bDescriptorSubtype */
db 0x01 ;;/* bTerminalLink */
db 0x01 ;;/* bDelay */
db 0x01 ;;/* wFormatTag AUDIO_FORMAT_PCM 0x0001*/
db 0x00
;;/* 07 byte*/

;;/* USB Speaker Audio Type III Format Interface Descriptor */
db 0x0B ;;/* bLength */
db 0x24 ;;/* bDescriptorType */
db 0x02 ;;/* bDescriptorSubtype */
db 0x01 ;;/* bFormatType */
db 0x02 ;;/* bNrChannels */
db 0x03 ;;/* bSubFrameSize : 3 Bytes per frame (24bits) */
db 24 ;;/* bBitResolution (24-bits per sample) */
db 0x01 ;;/* bSamFreqType only one frequency supported */
db 0x80 ;;/* Audio sampling frequency coded on 3 bytes */
db 0xBB
db 0x00 ;;/* 11 byte*/

;;/* Endpoint 1 - Standard Descriptor */
db 0x09 ;;/* bLength */
db 0x05 ;;/* bDescriptorType */
db 0x04 ;;/* bEndpointAddress 4 out endpoint*/
db 0x01;;0x05 ;;/* bmAttributes */
db 0x20 ;;/* wMaxPacketSize in Bytes (Freq(Samples)*2(Stereo)*2(HalfWord)) */
db 0x01
db 0x01 ;;/* bInterval */
db 0x00 ;;/* bRefresh */
db 0x00;//0x81 ;;/* bSynchAddress */
;;/* 09 byte*/

;;/* Endpoint - Audio Streaming Descriptor*/
db 0x07 ;;/* bLength */
db 0x25 ;;/* bDescriptorType */
db 0x01 ;;/* bDescriptor */
db 0x00 ;;/* bmAttributes */
db 0x00 ;;/* bLockDelayUnits */
db 0x00 ;;/* wLockDelay */
db 0x00
;;/* 07 byte*/

;; Endpoint - Standard Descriptor <-------- additional feedback EP
;;db 0x09 ;;/* bLength */
;;db 0x05 ;;/* bDescriptorType */
;;db 0x81 ;;/* bEndpointAddress */
;;db 0x01 ;;/* bmAttributes */
;;db 0x03 ;;/*1x 3 bytes wMaxPacketSize */
;;db 0x00
;;db 0x01 ;;/* bInterval */
;;db 0x03 ;;/* bRefresh, every 2ms */
;;db 0x00 ;;/* bSynchAddress */
;;/* 09 byte*/

HighSpeedConfigDscrEnd:

FullSpeedConfigDscr:

/* Configuration 1 */
db 0x09 /* bLength */
db 0x02 /* bDescriptorType */
db (HighSpeedConfigDscrEnd-HighSpeedConfigDscr) mod 256 /* wTotalLength 109 bytes*/
db (HighSpeedConfigDscrEnd-HighSpeedConfigDscr) / 256
db 0x02 /* bNumInterfaces */
db 0x01 /* bConfigurationValue */
db 0x00 /* iConfiguration */
db 0xC0 /* bmAttributes BUS Powred*/
db 0x32 /* bMaxPower = 100 mA*/
/* 09 byte*/

/* USB Speaker Standard interface descriptor */
db 0x09 /* bLength */
db 0x04 /* bDescriptorType */
db 0x00 /* bInterfaceNumber */
db 0x00 /* bAlternateSetting */
db 0x00 /* bNumEndpoints */
db 0x01 /* bInterfaceClass */
db 0x01 /* bInterfaceSubClass */
db 0x00 /* bInterfaceProtocol */
db 0x00 /* iInterface 7??????????*/

;;USB Speaker Class-specific AC Interface Descriptor */
db 0x09 ;;;;/* bLength */
db 0x24 ;;;;/* bDescriptorType */
db 0x01 ;;;;/* bDescriptorSubtype */
db 0x00, 0x01 ;;;;/* 1.00 */ ;;/* bcdADC */
db 0x27, 0x00 ;;;;/* wTotalLength = 39 30?????????*/
db 0x01 ;;;;/* bInCollection */
db 0x01 ;;;;/* baInterfaceNr */
;;;;/* 09 byte*/

;;;;/* USB Speaker Input Terminal Descriptor */
db 0x0C ;;;;/* bLength */
db 0x24 ;;;;/* bDescriptorType */
db 0x02 ;;;;/* bDescriptorSubtype */
db 0x01 ;;;;/* bTerminalID */
db 0x01, 0x01 ;;;;/* wTerminalType AUDIO_TERMINAL_USB_STREAMING 0x0101 */
db 0x00 ;;;;/* bAssocTerminal */
db 0x02, 0x03 ;;;;/* bNrChannels */
;;;;/* wChannelConfig 0x0003 Mono */
db 0x00
db 0x00 ;;;;/* iChannelNames */
db 0x00 ;;;;/* iTerminal */

;;;;/*USB Speaker Output Terminal Descriptor */
db 0x09 ;;;;/* bLength */
db 0x24 ;;;;/* bDescriptorType */
db 0x03 ;;;;/* bDescriptorSubtype */
db 0x02 ;;;;/* bTerminalID */
db 0x01 ;;/* wTerminalType 0x0301*/
db 0x03
db 0x00 ;;/* bAssocTerminal */
db 0x01 ;;/* bSourceID */
db 0x00 ;;/* iTerminal */
;;/* 09 byte*/

;;/* USB Speaker Standard AS Interface Descriptor - Audio Streaming Zero Bandwith */
;;/* Interface 1, Alternate Setting 0 */
db 0x09 ;;/* bLength */
db 0x04 ;;/* bDescriptorType */
db 0x01 ;;/* bInterfaceNumber */
db 0x00 ;;/* bAlternateSetting */
db 0x00 ;;/* bNumEndpoints */
db 0x01 ;;/* bInterfaceClass */
db 0x02 ;;/* bInterfaceSubClass */
db 0x00 ;;/* bInterfaceProtocol */
db 0x00 ;;/* iInterface */
;;/* 09 byte*/

;;/* USB Speaker Standard AS Interface Descriptor - Audio Streaming Operational */
;;/* Interface 1, Alternate Setting 1 */
db 0x09 ;;/* bLength */
db 0x04 ;;/* bDescriptorType */
db 0x01 ;;/* bInterfaceNumber */
db 0x01 ;;/* bAlternateSetting */
db 0x01 ;;/* bNumEndpoints */
db 0x01 ;;/* bInterfaceClass */
db 0x02 ;;/* bInterfaceSubClass */
db 0x00 ;;/* bInterfaceProtocol */
db 0x00 ;;/* iInterface */
;;/* 09 byte*/

;;/* USB Speaker Audio Streaming Interface Descriptor */
db 0x07 ;;/* bLength */
db 0x24 ;;/* bDescriptorType */
db 0x01 ;;/* bDescriptorSubtype */
db 0x01 ;;/* bTerminalLink */
db 0x01 ;;/* bDelay */
db 0x01 ;;/* wFormatTag AUDIO_FORMAT_PCM 0x0001*/
db 0x00
;;/* 07 byte*/

;;/* USB Speaker Audio Type III Format Interface Descriptor */
db 0x0B ;;/* bLength */
db 0x24 ;;/* bDescriptorType */
db 0x02 ;;/* bDescriptorSubtype */
db 0x01 ;;/* bFormatType */
db 0x02 ;;/* bNrChannels */
db 0x03 ;;/* bSubFrameSize : 3 Bytes per frame (24bits) */
db 24 ;;/* bBitResolution (24-bits per sample) */
db 0x01 ;;/* bSamFreqType only one frequency supported */
db 0x80 ;;/* Audio sampling frequency coded on 3 bytes */
db 0xBB
db 0x00 ;;/* 11 byte*/

;;/* Endpoint 1 - Standard Descriptor */
db 0x09 ;;/* bLength */
db 0x05 ;;/* bDescriptorType */
db 0x04 ;;/* bEndpointAddress 4 out endpoint*/
db 0x01;;0x05 ;;/* bmAttributes */
db 0x20 ;;/* wMaxPacketSize in Bytes (Freq(Samples)*2(Stereo)*2(HalfWord)) */
db 0x01
db 0x01 ;;/* bInterval */
db 0x00 ;;/* bRefresh */
db 0x00;//0x81 ;;/* bSynchAddress */
;;/* 09 byte*/

;;/* Endpoint - Audio Streaming Descriptor*/
db 0x07 ;;/* bLength */
db 0x25 ;;/* bDescriptorType */
db 0x01 ;;/* bDescriptor */
db 0x00 ;;/* bmAttributes */
db 0x00 ;;/* bLockDelayUnits */
db 0x00 ;;/* wLockDelay */
db 0x00
;;/* 07 byte*/

;; Endpoint - Standard Descriptor <-------- additional feedback EP
;;db 0x09 ;;/* bLength */
;;db 0x05 ;;/* bDescriptorType */
;;db 0x81 ;;/* bEndpointAddress */
;;db 0x01 ;;/* bmAttributes */
;;db 0x03 ;;/*1x 3 bytes wMaxPacketSize */
;;db 0x00
;;db 0x01 ;;/* bInterval */
;;db 0x03 ;;/* bRefresh, every 2ms */
;;db 0x00 ;;/* bSynchAddress */
;;/* 09 byte*/

FullSpeedConfigDscrEnd:

StringDscr:

StringDscr0:
db StringDscr0End-StringDscr0 ;; String descriptor length
db DSCR_STRING
db 09H,04H
StringDscr0End:

StringDscr1:
db StringDscr1End-StringDscr1 ;; String descriptor length
db DSCR_STRING
db 'R',00
db '6',00
db 'M',00
db 'F',00
db '4',00
db '9',00
db 'T',00
db '2',00
StringDscr1End:

StringDscr2:
db StringDscr2End-StringDscr2 ;; Descriptor length
db DSCR_STRING
db 'Q',00
db 'W',00
db 'E',00
db 'R',00
db 'T',00
db 'Y',00
StringDscr2End:

UserDscr:
dw 0000H
end


Сообщение отредактировал maxis - Jul 27 2015, 08:39
Go to the top of the page
 
+Quote Post

19 страниц V  « < 17 18 19
Reply to this topicStart new topic
4 чел. читают эту тему (гостей: 4, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 20th July 2025 - 00:04
Рейтинг@Mail.ru


Страница сгенерированна за 0.01438 секунд с 7
ELECTRONIX ©2004-2016