由于ataResources没有在外部定义,所以在这里自己进行了定义,它主要就是定义IDE寄存器的地址映射,我这里定义如下:
UINT32 ioStart[2] = {0x3600000,0x3604000};
pCtrl->data = ATA_DATA (ioStart[0]);
pCtrl->error = ATA_ERROR (ioStart[0]);
pCtrl->feature = ATA_FEATURE (ioStart[0]);
pCtrl->seccnt = ATA_SECCNT (ioStart[0]);
pCtrl->sector = ATA_SECTOR (ioStart[0]);
pCtrl->cylLo = ATA_CYL_LO (ioStart[0]);
pCtrl->cylHi = ATA_CYL_HI (ioStart[0]);
pCtrl->sdh = ATA_SDH (ioStart[0]);
pCtrl->command = ATA_COMMAND (ioStart[0]);
pCtrl->status = ATA_STATUS (ioStart[0]);
pCtrl->aStatus = ATA_A_STATUS (ioStart[1]);
pCtrl->dControl = ATA_D_CONTROL (ioStart[1]);
pCtrl->dAddress = ATA_D_ADDRESS (ioStart[1]);
设置ataDrv()函数的参数值,我是在函数体内直接设好了。具体参数如下:
configType = 0x066b; /*配置类型,就是选择Transfer mode、Transfer bits、Transfer unit、Geometry parameters 等参数 */
wdgTimeout = 10; /*软件狗定时 */
semTimeout = 10; /*信号量超时 */
|