int initSDFAT() { int i = 0; Dev_No = 0; Init_Dev(); SD_Init(); //初始化spi口 while(SD_Reset()) //复位是否成功 { Delay_ms(10); i++; if(i > 5) return 0; } SPI_High_Rate(); //SPI进入高速操作模式 pArg = &Init_Arg_SD; FAT32_Init(); return 1; }
void main(void) { char txtbuf[16]=""; Init_Dev(); PORTB=0x00; putstr("\nLongQiu s.&t. Co. Ltd."); putstr("\nhttp://shop36265907.taobao.com"); Dly_ms(1000); PORTB=0xFF; EnableInterrupts; for(;;) { Dly_ms(500); //----------PWM0---------------------------------- sprintf(txtbuf,"\nFrequence: %d0Hz",PWMPER1); putstr(txtbuf); sprintf(txtbuf,"\n duty circle: %d%%",(PWMPER1-PWMDTY1)*100/PWMDTY1); putstr(txtbuf); PORTB_PB0=~PORTB_PB0; }//for(;;) } //main