Intel 386 Manual do Utilizador Página 281

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 691
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 280
Intel386™ EX EMBEDDED PROCESSOR USER’S MANUAL
10-38
Returns:
Counter Value of specified timer
Assumptions:
This function assumes that the R/W format is configured to be LSB
first, then MSB
Syntax:
WORD Counter_Value;
Counter_Value = CounterLatch(TMR_1);
Real/Protected Mode:
No changes required
*****************************************************************************/
WORD CounterLatch( BYTE Timer )
{
BYTE control_word = 0;
BYTE CounterL, CounterH;
WORD Counter;
control_word = Timer << 6;
control_word &= 0xc0;
_SetEXRegByte(TMRCON, control_word); //Select which counter
switch (Timer) {
case TMR_0:
CounterL = _GetEXRegByte(TMR0);
CounterH = _GetEXRegByte(TMR0);
break;
case TMR_1:
CounterL = _GetEXRegByte(TMR1);
CounterH = _GetEXRegByte(TMR1);
break;
case TMR_2:
CounterL = _GetEXRegByte(TMR2);
CounterH = _GetEXRegByte(TMR2);
break;
}
Counter = (((WORD)CounterH << 8) + CounterL);
return(Counter);
}/* CounterLatch */
Vista de página 280
1 2 ... 276 277 278 279 280 281 282 283 284 285 286 ... 690 691

Comentários a estes Manuais

Sem comentários