Sensoray 417 Manuel d'utilisateur Page 12

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 37
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 11
11 Sensoray Model 417
Chapter 4 Programming
C Language Drivers
//======================================================
// Write a command byte to the 417 command register.
//======================================================
void adSendByte ( short base_port, short cmd_byte )
{
while ( ( inp( base_port + 1 ) & 128 ) == 0 ) ; // wait for CRMT
outp ( base_port, cmd_byte ) ; // send the byte
}
//======================================================
// Read a data byte from the 417 data register
//======================================================
short adReadByte ( short base_port )
{
while ( ( inp ( base_port + 1 ) & 64 ) == 0 ) ; // wait for DAV
return ( inp ( base_port ) ) ; // read the byte
}
//======================================================
// Write 16-bit value to the 417
//======================================================
void adSendByte ( short base_port, short cmd_word )
{
adSendByte ( base_port, cmd_word >> 8 ) ; // send high byte
adSendByte ( base_port, cmd_word ) ; // send low byte
}
//======================================================
// Read 16-bit value from the 417
//======================================================
short adReadWord ( short base_port )
{
short hiByte = adReadByte ( base_port ) << 8 ; // read hi byte
return ( hiByte | adReadByte ( base_port ) ) ; // rd/concat lo byte
}
Vue de la page 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 36 37

Commentaires sur ces manuels

Pas de commentaire