void CH375_Read(void) { int i; CH375WriteCommand(RD_USB_DATA); Usb_Buf_Len=CH375ReadData(); for (i=0;i { Usb_Buf[i]=CH375ReadData(); } }
void CH375_Disk_Init(void) { CH375_check(); CH375_setmode(0x06);//usb host
Delay(200); while(CH375_get_status()!=USB_INT_CONNECT) { }
Delay(2000); CH375WriteCommand(DISK_INIT); while(CH375_get_status()!=USB_INT_SUCCESS) { }
Delay(200); CH375WriteCommand(DISK_RESET);
Delay(200); CH375WriteCommand(DISK_SIZE); while(CH375_get_status()!=USB_INT_SUCCESS)//USB_INT_SUCCESS就是0X14 { } CH375_Read();// <-------返回的数据全是0X14,不是U盘容量大小.
}