⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drvr6430.h

📁 rt采集卡dos下dm6430驱动源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/***************************************************************************

	FILE NAME: DRVR6430.H

	FILE DESCRIPTION:

   Header for the main part of the DM6430 driver

	PROJECT NAME:  DM6430 DOS Driver

	DRIVER VERSION: 1.1

	COMPILER: Borland C++ 3.1

	TARGET: Real-Mode DOS

	Copyright 2003 RTD Embedded Technologies

***************************************************************************/

#if !defined(__DRVR6430_H)
#define __DRVR6430_H

typedef unsigned char uchar8;			// 8 bit unsigned integer.
typedef char char8;						// 8 bit signed integer.
typedef unsigned int uint16;			// 16 unsigned integer.
typedef int int16;						// 16 bit signed integer.
typedef float float32;					// 32 bit floating point.

// Structure for A/D Table
typedef struct
			{
			 uint16 Channel;
			 uint16 Gain;
			 uint16 Se_Diff;
			 uint16 Pause;
			 uint16 Skip;
			} ADTableRow;

extern uint16  BaseAddress;


char* TitleString6430(void);




//*************************************************************************
//	SetBaseAddress
//
//	This routine is used to set the variable BaseAddress.
//
//	Parameters:
//		Address:
//*************************************************************************
void SetBaseAddress(uint16 Address);




//*************************************************************************
//	InitBoard6430
//
//	This Routine Should allways be called first.
//	This clears the board and varibles the driver uses.
//
//	Parameters:
//		None
//*************************************************************************
void InitBoard6430(void);




//************************ CLEAR ROUTINES *********************************
//	Read & Write at BA + 0

//*************************************************************************
//	ClearRegister6430
//
//	This routine is used to write the clear register with one command
// and issue a clear to the board.
//
//	Parameters:
//		ClearValue:		1 - 65535
//*************************************************************************
void ClearRegister6430(uint16 ClearValue);




//*************************************************************************
//	ClearBoard6430
//
//	This routine is used to clear board.
//
//	Parameters:
//		None
//*************************************************************************
void ClearBoard6430(void);




//*************************************************************************
//	ClearADFIFO6430
//
//	This routine is used to clear all the data from the A/D FIFO.
//
//	Parameters:
//		None
//*************************************************************************
void ClearADFIFO6430(void);




//*************************************************************************
//	ClearADDMADone6430
//
//	This routine is used to clear the A/D DMA done status bit.
//
//	Parameters:
//		None
//*************************************************************************
void ClearADDMADone6430(void);




//*************************************************************************
//	ClearChannelGainTable6430
//
//	This routine is used to clear both the AD Table and the Digital Table.
//
//	Parameters:
//		None
//*************************************************************************
void ClearChannelGainTable6430(void);




//*************************************************************************
//	ResetChannelGainTable6430
//
//	This routine is used to reset both the AD Table and the Digital Table
//	pointers to the first location in the table.
//
//	Parameters:
//		None
//*************************************************************************
void ResetChannelGainTable6430(void);




//*************************************************************************
//	ClearDINFIFO6430
//
//	This routine is used to clear the Digital Input FIFO.
//
//	Parameters:
//		None
//*************************************************************************
void ClearDINFIFO6430(void);




//*************************************************************************
//	ClearIRQ16430
//
//	This routine is used to clear the IRQ 1 circuitry and status bit.
//
//	Parameters:
//		None
//*************************************************************************
void ClearIRQ16430(void);




//*************************************************************************
//	ClearIRQ26430
//
//	This routine is used to clear the IRQ 2 status bit.
//
//	Parameters:
//		None
//*************************************************************************
void ClearIRQ26430(void);




//************************ QUERY ROUTINES *********************************
//	Read at BA + 2

//*************************************************************************
//	ReadStatus6430
//
//	This routine returns the status from the board.
//
//	Returns:		16 bit unsigned integer
//*************************************************************************
uint16 ReadStatus6430(void);




//*************************************************************************
//	IsADFIFOEmpty6430
//
//	This routine checks to see if the A/D FIFO is empty.
//
//	Returns:				1 if FIFO is empty
//							0 if FIFO is not empty
//*************************************************************************
uint16 IsADFIFOEmpty6430(void);




//*************************************************************************
//	IsADFIFOFull6430
//
//	This routine checks to see if the A/D FIFO is full.
//
//	Returns:				1 if FIFO is full
//							0 if FIFO is not full
//*************************************************************************
uint16 IsADFIFOFull6430(void);




//*************************************************************************
//	IsADHalted6430
//
//	This routine checks to see if the AD is halted.
//
//	Returns:				1 if AD is halted
//							0 if AD is not halted
//*************************************************************************
uint16 IsADHalted6430(void);




//*************************************************************************
//	IsADConverting6430
//
//	This routine checks to see if the AD converting.
//
//	Returns:				1 if AD is converting
//							0 if AD is not converting
//*************************************************************************
uint16 IsADConverting6430(void);




//*************************************************************************
//	IsADDMADone6430
//
//	This routine checks to see if the A/D DMA transfer is done.
//
//	Returns:				1 if DMA is done
//							0 if DMA is not done
//*************************************************************************
uint16 IsADDMADone6430(void);




//*************************************************************************
//	IsFirstADDMADone6430
//
//	This routine checks to see if the A/D DMA transfer is done on the first
//	channel.
//
//	Returns:				1 if DMA is done
//							0 if DMA is not done
//*************************************************************************
uint16 IsFirstADDMADone6430(void);




