Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of d7a_1x by
Diff: include/d7a_fs.h
- Revision:
- 41:a924aa709b6f
- Parent:
- 38:c1e7f97ab396
- Child:
- 44:8ebe6b70f932
--- a/include/d7a_fs.h Mon Aug 29 15:05:07 2016 +0000
+++ b/include/d7a_fs.h Tue Aug 30 10:48:11 2016 +0000
@@ -64,6 +64,7 @@
#define FS_OP_NULL 0
#define FS_OP_RD 1
#define FS_OP_WR 4
+#define FS_OP_SYNC 6 // Write File Properties
#define FS_OP_TOUCH 7 // Not in ALP but '7' is still in 'write' actions area
#define FS_OP_STAT 16
#define FS_OP_DSTAT 30 // Not in ALP: Variant of STAT for distant files
@@ -96,9 +97,16 @@
// Memory "TYPE"
-#define FS_TYPE_DISTANT 0x80
-#define FS_PHY_TYPE(t) ((t)&0x0F)
-#define FS_COM_TYPE(t) ((t)&0xF0)
+// ------------------------------------------------------
+// | Sync | Distant | Com | MemType |
+// ------------------------------------------------------
+// | b7 | b6 | b5-b4 | b3-b0 |
+// ------------------------------------------------------
+#define FS_TYPE_SYNC 0x80
+#define FS_TYPE_DISTANT 0x40
+#define FS_MEM_TYPE(t) ((t)&0x0F)
+#define FS_COM_TYPE(t) ((t)&0x30)
+#define FS_DISTANT_TYPE(t) ((t)&0x70)
enum {
// Markers
NOFILE = 0,
@@ -107,15 +115,25 @@
PFLASH = 1,
EEPROM = 2,
RAM = 3,
- UNKNOWN = 0xF,
+ OTP = 4,
+ UNKNOWN = 0x0F,
// PSRAM
// DDR
// ...etc
- // COM Type for 'distant' files
- HOST = FS_TYPE_DISTANT + (1<<4), // Distant HST_COM Files
- SPI = FS_TYPE_DISTANT + (2<<4),
- I2C = FS_TYPE_DISTANT + (3<<4),
-
+ FS_COM_UART = (0<<4),
+ FS_COM_SPI = (1<<4),
+ FS_COM_I2C = (2<<4),
+ // DISTANT Full Types
+ // Symetric HST-COM Files:
+ // - Header on Host side (i.e. need syncro on STAT)
+ // - Data on Host side
+ // - Same/Similar memory physical types
+ HOSTNS = FS_TYPE_SYNC + FS_TYPE_DISTANT + FS_COM_UART,
+ // Synchronised Symetric HST / COM Files
+ // - Idem Symetric HST-COM Files excepted:
+ // - Local header is assumed to be syncronised (through FS:SYNC)
+ HOSTS = FS_TYPE_DISTANT + FS_COM_UART,
+ HOST = FS_TYPE_DISTANT + FS_COM_UART, // Common Alias for FS_DISTANT_TYPE(t) usage
};
// File "Storage Class"
enum { TRANSIENT=0, VOLATILE, RESTORABLE, PERMANENT};
@@ -130,7 +148,11 @@
TYPEDEF_STRUCT_PACKED{
uint32_t addr : 32;
- uint32_t type : 8;
+ // MEMORY Type 8bits
+ uint32_t t_mem : 4;
+ uint32_t t_com : 2;
+ uint32_t t_distant : 1;
+ uint32_t t_sync : 1;
// RAM Mirroring
uint32_t mirror_idx : 7;
