Updated get_fattime to use rtc and provide a date/time. This has been an annoying missing feature.

Dependents:   IoTGateway_Basic y_XBeeTest_5_read CameraC1098_picture LifeCam ... more

Committer:
SomeRandomBloke
Date:
Mon Apr 02 22:06:35 2012 +0000
Revision:
1:5baba5d5b728
Parent:
0:93acdd9f65f4

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SomeRandomBloke 0:93acdd9f65f4 1 /*-----------------------------------------------------------------------
SomeRandomBloke 0:93acdd9f65f4 2 / Low level disk interface modlue include file
SomeRandomBloke 0:93acdd9f65f4 3 /-----------------------------------------------------------------------*/
SomeRandomBloke 0:93acdd9f65f4 4
SomeRandomBloke 0:93acdd9f65f4 5 #ifndef _DISKIO
SomeRandomBloke 0:93acdd9f65f4 6
SomeRandomBloke 0:93acdd9f65f4 7 #define _READONLY 0 /* 1: Remove write functions */
SomeRandomBloke 0:93acdd9f65f4 8 #define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */
SomeRandomBloke 0:93acdd9f65f4 9
SomeRandomBloke 0:93acdd9f65f4 10 #include "integer.h"
SomeRandomBloke 0:93acdd9f65f4 11
SomeRandomBloke 0:93acdd9f65f4 12
SomeRandomBloke 0:93acdd9f65f4 13 /* Status of Disk Functions */
SomeRandomBloke 0:93acdd9f65f4 14 typedef BYTE DSTATUS;
SomeRandomBloke 0:93acdd9f65f4 15
SomeRandomBloke 0:93acdd9f65f4 16 /* Results of Disk Functions */
SomeRandomBloke 0:93acdd9f65f4 17 typedef enum {
SomeRandomBloke 0:93acdd9f65f4 18 RES_OK = 0, /* 0: Successful */
SomeRandomBloke 0:93acdd9f65f4 19 RES_ERROR, /* 1: R/W Error */
SomeRandomBloke 0:93acdd9f65f4 20 RES_WRPRT, /* 2: Write Protected */
SomeRandomBloke 0:93acdd9f65f4 21 RES_NOTRDY, /* 3: Not Ready */
SomeRandomBloke 0:93acdd9f65f4 22 RES_PARERR /* 4: Invalid Parameter */
SomeRandomBloke 0:93acdd9f65f4 23 } DRESULT;
SomeRandomBloke 0:93acdd9f65f4 24
SomeRandomBloke 0:93acdd9f65f4 25
SomeRandomBloke 0:93acdd9f65f4 26 /*---------------------------------------*/
SomeRandomBloke 0:93acdd9f65f4 27 /* Prototypes for disk control functions */
SomeRandomBloke 0:93acdd9f65f4 28
SomeRandomBloke 0:93acdd9f65f4 29 int assign_drives (int, int);
SomeRandomBloke 0:93acdd9f65f4 30 DSTATUS disk_initialize (BYTE);
SomeRandomBloke 0:93acdd9f65f4 31 DSTATUS disk_status (BYTE);
SomeRandomBloke 0:93acdd9f65f4 32 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
SomeRandomBloke 0:93acdd9f65f4 33 #if _READONLY == 0
SomeRandomBloke 0:93acdd9f65f4 34 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
SomeRandomBloke 0:93acdd9f65f4 35 #endif
SomeRandomBloke 0:93acdd9f65f4 36 DRESULT disk_ioctl (BYTE, BYTE, void*);
SomeRandomBloke 0:93acdd9f65f4 37
SomeRandomBloke 0:93acdd9f65f4 38
SomeRandomBloke 0:93acdd9f65f4 39
SomeRandomBloke 0:93acdd9f65f4 40 /* Disk Status Bits (DSTATUS) */
SomeRandomBloke 0:93acdd9f65f4 41
SomeRandomBloke 0:93acdd9f65f4 42 #define STA_NOINIT 0x01 /* Drive not initialized */
SomeRandomBloke 0:93acdd9f65f4 43 #define STA_NODISK 0x02 /* No medium in the drive */
SomeRandomBloke 0:93acdd9f65f4 44 #define STA_PROTECT 0x04 /* Write protected */
SomeRandomBloke 0:93acdd9f65f4 45
SomeRandomBloke 0:93acdd9f65f4 46
SomeRandomBloke 0:93acdd9f65f4 47 /* Command code for disk_ioctrl fucntion */
SomeRandomBloke 0:93acdd9f65f4 48
SomeRandomBloke 0:93acdd9f65f4 49 /* Generic command (defined for FatFs) */
SomeRandomBloke 0:93acdd9f65f4 50 #define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
SomeRandomBloke 0:93acdd9f65f4 51 #define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
SomeRandomBloke 0:93acdd9f65f4 52 #define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
SomeRandomBloke 0:93acdd9f65f4 53 #define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
SomeRandomBloke 0:93acdd9f65f4 54 #define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
SomeRandomBloke 0:93acdd9f65f4 55
SomeRandomBloke 0:93acdd9f65f4 56 /* Generic command */
SomeRandomBloke 0:93acdd9f65f4 57 #define CTRL_POWER 5 /* Get/Set power status */
SomeRandomBloke 0:93acdd9f65f4 58 #define CTRL_LOCK 6 /* Lock/Unlock media removal */
SomeRandomBloke 0:93acdd9f65f4 59 #define CTRL_EJECT 7 /* Eject media */
SomeRandomBloke 0:93acdd9f65f4 60
SomeRandomBloke 0:93acdd9f65f4 61 /* MMC/SDC specific ioctl command */
SomeRandomBloke 0:93acdd9f65f4 62 #define MMC_GET_TYPE 10 /* Get card type */
SomeRandomBloke 0:93acdd9f65f4 63 #define MMC_GET_CSD 11 /* Get CSD */
SomeRandomBloke 0:93acdd9f65f4 64 #define MMC_GET_CID 12 /* Get CID */
SomeRandomBloke 0:93acdd9f65f4 65 #define MMC_GET_OCR 13 /* Get OCR */
SomeRandomBloke 0:93acdd9f65f4 66 #define MMC_GET_SDSTAT 14 /* Get SD status */
SomeRandomBloke 0:93acdd9f65f4 67
SomeRandomBloke 0:93acdd9f65f4 68 /* ATA/CF specific ioctl command */
SomeRandomBloke 0:93acdd9f65f4 69 #define ATA_GET_REV 20 /* Get F/W revision */
SomeRandomBloke 0:93acdd9f65f4 70 #define ATA_GET_MODEL 21 /* Get model name */
SomeRandomBloke 0:93acdd9f65f4 71 #define ATA_GET_SN 22 /* Get serial number */
SomeRandomBloke 0:93acdd9f65f4 72
SomeRandomBloke 0:93acdd9f65f4 73 /* NAND specific ioctl command */
SomeRandomBloke 0:93acdd9f65f4 74 #define NAND_FORMAT 30 /* Create physical format */
SomeRandomBloke 0:93acdd9f65f4 75
SomeRandomBloke 0:93acdd9f65f4 76
SomeRandomBloke 0:93acdd9f65f4 77 #define _DISKIO
SomeRandomBloke 0:93acdd9f65f4 78 #endif