Sensoray 417 Manual de usuario Pagina 12

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 37
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
}
Vista de pagina 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 36 37

Comentarios a estos manuales

Sin comentarios