Lines Matching +full:static +full:- +full:address
5 * SPDX-License-Identifier: Apache-2.0
27 uint8_t *address; member
31 static inline void zephyr_retained_mem_reg_lock_take(const struct device *dev) in zephyr_retained_mem_reg_lock_take()
34 struct zephyr_retained_mem_reg_data *data = dev->data; in zephyr_retained_mem_reg_lock_take()
36 k_mutex_lock(&data->lock, K_FOREVER); in zephyr_retained_mem_reg_lock_take()
42 static inline void zephyr_retained_mem_reg_lock_release(const struct device *dev) in zephyr_retained_mem_reg_lock_release()
45 struct zephyr_retained_mem_reg_data *data = dev->data; in zephyr_retained_mem_reg_lock_release()
47 k_mutex_unlock(&data->lock); in zephyr_retained_mem_reg_lock_release()
53 static int zephyr_retained_mem_reg_init(const struct device *dev) in zephyr_retained_mem_reg_init()
56 struct zephyr_retained_mem_reg_data *data = dev->data; in zephyr_retained_mem_reg_init()
58 k_mutex_init(&data->lock); in zephyr_retained_mem_reg_init()
64 static ssize_t zephyr_retained_mem_reg_size(const struct device *dev) in zephyr_retained_mem_reg_size()
66 const struct zephyr_retained_mem_reg_config *config = dev->config; in zephyr_retained_mem_reg_size()
68 return (ssize_t)config->size; in zephyr_retained_mem_reg_size()
71 static int zephyr_retained_mem_reg_read(const struct device *dev, off_t offset, uint8_t *buffer, in zephyr_retained_mem_reg_read()
74 const struct zephyr_retained_mem_reg_config *config = dev->config; in zephyr_retained_mem_reg_read()
78 memcpy(buffer, (config->address + offset), size); in zephyr_retained_mem_reg_read()
85 static int zephyr_retained_mem_reg_write(const struct device *dev, off_t offset, in zephyr_retained_mem_reg_write()
88 const struct zephyr_retained_mem_reg_config *config = dev->config; in zephyr_retained_mem_reg_write()
92 memcpy((config->address + offset), buffer, size); in zephyr_retained_mem_reg_write()
99 static int zephyr_retained_mem_reg_clear(const struct device *dev) in zephyr_retained_mem_reg_clear()
101 const struct zephyr_retained_mem_reg_config *config = dev->config; in zephyr_retained_mem_reg_clear()
105 memset(config->address, 0, config->size); in zephyr_retained_mem_reg_clear()
112 static DEVICE_API(retained_mem, zephyr_retained_mem_reg_api) = {
120 static struct zephyr_retained_mem_reg_data zephyr_retained_mem_reg_data_##inst; \
121 static const struct zephyr_retained_mem_reg_config \
123 .address = (uint8_t *)DT_INST_REG_ADDR(inst), \