ecc.h

来自「微软提供的Flash驱动程序」· C头文件 代码 · 共 56 行

H
56
字号
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Module Name:    ECC.H

Abstract:       Error Correcting Codes (ECC) module for FLASH Media Drivers 
  
-----------------------------------------------------------------------------*/

#ifndef _ECC_H_
#define _ECC_H_ 

#include <windows.h>

#define DATA_BLOCK_LEN          256
#define ECC_BUFF_LEN            6                   // 3 bytes per 256 bytes of data

#define UNCORRECTABLE_ERROR     1
#define CORRECTABLE_ERROR       11

#ifdef __cplusplus
extern "C" {
#endif 

//---------------------------- Structure Definitions -----------------------------



//------------------------------- Public Interface ------------------------------

BOOL ECC_ComputeECC(LPBYTE pData, DWORD dwDataBuffLen, LPBYTE pECC, DWORD dwECCBuffLen); 
BOOL ECC_IsDataValid(LPBYTE pData, DWORD dwDataBuffLen, LPBYTE pExistingECC, DWORD dwECCBuffLen); 
BOOL ECC_CorrectData(LPBYTE pData, DWORD dwDataBuffLen, LPBYTE pExistingECC, DWORD dwECCBuffLen);


//------------------------------ Helper Functions ------------------------------ 
UCHAR CountNumberOfOnes(UCHAR num);

#ifdef __cplusplus
}
#endif

#endif _ECC_H_



⌨️ 快捷键说明

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