Lines Matching +full:0 +full:x00 +full:- +full:positive
4 * SPDX-License-Identifier: Apache-2.0
34 * @version 0.8.0
64 * @brief Callback API to clear retained memory area (reset all data to 0x00).
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.
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()
112 * @retval 0 on success else negative errno code.
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()
125 return 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
146 * @retval 0 on success else negative errno code.
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()
159 return 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()
172 * @brief Clears data in the retained memory area by setting it to 0x00.
176 * @retval 0 on success else negative errno code.
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()