?? command_api.h
字號:
/*----------------------------------------------------------------------------
* Copyright (c) 2001 by National Semiconductor Corporation
* National Semiconductor Corporation
*
* All rights reserved
*
*<<<-------------------------------------------------------------------------
* File Contents:
* comamand_api.h - Custom Requests
*
* Project: USB Demo firmware
* Author : Yan Nosovitsky
* Date : Oct 2001
*----------------------------------------------------------------------->>>*/
#ifndef _command_api_h_
#define _command_api_h_
/* ----------------------------------------------------------------------------
* Bulk commands
*------------------------------------------------------------------------------ */
typedef enum {
BULK_NO_COMMAND = 0x00,
BULK_SEND_IMM_BACK = 0x10, /* Send the data back to host (trough Bulk transfer IN) immediately
when it arrives (trough Bulk transfer OUT). */
BULK_SEND_AFTER_LAST_BACK = 0x11, /* Send the data back to host (trough Bulk transfer IN) after its last
packet arrives from the host (trough Bulk transfer OUT).*/
BULK_SEND_DATA = 0x12, /* Send data to the host through Bulk transfer IN. The data contains
bytes equal to wLength parameter. */
BULK_GET_DATA = 0x13 /* Receive data from the host through Bulk transfer OUT. The data contains
bytes equal to wLength parameter.
After sending data completing GET_FEEDBACK request is sent by the host.*/
} BulkCommand;
/* ----------------------------------------------------------------------------
* Interrupt commands
*------------------------------------------------------------------------------ */
typedef enum {
INTERRUPT_NO_COMMAND = 0x00,
INTERRUPT_GET_INT = 0x20 /* Send data to the host through Interrupt transfer IN. When getting this
request, the firmware generates number of interrupts equal to wValue
parameter. Each interrupt will 8 bytes of data. Each byte of the data
contains a serial number of the current interrupt */
} InterruptCommand;
/* ----------------------------------------------------------------------------
* Isochronous commands
*------------------------------------------------------------------------------ */
typedef enum {
ISOCH_NO_COMMAND = 0x00,
ISOCH_SEND_IMM_BACK = 0x30, /* Send the data back to host (trough Isochronous transfer IN) immediately
when it arrives (trough Isochronous transfer OUT). */
ISOCH_SEND_DATA = 0x31, /* Send data to the host through Isochronous transfer IN. The data contains
bytes equal to wLength parameter */
ISOCH_GET_DATA = 0x32 /* Receive data from the host through Isochronous transfer IN. The data
contains bytes equal to wLength parameter.
After sending data completing GET_FEEDBACK request is sent by the host.*/
}IsochCommand;
/*------------------------------------------------------------------------------
* General command
*------------------------------------------------------------------------------ */
#define GET_BULK_FEEDBACK 0x01 /* The request returns results of the last BULK_GET_DATA request.
The device should return number of bytes received in last request (4 bytes)
and number of errors (4 bytes).*/
#define GET_ISO_FEEDBACK 0x02 /* The request returns results of the last ISOCH_GET_DATA request.
The device should return number of bytes received in last request (4 bytes)
and number of errors (4 bytes).*/
#define STOP_REQUEST 0x03 /* Stop performing current request.*/
#define READ_USB_REG 0x4 /* Read USBN9603 register. wValue contains the register address. The device
should return the register value */
#define WRITE_USB_REG 0x5 /* Write USBN9603 register. wValue contains the register address and wIndex
contains new value of register */
#endif /* _command_api_h_ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -