mirror of
https://github.com/pvvx/RTL00MP3.git
synced 2025-07-31 12:41:06 +00:00
first commit
This commit is contained in:
parent
2ee525362e
commit
d108756e9b
792 changed files with 336059 additions and 0 deletions
|
@ -0,0 +1,39 @@
|
|||
#ifndef _SD_DRIVER_H
|
||||
#define _SD_DRIVER_H
|
||||
|
||||
#include "basic_types.h"
|
||||
|
||||
#define CONFIG_SD_SDIO 1
|
||||
#define CONFIG_SD_SPI 0
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SD_OK = 0,
|
||||
SD_NODISK,
|
||||
SD_INITERR,
|
||||
SD_PROTECTED,
|
||||
SD_ERROR,
|
||||
}SD_RESULT;
|
||||
|
||||
typedef enum{
|
||||
SD_CLK_LOW,
|
||||
SD_CLK_MID,
|
||||
SD_CLK_HIGH,
|
||||
SD_CLK_RSV,
|
||||
}SD_CLK;
|
||||
|
||||
SD_RESULT SD_WaitReady(void);
|
||||
SD_RESULT SD_Init(void);
|
||||
SD_RESULT SD_DeInit(void);
|
||||
SD_RESULT SD_SetCLK(SD_CLK CLK);
|
||||
|
||||
SD_RESULT SD_Status(void);
|
||||
|
||||
SD_RESULT SD_GetCID(u8 *cid_data); // read sd card CID
|
||||
SD_RESULT SD_GetCSD(u8 *csd_data); // read sd card CSD
|
||||
SD_RESULT SD_GetCapacity(u32* sector_count); // read sd card Capacity
|
||||
|
||||
SD_RESULT SD_ReadBlocks(u32 sector,u8 *data,u32 count); //read multi sector
|
||||
SD_RESULT SD_WriteBlocks(u32 sector,const u8 *data,u32 count); //write multi sector
|
||||
|
||||
#endif
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef _SDIO_HOST_H
|
||||
#define _SDIO_HOST_H
|
||||
#include "basic_types.h"
|
||||
#include "rtl8195a_sdio_host.h"
|
||||
|
||||
typedef enum{
|
||||
SDIO_INIT_NONE = -1,
|
||||
SDIO_INIT_FAIL = 0,
|
||||
SDIO_INIT_OK = 1,
|
||||
SDIO_SD_NONE = 2,
|
||||
SDIO_SD_OK = 3,
|
||||
}_sdio_init_s;
|
||||
|
||||
|
||||
s8 sdio_init_host(void); // init sdio host interface
|
||||
void sdio_deinit_host(void);
|
||||
|
||||
s8 sdio_sd_init(void); // init sd card through sdio
|
||||
void sdio_sd_deinit(void); //de-init sd card through sdio
|
||||
s8 sdio_sd_status(void);
|
||||
u32 sdio_sd_getCapacity(void);
|
||||
s8 sdio_sd_getProtection(void);
|
||||
s8 sdio_sd_setProtection(bool protected);
|
||||
s8 sdio_sd_getCSD(u8* CSD);
|
||||
s8 sdio_sd_isReady();
|
||||
s8 sdio_sd_setClock(SD_CLK_FREQUENCY SDCLK);
|
||||
|
||||
|
||||
s8 sdio_read_blocks(u32 sector, u8 *buffer, u32 count);
|
||||
s8 sdio_write_blocks(u32 sector, const u8 *buffer, u32 count);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue