📄 smt_tmp.h
字号:
/********************************************************************************/
/* */
/* Copyright (C) SEIKO EPSON CORP. 2000 */
/* */
/* File name : smt_tmp.h */
/* This is smart media control library header file. */
/* */
/* Revision history */
/* 2000.11.17 H.Ogura start */
/* 2003.03.26 A.Saito Modify parameter of smtTmpWriteData() */
/* 2003.06.05 A.Saito Modify Comment */
/* */
/********************************************************************************/
/********************************************************************************/
/* The tab size of this file is 4. */
/********************************************************************************/
#ifndef __SMART_MEDIA_TMP_MEMORY_LIBRARY__
#define __SMART_MEDIA_TMP_MEMORY_LIBRARY__
/********************************************************/
/* PROTOTYPE */
/********************************************************/
extern int smtTmpInitial(void);
extern unsigned long smtTmpGetMaxSize(void);
extern unsigned long smtTmpGetSector(unsigned long);
extern int smtTmpRlsSector(unsigned long);
extern unsigned long smtTmpWriteData(unsigned long, unsigned long, unsigned char *);
extern unsigned long smtTmpReadData(unsigned long, unsigned long, unsigned char *);
/********************************************************/
/* CONSTANT DEFINE */
/********************************************************/
/* A distinction code can be changed */
#define SMT_C_DISCOD "SMT33" // Distinction code.
/* The number of the memories which can be used can be changed */
#define SMT_C_MEMNUM 20 // Number of temporary memory.
/* It is used for the index of SMT_TMPACC structure */
#define SMT_C_TMPNUM (SMT_C_MEMNUM + 1)
// [0] : Use of a system.
// [1]-[20] : Use of a user.
/* It is used when it is changed into physics block from the logic block */
#define SMT_C_BLOCK 32 // The number of the sectors of block.
#define SMT_C_SECT 512 // The number of the bytes of sector.
#define SMT_C_ZONE 1024 // The number of the blocks of the zone.
#define SMT_C_VALID 1000 // The number of valid blocks inside the zone.
/* It is used for the arrangement of device information structure */
#define SMT_C_MODEL 7 // The number of the media models.
/********************************************************/
/* STRUCTURE */
/********************************************************/
/* This structure body stores the position information of free sector */
struct SMT_TMPACC{
unsigned char bUseFlag; // Table use flag.
unsigned char bWrtFlag; // Write flag.
unsigned long ulZone; // Zone address.
unsigned long ulPhyBlk; // Physics block address.
unsigned long ulPhySct; // Physics sector address.
unsigned long ulSctNum; // Number of sectors.
unsigned long ulWrtSize; // Write data size.
};
/* This structure stores information on device */
struct SMT_DEVINF{
unsigned char bDevice; // Device code.
unsigned long ulNumBlk; // Number of blocks.
unsigned long ulSctSize; // Sector size.
unsigned long ulBlkSize; // Block size.
unsigned long ulStartSct; // Start logic sector.
};
#endif //__SMART_MEDIA_TMP_MEMORY_LIBRARY__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -