Files
luban-lite-t3e-pro/packages/third-party/dfs/filesystems/elmfat/sdmc_disk/sdmc_disk.h

101 lines
2.4 KiB
C
Raw Normal View History

2023-08-30 16:21:18 +08:00
/*
* Copyright (c) 2022-2023, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: matteo <duanmt@artinchip.com>
*/
#ifndef _SDMC_DISK_H_
#define _SDMC_DISK_H_
#include <stdint.h>
#include <ff.h>
#include "diskio.h"
#include "mmc.h"
/*!
* @addtogroup SDMC Disk
* @{
*/
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
/*************************************************************************************************
* API
************************************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif
/*!
* @name SDMC Disk Function
* @{
*/
/*!
* @brief Initializes SDMC disk.
*
2023-11-09 20:19:51 +08:00
* @param device_name the name of device which includes a file system.
2024-01-27 08:47:24 +08:00
* @retval disk handle.
2023-08-30 16:21:18 +08:00
*/
2024-01-27 08:47:24 +08:00
void *sdmc_disk_initialize(const char *device_name);
2023-08-30 16:21:18 +08:00
/*!
* Gets SDMC disk status
*
2024-01-27 08:47:24 +08:00
* @param hdisk disk handle.
2023-08-30 16:21:18 +08:00
* @retval STA_NOINIT Failed.
* @retval RES_OK Success.
*/
2024-01-27 08:47:24 +08:00
DSTATUS sdmc_disk_status(void *hdisk);
2023-08-30 16:21:18 +08:00
/*!
* @brief Reads SDMC disk.
*
2024-01-27 08:47:24 +08:00
* @param hdisk disk handle.
2023-08-30 16:21:18 +08:00
* @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.
*/
2024-01-27 08:47:24 +08:00
DRESULT sdmc_disk_read(void *hdisk, uint8_t *buf, uint32_t sector, uint8_t cnt);
2023-08-30 16:21:18 +08:00
/*!
* @brief Writes SDMC disk.
*
2024-01-27 08:47:24 +08:00
* @param hdisk disk handle.
2023-08-30 16:21:18 +08:00
* @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.
*/
2024-01-27 08:47:24 +08:00
DRESULT sdmc_disk_write(void *hdisk, const uint8_t *buf, uint32_t sector, uint8_t cnt);
2023-08-30 16:21:18 +08:00
/*!
* @brief SDMC disk IO operation.
*
2024-01-27 08:47:24 +08:00
* @param hdisk disk handle.
2023-08-30 16:21:18 +08:00
* @param command The command to be set.
* @param buf The buffer to store command result.
* @retval RES_PARERR Failed.
* @retval RES_OK Success.
*/
2024-01-27 08:47:24 +08:00
DRESULT sdmc_disk_ioctl(void *hdisk, uint8_t command, void *buf);
2023-08-30 16:21:18 +08:00
/* @} */
#if defined(__cplusplus)
}
#endif
#endif /* _SDMC_DISK_H_ */