include: move disk_access.h to storage
Zephyr already has a directory for storage API relevant headers. Move disk_access.h header to include/storage where it fits better structurally. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
parent
45d468bfdb
commit
f205e94f9e
6 changed files with 103 additions and 86 deletions
|
@ -4,92 +4,14 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Disk Access layer API
|
||||
*
|
||||
* This file contains APIs for disk access.
|
||||
/*
|
||||
* The header was moved to include/storage/disk_access.h
|
||||
* This header is deprecated and there for compatibility.
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_INCLUDE_DISK_DISK_ACCESS_H_
|
||||
#define ZEPHYR_INCLUDE_DISK_DISK_ACCESS_H_
|
||||
|
||||
/**
|
||||
* @brief Disk Access APIs
|
||||
* @defgroup disk_access_interface Disk Access Interface
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <drivers/disk.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @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] 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
|
||||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
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] 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
|
||||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
int disk_access_ioctl(const char *pdrv, uint8_t cmd, void *buff);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#include <storage/disk_access.h>
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_DISK_DISK_ACCESS_H_ */
|
||||
|
|
95
include/storage/disk_access.h
Normal file
95
include/storage/disk_access.h
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Disk Access layer API
|
||||
*
|
||||
* This file contains APIs for disk access.
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_INCLUDE_STORAGE_DISK_ACCESS_H_
|
||||
#define ZEPHYR_INCLUDE_STORAGE_DISK_ACCESS_H_
|
||||
|
||||
/**
|
||||
* @brief Disk Access APIs
|
||||
* @defgroup disk_access_interface Disk Access Interface
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <drivers/disk.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @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] 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
|
||||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
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] 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
|
||||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return 0 on success, negative errno code on fail
|
||||
*/
|
||||
int disk_access_ioctl(const char *pdrv, uint8_t cmd, void *buff);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_STORAGE_DISK_ACCESS_H_ */
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <zephyr.h>
|
||||
#include <device.h>
|
||||
#include <disk/disk_access.h>
|
||||
#include <storage/disk_access.h>
|
||||
#include <logging/log.h>
|
||||
#include <fs/fs.h>
|
||||
#include <ff.h>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <sys/__assert.h>
|
||||
#include <sys/util.h>
|
||||
#include <init.h>
|
||||
#include <disk/disk_access.h>
|
||||
#include <storage/disk_access.h>
|
||||
#include <errno.h>
|
||||
#include <device.h>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <string.h>
|
||||
#include <sys/byteorder.h>
|
||||
#include <sys/__assert.h>
|
||||
#include <disk/disk_access.h>
|
||||
#include <storage/disk_access.h>
|
||||
#include <usb/class/usb_msc.h>
|
||||
#include <usb/usb_device.h>
|
||||
#include <usb/usb_common.h>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <string.h>
|
||||
#include <zephyr/types.h>
|
||||
#include <sys/__assert.h>
|
||||
#include <disk/disk_access.h>
|
||||
#include <storage/disk_access.h>
|
||||
#include <errno.h>
|
||||
#include <init.h>
|
||||
#include <device.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue