📄 tr_gene.h
字号:
/*
** Kenobi2 version 1.3
**
** ** This code has been made to check/learn the 1161 functionalities **
** ** Release 25-Feb-2002 **
**
** OKANO, Akifumi
**
** Computing Segment, Semisonductors Div, Philips Japan Ltd.
** akifumi.okano@philips.com
** +81-3-3740-4668
*/
#ifndef _TR_GENE_H
#define _TR_GENE_H
#include "chap9.h"
#define reqtype( x ) (x >> 8)
#define request( x ) (x & 0xF)
#define DEFAULT_BUFFER_SIZE 8
#define MAX_DEVICE_NUM 127
#define MAX_ENDPOINT_NUM 16
#define MAX_HUB_PORTS 5
#define isCCFatalError( x ) ((x) && (~(x) & 0x8))
typedef struct epi *endpoint_info_ptr;
typedef struct epi {
unsigned short max_packet_size;
unsigned char dev_addr;
unsigned char ep_num;
unsigned char toggle;
unsigned char speed;
unsigned char direction;
unsigned char tr_type; // "Async or Iso" for PTD parameter
unsigned char transfer_type; // Ctrl, Iso, Bulk, Intrr
std_endpoint_descriptor endpoint_descriptor;
}
endpoint_info;
typedef struct dev {
unsigned char address;
unsigned char speed;
std_dev_descriptor dev_descriptor;
std_conf_descriptor conf_descriptor;
std_interface_descriptor interfacef_descriptor;
endpoint_info_ptr epi_ptr[ MAX_ENDPOINT_NUM ];
unsigned short *string_manufacturer;
unsigned short *string_product;
unsigned short *string_serialNum;
}
device_instance;
typedef struct req {
unsigned char bmRequestType;
unsigned char bRequest;
unsigned short wValue;
unsigned short wIndex;
unsigned short wLength;
}
USB_Device_Request;
unsigned short control_transfer( USB_Device_Request *dev_req, device_instance *dvi_ptr, unsigned char *data_ptr );
unsigned char transaction( unsigned char direction, unsigned char *data_ptr, unsigned short *size, endpoint_info *epi_ptr );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -