aboutsummaryrefslogtreecommitdiff
path: root/extmod/vfs_fat.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-29 19:20:27 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-30 12:26:08 +1100
commitb697c890096805d9ccaf7553dbff5b82f5332609 (patch)
tree8d5ab2b4d16a7139189cb704b36e6ca957e1fb6a /extmod/vfs_fat.h
parent9425bf5b2ba4a4b7f535c9e52add43fd1664802d (diff)
extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h.
vfs.h is for generic VFS declarations, and vfs_fat.h is for VfsFat specific things.
Diffstat (limited to 'extmod/vfs_fat.h')
-rw-r--r--extmod/vfs_fat.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h
index bc5be0c67..fefae776c 100644
--- a/extmod/vfs_fat.h
+++ b/extmod/vfs_fat.h
@@ -25,8 +25,32 @@
*/
#include "py/lexer.h"
+#include "py/obj.h"
+#include "lib/oofatfs/ff.h"
+#include "extmod/vfs.h"
-struct _fs_user_mount_t;
+// these are the values for fs_user_mount_t.flags
+#define FSUSER_NATIVE (0x0001) // readblocks[2]/writeblocks[2] contain native func
+#define FSUSER_FREE_OBJ (0x0002) // fs_user_mount_t obj should be freed on umount
+#define FSUSER_HAVE_IOCTL (0x0004) // new protocol with ioctl
+
+typedef struct _fs_user_mount_t {
+ mp_obj_base_t base;
+ const char *str;
+ uint16_t len; // length of str
+ uint16_t flags;
+ mp_obj_t readblocks[4];
+ mp_obj_t writeblocks[4];
+ // new protocol uses just ioctl, old uses sync (optional) and count
+ union {
+ mp_obj_t ioctl[4];
+ struct {
+ mp_obj_t sync[2];
+ mp_obj_t count[2];
+ } old;
+ } u;
+ FATFS fatfs;
+} fs_user_mount_t;
extern const byte fresult_to_errno_table[20];
extern const mp_obj_type_t mp_fat_vfs_type;