/* C language header file for sample programs for the DM5406. Real Time Devices, Inc. Box 906 State College, PA 16804 Voice: 814-234-8087 FAX: 814-234-5218 Compiler: Turbo C (r) version 1.0, 2.0 Turbo C++ (r) version 1.0 Borland C++ (r) version 2.0 Last update: 9/4/93 */ /* The following constants define the location of the various registers on the DM5406 The are included to make the code more readable; statements such as: outportb(BaseAddress + START_CONVERSION, 0); are less obscure than: outportb(516, 0); */ #define STATUS_BYTE 0 #define START_CONVERSION 0 #define READ_DATA 1 #define DAC_UPDATE 1 #define CLEAR_BOARD 2 #define SCAN_BURST_SLCT 3 #define CHANNEL_SLCT 5 #define GAIN_SLCT 5 #define IRQ_ENABLE 5 #define EXT_TRIG_ENABLE 5 #define PPI_A 4 #define PPI_B 5 #define PPI_C 6 #define PPI_CTRL 7 #define TIMER_A 8 #define TIMER_B 9 #define TIMER_C 10 #define TIMER_CTRL 11 #define DAC1_LSB 12 #define DAC1_MSB 13 #define DAC2_LSB 14 #define DAC2_MSB 15 #define CLEAR_IRQ_STAT 14 #define CLEAR_DMA_DONE 15 #define PPI_PORT_A 0 #define PPI_PORT_B 1 #define PPI_PORT_C 2 #define DISABLE_BOTH 0 #define SCAN_ENABLE 1 #define BURST_ENABLE 2 #define SOURCE_AD_START 0 #define SOURCE_DMA_DONE 1 #define SOURCE_TRIGGER 2 #define SOURCE_PACER_CLOCK 3 /* Norton's Additions... */ #define BaseAddress 0x380 /* These are the bits that pertain to the A/D address and gain */ #define AD_MASK 0x3F #define GAIN_MASK 0x30 #define GAIN_1 0 #define GAIN_2 0x10 #define GAIN_4 0x20 #define GAIN_8 0x30 #define DM_INPUT 1 #define DM_OUTPUT 0 unsigned short DM_DoConversion( void ); unsigned short DM_Read_AtoD( unsigned char Channel ); void DM_Reset(void); void DM_DAC_Write( unsigned char DAC, unsigned short Value ); unsigned char DM_ReadDigitalIO(unsigned char InputPort); void DM_ConfigureIOPorts(unsigned char PortA, unsigned char PortC); void DM_WriteDigitalIO(unsigned char OutputPort, unsigned char v);