Lines Matching +full:static +full:- +full:address

4  * SPDX-License-Identifier: Apache-2.0
26 uint8_t *address; member
30 static inline void zephyr_retained_mem_ram_lock_take(const struct device *dev) in zephyr_retained_mem_ram_lock_take()
33 struct zephyr_retained_mem_ram_data *data = dev->data; in zephyr_retained_mem_ram_lock_take()
35 k_mutex_lock(&data->lock, K_FOREVER); in zephyr_retained_mem_ram_lock_take()
41 static inline void zephyr_retained_mem_ram_lock_release(const struct device *dev) in zephyr_retained_mem_ram_lock_release()
44 struct zephyr_retained_mem_ram_data *data = dev->data; in zephyr_retained_mem_ram_lock_release()
46 k_mutex_unlock(&data->lock); in zephyr_retained_mem_ram_lock_release()
52 static int zephyr_retained_mem_ram_init(const struct device *dev) in zephyr_retained_mem_ram_init()
55 struct zephyr_retained_mem_ram_data *data = dev->data; in zephyr_retained_mem_ram_init()
57 k_mutex_init(&data->lock); in zephyr_retained_mem_ram_init()
63 static ssize_t zephyr_retained_mem_ram_size(const struct device *dev) in zephyr_retained_mem_ram_size()
65 const struct zephyr_retained_mem_ram_config *config = dev->config; in zephyr_retained_mem_ram_size()
67 return (ssize_t)config->size; in zephyr_retained_mem_ram_size()
70 static int zephyr_retained_mem_ram_read(const struct device *dev, off_t offset, uint8_t *buffer, in zephyr_retained_mem_ram_read()
73 const struct zephyr_retained_mem_ram_config *config = dev->config; in zephyr_retained_mem_ram_read()
77 memcpy(buffer, (config->address + offset), size); in zephyr_retained_mem_ram_read()
84 static int zephyr_retained_mem_ram_write(const struct device *dev, off_t offset, in zephyr_retained_mem_ram_write()
87 const struct zephyr_retained_mem_ram_config *config = dev->config; in zephyr_retained_mem_ram_write()
91 memcpy((config->address + offset), buffer, size); in zephyr_retained_mem_ram_write()
98 static int zephyr_retained_mem_ram_clear(const struct device *dev) in zephyr_retained_mem_ram_clear()
100 const struct zephyr_retained_mem_ram_config *config = dev->config; in zephyr_retained_mem_ram_clear()
104 memset(config->address, 0, config->size); in zephyr_retained_mem_ram_clear()
111 static DEVICE_API(retained_mem, zephyr_retained_mem_ram_api) = {
120 (static struct zephyr_retained_mem_ram_data \
123 static const struct zephyr_retained_mem_ram_config \
125 .address = (uint8_t *)DT_REG_ADDR(DT_PARENT(DT_INST(inst, DT_DRV_COMPAT))), \