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:
- 30:d775c1409849
- Parent:
- 29:8e7c5c1e9aab
- Child:
- 33:f9a542d3efaa
diff -r 8e7c5c1e9aab -r d775c1409849 include/d7a_fs.h --- a/include/d7a_fs.h Tue May 03 16:53:52 2016 +0000 +++ b/include/d7a_fs.h Wed May 25 08:23:15 2016 +0000 @@ -6,21 +6,10 @@ #include "d7a_common.h" #include "d7a_com.h" -#define TO_FS (2000) +#define TO_FS (5000) +#define FS_MAX_CONCURRENCY 8 // Maximum number of concurrent access -typedef uint32_t (*WriteFileFunction)( const uint8_t file_id, - const uint16_t offset, - const uint16_t file_size, - const uint8_t * const content); - -typedef uint32_t (*ReadFileFunction)( const uint8_t file_id, - const uint16_t offset, - const uint16_t file_size, - uint8_t* buf); -typedef uint32_t (*TouchFileFunction)( const uint8_t file_id, - const uint16_t offset, - const uint16_t file_size); // PROP Byte #define FS_BFO_STORAGE_CLASS 0 @@ -81,10 +70,12 @@ #define FS_OP_DSTAT 30 // Not in ALP: Variant of STAT for distant files #define FS_OP_CREATE 17 #define FS_OP_FLUSH 20 +#define FS_OP_EXECUTE 31 #define FS_OP_RETSTAT 32 #define FS_OP_RETDATA 34 + // FS/COM-FS Status-codes. Mimics ALP ones. enum { FS_STAT_PENDING = 1, @@ -216,7 +207,34 @@ uint32_t alloc; } d7a_fs_properties_t; -void d7a_fs_open(WriteFileFunction write_file, ReadFileFunction read_file, TouchFileFunction touch_file); + +typedef d7a_fs_header_t* (*GetStatFileFunction)(const uint8_t file_id); + +typedef bool (*SetStatFileFunction)(const uint8_t file_id, const d7a_fs_header_t* hdr); + +typedef uint32_t (*WriteFileFunction)( const uint8_t file_id, + const uint16_t offset, + const uint16_t size, + const uint8_t * const content); + +typedef uint32_t (*ReadFileFunction)( const uint8_t file_id, + const uint16_t offset, + const uint16_t size, + uint8_t* buf); + +typedef uint32_t (*TouchFileFunction)( const uint8_t file_id, + const uint16_t offset, + const uint16_t size); + +typedef struct { + GetStatFileFunction get_stat; + SetStatFileFunction set_stat; + WriteFileFunction write_file; + ReadFileFunction read_file; + TouchFileFunction touch_file; +} d7a_fs_callbacks_t; + +void d7a_fs_open(const d7a_fs_callbacks_t* config); void* d7a_fs_wait_done(uint32_t millisec = osWaitForever); void d7a_fs_new_pkt(d7a_com_rx_msg_t* pkt); d7a_com_rx_msg_t* d7a_fs_wait_pkt( uint32_t millisec = osWaitForever );