forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
it8xxx2.h
36 lines (30 loc) · 1.28 KB
/
it8xxx2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* Copyright (c) 2024 Google Inc
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef INCLUDE_ZEPHYR_DRIVERS_BBRAM_IT8XXX2_H_
#define INCLUDE_ZEPHYR_DRIVERS_BBRAM_IT8XXX2_H_
#include <stdint.h>
#include <zephyr/devicetree.h>
/** Device config */
struct bbram_it8xxx2_config {
/** BBRAM base address */
uintptr_t base_addr;
/** BBRAM size (Unit:bytes) */
int size;
};
#ifdef CONFIG_BBRAM_IT8XXX2_EMUL
#define BBRAM_IT8XXX2_DECL_CONFIG(inst) \
static uint8_t bbram_it8xxx2_emul_buffer_##inst[DT_INST_REG_SIZE(inst)]; \
static const struct bbram_it8xxx2_config bbram_cfg_##inst = { \
.base_addr = (uintptr_t)bbram_it8xxx2_emul_buffer_##inst, \
.size = DT_INST_REG_SIZE(inst), \
}
#else
#define BBRAM_IT8XXX2_DECL_CONFIG(inst) \
static const struct bbram_it8xxx2_config bbram_cfg_##inst = { \
.base_addr = DT_INST_REG_ADDR(inst), \
.size = DT_INST_REG_SIZE(inst), \
}
#endif
#endif /* INCLUDE_ZEPHYR_DRIVERS_BBRAM_IT8XXX2_H_ */