CHAPTER 5 APPLICATION EXAMPLES
Application Note U17121EJ1V1AN
97
// Sets transfer mode to PIO transfer Mode0 using SET_FEATURE command.
Set_Transfer_Mode(0, PIO_MODE0);
// Sets PIO Timing register of configuration register of
// PCI-IDE ASIC board.
Set_PIO_Timing(IDE_PIO_TIMING_IDE33MHz_MODE0);
// Buffer initialization
InitBuffer(wbuff, 4096);
//////////////////
// PIO transfer //
//////////////////
ATA_Write_Sector( // Issues WRITE SECTOR command.
0, // Master Device
0, // LBA 0
1, // 1 Sector
wbuff // Buffer storing written contents
);
ATA_Read_Sector( // Issues READ SECTOR command.
0, // Master Device
0, // LBA 0
1, // 1 Sector
rbuff // Buffer storing read results
);
status = memcmp(wbuff, rbuff, 512);
if ( status != 0 ) {
printf("Verify Error!: WRITE SECTOR(S), READ SECTOR(S)\n");
}
///////////////////////////////////
// UltraDMA transfer preparation //
///////////////////////////////////
// Sets transfer mode to UltraDMA transfer Mode0 using SET_FEATURE command.
Set_Transfer_Mode(0, UDMA_MODE0);
// Sets UltraDMA Timing1 and UltraDMA Timing2 registers of configuration
// register of PCI-IDE ASIC board.
Set_UDMA_Timing(IDE_UDMA_TIMING1_IDE33MHz_MODE0, IDE_UDMA_TIMING2_IDE33MHz_MODE0);
////////////////////////////////
// PCI->IDE UltraDMA transfer //
////////////////////////////////
// Sets descriptor table referenced by PCI-IDE ASIC board during UltraDMA transfer.
dsc_tbl = (DISCRIPTOR_TABLE*)(BASE_ADDRESS 0x02000000)
Содержание V850E/MA1
Страница 2: ...Application Note U17121EJ1V1AN 2 MEMO ...