h375B測(cè)試取反正常,插上u盤(pán)后,有時(shí)候正常,有時(shí)不正常,設(shè)置usb模式6,常常返回0x15,就是不能返回0x14, UINT8 Wait_CH375_Interrupt( void ) /* 等待CH375中斷并獲取狀態(tài),返回操作狀態(tài) */ { UINT8 Status1; while(0b00010000==PINB & (1 << PB4)); /* 查詢等待CH375操作完成中斷(INT#低電平) */ printf("0b00010000==PINB & (1 << PB4)\n"); Write_Cmd_to_CH375( CMD_GET_STATUS ); Status1=Read_Cmd_From_CH375( ); printf( "Read_Cmd_From_CH375: 0X%X\n", Status1 ); Status1=Read_Data_From_CH375( ); printf( "Read_Data_From_CH375: 0X%X\n", Status1 ); return( Status1); }
調(diào)用代碼如下:
Write_Cmd_to_CH375( CMD_DISK_INIT ); // 初始化USB存儲(chǔ)器 Status = Wait_CH375_Interrupt( ); // 等待中斷并獲取狀態(tài) if ( Status != USB_INT_CONNECT ) { printf( "0x14 USB_INT_SUCCESS: 0X%X\n", Status ); return(Status ); // 出現(xiàn)錯(cuò)誤 }
這是什么問(wèn)題? 如何知道給ch375發(fā)個(gè)命令后,ch375b返回什么,有沒(méi)有這個(gè)命令手冊(cè)?