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

📄 ide.c

📁 at91rm9200硬盘的接口代码
💻 C
字号:
/****************************************************************************************/
/*文件:ide.c                                                                            */
/*功能:ucfs硬盘驱动中间件                                                               */
/*描述:ide.c的存在对于ucfs的移植大有益处,它起到中间件的作用,通过FS_IDE_Init,          */
/*      FS__IDE_ReadSector,FS__IDE_WriteSector三个函数屏蔽底层细节,隔离底层,和ucfs    */
/*                                                                                      */
/****************************************************************************************/
/*
历史纪录:
Ver1.00   20050617 开始整理加入注释
*/
#include "fs_port.h"
#include "fs_dev.h" 
#include "fs_lbl.h" 
#include "fs_conf.h"

#if FS_USE_IDE_DRIVER

#include "fs_api.h"
#include "ide_x_hw.h"
#include "ide.h"
#include "at91rm9200hdd.h"
/****************************************************************************************/
/*Name:FS__IDE_Init                                                                     */
/*功能:初始硬盘                                                                         */
/*参数:无                                                                               */
/*                                                                                      */
/****************************************************************************************/

int FS__IDE_Init(FS_u32 Unit){
	AT91F_HDDOpen();
	return 0;
}
/****************************************************************************************/
/*Name:FS__IDE_ReadSector                                                               */
/*功能:读取指定的扇区数据                                                               */
/*参数:Unit 制定的逻辑盘,pBuffer数据缓冲区,Sector扇区号                                 */
/*                                                                                      */
/****************************************************************************************/
int FS__IDE_ReadSector(FS_u32 Unit,unsigned long Sector,unsigned char *pBuffer){
	AT91F_HDDRead((unsigned short *)pBuffer,Sector);
	return 0;
}
/****************************************************************************************/
/*Name:FS__IDE_WriteSector                                                              */
/*功能:写指定的扇区数据                                                                 */
/*参数:Unit 制定的逻辑盘,pBuffer数据缓冲区,Sector扇区号                                 */
/*                                                                                      */
/****************************************************************************************/
int FS__IDE_WriteSector(FS_u32 Unit,unsigned long Sector,unsigned char *pBuffer){
	AT91F_HDDWrite((unsigned short *)pBuffer,Sector);
	return 0;
}
#endif

⌨️ 快捷键说明

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