SSCMA-Micro CPP SDK  v2.0.0
SSCMA-Micro is a cross-platform machine learning inference framework designed for embedded devices.
lfs_flashbd.h
Go to the documentation of this file.
1 
2 #ifndef _LFS_FLASHBD_H_
3 #define _LFS_FLASHBD_H_
4 
5 #include "lfs.h"
6 #include "lfs_util.h"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #ifndef LFS_FLASHBD_TRACE
13  #ifdef LFS_FLASHBD_YES_TRACE
14  #define LFS_FLASHBD_TRACE(...) LFS_TRACE(__VA_ARGS__)
15  #else
16  #define LFS_FLASHBD_TRACE(...)
17  #endif
18 #endif
19 
21  lfs_size_t read_size;
22  lfs_size_t prog_size;
23  lfs_size_t erase_size;
24  lfs_size_t erase_count;
25  void* flash_addr;
26 };
27 
28 typedef struct lfs_flashbd {
29  void* flash_addr;
30  const struct lfs_flashbd_config* cfg;
32 
33 int lfs_flashbd_create(const struct lfs_config* cfg, const struct lfs_flashbd_config* bdcfg);
34 
35 int lfs_flashbd_destroy(const struct lfs_config* cfg);
36 
37 int lfs_flashbd_read(const struct lfs_config* cfg, lfs_block_t block, lfs_off_t off, void* buffer, lfs_size_t size);
38 
40  const struct lfs_config* cfg, lfs_block_t block, lfs_off_t off, const void* buffer, lfs_size_t size);
41 
42 int lfs_flashbd_erase(const struct lfs_config* cfg, lfs_block_t block);
43 
44 int lfs_flashbd_sync(const struct lfs_config* cfg);
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
50 #endif
int lfs_flashbd_create(const struct lfs_config *cfg, const struct lfs_flashbd_config *bdcfg)
int lfs_flashbd_destroy(const struct lfs_config *cfg)
struct lfs_flashbd lfs_flashbd_t
int lfs_flashbd_sync(const struct lfs_config *cfg)
int lfs_flashbd_erase(const struct lfs_config *cfg, lfs_block_t block)
int lfs_flashbd_prog(const struct lfs_config *cfg, lfs_block_t block, lfs_off_t off, const void *buffer, lfs_size_t size)
int lfs_flashbd_read(const struct lfs_config *cfg, lfs_block_t block, lfs_off_t off, void *buffer, lfs_size_t size)
Definition: lfs_flashbd.h:20
lfs_size_t erase_size
Definition: lfs_flashbd.h:23
lfs_size_t prog_size
Definition: lfs_flashbd.h:22
lfs_size_t read_size
Definition: lfs_flashbd.h:21
lfs_size_t erase_count
Definition: lfs_flashbd.h:24
void * flash_addr
Definition: lfs_flashbd.h:25
Definition: lfs_flashbd.h:28
const struct lfs_flashbd_config * cfg
Definition: lfs_flashbd.h:30
void * flash_addr
Definition: lfs_flashbd.h:29