ide.c
上传用户:yj_qqy
上传日期:2017-01-28
资源大小:2911k
文件大小:3k
源码类别:

uCOS

开发平台:

C/C++

  1. /****************************************************************************************/
  2. /*文件:ide.c                                                                            */
  3. /*功能:ucfs硬盘驱动中间件                                                               */
  4. /*描述:ide.c的存在对于ucfs的移植大有益处,它起到中间件的作用,通过FS_IDE_Init,          */
  5. /*      FS__IDE_ReadSector,FS__IDE_WriteSector三个函数屏蔽底层细节,隔离底层,和ucfs    */
  6. /*                                                                                      */
  7. /****************************************************************************************/
  8. /*
  9. 历史纪录:
  10. Ver1.00   20050617 开始整理加入注释
  11. */
  12. #include "fs_port.h"
  13. #include "fs_dev.h" 
  14. #include "fs_lbl.h" 
  15. #include "fs_conf.h"
  16. #if FS_USE_IDE_DRIVER
  17. #include "fs_api.h"
  18. #include "ide_x_hw.h"
  19. #include "ide.h"
  20. #include "at91rm9200hdd.h"
  21. /****************************************************************************************/
  22. /*Name:FS__IDE_Init                                                                     */
  23. /*功能:初始硬盘                                                                         */
  24. /*参数:无                                                                               */
  25. /*                                                                                      */
  26. /****************************************************************************************/
  27. int FS__IDE_Init(FS_u32 Unit){
  28. AT91F_HDDOpen();
  29. return 0;
  30. }
  31. /****************************************************************************************/
  32. /*Name:FS__IDE_ReadSector                                                               */
  33. /*功能:读取指定的扇区数据                                                               */
  34. /*参数:Unit 制定的逻辑盘,pBuffer数据缓冲区,Sector扇区号                                 */
  35. /*                                                                                      */
  36. /****************************************************************************************/
  37. int FS__IDE_ReadSector(FS_u32 Unit,unsigned long Sector,unsigned char *pBuffer){
  38. AT91F_HDDRead((unsigned short *)pBuffer,Sector);
  39. return 0;
  40. }
  41. /****************************************************************************************/
  42. /*Name:FS__IDE_WriteSector                                                              */
  43. /*功能:写指定的扇区数据                                                                 */
  44. /*参数:Unit 制定的逻辑盘,pBuffer数据缓冲区,Sector扇区号                                 */
  45. /*                                                                                      */
  46. /****************************************************************************************/
  47. int FS__IDE_WriteSector(FS_u32 Unit,unsigned long Sector,unsigned char *pBuffer){
  48. AT91F_HDDWrite((unsigned short *)pBuffer,Sector);
  49. return 0;
  50. }
  51. #endif