?? parser.h
字號:
/*----------------------------------------------------------------------------
* Copyright (c) 2001 by National Semiconductor Corporation
* National Semiconductor Corporation
*
* All rights reserved
*
*<<<-------------------------------------------------------------------------
* File Contents:
* parser.h - parser states
*
* Project: USB Demo firmware
* Author : Yan Nosovitsky
* Date : Oct 2001
*----------------------------------------------------------------------->>>*/
#ifndef _parser_h_
#define _parser_h_
/*-------------------------------------------------------------------
* This structure represents buffer used in immediate response commands
*-------------------------------------------------------------------*/
typedef struct {
byte buffer[TX_BULK_EP_FIFO_SIZE]; /* the buffer */
boolean getReady; /* boolean indicating buffer emptiness */
boolean sendReady; /* boolean indicating buffer fullness */
int nextBuf; /* index of the next buffer */
} LocBuff;
/*-------------------------------------------------------------------
* This structure represents last bulk/isochronous command status
*-------------------------------------------------------------------*/
typedef struct {
union {
BulkCommand bulkCommand;
IsochCommand isoCommand;
} command; /* current command */
dword dataSize; /* number of bytes to be sent/received in current command */
dword restToRead; /* remained number of bytes to be received */
dword restToWrite; /* remained number of bytes to be sent*/
byte data; /* constant byte of which the data is contained, for get or send commands */
dword numOfErrors; /* number of errors detected during the command */
boolean zeroPacketNeed; /* boolean indicating whether a zero packet needed for end indication*/
int bufferForGetData; /* index of the "receiving" buffer (for immediate response commands only) */
int bufferForSendData; /* index of the "sending" buffer (for immediate response commands only) */
LocBuff locBuff[4]; /* recived/sent data buffers (for immediate response commands only) */
} State;
/*-------------------------------------------------------------------
* This structure represents last interrupt command status
*-------------------------------------------------------------------*/
typedef struct {
InterruptCommand interruptCommand; /* current interrupt command */
word interruptNum; /* number of interrupts to be sent in current command */
word restToSend; /* remained number of interrupts to be sent*/
word interval; /* interval between the interrupts */
} InterruptState;
void Bulk_Parser (USB_request_t *req);
void Iso_Parser (USB_request_t *req);
void Gen_Parser (USB_request_t *req);
void Interrupt_Parser (USB_request_t *req);
void DMA_work();
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -