From 97a97c744a294ba14278a1f436d46eaa2d488354 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Tue, 4 Jun 2024 19:57:25 +0200 Subject: [PATCH] drivers/flash: Fix typos and incorrect description Fixing typos. Signed-off-by: Dominik Ermel --- drivers/flash/Kconfig | 6 +++--- include/zephyr/drivers/flash.h | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/flash/Kconfig b/drivers/flash/Kconfig index 74c56d1032615f..d0bb8e24c55dc9 100644 --- a/drivers/flash/Kconfig +++ b/drivers/flash/Kconfig @@ -20,7 +20,7 @@ config FLASH_HAS_EX_OP config FLASH_HAS_EXPLICIT_ERASE bool help - Device has does not do erase-on-write (erase-on-program, auto-erase + Device does not do erase-on-write (erase-on-program, auto-erase on write) and requires explicit erase procedure to be programmed with random value, in place where it has already been programmed with some other value, as program can only change bits from erased-value @@ -128,7 +128,7 @@ config FLASH_SHELL_BUFFER_SIZE endif # FLASH_SHELL config FLASH_FILL_BUFFER_SIZE - int "Buffer size of flash_fill funciton" + int "Buffer size of flash_fill function" default 32 help Size of a buffer used by flash_fill function to fill a device with @@ -138,7 +138,7 @@ config FLASH_FILL_BUFFER_SIZE be written to a device, and alignment of write offset. Even if device does not have such requirement, filling device by single bytes is not efficient. - Value selected here should be multiply of the largest write-block-size + Value selected here should be a multiple of the largest write-block-size among all the memory devices used in system. if FLASH_HAS_PAGE_LAYOUT diff --git a/include/zephyr/drivers/flash.h b/include/zephyr/drivers/flash.h index 7ceea4a5b254e6..3109f6984048be 100644 --- a/include/zephyr/drivers/flash.h +++ b/include/zephyr/drivers/flash.h @@ -57,10 +57,12 @@ struct flash_pages_layout { * through a runtime. */ struct flash_parameters { + /** Minimal write alignment and size */ const size_t write_block_size; - /* Device capabilities. Only drivers are supposed to set the - * capabilities directly, users need to call the FLASH_CAPS_ - * macros on pointer to flash_parameters to get capabilities. + + /** @cond INTERNAL_HIDDEN */ + /* User code should call flash_params_get_ functions on flash_parameters + * to get capabilities, rather than accessing object contents directly. */ struct { /* Device has no explicit erase, so it either erases on @@ -70,7 +72,9 @@ struct flash_parameters { */ bool no_explicit_erase: 1; } caps; - uint8_t erase_value; /* Byte value of erased flash */ + /** @endcond */ + /** Value the device is filled in erased areas */ + uint8_t erase_value; }; /** Set for ordinary Flash where erase is needed before write of random data */ @@ -324,7 +328,7 @@ __syscall int flash_fill(const struct device *dev, uint8_t val, off_t offset, si * If device is explicit erase type device or device driver provides erase * callback, the callback of the device is called, in which it behaves * the same way as flash_erase. - * If a device is does not require explicit erase, either because + * If a device does not require explicit erase, either because * it has no erase at all or has auto-erase/erase-on-write, * and does not provide erase callback then erase is emulated by * leveling selected device memory area with erase_value assigned to