Lines Matching +full:buffer +full:- +full:size

4  * SPDX-License-Identifier: Apache-2.0
28 "Size of off_t must be equal or less than size of size_t");
41 * @brief Callback API to get size of retained memory area.
51 typedef int (*retained_mem_read_api)(const struct device *dev, off_t offset, uint8_t *buffer,
52 size_t size);
60 const uint8_t *buffer, size_t size);
74 * non-initialised RAM region, or in specific registers, but is not reset when a different
76 * byte-level reading and writing without a need to erase data before writing.
81 retained_mem_size_api size; member
88 * @brief Returns the size of the retained memory area.
92 * @retval Positive value indicating size in bytes on success, else negative errno
99 struct retained_mem_driver_api *api = (struct retained_mem_driver_api *)dev->api; in z_impl_retained_mem_size()
101 return api->size(dev); in z_impl_retained_mem_size()
109 * @param buffer Buffer to store read data in.
110 * @param size Size of data to read.
114 __syscall int retained_mem_read(const struct device *dev, off_t offset, uint8_t *buffer,
115 size_t size);
118 uint8_t *buffer, size_t size) in z_impl_retained_mem_read() argument
120 struct retained_mem_driver_api *api = (struct retained_mem_driver_api *)dev->api; in z_impl_retained_mem_read()
123 /* Validate user-supplied parameters */ in z_impl_retained_mem_read()
124 if (size == 0) { in z_impl_retained_mem_read()
128 area_size = api->size(dev); in z_impl_retained_mem_read()
130 if (offset < 0 || size > area_size || (area_size - size) < (size_t)offset) { in z_impl_retained_mem_read()
131 return -EINVAL; in z_impl_retained_mem_read()
134 return api->read(dev, offset, buffer, size); in z_impl_retained_mem_read()
138 * @brief Writes data to the Retained memory area - underlying data does not need to
143 * @param buffer Data to write.
144 * @param size Size of data to be written.
148 __syscall int retained_mem_write(const struct device *dev, off_t offset, const uint8_t *buffer,
149 size_t size);
152 const uint8_t *buffer, size_t size) in z_impl_retained_mem_write() argument
154 struct retained_mem_driver_api *api = (struct retained_mem_driver_api *)dev->api; in z_impl_retained_mem_write()
157 /* Validate user-supplied parameters */ in z_impl_retained_mem_write()
158 if (size == 0) { in z_impl_retained_mem_write()
162 area_size = api->size(dev); in z_impl_retained_mem_write()
164 if (offset < 0 || size > area_size || (area_size - size) < (size_t)offset) { in z_impl_retained_mem_write()
165 return -EINVAL; in z_impl_retained_mem_write()
168 return api->write(dev, offset, buffer, size); in z_impl_retained_mem_write()
182 struct retained_mem_driver_api *api = (struct retained_mem_driver_api *)dev->api; in z_impl_retained_mem_clear()
184 return api->clear(dev); in z_impl_retained_mem_clear()