Intel 386 Manual do Utilizador Página 282

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 691
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 281
10-39
TIMER/COUNTER UNIT
/*****************************************************************************
ReadCounter:
Description:
This function performs a simple read operation on the specified
timer. However, because the counter value is not latched, the timer
must be disabled, read, and then re-enabled.
Parameters:
Timer Unit number of Timer whose count is being read
Returns:
Counter value that was read
Assumptions:
This function assumes that the R/W format is configured to be LSB
first, then MSB
Syntax:
WORD Counter_Value;
Counter_Value = ReadCounter(TMR0);
Real/Protected Mode:
No changes required
*****************************************************************************/
WORD ReadCounter(BYTE Timer)
{
BYTE CountL, CountH;
WORD Count = 0;
DisableTimer();
switch (Timer) {
case TMR_0:
CountL = _GetEXRegByte(TMR0);
CountH = _GetEXRegByte(TMR0);
break;
case TMR_1:
CountL = _GetEXRegByte(TMR1);
CountH = _GetEXRegByte(TMR1);
break;
Vista de página 281
1 2 ... 277 278 279 280 281 282 283 284 285 286 287 ... 690 691

Comentários a estes Manuais

Sem comentários