From 5678189c27cce3ef03eada5bfd6b10fa8e2bffaf Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Fri, 26 Feb 2021 14:33:04 +0100 Subject: [PATCH] doc: update disk API documentation Fix disk access interface description and update disk API documentation. Signed-off-by: Johann Fischer --- doc/reference/storage/disk/access.rst | 20 ++++++++++++++++---- include/storage/disk_access.h | 20 ++++++++++++++------ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/doc/reference/storage/disk/access.rst b/doc/reference/storage/disk/access.rst index ab705ae3adb..3f8c3ac00ae 100644 --- a/doc/reference/storage/disk/access.rst +++ b/doc/reference/storage/disk/access.rst @@ -6,11 +6,10 @@ Disk Access Overview ******** -The disk access API provides access to storage disks, physical or in Flash or -RAM. +The disk access API provides access to storage devices. -Configuration Options -********************* +API Configuration Options +************************* Related configuration options: @@ -21,3 +20,16 @@ API Reference .. doxygengroup:: disk_access_interface :project: Zephyr + +Disk Driver Configuration Options +********************************* + +Related driver configuration options: + +* :option:`CONFIG_DISK_DRIVERS` + +Disk Driver Interface +********************* + +.. doxygengroup:: disk_driver_interface + :project: Zephyr diff --git a/include/storage/disk_access.h b/include/storage/disk_access.h index 8d4e68b1a2c..35d4734a932 100644 --- a/include/storage/disk_access.h +++ b/include/storage/disk_access.h @@ -26,30 +26,35 @@ extern "C" { #endif -/* +/** * @brief perform any initialization * * This call is made by the consumer before doing any IO calls so that the * disk or the backing device can do any initialization. * + * @param[in] pdrv Disk name + * * @return 0 on success, negative errno code on fail */ int disk_access_init(const char *pdrv); -/* +/** * @brief Get the status of disk * * This call is used to get the status of the disk * + * @param[in] pdrv Disk name + * * @return DISK_STATUS_OK or other DISK_STATUS_*s */ int disk_access_status(const char *pdrv); -/* +/** * @brief read data from disk * * Function to read data from disk to a memory buffer. * + * @param[in] pdrv Disk name * @param[in] data_buf Pointer to the memory buffer to put data. * @param[in] start_sector Start disk sector to read from * @param[in] num_sector Number of disk sectors to read @@ -59,11 +64,12 @@ int disk_access_status(const char *pdrv); int disk_access_read(const char *pdrv, uint8_t *data_buf, uint32_t start_sector, uint32_t num_sector); -/* +/** * @brief write data to disk * * Function write data from memory buffer to disk. * + * @param[in] pdrv Disk name * @param[in] data_buf Pointer to the memory buffer * @param[in] start_sector Start disk sector to write to * @param[in] num_sector Number of disk sectors to write @@ -73,12 +79,14 @@ int disk_access_read(const char *pdrv, uint8_t *data_buf, int disk_access_write(const char *pdrv, const uint8_t *data_buf, uint32_t start_sector, uint32_t num_sector); -/* +/** * @brief Get/Configure disk parameters * * Function to get disk parameters and make any special device requests. * - * @param[in] cmd DISK_IOCTL_* code describing the request + * @param[in] pdrv Disk name + * @param[in] cmd DISK_IOCTL_* code describing the request + * @param[in] buff Command data buffer * * @return 0 on success, negative errno code on fail */