Skip to content
Snippets Groups Projects
Select Git revision
  • font-fix
  • schneider/ble-stability-new-phy-adv
  • schneider/ble-stability
  • master default protected
  • genofire/ble-follow-py
  • msgctl/gfx_rle
  • schneider/ble-stability-new-phy
  • add_menu_vibration
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • koalo/wip/i2c-for-python
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
35 results

internal.h

Blame
  • Forked from card10 / firmware
    1320 commits behind the upstream repository.
    internal.h 1.82 KiB
    #ifndef EPICARCIUM_FS_INTERNAL_H_INCLUDED
    #define EPICARCIUM_FS_INTERNAL_H_INCLUDED
    
    #include <stdint.h>
    #include <stddef.h>
    #include <stdbool.h>
    
    #include "epicardium.h"
    
    /* Number of bits to use for indexing into our internal pool of files/directories
     * This indirectly specifies the size of the pool as 1^EPIC_FAT_FD_INDEX_BITS
     * Increase if number of open file descriptors is not enough, but be aware of
     * memory usage of the pool!
     */
    #define EPIC_FAT_FD_INDEX_BITS 4
    #define EPIC_FAT_STATIC_SEMAPHORE 1
    
    // forward declaration, actual definition is in filesystem_fat.c
    typedef struct EpicFileSystem EpicFileSystem;
    
    int efs_open(EpicFileSystem *fs, const char *filename, const char *modeString);
    int efs_close(EpicFileSystem *fs, int fd);
    int efs_read(EpicFileSystem *fs, int fd, void *buf, size_t nbytes);
    int efs_write(EpicFileSystem *fs, int fd, const void *buf, size_t nbytes);
    int efs_flush(EpicFileSystem *fs, int fd);
    int efs_seek(EpicFileSystem *fs, int fd, long offset, int whence);
    int efs_tell(EpicFileSystem *fs, int fd);
    int efs_stat(EpicFileSystem *fs, const char *filename, struct epic_stat *stat);
    int efs_opendir(EpicFileSystem *fs, const char *path);
    int efs_readdir(EpicFileSystem *fs, int fd, struct epic_stat *stat);
    int efs_unlink(EpicFileSystem *fs, const char *path);
    int efs_rename(EpicFileSystem *fs, const char *oldp, const char *newp);
    int efs_mkdir(EpicFileSystem *fs, const char *dirname);
    /**
     * lock global filesystem
     * 
     * locks the global mutex and, if the global EpicFileSystem has been initialized correctly
     * passes it to *fs
     *
     * Upon successful return, the filesystem has to be re-locked with epic_fs_unlock_global
     * In case of error, the filesystem will be left in a locked state.
     */
    int efs_lock_global(EpicFileSystem** fs);
    void efs_unlock_global(EpicFileSystem* fs);
    
    #endif// EPICARCIUM_FS_INTERNAL_H_INCLUDED