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

📄 2k_dtc.h

📁 HID-Ukey底层源码实现(st72651芯片) windows上层驱动
💻 H
字号:
/**************** (c) 2001  STMicroelectronics **********************

PROJECT : ST7265 USB Mass Storage - SMC

VERSION :  V1.0 Beta2

CREATION DATE :  20/03/2001

AUTHOR : MICROCONTROLLER DIVISION / Rousset

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

DESCRIPTION : DTC programs for SMC

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

MODIFICATIONS :

******************************************************************************/

#ifndef DTC_code_H
#define DTC_code_H

/* DTC_code */
#pragma CONST_SEG SMC_DTC_CODE
extern const unsigned char SMC_DTC_Code0[];
extern const unsigned char SMC_DTC_USB_Mass_Upld[];
extern const unsigned char SMC_DTC_USB_Mass_Dwld[];
extern const unsigned char SMC_DTC_Play[];
extern const unsigned char SMC_DTC_Map_Zone[];
extern const unsigned char SMC_DTC_Format[];
extern const unsigned char SMC_DTC_Copy_Pages[];
extern const unsigned char SMC_DTC_Mark_Pages[];

extern const unsigned char SMC_DTC_Map_Range[];	// For playback
extern const unsigned char SMC_DTC_Play_Read[];	// For playback

extern const unsigned char SMC_DTC_Play256[]; 
extern const unsigned char SMC_DTC_USB_Mass_Upld256[];
extern const unsigned char SMC_DTC_Map_Zone256[];
extern const unsigned char SMC_DTC_USB_Mass_Dwld256[];
extern const unsigned char SMC_DTC_Markpages256[];
extern const unsigned char SMC_DTC_Copypages256[];
extern const unsigned char SMC_DTC_Format256[];
extern const unsigned char SMC_DTC_Debug[];
extern const unsigned char SMC_DTC_Erass_256[];

#define	CODE_DTC_PLAY	0x01
#define CODE_DTC_WRITE	0x02
#define CODE_WRITE_USB	0x03
#define CODE_READ_USB	0x04
#define CODE_MAP_ZONE	0x05
#define CODE_SMC_FORMAT	0x06
#define CODE_COPY_PAGES 0x07
#define CODE_MARK_PAGES 0x08
#define	CODE_DTC_CODE0	0x09

#define CODE_MAP_RANGE	0x0A	// For playback
#define CODE_PLAY_READ	0x0B	// For playback 
#define CODE_READ_USB256 0x0C

#ifdef debug
#define CODE_DEBUG 0x10  //for debug
#endif

#define CODE_COPY_PAGES256	0x0E
#define CODE_WRITE_USB256	0x0D
#define CODE_SMC_FORMAT256	0x0F

#define CODE_ERASE_256		0x11	// added by HYJ
//  0x10 --- Used for LCD

/************************************************/
/* Starting Addresses of SMC Process in DTC_RAM */
/************************************************/

/* Starting Addresses of SMC Code0 Lib */
#define SMC_DTC_Code_Init_SMC_Mode        0x00   // SMC_Init_Upld Address in DTC_RAM
#define SMC_DTC_Code_Dummy_Write		0x14	// Simulate the writing

/* Starting Addresses of SMC Play Lib */
#define SMC_DTC_Play_Read0				0x00
#define SMC_DTC_Play_Read1				0x03
#define SMC_DTC_Play_Write0				0x4b
#define SMC_DTC_Play_Write1				0x4e
#define SMC_DTC_Play_Send_Cmd			0x8b
#define SMC_DTC_Play_Send_Addr			0xA5
//#define SMC_DTC_Play_Read_ID			0xC0	// Read the device ID
#define SMC_DTC_Play_Read_ID			0xba	// Read the device ID
//#define SMC_DTC_Play_Read_Status		0xE0	// Read the status byte
#define SMC_DTC_Play_Read_Status		0xda	// Read the status byte

/* Starting Address of SMC_DTC_USB_Upload */
#define SMC_DTC_USB_Upload			0x00		// Read data page and upload to USB
#define SMC_DTC_USB_Upload2			0xA0		// Read data page and upload to USB after ECC correction
#define SMC_DTC_USB_Upload_FF		0xB6		// pload all FF to USB

/* Starting Address of SMC_DTC_USB_Download */	// Modified by HYJ
#define SMC_DTC_USB_DownErase		0x00		// Erase a physical cluster after download
#define SMC_DTC_USB_Download_Buf0	0x00		// Write data page downloaded from the USB, start from Buffer0
#define SMC_DTC_USB_Download_Buf1	0x03		// Write data page downloaded from the USB, start from Buffer1

//#define SMC_DTC_USB_DownErase		0x09		// Erase a physical cluster after download
//#define SMC_DTC_USB_Download_Buf0	0x00		// Write data page downloaded from the USB, start from Buffer0
//#define SMC_DTC_USB_Download_Buf1	0x06		// Write data page downloaded from the USB, start from Buffer1

/* Starting Address of SMC_DTC_Format */
#define SMC_DTC_Format_Cmd_Read0		0x11	// Send command of sequencial read for further reading
#define SMC_DTC_Format_Cmd_Erase		0x14	// Send command and address for erase the cluster
#define SMC_DTC_Format_Cmd_Check		0x1A	// Send command and address for check the redundant area
#define SMC_DTC_Format_Cmd_Read			0x1D	// Send command and address for read the cluster
#define SMC_DTC_Format_Write_0			0x22	// Write all 0's to the every page of the cluster
#define SMC_DTC_Format_Erase_Wait		0x74	// Send command to erase the cluster and wait erasing finishes
#define SMC_DTC_Format_Read_0			0x9D	// Read every page of the cluster and check with 0's
#define SMC_DTC_Format_Check			0xBD	// Read redundant area & check if it can be used

// Following data is modifed by HYJ on Oct. 12, 2005
/*starting addresses for 256mb Format*/
//#define SMC_DTC_Format_Cmd_Read0		0x11	// Send command of sequencial read for further reading
/*
#define SMC_DTC_Format_Cmd_Erase256		0x23	// Send command and address for erase the cluster
#define SMC_DTC_Format_Cmd_Check256		0x16	// Send command and address for check the redundant area
#define SMC_DTC_Format_Cmd_Read256		0x16	// Send command and address for read the cluster
#define SMC_DTC_Format_Write0_256		0x19	// Write all 0's to the every page of the cluster
#define SMC_DTC_Format_Erase_Wait256	0x71	// Send command to erase the cluster and wait erasing finishes
#define SMC_DTC_Format_Read0_256		0x9e	// Read every page of the cluster and check with 0's
#define SMC_DTC_Format_Check256			0xBc	// Read redundant area & check if it can be used
*/

#define SMC_DTC_Format_Cmd_Erase256		0x22	// Send command and address for erase the cluster
#define SMC_DTC_Format_Cmd_Check256		0x16	// Send command and address for check the redundant area
#define SMC_DTC_Format_Cmd_Read256		0x16	// Send command and address for read the cluster
#define SMC_DTC_Format_Write0_256		0x18	// Write all 0's to the every page of the cluster
#define SMC_DTC_Format_Erase_Wait256	0x72	// Send command to erase the cluster and wait erasing finishes
#define SMC_DTC_Format_Read0_256		0x9E	// Read every page of the cluster and check with 0's
#define SMC_DTC_Format_Check256			0xBB	// Read redundant area & check if it can be used



#endif
/*** (c) 1998   STMicroelectronics ****************** END OF FILE ***/




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -