76 lines
3.1 KiB
C
76 lines
3.1 KiB
C
/**
|
|
******************************************************************************
|
|
* @file extfuns.h
|
|
* @author AMG Energy Solution Team
|
|
* @version V1.0.0
|
|
* @date 07-Feb-2022
|
|
* @brief This file provides all the headers of the ext file functions.
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
|
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
|
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
|
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
|
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
|
*
|
|
* <h2><center>© COPYRIGHT 2022 AMG</center></h2>
|
|
******************************************************************************
|
|
*/
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __EXFUNS_H
|
|
#define __EXFUNS_H
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "hc32_ddl.h"
|
|
#include "ff.h"
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
/* Exported constants --------------------------------------------------------*/
|
|
//F_typetell returns the type definition
|
|
//Table FILE_TYPE_TBL access to. exfuns.c definition
|
|
#define T_BIN 0X00 //Bin file
|
|
#define T_LRC 0X10 //lrc file
|
|
#define T_NES 0X20 //nes file
|
|
|
|
#define T_TEXT 0X30 //.txt file
|
|
#define T_C 0X31 //.c file
|
|
#define T_H 0X32 //.h file
|
|
|
|
#define T_WAV 0X40 //WAV file
|
|
#define T_MP3 0X41 //MP3 file
|
|
#define T_APE 0X42 //APE file
|
|
#define T_FLAC 0X43 //FLAC file
|
|
|
|
#define T_BMP 0X50 //bmp file
|
|
#define T_JPG 0X51 //jpg file
|
|
#define T_JPEG 0X52 //jpeg file
|
|
#define T_GIF 0X53 //gif file
|
|
|
|
#define T_AVI 0X60 //avi file
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
/* Exported extern variables -------------------------------------------------*/
|
|
extern FATFS *fs[_VOLUMES];
|
|
extern FIL *file;
|
|
extern FIL *ftemp;
|
|
extern UINT br,bw;
|
|
extern FILINFO fileinfo;
|
|
extern DIR dir;
|
|
extern uint8_t *fatbuf;//SD card data buffer
|
|
|
|
/* Exported functions ------------------------------------------------------- */
|
|
uint8_t exfuns_init(void); //For the memory
|
|
uint8_t f_typetell(uint8_t *fname); //Identify the file type
|
|
uint8_t exf_getfree(uint8_t *drv,uint32_t *total,uint32_t *free); //Get the total disk capacity and remaining capacity
|
|
uint32_t exf_fdsize(uint8_t *fdname); //Get folder size
|
|
uint8_t* exf_get_src_dname(uint8_t* dpfn);
|
|
uint8_t exf_copy(uint8_t(*fcpymsg)(uint8_t*pname,uint8_t pct,uint8_t mode),uint8_t *psrc,uint8_t *pdst,uint32_t totsize,uint32_t cpdsize,uint8_t fwmode); //File replication
|
|
uint8_t exf_fdcopy(uint8_t(*fcpymsg)(uint8_t*pname,uint8_t pct,uint8_t mode),uint8_t *psrc,uint8_t *pdst,uint32_t *totsize,uint32_t *cpdsize,uint8_t fwmode);//Folder replication
|
|
|
|
#endif
|
|
|
|
/*******************(C)COPYRIGHT 2022 AMG ********************END OF FILE******/
|
|
|