⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 command_api.h

📁 杭州立宇泰arm7的bootloader程序
💻 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.*/
    BULK_TRANS_FILENAME         = 0x14, /* defined by us, used by USBTool to transmit file's name*/
    BULK_TRANS_FILE             = 0x15, /* defined by us, used by USBTool to transmit whole file*/
    BULK_TRANS_TEST             = 0x16  /* defined by us, used by USBTool to test if EP2 is ready for datum*/
  
} 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 + -