storage: flash_map: Add macros to get FLASH_AREA info

Add macros that we'll utilize instead of DT_FLASH_AREA_

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-05-06 23:41:47 -05:00 committed by Carles Cufí
parent bd97378870
commit 6133d51ef7
1 changed files with 12 additions and 0 deletions

View File

@ -209,6 +209,18 @@ int flash_area_has_driver(const struct flash_area *fa);
*/
struct device *flash_area_get_device(const struct flash_area *fa);
#define FLASH_AREA_LABEL_EXISTS(label) \
DT_HAS_FIXED_PARTITION_LABEL(label)
#define FLASH_AREA_ID(label) \
DT_FIXED_PARTITION_ID(DT_NODE_BY_FIXED_PARTITION_LABEL(label))
#define FLASH_AREA_OFFSET(label) \
DT_REG_ADDR(DT_NODE_BY_FIXED_PARTITION_LABEL(label))
#define FLASH_AREA_SIZE(label) \
DT_REG_SIZE(DT_NODE_BY_FIXED_PARTITION_LABEL(label))
#ifdef __cplusplus
}
#endif