//*************************************************************************
//	IsBurstClockOn6430
//
//	This routine checks to see if the burst clock is enabled.
//
//	Returns:				1 if Burst Clock is on
//							0 if Burst Clock is off
//*************************************************************************
uint16 IsBurstClockOn6430(void);




//*************************************************************************
//	IsPacerClockOn6430
//
//	This routine checks to see if the pacer clock is running.
//
//	Returns:				1 if Pacer Clock is on
//							0 if Pacer Clock is off
//*************************************************************************
uint16 IsPacerClockOn6430(void);




//*************************************************************************
//	IsAboutTrigger6430
//
//	This routine checks to see if the about trigger has occurred.
//
//	Returns:				1 if trigger has occurred
//							0 if trigger has not occurred
//*************************************************************************
uint16 IsAboutTrigger6430(void);




//*************************************************************************
//	IsDigitalIRQ6430
//
//	This routine checks to see if the digital I/O chip has generated
//	an interrupt.
//
//	Returns:				1 if IRQ has been generated
//							0 if no IRQ
//*************************************************************************
uint16 IsDigitalIRQ6430(void);




//*************************************************************************
//	IsDINFIFOEmpty6430
//
//	This routine checks to see if the Digital Input FIFO is empty.
//
//	Returns:				1 if FIFO is empty
//							0 if FIFO is not empty
//*************************************************************************
uint16 IsDINFIFOEmpty6430(void);




//*************************************************************************
//	IsDINFIFOHalf6430
//
//	This routine checks to see if the Digital Input FIFO is half full.
//
//	Returns:				1 if FIFO is half full
//							0 if FIFO is not half full
//*************************************************************************
uint16 IsDINFIFOHalf6430(void);




//*************************************************************************
//	IsDINFIFOFull6430
//
//	This routine checks to see if the Digital Input FIFO is full.
//
//	Returns:				1 if FIFO is full
//							0 if FIFO is not full
//*************************************************************************
uint16 IsDINFIFOFull6430(void);




//*************************************************************************
//	IsIRQ16430
//
//	This routine checks the IRQ 1 status bit.
//
//	Returns:				1 if IRQ has been generated
//							0 if no IRQ
//*************************************************************************
uint16 IsIRQ16430(void);




//*************************************************************************
//	IsIRQ26430
//
//	This routine checks the IRQ 2 status bit.
//
//	Returns:				1 if IRQ has been generated
//							0 if no IRQ
//*************************************************************************
uint16 IsIRQ26430(void);




//************************ CONTROL REGISTER *******************************
//	Write at BA + 2

//*************************************************************************
//	LoadControlRegister6430
//
//	This routine loads the control register with one write operation.
//
//	Parameters:
//		Value:		0 - 65535
//*************************************************************************
void LoadControlRegister6430(uint16 Value);




//*************************************************************************
//	EnableTables6430
//
//	This Routine Enables and Disables both the AD and Digital Tables.
//
//	Parameters:
//			Enable_AD_Table:			0 = disable
//    	                	   	1 = enable
// 		Enable_Digital_Table:	0 = disable
//    	                  	 	1 = enable
//*************************************************************************
void EnableTables6430(uint16 Enable_AD_Table, uint16 Enable_Digital_Table);




//*************************************************************************
//	ChannelGainDataStore6430
//
//	This routine enables the Channel Gain Data Store feature of the board.
//
//	Parameters:
//			Enable:		0 = Disable
//							1 = Enable
//*************************************************************************
void ChannelGainDataStore6430(uint16 Enable);




//*************************************************************************
//	SelectTimerCounter6430
//
//	This routine selects one of the four 8254 timer chips.
//
//	Parameters:
//		Select:	0 = Clock TC (Pacer & Burst clocks)
//					1 = User TC (A/D sample counter & User timer/counters)
//					2 = reserved
//					3 = reserved
//*************************************************************************
void SelectTimerCounter6430(uint16 Select);




//*************************************************************************
//	SetADSampleCounterStop6430
//
//	This routine enables and disables the A/D sample counter stop bit.
//
//	Parameters:
//		Enable:	0 = Enable
//  				1 = Disable
//*************************************************************************
void SetSampleCounterStop6430(uint16 Enable);




//*************************************************************************
//	SetADPauseEnable6430
//
//	This routine enables and disables the A/D pause bit.
//
//	Parameters:
//		Enable:	0 = Enable
//  				1 = Disable
//*************************************************************************
void SetPauseEnable6430(uint16 Enable);




//*************************************************************************
//	SetADDMA6430
//
//	This routine sets the A/D DMA channels.
//
//	Parameters:
//		Channel1:	0 = disabled
//  					5 = DRQ 5
//						6 = DRQ 6
//						7 = DRQ 7
//
//		Channel2:	0 = disabled
//  					5 = DRQ 5
//						6 = DRQ 6
//						7 = DRQ 7
//*************************************************************************
void SetADDMA6430(uint16 Channel1, uint16 Channel2);




//************************ READ A/D DATA **********************************
//	Read at BA + 4

//*************************************************************************
//	ReadADData6430
//
//	This Routine Reads the Data from the FIFO.
//
//	Returns signed 16 bit AD Data.
//*************************************************************************
int16  ReadADData6430(void);




//*************************************************************************
//	ReadChannelGainDataStore6430
//
//	This Routine Reads the Channel/Gain Data from the FIFO when the
// Channel Gain Data Store feature of the board is enabled.
//
//	Returns a 16 bit value: Bottom 8 bits = A/D table value
//									Upper 8 bits  = digital table value
//*************************************************************************
uint16  ReadChannelGainDataStore6430(void);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -