📄 test_sdcard.c
字号:
//====================================================================================
//File Name: Test_SDCard.c
//Description: SD card test
//Update: V1.0 by wangtao <wangtao@sunnorth.com.cn>
//====================================================================================
#include "SystemHeader.h"
short Test_SDCard(void)
{
short x, y;
short Ret = 0;
int i;
*P_SD_CLK_CONF = C_SD_CLK_EN|C_SD_RST_DIS; // Enable SD controller clock
*P_SD_INTERFACE_SEL = C_SD_PORT_SEL; // Enable SD card port
TFT_SetBGColor(0x0001);
TFT_SetWindow(0, 0, TFT_WIDTH-1, TFT_HEIGHT-1);
TFT_SetBGColor(COLOR_WHITE);
TFT_SetWindow(40, 40, 279, 199);
TFT_SetColor(COLOR_RED);
TFT_Rectangle(0, 0, 239, 159, PAINT_HOLLOW);
TFT_SetColor(COLOR_BLUE);
TFT_SetWindow(70, 100, 259, 189);
TFT_SetTextPos(0, 0);
TFT_Print("SD card test...");
if(SDDrv_Initial())
{
TFT_SetColor(COLOR_RED);
TFT_Print("Failed!");
TFT_SetColor(COLOR_BLUE);
TFT_Print("Make sure the SD card has been inserted.");
Ret = 0;
}
else
{
TFT_Print("Successful!\n");
Ret = 1;
}
TFT_SetTextPos(0, 60);
TFT_Print("Click any position on the screen to return");
while(1)
{
Touch_Get(&x, &y);
if(x!=-1) break;
}
for(i=0; i<1000000; i++);
TFT_SetBGColor(0x0001);
TFT_SetWindow(0, 0, TFT_WIDTH-1, TFT_HEIGHT-1);
return Ret;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -