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

📄 genecc.h

📁 瑞萨单片机开发软代码.非常实用小巧的平台,很多应用都可以在上面实现.
💻 H
字号:
/*=============================================================================
**
**  <Name>  genEcc.h        
**
**          VV-RR   date    
**          01-00   00/07/02    
**          01-00   00/07/25    
**          01-01   00/10/20    
**
**
**          Hitachi ULSI Systems Confidential.
**          All Rights Reserved,Copyright (C) 2000
**          Hitachi ULSI Systems Co.,LTD.
**
**============================================================================*/


#ifndef __INCgenEcch
#define __INCgenEcch

#ifdef __cplusplus
extern "C" {
#endif

/*--------------------------------------*/
/* define the constant                  */
/*--------------------------------------*/
#define ECC_CODE_SIZE   11
#define DATA_UNIT_SIZE  512
#define ECC_MASK_C1     0x0100
#define ECC_MASK_C2     0x0080
#define ECC_MASK_C3     0x0040
#define ECC_MASK_C4     0x0020
#define ECC_MASK_C5     0x0010
#define ECC_MASK_C6     0x0008
#define ECC_MASK_C7     0x0004
#define ECC_MASK_C8     0x0002
#define ECC_MASK_C9     0x0001

/* return code */
#define ECC_CHECK_NG        -1
#define ECC_CHECK_OK        0
#define ECC_CORRECTION_OK   1
#define ECC_ECC_ERROR       2

#ifndef TRUE
#define TRUE        1
#define FALSE       0
#endif

/*--------------------------------------*/
/* function prototype                   */
/*--------------------------------------*/
/*  Generate ECC code(11Byte) from 512Byte data  */
extern void genEcc512(unsigned char *pData, unsigned char *pEcc) ;

/*  ECC check and error correction of 512Byte data  */
extern int chkCorEcc512(unsigned char *pData, unsigned char *pEcc) ;

void asm_genEcc(unsigned char *bptr, unsigned char *eptr);

#ifdef __cplusplus
}
#endif

#endif /* __INCgenEcch */

⌨️ 快捷键说明

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