1 #ifndef __FLASH_MAP_BACKEND_H__
2 #define __FLASH_MAP_BACKEND_H__
3 
4 #include <storage/flash_map.h>
5 
flash_area_get_off(const struct flash_area * fa)6 static inline uint32_t flash_area_get_off(const struct flash_area *fa)
7 {
8 	return (uint32_t)fa->fa_off;
9 }
10 
flash_area_get_size(const struct flash_area * fa)11 static inline uint32_t flash_area_get_size(const struct flash_area *fa)
12 {
13 	return (uint32_t)fa->fa_size;
14 }
15 
flash_sector_get_off(const struct flash_sector * fs)16 static inline uint32_t flash_sector_get_off(const struct flash_sector *fs)
17 {
18 	return fs->fs_off;
19 }
20 
flash_sector_get_size(const struct flash_sector * fs)21 static inline uint32_t flash_sector_get_size(const struct flash_sector *fs)
22 {
23 	return fs->fs_size;
24 }
25 
26 #define FLASH_DEVICE_ID 0
27 
flash_area_get_device_id(const struct flash_area * fa)28 static inline uint8_t flash_area_get_device_id(const struct flash_area *fa)
29 {
30     return fa->fa_device_id;
31 }
32 
flash_area_get_id(const struct flash_area * fa)33 static inline uint8_t flash_area_get_id(const struct flash_area *fa)
34 {
35 	return fa->fa_id;
36 }
37 
38 #endif /* __FLASH_MAP_BACKEND_H__*/
39