ch376t sd卡 spi方式 問題

我用的是ch376t芯片用spi方式操作sd卡,sd卡是t卡。

初始化都能成功,但是我想建立二層目錄來寫一個txt文件時,每次只是建立了一層目錄,沒有出現(xiàn)二層目錄和txt文件 ,多級目錄宏也打開了,不知道為什么,求大俠解惑

這是程序:

printf( "Write TXT file :" ); CH376DirCreate("/YICENG"); CH376FileClose(FALSE); CH376DirCreatePath("/YICENG/ERCENG"); CH376FileClose(FALSE); CH376FileCreate("111.TXT"); for(i = 0; i < sizeof(bmphead); i++){ CH376ByteWrite(&bmphead[i], i, NULL); } CH376FileClose( TRUE );

你的操作我這邊可以測試通過。到我們網(wǎng)站上下載最新的FILE_SYS.C,主要是CH376SetFileName函數(shù)。 void CH376SetFileName( PUINT8 name ) /* 設置將要操作的文件的文件名 */ { /* UINT8 i;*/ UINT8 c; #ifndef DEF_IC_V43_U UINT8 s; xWriteCH376Cmd( CMD01_GET_IC_VER ); if ( xReadCH376Data( ) < 0x43 ) { if ( CH376ReadVar8( VAR_DISK_STATUS ) < DEF_DISK_READY ) { xWriteCH376Cmd( CMD10_SET_FILE_NAME ); xWriteCH376Data( 0 ); s = CH376SendCmdWaitInt( CMD0H_FILE_OPEN ); if ( s == USB_INT_SUCCESS ) { s = CH376ReadVar8( 0xCF ); if ( s ) { CH376WriteVar32( 0x4C, CH376ReadVar32( 0x4C ) + ( (UINT16)s << 8 ) ); CH376WriteVar32( 0x50, CH376ReadVar32( 0x50 ) + ( (UINT16)s << 8 ) ); CH376WriteVar32( 0x70, 0 ); } } } } #endif xWriteCH376Cmd( CMD10_SET_FILE_NAME ); /* for ( i = MAX_FILE_NAME_LEN; i != 0; -- i ) { c = *name; xWriteCH376Data( c ); if ( c == 0 ) break; name ++; }*/ c = *name; xWriteCH376Data( c ); while ( c ) { name ++; c = *name; if ( c == DEF_SEPAR_CHAR1 || c == DEF_SEPAR_CHAR2 ) c = 0; /* 強行將文件名截止 */ xWriteCH376Data( c ); }


只有登錄才能回復,可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频