This commit is contained in:
刘可亮
2024-01-27 08:47:24 +08:00
parent d3bd993b5f
commit 9f7ba67007
2345 changed files with 74421 additions and 76616 deletions

View File

@@ -14,13 +14,23 @@
#include "diskio.h"
#include "mtd.h"
#ifdef AIC_NFTL_SUPPORT
#include "nftl_api.h"
#endif
#if defined(__cplusplus)
extern "C" {
#endif
struct spinand_blk_device {
struct mtd_dev *mtd_device;
struct rt_device_blk_geometry info;
#ifdef AIC_NFTL_SUPPORT
struct nftl_api_handler_t *nftl_handler;
#endif
u8 *pagebuf;
enum part_attr attr;
};
/*!
@@ -32,54 +42,53 @@ struct spinand_blk_device {
* @brief Initializes SPINAND disk.
*
* @param device_name the name of device which includes a file system.
* @retval STA_NOINIT Failed.
* @retval RES_OK Success.
* @retval the handle of disk.
*/
DSTATUS spinand_disk_initialize(const char *device_name);
void *spinand_disk_initialize(const char *device_name);
/*!
* Gets SPINAND disk status
*
* @param device_name the name of device which includes a file system.
* @param hdisk the handle of device which includes a file system.
* @retval STA_NOINIT Failed.
* @retval RES_OK Success.
*/
DSTATUS spinand_disk_status(const char *device_name);
DSTATUS spinand_disk_status(void *hdisk);
/*!
* @brief Reads SPINAND disk.
*
* @param device_name the name of device which includes a file system.
* @param hdisk the handle of device which includes a file system.
* @param buf The data buffer pointer to store read content.
* @param sector The start sector number to be read.
* @param cnt The sector count to be read.
* @retval RES_PARERR Failed.
* @retval RES_OK Success.
*/
DRESULT spinand_disk_read(const char *device_name, uint8_t *buf, uint32_t sector, uint8_t cnt);
DRESULT spinand_disk_read(void *hdisk, uint8_t *buf, uint32_t sector, uint8_t cnt);
/*!
* @brief Writes SPINAND disk.
*
* @param device_name the name of device which includes a file system.
* @param hdisk the handle of device which includes a file system.
* @param buf The data buffer pointer to store write content.
* @param sector The start sector number to be written.
* @param cnt The sector count to be written.
* @retval RES_PARERR Failed.
* @retval RES_OK Success.
*/
DRESULT spinand_disk_write(const char *device_name, const uint8_t *buf, uint32_t sector, uint8_t cnt);
DRESULT spinand_disk_write(void *hdisk, const uint8_t *buf, uint32_t sector, uint8_t cnt);
/*!
* @brief SPINAND disk IO operation.
*
* @param device_name the name of device which includes a file system.
* @param hdisk the handle of device which includes a file system.
* @param command The command to be set.
* @param buf The buffer to store command result.
* @retval RES_PARERR Failed.
* @retval RES_OK Success.
*/
DRESULT spinand_disk_ioctl(const char *device_name, uint8_t command, void *buf);
DRESULT spinand_disk_ioctl(void *hdisk, uint8_t command, void *buf);
/* @} */
#if defined(__cplusplus)