storage/flash_map: Add FLASH_AREA_DEVICE macro
The macro returns pointer to a device object the flash area exists on. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
parent
5b5417a1dd
commit
a333ffce1d
3 changed files with 16 additions and 3 deletions
|
@ -271,6 +271,16 @@ uint8_t flash_area_erased_val(const struct flash_area *fa);
|
|||
#define FLASH_AREA_SIZE(label) \
|
||||
DT_REG_SIZE(DT_NODE_BY_FIXED_PARTITION_LABEL(label))
|
||||
|
||||
/**
|
||||
* Get device pointer for device the area/partition resides on
|
||||
*
|
||||
* @param label partition label
|
||||
*
|
||||
* @return const struct device type pointer
|
||||
*/
|
||||
#define FLASH_AREA_DEVICE(label) \
|
||||
DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODE_BY_FIXED_PARTITION_LABEL(label)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue