Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

diskio.c 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*-----------------------------------------------------------------------*/
  2. /* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */
  3. /*-----------------------------------------------------------------------*/
  4. /* This is a stub disk I/O module that acts as front end of the existing */
  5. /* disk I/O modules and attach it to FatFs module with common interface. */
  6. /*-----------------------------------------------------------------------*/
  7. #include "diskio.h"
  8. /*-----------------------------------------------------------------------*/
  9. /* Initialize a Drive */
  10. DSTATUS disk_initialize (
  11. BYTE drv /* Physical drive number (0..) */
  12. )
  13. {
  14. return FR_OK;
  15. }
  16. /*-----------------------------------------------------------------------*/
  17. /* Return Disk Status */
  18. DSTATUS disk_status (
  19. BYTE drv /* Physical drive number (0..) */
  20. )
  21. {
  22. return FR_OK;
  23. }
  24. /*-----------------------------------------------------------------------*/
  25. /* Read Sector(s) */
  26. DRESULT disk_read (
  27. BYTE drv, /* Physical drive number (0..) */
  28. BYTE *buff, /* Data buffer to store read data */
  29. DWORD sector, /* Sector address (LBA) */
  30. BYTE count /* Number of sectors to read (1..128) */
  31. )
  32. {
  33. DataflashManager_ReadBlocks_RAM(sector, count, buff);
  34. return RES_OK;
  35. }
  36. /*-----------------------------------------------------------------------*/
  37. /* Write Sector(s) */
  38. #if _READONLY == 0
  39. DRESULT disk_write (
  40. BYTE drv, /* Physical drive number (0..) */
  41. const BYTE *buff, /* Data to be written */
  42. DWORD sector, /* Sector address (LBA) */
  43. BYTE count /* Number of sectors to write (1..128) */
  44. )
  45. {
  46. DataflashManager_WriteBlocks_RAM(sector, count, buff);
  47. return RES_OK;
  48. }
  49. #endif /* _READONLY */