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

📄 cfdisk.h

📁 这个是嵌入式arm系列的一个bootloader程序。对需要编写bootloader的很有参考价值
💻 H
字号:
/*



Module Name:

    CFDisk.h

Abstract:
	Compact Flash Memory Card interface.

*/

#ifndef __CFDISK_H__
#define __CFDISK_H__


typedef enum
{
	mAtaWaitForBusy,				// Drive locked us out from command registers (can read status register though)
	mAtaWaitForNotBusy,				// Drive allows us access to command registers (can read status register though)
	mAtaWaitForReady,				// Drive is ready to accept commands
	mAtaWaitForDataReady,			// Drive is ready to exchange data to host
	mAtaWaitForDataReadyIgnoreErr,	// Drive is ready to exchange data to host, ignore
									// error bit from previous command
} AtaWaitType;

typedef enum
{
	mAtaIoErr,
	mAtaTimeout,
	mAtaOk,
} AtaStatus;

// ATA DISK ACCESS SERVICES
BOOL CFAtaDiskDownload(UINT AtaDiskCmdAddress);
BOOL CFReadSector(int sector, PBYTE ramAddress);
static AtaStatus CFWaitForAtaDisk(AtaWaitType type, ULONG timeout);
static AtaStatus CFReadAtaSector(DWORD sector, PUCHAR pSectorData);

BOOL CFDisk_Open(PBYTE filename, PBYTE extention);
void CFDisk_Read(PBYTE fileAddr, ULONG bytesToRead, PULONG bytesRead);
//

static void FormatDosName(PBYTE d, PBYTE s, DWORD size);
static void DumpATARegisters(void);



#endif  // __CFDISK_H__

⌨️ 快捷键说明

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