2022-03-26 20:51:40 +08:00

347 lines
17 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* 2014.09.09
*****************************************
** Copyright (C) W.ch 1999-2019 **
** Web: http://wch.cn **
*****************************************
** USB-flash File Interface for CHRV3 **
** KEIL423, gcc 8.20 **
*****************************************
*/
/* CHRV3 U<><55><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ϵͳ<CFB5>ӿ<EFBFBD>, ֧<><D6A7>: FAT12/FAT16/FAT32 */
//#include "CHRV3BAS.H"
#ifndef __CHRV3UFI_H__
#define __CHRV3UFI_H__
#define CHRV3_LIB_VER 0x10
//#define DISK_BASE_BUF_LEN 512 /* Ĭ<>ϵĴ<CFB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>СΪ512<31>ֽ<EFBFBD>(<28><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>Ϊ2048<34><38><EFBFBD><EFBFBD>4096<39><36>֧<EFBFBD><D6A7>ijЩ<C4B3><D0A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>U<EFBFBD><55>),Ϊ0<CEAA><30><EFBFBD><EFBFBD>ֹ<EFBFBD>ڱ<EFBFBD><DAB1>ļ<EFBFBD><C4BC>ж<EFBFBD><D0B6><EFBFBD><E5BBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>pDISK_BASE_BUF<55><46>ָ<EFBFBD><D6B8> */
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD>ԼRAM,<2C><>ô<EFBFBD>ɽ<EFBFBD>DISK_BASE_BUF_LEN<45><4E><EFBFBD><EFBFBD>Ϊ0<CEAA>Խ<EFBFBD>ֹ<EFBFBD>ڱ<EFBFBD><DAB1>ļ<EFBFBD><C4BC>ж<EFBFBD><D0B6><EFBFBD><E5BBBA><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>CHRV3LibInit֮ǰ<D6AE><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õĻ<C3B5><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>pDISK_BASE_BUF<55><46><EFBFBD><EFBFBD> */
//#define NO_DEFAULT_ACCESS_SECTOR 1 /* <20><>ֹĬ<D6B9>ϵĴ<CFB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>д<EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
//#define NO_DEFAULT_DISK_CONNECT 1 /* <20><>ֹĬ<D6B9>ϵļ<CFB5><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>д<EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
//#define NO_DEFAULT_FILE_ENUMER 1 /* <20><>ֹĬ<D6B9>ϵ<EFBFBD><CFB5>ļ<EFBFBD><C4BC><EFBFBD>ö<EFBFBD>ٻص<D9BB><D8B5><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>д<EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#ifdef __cplusplus
extern "C" {
#endif
/* ********************************************************************************************************************* */
/* FILE: CHRV3UF.H */
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#ifndef ERR_SUCCESS
#define ERR_SUCCESS 0x00 /* <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD> */
#endif
#ifndef ERR_DISK_DISCON
#define ERR_CHRV3_ERROR 0x81 /* CHRV3Ӳ<33><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>λCHRV3 */
//#define ERR_DISK_DISCON 0x82 /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>,<2C><><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>Ͽ<EFBFBD> */
#define ERR_STATUS_ERR 0x83 /* <20><><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><D3BB>߶Ͽ<DFB6><CFBF><EFBFBD><EFBFBD><EFBFBD> */
#define ERR_HUB_PORT_FREE 0x84 /* USB-HUB<55>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>HUB<55>˿<EFBFBD><CBBF><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD>,<2C><><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>Ͽ<EFBFBD> */
#define ERR_MBR_ERROR 0x91 /* <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>Ч,<2C><><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>ʽ<EFBFBD><CABD> */
#define ERR_TYPE_ERROR 0x92 /* <20><><EFBFBD>̷<EFBFBD><CCB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD>֧<EFBFBD><D6A7>,ֻ֧<D6BB><D6A7>FAT12/FAT16/BigDOS/FAT32,<2C><>Ҫ<EFBFBD>ɴ<EFBFBD><C9B4>̹<EFBFBD><CCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD> */
#define ERR_BPB_ERROR 0xA1 /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>ʽ<EFBFBD><CABD>,<2C><><EFBFBD>߲<EFBFBD><DFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>Ҫ<EFBFBD><D2AA>WINDOWS<57><53><EFBFBD><EFBFBD>Ĭ<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ʽ<EFBFBD><CABD> */
#define ERR_TOO_LARGE 0xA2 /* <20><><EFBFBD>̷<EFBFBD><CCB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4GB,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>250GB,<2C><>Ҫ<EFBFBD><D2AA>WINDOWS<57><53><EFBFBD><EFBFBD>Ĭ<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ʽ<EFBFBD><CABD> */
#define ERR_FAT_ERROR 0xA3 /* <20><><EFBFBD>̵<EFBFBD><CCB5>ļ<EFBFBD>ϵͳ<CFB5><CDB3>֧<EFBFBD><D6A7>,ֻ֧<D6BB><D6A7>FAT12/FAT16/FAT32,<2C><>Ҫ<EFBFBD><D2AA>WINDOWS<57><53><EFBFBD><EFBFBD>Ĭ<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ʽ<EFBFBD><CABD> */
#define ERR_DISK_FULL 0xB1 /* <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>̫<EFBFBD><CCAB><><CAA3><EFBFBD>ռ<EFBFBD>̫<EFBFBD>ٻ<EFBFBD><D9BB><EFBFBD><EFBFBD>Ѿ<EFBFBD>û<EFBFBD><C3BB>,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define ERR_FDT_OVER 0xB2 /* Ŀ¼<C4BF><C2BC><EFBFBD>ļ<EFBFBD>̫<EFBFBD><CCAB><>п<EFBFBD><D0BF>е<EFBFBD>Ŀ¼<C4BF><C2BC>,FAT12/FAT16<31><36>Ŀ¼<C4BF>µ<EFBFBD><C2B5>ļ<EFBFBD><C4BC><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>500<30><30>,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define ERR_MISS_DIR 0xB3 /* ָ<><D6B8>·<EFBFBD><C2B7><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD>Ŀ¼û<C2BC><C3BB><EFBFBD>ҵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD> */
#define ERR_FILE_CLOSE 0xB4 /* <20>ļ<EFBFBD><C4BC>Ѿ<EFBFBD><D1BE>ر<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫʹ<D2AA><CAB9><><D3A6><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD><C2B4><EFBFBD><EFBFBD>ļ<EFBFBD> */
#define ERR_OPEN_DIR 0x41 /* ָ<><D6B8>·<EFBFBD><C2B7><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define ERR_MISS_FILE 0x42 /* ָ<><D6B8>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD> */
#define ERR_FOUND_NAME 0x43 /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>,<2C>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEBBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫʹ<D2AA><CAB9><>ô򿪸<C3B4><F2BFAAB8>ļ<EFBFBD> */
#endif
/* <20><><EFBFBD><EFBFBD>2XH-3XH<58><48><EFBFBD><EFBFBD>USB<53><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ͨѶʧ<D1B6>ܴ<EFBFBD><DCB4><EFBFBD>,<2C><>CHRV3<56>ӳ<EFBFBD><D3B3><EFBFBD>ģ<EFBFBD><C4A3>CH375<37>ķ<EFBFBD><C4B7><EFBFBD> */
/* <20><><EFBFBD><EFBFBD>1XH<58><48><EFBFBD><EFBFBD>USB<53><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>,<2C><>CHRV3<56>ӳ<EFBFBD><D3B3><EFBFBD>ģ<EFBFBD><C4A3>CH375<37>ķ<EFBFBD><C4B7><EFBFBD> */
#ifndef ERR_USB_CONNECT
#define ERR_USB_CONNECT_LS 0x13 /* <20><><EFBFBD><EFBFBD><E2B5BD><EFBFBD><EFBFBD>USB<53><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> */
#define ERR_USB_CONNECT 0x15 /* <20><><EFBFBD>⵽USB<53><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD> */
#define ERR_USB_DISCON 0x16 /* <20><><EFBFBD>⵽USB<53><EFBFBD>Ͽ<EFBFBD><CFBF>¼<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>Ͽ<EFBFBD> */
#define ERR_USB_BUF_OVER 0x17 /* USB<53><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD><E0BBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define ERR_USB_DISK_ERR 0x1F /* USB<53><EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>,<2C>ڳ<EFBFBD>ʼ<EFBFBD><CABC>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USB<53><EFBFBD><E6B4A2><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>,<2C>ڶ<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><D0BF><EFBFBD><EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD><EFBFBD>𻵻<EFBFBD><F0BBB5BB><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>Ͽ<EFBFBD> */
#define ERR_USB_TRANSFER 0x20 /* NAK/STALL<4C>ȸ<EFBFBD><C8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0x20~0x2F */
#endif
/* <20><><EFBFBD>̼<EFBFBD><CCBC>ļ<EFBFBD>״̬ */
#define DISK_UNKNOWN 0x00 /* <20><>δ<EFBFBD><CEB4>ʼ<EFBFBD><CABC>,δ֪״̬ */
#define DISK_DISCONNECT 0x01 /* <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>Ͽ<EFBFBD> */
#define DISK_CONNECT 0x02 /* <20><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>ô<EFBFBD><C3B4><EFBFBD> */
#define DISK_USB_ADDR 0x04 /* <20><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>USB<53><EFBFBD><E8B1B8>ַ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>USB<53>ͳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define DISK_MOUNTED 0x05 /* <20><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ɹ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ϵͳ<CFB5><CDB3>֧<EFBFBD><D6A7> */
#define DISK_READY 0x10 /* <20>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5>ļ<EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>ܹ<EFBFBD>֧<EFBFBD><D6A7> */
#define DISK_OPEN_ROOT 0x12 /* <20>Ѿ<EFBFBD><D1BE>򿪸<EFBFBD>Ŀ¼,<2C><><EFBFBD><EFBFBD>ģʽ<><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB>дĿ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ʹ<>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><><D7A2>FAT12/FAT16<31><36>Ŀ¼<C4BF>ǹ̶<C7B9><CCB6><EFBFBD><EFBFBD><EFBFBD> */
#define DISK_OPEN_DIR 0x13 /* <20>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼,<2C><><EFBFBD><EFBFBD>ģʽ<><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB>дĿ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define DISK_OPEN_FILE 0x14 /* <20>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>,<2C><><EFBFBD><EFBFBD>ģʽ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD>д */
#define DISK_OPEN_FILE_B 0x15 /* <20>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>,<2C>ֽ<EFBFBD>ģʽ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD>д */
/* FAT<41><54><EFBFBD>ͱ<EFBFBD>־ */
#ifndef DISK_FAT16
#define DISK_FS_UNKNOWN 0 /* δ֪<CEB4><D6AA><EFBFBD>ļ<EFBFBD>ϵͳ */
#define DISK_FAT12 1 /* FAT12<31>ļ<EFBFBD>ϵͳ */
#define DISK_FAT16 2 /* FAT16<31>ļ<EFBFBD>ϵͳ */
#define DISK_FAT32 3 /* FAT32<33>ļ<EFBFBD>ϵͳ */
#endif
/* FAT<41><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>Ŀ¼<C4BF><C2BC>Ϣ */
typedef struct _FAT_DIR_INFO {
UINT8 DIR_Name[11]; /* 00H,<2C>ļ<EFBFBD><C4BC><EFBFBD>,<2C><>11<31>ֽ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E3B4A6><EFBFBD>ո<EFBFBD> */
UINT8 DIR_Attr; /* 0BH,<2C>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>,<2C>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> */
UINT8 DIR_NTRes; /* 0CH */
UINT8 DIR_CrtTimeTenth; /* 0DH,<2C>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,<2C><>0.1<EFBFBD>뵥λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT16 DIR_CrtTime; /* 0EH,<2C>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> */
UINT16 DIR_CrtDate; /* 10H,<2C>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT16 DIR_LstAccDate; /* 12H,<2C><><EFBFBD><EFBFBD>һ<EFBFBD>δ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT16 DIR_FstClusHI; /* 14H */
UINT16 DIR_WrtTime; /* 16H,<2C>ļ<EFBFBD><C4BC>޸<EFBFBD>ʱ<EFBFBD><CAB1>,<2C>ο<EFBFBD><CEBF><EFBFBD>MAKE_FILE_TIME */
UINT16 DIR_WrtDate; /* 18H,<2C>ļ<EFBFBD><C4BC>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>,<2C>ο<EFBFBD><CEBF><EFBFBD>MAKE_FILE_DATA */
UINT16 DIR_FstClusLO; /* 1AH */
UINT32 DIR_FileSize; /* 1CH,<2C>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> */
} FAT_DIR_INFO; /* 20H */
typedef FAT_DIR_INFO *PX_FAT_DIR_INFO;
/* <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> */
#define ATTR_READ_ONLY 0x01 /* <20>ļ<EFBFBD>Ϊֻ<CEAA><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define ATTR_HIDDEN 0x02 /* <20>ļ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define ATTR_SYSTEM 0x04 /* <20>ļ<EFBFBD>Ϊϵͳ<CFB5><CDB3><EFBFBD><EFBFBD> */
#define ATTR_VOLUME_ID 0x08 /* <20><><EFBFBD><EFBFBD> */
#define ATTR_DIRECTORY 0x10 /* <20><>Ŀ¼ */
#define ATTR_ARCHIVE 0x20 /* <20>ļ<EFBFBD>Ϊ<EFBFBD><EFBFBD><E6B5B5><EFBFBD><EFBFBD> */
#define ATTR_LONG_NAME ( ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID )
/* <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> UINT8 */
/* bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 */
/* ֻ <20><> ϵ <20><> Ŀ <20><> δ<><CEB4><EFBFBD><EFBFBD> */
/* <20><> <20><> ͳ <20><> ¼ <20><> */
/* <20>ļ<EFBFBD>ʱ<EFBFBD><CAB1> UINT16 */
/* Time = (Hour<<11) + (Minute<<5) + (Second>>1) */
#define MAKE_FILE_TIME( h, m, s ) ( (h<<11) + (m<<5) + (s>>1) ) /* <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
/* <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> UINT16 */
/* Date = ((Year-1980)<<9) + (Month<<5) + Day */
#define MAKE_FILE_DATE( y, m, d ) ( ((y-1980)<<9) + (m<<5) + d ) /* <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
/* <20>ļ<EFBFBD><C4BC><EFBFBD> */
#define PATH_WILDCARD_CHAR 0x2A /* ·<><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD> '*' */
#define PATH_SEPAR_CHAR1 0x5C /* ·<><C2B7><EFBFBD><EFBFBD><EFBFBD>ķָ<C4B7><D6B8><EFBFBD> '\' */
#define PATH_SEPAR_CHAR2 0x2F /* ·<><C2B7><EFBFBD><EFBFBD><EFBFBD>ķָ<C4B7><D6B8><EFBFBD> '/' */
#ifndef MAX_PATH_LEN
#define MAX_PATH_LEN 64 /* <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>ָܷ<DCB7><D6B8><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>00H */
#endif
/* <20>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
typedef union _CMD_PARAM {
struct {
UINT8 mBuffer[ MAX_PATH_LEN ];
} Other;
struct {
UINT32 mTotalSector; /* <20><><EFBFBD><EFBFBD>: <20><>ǰ<EFBFBD>߼<EFBFBD><DFBC>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT32 mFreeSector; /* <20><><EFBFBD><EFBFBD>: <20><>ǰ<EFBFBD>߼<EFBFBD><DFBC>̵<EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT32 mSaveValue;
} Query; /* CMD_DiskQuery, <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ */
struct {
UINT8 mPathName[ MAX_PATH_LEN ]; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ·<><C2B7>: [<5B>̷<EFBFBD><><C3B0>,б<><D0B1>,Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>...,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>00H], <20><><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD><CCB7><EFBFBD>ð<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>ʡ<EFBFBD><CAA1>, <20><><EFBFBD><EFBFBD>"C:\DIR1.EXT\DIR2\FILENAME.EXT",00H */
} Open; /* CMD_FileOpen, <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD> */
// struct {
// UINT8 mPathName[ MAX_PATH_LEN ]; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ·<><C2B7>: [<5B>̷<EFBFBD><><C3B0>,б<><D0B1>,Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>(<28><>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>*)...,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>00H], <20><><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD><CCB7><EFBFBD>ð<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>ʡ<EFBFBD><CAA1>, <20><><EFBFBD><EFBFBD>"C:\DIR1.EXT\DIR2\FILE*",00H */
// } Open; /* CMD_FileOpen, ö<><C3B6><EFBFBD>ļ<EFBFBD>, CHRV3vFileSize<7A><65><EFBFBD><EFBFBD>λΪ1<CEAA><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>xFileNameEnumer,Ϊ0<CEAA>򷵻<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5>ļ<EFBFBD><C4BC><EFBFBD> */
struct {
UINT8 mUpdateLen; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>³<EFBFBD><C2B3><EFBFBD>: 0<><30>ֹ,1<><31><EFBFBD><EFBFBD> */
} Close; /* CMD_FileClose, <20>رյ<D8B1>ǰ<EFBFBD>ļ<EFBFBD> */
struct {
UINT8 mPathName[ MAX_PATH_LEN ]; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ·<><C2B7>: [<5B>̷<EFBFBD><><C3B0>,б<><D0B1>,Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>...,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>00H], <20><><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD><CCB7><EFBFBD>ð<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>ʡ<EFBFBD><CAA1>, <20><><EFBFBD><EFBFBD>"C:\DIR1.EXT\DIR2\FILENAME.EXT",00H */
} Create; /* CMD_FileCreate, <20>½<EFBFBD><C2BD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD> */
struct {
UINT8 mPathName[ MAX_PATH_LEN ]; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ·<><C2B7>: [<5B>̷<EFBFBD><><C3B0>,б<><D0B1>,Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>...,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>00H], <20><><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD><CCB7><EFBFBD>ð<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>ʡ<EFBFBD><CAA1>, <20><><EFBFBD><EFBFBD>"C:\DIR1.EXT\DIR2\FILENAME.EXT",00H */
} Erase; /* CMD_FileErase, ɾ<><C9BE><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ر<EFBFBD> */
struct {
UINT32 mFileSize; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>µ<EFBFBD><C2B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>,Ϊ0FFFFFFFFH<46><48><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>, <20><><EFBFBD><EFBFBD>: ԭ<><D4AD><EFBFBD><EFBFBD> */
UINT16 mFileDate; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>µ<EFBFBD><C2B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>,Ϊ0FFFFH<46><48><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>, <20><><EFBFBD><EFBFBD>: ԭ<><D4AD><EFBFBD><EFBFBD> */
UINT16 mFileTime; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>µ<EFBFBD><C2B5>ļ<EFBFBD>ʱ<EFBFBD><CAB1>,Ϊ0FFFFH<46><48><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>, <20><><EFBFBD><EFBFBD>: ԭʱ<D4AD><CAB1> */
UINT8 mFileAttr; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>µ<EFBFBD><C2B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>,Ϊ0FFH<46><48><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>, <20><><EFBFBD><EFBFBD>: ԭ<><D4AD><EFBFBD><EFBFBD> */
} Modify; /* CMD_FileQuery, <20><>ѯ<EFBFBD><D1AF>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ϣ; CMD_FileModify, <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>޸ĵ<DEB8>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ϣ */
struct {
UINT32 mSaveCurrClus;
UINT32 mSaveLastClus;
} Alloc; /* CMD_FileAlloc, <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>̿ռ<CCBF> */
struct {
UINT32 mSectorOffset; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>,0<><30><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>ļ<EFBFBD>ͷ,0FFFFFFFFH<46><48><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>ļ<EFBFBD>β, <20><><EFBFBD><EFBFBD>: <20><>ǰ<EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>Ӧ<EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 0FFFFFFFFH<46><48><EFBFBD>ѵ<EFBFBD><D1B5>ļ<EFBFBD>β */
UINT32 mLastOffset;
} Locate; /* CMD_FileLocate, <20>ƶ<EFBFBD><C6B6><EFBFBD>ǰ<EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8> */
struct {
UINT8 mSectorCount; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>: ʵ<>ʶ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT8 mActCnt;
UINT8 mLbaCount;
UINT8 mRemainCnt;
PUINT8 mDataBuffer; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ַ, <20><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>ַ */
UINT32 mLbaStart;
} Read; /* CMD_FileRead, <20>ӵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD> */
struct {
UINT8 mSectorCount; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>: ʵ<><CAB5>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT8 mActCnt;
UINT8 mLbaCount;
UINT8 mAllocCnt;
PUINT8 mDataBuffer; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ַ, <20><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>ַ */
UINT32 mLbaStart;
UINT32 mSaveValue;
} Write; /* CMD_FileWrite, <20><><EFBFBD><EFBFBD>ǰ<EFBFBD>ļ<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
struct {
UINT32 mDiskSizeSec; /* <20><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>״ε<D7B4><CEB5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD> */
} DiskReady; /* CMD_DiskReady, <20><>ѯ<EFBFBD><D1AF><EFBFBD>̾<EFBFBD><CCBE><EFBFBD> */
struct {
UINT32 mByteOffset; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB>ƫ<EFBFBD><C6AB><EFBFBD><EFBFBD>, <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB><EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8>, <20><><EFBFBD><EFBFBD>: <20><>ǰ<EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>Ӧ<EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 0FFFFFFFFH<46><48><EFBFBD>ѵ<EFBFBD><D1B5>ļ<EFBFBD>β */
UINT32 mLastOffset;
} ByteLocate; /* CMD_ByteLocate, <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>ǰ<EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8> */
struct {
UINT16 mByteCount; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ׼<><D7BC><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>, <20><><EFBFBD><EFBFBD>: ʵ<>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD> */
PUINT8 mByteBuffer; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD> */
UINT16 mActCnt;
} ByteRead; /* CMD_ByteRead, <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD>ӵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ݿ<EFBFBD> */
struct {
UINT16 mByteCount; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ׼<><D7BC>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>, <20><><EFBFBD><EFBFBD>: ʵ<><CAB5>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD> */
PUINT8 mByteBuffer; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD> */
UINT16 mActCnt;
} ByteWrite; /* CMD_ByteWrite, <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ǰ<EFBFBD>ļ<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD> */
struct {
UINT8 mSaveVariable; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Ϊ0<CEAA><30><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>U<EFBFBD>̵ı<CCB5><C4B1><EFBFBD>,Ϊ0x80<38><30><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>U<EFBFBD>̵ı<CCB5><C4B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>ֵ<EFBFBD>򱸷<EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
UINT8 mReserved[3];
PUINT8 mBuffer; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ָ<><D6B8><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD>ı<EFBFBD><C4B1>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>Ȳ<EFBFBD>С<EFBFBD><D0A1>80<38><30><EFBFBD>ֽ<EFBFBD> */
} SaveVariable; /* CMD_SaveVariable, <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>/<2F>ָ<EFBFBD><D6B8>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD> */
} CMD_PARAM;
typedef CMD_PARAM CMD_PARAM_I;
//typedef CMD_PARAM *P_CMD_PARAM;
/* SCSI<53><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#ifndef SPC_CMD_INQUIRY
#define SPC_CMD_INQUIRY 0x12
#define SPC_CMD_READ_CAPACITY 0x25
#define SPC_CMD_READ10 0x28
#define SPC_CMD_WRITE10 0x2A
#define SPC_CMD_TEST_READY 0x00
#define SPC_CMD_REQUEST_SENSE 0x03
#define SPC_CMD_MODESENSE6 0x1A
#define SPC_CMD_MODESENSE10 0x5A
#define SPC_CMD_START_STOP 0x1B
#endif
/* FILE: CHRV3UFI.C */
#define EN_DISK_WRITE 1
#ifndef DISK_BASE_BUF_LEN
#define DISK_BASE_BUF_LEN 512 /* Ĭ<>ϵĴ<CFB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>СΪ512<31>ֽ<EFBFBD>,<2C><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>Ϊ2048<34><38><EFBFBD><EFBFBD>4096<39><36>֧<EFBFBD><D6A7>ijЩ<C4B3><D0A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>U<EFBFBD><55>,Ϊ0<CEAA><30><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9>.H<>ļ<EFBFBD><C4BC>ж<EFBFBD><D0B6><EFBFBD><E5BBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>pDISK_BASE_BUF<55><46>ָ<EFBFBD><D6B8> */
#endif
/* <20>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD> */
extern UINT8V CHRV3IntStatus; /* CHRV3<56><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>״̬ */
extern UINT8V CHRV3DiskStatus; /* <20><><EFBFBD>̼<EFBFBD><CCBC>ļ<EFBFBD>״̬ */
extern UINT8 CHRV3vDiskFat; /* <20>߼<EFBFBD><DFBC>̵<EFBFBD>FAT<41><54>־:1=FAT12,2=FAT16,3=FAT32 */
extern UINT8 CHRV3vSecPerClus; /* <20>߼<EFBFBD><DFBC>̵<EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
extern UINT8 CHRV3vSectorSizeB; /* log2(CHRV3vSectorSize) */
extern UINT32 CHRV3vStartLba; /* <20>߼<EFBFBD><DFBC>̵<EFBFBD><CCB5><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>LBA */
extern UINT32 CHRV3vDiskRoot; /* <20><><EFBFBD><EFBFBD>FAT16<31><36>Ϊ<EFBFBD><CEAA>Ŀ¼ռ<C2BC><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>FAT32<33><32>Ϊ<EFBFBD><CEAA>Ŀ¼<C4BF><C2BC>ʼ<EFBFBD>غ<EFBFBD> */
extern UINT32 CHRV3vDataStart; /* <20>߼<EFBFBD><DFBC>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼLBA */
extern UINT32 CHRV3vStartCluster; /* <20><>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD>ʼ<EFBFBD>غ<EFBFBD> */
extern UINT32 CHRV3vFileSize; /* <20><>ǰ<EFBFBD>ļ<EFBFBD><C4BC>ij<EFBFBD><C4B3><EFBFBD> */
extern UINT32 CHRV3vCurrentOffset; /* <20><>ǰ<EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8>,<2C><>ǰ<EFBFBD><C7B0>дλ<D0B4>õ<EFBFBD><C3B5>ֽ<EFBFBD>ƫ<EFBFBD><C6AB> */
extern UINT32 CHRV3vFdtLba; /* <20><>ǰFDT<44><54><EFBFBD>ڵ<EFBFBD>LBA<42><41>ַ */
extern UINT32 CHRV3vLbaCurrent; /* <20><>ǰ<EFBFBD><C7B0>д<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ʼLBA<42><41>ַ */
extern UINT16 CHRV3vFdtOffset; /* <20><>ǰFDT<44><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>ƫ<EFBFBD>Ƶ<EFBFBD>ַ */
extern UINT16 CHRV3vSectorSize; /* <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С */
extern UINT8 CHRV3vCurrentLun; /* <20><><EFBFBD>̵<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>߼<EFBFBD><DFBC><EFBFBD>Ԫ<EFBFBD><D4AA> */
extern BOOL CHRV3vSubClassIs6; /* USB<53><EFBFBD><E6B4A2><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ6,0<><30><EFBFBD><EFBFBD>6 */
extern PUINT8 pDISK_BASE_BUF; /* ָ<><D6B8><EFBFBD>ⲿRAM<41>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD>С<EFBFBD><D0A1>CHRV3vSectorSize,<2C><>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
extern PUINT8 pDISK_FAT_BUF; /* ָ<><D6B8><EFBFBD>ⲿRAM<41>Ĵ<EFBFBD><C4B4><EFBFBD>FAT<41><54><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD>С<EFBFBD><D0A1>CHRV3vSectorSize,<2C><>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
extern UINT16 CHRV3vPacketSize; /* USB<53><EFBFBD><E6B4A2><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:64@FS,512@HS/SS,<2C><>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
extern PUINT32 pTX_DMA_A_REG; /* ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DMA<4D><41>ַ<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>,<2C><>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
extern PUINT32 pRX_DMA_A_REG; /* ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DMA<4D><41>ַ<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>,<2C><>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
extern PUINT16 pTX_LEN_REG; /* ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>ȼĴ<C8BC><C4B4><EFBFBD>,<2C><>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
extern PUINT16 pRX_LEN_REG; /* ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>ճ<EFBFBD><D5B3>ȼĴ<C8BC><C4B4><EFBFBD>,<2C><>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
extern CMD_PARAM_I mCmdParam; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
extern UINT8 RxBuffer[ MAX_PACKET_SIZE ]; // IN, must even address
extern UINT8 TxBuffer[ MAX_PACKET_SIZE ]; // OUT, must even address
//#define PXUDISK_BOC_CBW PUDISK_BOC_CBW
//#define PXUDISK_BOC_CSW PUDISK_BOC_CSW
#ifndef pSetupReq
#define pSetupReq ((PUSB_SETUP_REQ)TxBuffer)
#endif
#ifndef pCBW
#define pCBW ((PXUDISK_BOC_CBW)TxBuffer)
#define pCSW ((PXUDISK_BOC_CSW)RxBuffer)
#endif
#ifndef pBOC_buf
#define pBOC_buf (TxBuffer+((USB_BO_CBW_SIZE+4)&0xFE))
#endif
#if DISK_BASE_BUF_LEN > 0
extern UINT8 DISK_BASE_BUF[ DISK_BASE_BUF_LEN ]; /* <20>ⲿRAM<41>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊһ<CEAA><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD> */
#endif
extern UINT8 CHRV3ReadSector( UINT8 SectCount, PUINT8 DataBuf ); /* <20>Ӵ<EFBFBD><D3B4>̶<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#ifdef EN_DISK_WRITE
extern UINT8 CHRV3WriteSector( UINT8 SectCount, PUINT8 DataBuf ); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<D0B5><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#endif
extern UINT8 CHRV3DiskConnect( void ); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD>´<EFBFBD><C2B4><EFBFBD>״̬ */
extern void xFileNameEnumer( void ); /* <20><><EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>,<2C>ļ<EFBFBD><C4BC><EFBFBD>ö<EFBFBD>ٻص<D9BB><D8B5>ӳ<EFBFBD><D3B3><EFBFBD> */
extern UINT8 CHRV3LibInit( void ); /* <20><>ʼ<EFBFBD><CABC>CHRV3<56><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>0 */
/* <20>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B9A9><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD> */
/* <20><><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD>, <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>CHRV3File*<2A>ʹ<EFBFBD><CDB4>̲<EFBFBD>ѯ<EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>CHRV3DiskQuery<72><79><EFBFBD><EFBFBD><EFBFBD>ܻ<EFBFBD><DCBB>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD><EFBFBD><EFBFBD>pDISK_BASE_BUF,
<20><><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><D0BF><EFBFBD><EFBFBD><EFBFBD>pDISK_BASE_BUF<55>б<EFBFBD><D0B1><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD>Ϣ, <20><><EFBFBD>Ա<EFBFBD><D4B1>뱣֤pDISK_BASE_BUF<55><46><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;,
<20><><EFBFBD><EFBFBD>RAM<41><4D><EFBFBD><EFBFBD>, Ҫ<><D2AA>pDISK_BASE_BUF<55><46>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;, <20><>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CHRV3DirtyBuffer<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD> */
extern UINT8 CHRV3GetVer( void ); /* <20><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ汾<C4B0><E6B1BE> */
extern void CHRV3DirtyBuffer( void ); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD> */
extern UINT8 CHRV3BulkOnlyCmd( PUINT8 DataBuf ); /* ִ<>л<EFBFBD><D0BB><EFBFBD>BulkOnlyЭ<79><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
extern UINT8 CHRV3DiskReady( void ); /* <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD> */
extern UINT8 CHRV3AnalyzeError( UINT8 iMode ); /* USB<53><42><EFBFBD><EFBFBD>ʧ<EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD>CHRV3IntStatus<75><73><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>״̬ */
extern UINT8 CHRV3FileOpen( void ); /* <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>ļ<EFBFBD> */
extern UINT8 CHRV3FileClose( void ); /* <20>رյ<D8B1>ǰ<EFBFBD>ļ<EFBFBD> */
#ifdef EN_DISK_WRITE
extern UINT8 CHRV3FileErase( void ); /* ɾ<><C9BE><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ر<EFBFBD> */
extern UINT8 CHRV3FileCreate( void ); /* <20>½<EFBFBD><C2BD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD> */
extern UINT8 CHRV3FileAlloc( void ); /* <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>̿ռ<CCBF> */
#endif
extern UINT8 CHRV3FileModify( void ); /* <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>޸ĵ<DEB8>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ϣ */
extern UINT8 CHRV3FileQuery( void ); /* <20><>ѯ<EFBFBD><D1AF>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ϣ */
extern UINT8 CHRV3FileLocate( void ); /* <20>ƶ<EFBFBD><C6B6><EFBFBD>ǰ<EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8> */
extern UINT8 CHRV3FileRead( void ); /* <20>ӵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ݵ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#ifdef EN_DISK_WRITE
extern UINT8 CHRV3FileWrite( void ); /* <20><><EFBFBD><EFBFBD>ǰ<EFBFBD>ļ<EFBFBD>д<EFBFBD><D0B4>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#endif
extern UINT8 CHRV3ByteLocate( void ); /* <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>ǰ<EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8> */
extern UINT8 CHRV3ByteRead( void ); /* <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD>ӵ<EFBFBD>ǰλ<C7B0>ö<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ݿ<EFBFBD> */
#ifdef EN_DISK_WRITE
extern UINT8 CHRV3ByteWrite( void ); /* <20><><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ǰλ<C7B0><CEBB>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD> */
#endif
extern UINT8 CHRV3DiskQuery( void ); /* <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ */
extern void CHRV3SaveVariable( void ); /* <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>/<2F>ָ<EFBFBD><D6B8>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>оƬ<D0BE><C6AC><EFBFBD><EFBFBD>U<EFBFBD><55>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD> */
extern void mDelayuS( UINT16 n ); // <20><>uSΪ<53><CEAA>λ<EFBFBD><CEBB>ʱ
extern void mDelaymS( UINT16 n ); // <20><>mSΪ<53><CEAA>λ<EFBFBD><CEBB>ʱ
extern UINT8 USBHostTransact( UINT8 endp_pid, UINT8 tog, UINT32 timeout ); // CHRV3<56><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ŀ<EFBFBD>Ķ˵<C4B6><CBB5><EFBFBD>ַ/PID<49><44><EFBFBD><EFBFBD><><CDAC><EFBFBD><EFBFBD>־,NAK<41><4B><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,<2C><><EFBFBD><EFBFBD>0<EFBFBD>ɹ<EFBFBD>,<2C><>ʱ/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern UINT8 HostCtrlTransfer( PUINT8 DataBuf, PUINT8 RetLen ); // ִ<>п<EFBFBD><D0BF>ƴ<EFBFBD><C6B4><EFBFBD>,8<>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pSetupReq<65><71>,DataBufΪ<66><CEAA>ѡ<EFBFBD><D1A1><EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CAB5><EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD>ReqLenָ<6E><D6B8><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>
//extern void CopySetupReqPkg( PCCHAR pReqPkt ); // <20><><EFBFBD>ƿ<EFBFBD><C6BF>ƴ<EFBFBD><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//extern UINT8 CtrlGetDeviceDescrTB( void ); // <20><>ȡ<EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TxBuffer<65><72>
extern UINT8 CtrlGetConfigDescrTB( void ); // <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TxBuffer<65><72>
//extern UINT8 CtrlSetUsbAddress( UINT8 addr ); // <20><><EFBFBD><EFBFBD>USB<53><EFBFBD><E8B1B8>ַ
extern UINT8 CtrlSetUsbConfig( UINT8 cfg ); // <20><><EFBFBD><EFBFBD>USB<53><EFBFBD><E8B1B8><EFBFBD><EFBFBD>
extern UINT8 CtrlClearEndpStall( UINT8 endp ); // <20><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>STALL
#ifndef FOR_ROOT_UDISK_ONLY
//extern UINT8 CtrlGetHubDescr( void ); // <20><>ȡHUB<55><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TxBuffer<65><72>
extern UINT8 HubGetPortStatus( UINT8 HubPortIndex ); // <20><>ѯHUB<55>˿<EFBFBD>״̬,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TxBuffer<65><72>
//extern UINT8 HubSetPortFeature( UINT8 HubPortIndex, UINT8 FeatureSelt ); // <20><><EFBFBD><EFBFBD>HUB<55>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD>
extern UINT8 HubClearPortFeature( UINT8 HubPortIndex, UINT8 FeatureSelt ); // <20><><EFBFBD><EFBFBD>HUB<55>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD>
#endif
#ifdef __cplusplus
}
#endif
#endif