/**
 * 读磁盘扇区命令
 * @param sect 读取的物理扇区号
 * @param *buf 数据缓冲区指针
 * @return 0 - 成功
 */
short ufiReadSect( DWORD sect, BYTE *buf)
{
    READ_10 *read10;
    CBW *cbw;
 
    // 设置 Bulk-Only 协议参数
    cbw = &ufiCmdRunning. cbw ;
    cbw-> dCBW_Signature = CBW_SIGNATURE;
    cbw-> dCBW_Tag = 0x60a624de;
    cbw-> dCBW_DataXferLen = 512;
    cbw-> bCBW_Flag =0x80;
    cbw-> bCBW_LUN =0;
    cbw-> bCBW_CDBLen = 16; //sizeof(CDB_RBC);
 
    // 设置 UFI 命令参数
    read10 = &(cbw-> cdbRBC . ufiRead10 );
    read10-> OperationCode = 0x28;
    read10-> LBA_0 = byteInInt(sect, 0);
    read10-> LBA_1 = byteInInt(sect, 1);
    read10-> LBA_2 = byteInInt(sect, 2);
    read10-> LBA_3 = byteInInt(sect, 3);
    read10-> XferLen_0 = 0x01;
    read10-> XferLen_1 = 0x00;
 
    // 设置状态扫描函数所需要的参数
    ufiCmdRunning. funUfiCmd = bulkRead;
    ufiCmdRunning. pBuf = buf;
    ufiCmdRunning. state = UFI_STATE_BEGIN;
 
    // 通过 Bulk 端口发送读命令
    bulkRead(( unsigned char *)&ufiCmdRunning. cbw , buf, ( unsigned char *)&ufiCmdRunning. csw );
 
    return 0;
}
注意:把扇区号由4字节长度的整数转换为4个字节,不能直接使用数据类型转换,因为USB协议要求在传输时是低字节在前,高字节在后。AM9200如果直接进行数据类型转换,则得到的结果正好相反。