Sensoray 7429 Manual de usuario Pagina 17

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 48
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 16
'
' BasePort% is globally visible within this module
'
COMMON SHARED BasePort%'7429 base port address
'
' This subprogram establishes the 7429 base port address for subsequent
' driver calls. Call this procedure before using any other sample
' drivers described in this manual.
'
SUB SetBasePort (Address%)
BasePort% = Address%
END SUB
'
' This subprogram sends a byte to the 7429 command register:
'
SUB SendByte (ByteValue%)
DO: LOOP WHILE (INP(BasePort% + 1) AND 128) = 0'wait for CRMT
OUT BasePort%, ByteValue% 'write command register
END SUB
'
' This function reads a byte from the 7429 data register:
'
FUNCTION ReadByte%
DO: LOOP WHILE (INP(BasePort% + 1) AND 64) = 0'wait for DAV
ReadByte% = INP(BasePort%) 'read data register
END FUNCTION
You may also find the following procedures useful. The first procedure reads a 16-bit
value from the coprocessor, adjusting the sign if necessary. The second procedure sends
a 16-bit value to the coprocessor. Note that these routines call the above procedures.
'
' This function reads a 16-bit value from the coprocessor board.
'
FUNCTION ReadWord%
Value& = ReadByte%(BasePort%)
Value& = Value& * 256 + ReadWord%(BasePort%)
IF Value& > 32767 THEN Value& = Value& - 65536&
ReadWord% = Value&
END FUNCTION
'
' This subprogram sends a 16-bit value to the coprocessor board.
'
SUB SendWord (Value%)
CALL SendByte(BasePort%, Value% \ 256)
CALL SendByte(BasePort%, Value% AND 255)
END SUB
Vista de pagina 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 ... 47 48

Comentarios a estos manuales

Sin comentarios