NEC V850E/MA1 Application Note page 95

32-bit single-chip microcontrollers pci host bridge macro
Hide thumbs Also See for V850E/MA1:
Table of Contents

Advertisement

wait(TIMER400ns);
idestat = *IDEREG_ALT_STATUS;
*IDEREG_BUSMASTER_START_STOP |= 0x01;
status = Wait_IDE_BMEND();
if ( status != 0 ) {
return STATUS_TIMEOUT_BMEND;
}
status = Wait_IDE_INTRQ();
if ( status != 0 ) {
return STATUS_TIMEOUT_INTRQ;
}
idestat = *IDEREG_ALT_STATUS;
idestat = *IDEREG_STATUS;
if ( idestat & IDEREG_ERROR_ERR_BIT ) {
return STATUS_IDE_ERROR(*IDEREG_ERROR);
}
return STATUS_SUCCESS;
}
/////////////////////////////////////////////////////////////////
// Function name: ATA_Soft_Reset
// Function: Performs software reset.
// Argument: None
// Return value:
//
STATUS_SUCCESS : Normal end
//
STATUS_TIMEOUT_BSY0 : BSY=0 timeout error end
//
/////////////////////////////////////////////////////////////////
int ATA_soft_reset(void)
{
int status;
*IDEREG_DEVICE_CONTROL = 0x04;
wait(TIMER5ms);
*IDEREG_DEVICE_CONTROL = 0x00;
wait(TIMER5ms);
status = Wait_IDE_BSY0();
if ( status != 0 ) {
return STATUS_TIMEOUT_BSY0;
}
return STATUS_SUCCESS;
}
CHAPTER 5 APPLICATION EXAMPLES
// Reset execution
// Wait 5 ms
// Reset release
// Wait 5 ms
// Wait until BSY=0
// Timeout error end
Application Note U17121EJ1V1AN
// Wait 400 ns
// Alt Status register empty read
// Bus Master Start
// BMEND timeout error end
// Wait for INTRQ assert
// INTRQ timeout error end
// Alt Status register empty read
// Status register read
// Error end (after command execution)
// Normal end
//
//
//
//
//
//
//
95

Advertisement

Table of Contents
loading

This manual is also suitable for:

V850e/ma2V850e/ma3V850e/me2

Table of Contents