2 * Copyright (C) 2005 Meilhaus Electronic GmbH (support@meilhaus.de)
4 * Source File : medriver.h
5 * Author : GG (Guenter Gebhardt) <g.gebhardt@meilhaus.de>
6 * Author: Krzysztof Gantzke <k.gantzke@meilhaus.de>
14 #include "medefines.h"
20 /*===========================================================================
21 Functions to access the driver system
22 =========================================================================*/
24 int meOpen(int iFlags);
25 int meClose(int iFlags);
27 int meLockDriver(int iLock, int iFlags);
28 int meLockDevice(int iDevice, int iLock, int iFlags);
29 int meLockSubdevice(int iDevice, int iSubdevice, int iLock, int iFlags);
31 /*===========================================================================
32 Error handling functions
33 =========================================================================*/
35 int meErrorGetLastMessage(char *pcErrorMsg, int iCount);
36 int meErrorGetMessage(int iErrorCode, char *pcErrorMsg, int iCount);
37 int meErrorSetDefaultProc(int iSwitch);
38 int meErrorSetUserProc(meErrorCB_t pErrorProc);
41 /*===========================================================================
42 Functions to perform I/O on a device
43 =========================================================================*/
45 int meIOIrqSetCallback(
48 meIOIrqCB_t pCallback,
49 void *pCallbackContext,
73 int meIOResetDevice(int iDevice, int iFlags);
74 int meIOResetSubdevice(int iDevice, int iSubdevice, int iFlags);
76 int meIOStreamFrequencyToTicks(
95 int meIOSingle(meIOSingle_t *pSingleList, int iCount, int iFlags);
100 meIOStreamConfig_t *pConfigList,
102 meIOStreamTrigger_t *pTrigger,
103 int iFifoIrqThreshold,
105 int meIOStreamNewValues(
125 int meIOStreamStart(meIOStreamStart_t *pStartList, int iCount, int iFlags);
126 int meIOStreamStop(meIOStreamStop_t *pStopList, int iCount, int iFlags);
127 int meIOStreamStatus(
134 int meIOStreamSetCallbacks(
137 meIOStreamCB_t pStartCB,
138 void *pStartCBContext,
139 meIOStreamCB_t pNewValuesCB,
140 void *pNewValuesCBContext,
141 meIOStreamCB_t pEndCB,
144 int meIOStreamTimeToTicks(
154 /*===========================================================================
155 Functions to query the driver system
156 =========================================================================*/
158 int meQueryDescriptionDevice(int iDevice, char *pcDescription, int iCount);
160 int meQueryInfoDevice(
171 int meQueryNameDevice(int iDevice, char *pcName, int iCount);
172 int meQueryNameDeviceDriver(int iDevice, char *pcName, int iCount);
174 int meQueryNumberDevices(int *piNumber);
175 int meQueryNumberSubdevices(int iDevice, int *piNumber);
176 int meQueryNumberChannels(int iDevice, int iSubdevice, int *piNumber);
177 int meQueryNumberRanges(
183 int meQueryRangeByMinMax(
191 int meQueryRangeInfo(
200 int meQuerySubdeviceByType(
206 int meQuerySubdeviceType(
211 int meQuerySubdeviceCaps(
215 int meQuerySubdeviceCapsArgs(
222 int meQueryVersionLibrary(int *piVersion);
223 int meQueryVersionMainDriver(int *piVersion);
224 int meQueryVersionDeviceDriver(int iDevice, int *piVersion);
227 /*===========================================================================
228 Common utility functions
229 =========================================================================*/
231 int meUtilityExtractValues(
235 meIOStreamConfig_t *pConfigList,
236 int iConfigListCount,
238 int *piChanBufferCount);
239 int meUtilityDigitalToPhysical(
247 int meUtilityDigitalToPhysicalV(
255 double *pdPhysicalBuffer);
256 int meUtilityPhysicalToDigital(
262 int meUtilityPWMStart(
271 int meUtilityPWMStop(int iDevice,
273 int meUtilityPWMRestart(
280 /*===========================================================================
281 Load configuration from file into driver system
282 =========================================================================*/
284 int meConfigLoad(char *pcConfigFile);
287 /*===========================================================================
288 Functions to query a remote driver system
289 =========================================================================*/
291 int meRQueryDescriptionDevice(
297 int meRQueryInfoDevice(
309 int meRQueryNameDevice(
315 int meRQueryNumberDevices(char *location, int *piNumber);
316 int meRQueryNumberSubdevices(char *location, int iDevice, int *piNumber);
317 int meRQueryNumberChannels(
322 int meRQueryNumberRanges(
329 int meRQueryRangeInfo(
339 int meRQuerySubdeviceType(