1#include <zephyr/nvmem.h>
2
3static const struct nvmem_cell mac_address =
4	NVMEM_CELL_GET_BY_NAME(DT_NODELABEL(my_consumer), mac_address);
5
6int main(void)
7{
8	uint8_t mac[6];
9	int ret;
10
11	if (!nvmem_cell_is_ready(&mac_address)) {
12		printk("NVMEM cell is not ready\n");
13		return -ENODEV;
14	}
15
16	ret = nvmem_cell_read(&mac_address, mac, 0, sizeof(mac));
17	if (ret < 0) {
18		printk("Failed to read MAC address: %d\n", ret);
19		return ret;
20	}
21
22	/* ... */
23}
24