void WriteDataToRegister( DataRegisterType CurrentRegister, OutputValueType OutputValue )
{
High = (unsigned long)OutputValue + 8388608L;
High = _lrotr(High,16);
High = High & 0x0000ff;
Middle = OutputValue + 8388608L;
Middle = _lrotr(Middle,8);
Middle = Middle & 0x0000ff;
Low = (OutputValue + 8388608L) & 0x0000ff;
WRITE_PORT_UCHAR( CurrentRegister , (unsigned char)Low ) ;
WaitForTimeoutDelay(TIMEOUT_DELAY) ;
WRITE_PORT_UCHAR( CurrentRegister , (unsigned char)Middle ) ;
WaitForTimeoutDelay(TIMEOUT_DELAY) ;
WRITE_PORT_UCHAR( CurrentRegister , (unsigned char)High ) ;
WaitForTimeoutDelay(TIMEOUT_DELAY) ;
WRITE_PORT_UCHAR( CurrentRegister , (unsigned char)Low ) ;
WaitForTimeoutDelay(TIMEOUT_DELAY) ;
WRITE_PORT_UCHAR( CurrentRegister + 1 , 8 ) ;
WaitForTimeoutDelay(TIMEOUT_DELAY) ;
}
|