Reconfigurable fpga with 16 x 16 bit analog input, 8 x 16 bit analog output and 32 digital i/o (95 pages)
Summary of Contents for Tews Technologies TDRV006-SW-82
Page 1
Linux Device Driver 64 Digital Inputs/Outputs (Bit I/O) Version 2.0.x User Manual Issue 2.0.1 December 2017 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek, Germany Phone: +49 (0) 4101 4058 0 Fax: +49 (0) 4101 4058 19 e-mail: info@tews.com www.tews.com...
Page 2
However TEWS TECHNOLOGIES GmbH reserves the right to change the product described in this document at any time without notice. TEWS TECHNOLOGIES GmbH is not liable for any damage arising out of the application or use of the device described herein.
1 Introduction The TDRV006-SW-82 Linux device driver allows the operation of the TDRV006 compatible PMCs conforming to the Linux I/O system specification. The TDRV006-SW-82 device driver supports the following features: Reading input I/O value Writing to output buffers (masked and unmasked) ...
HAL library source file COPYING Copy of the GNU Public License (GPL) In order to perform an installation, extract all files of the archive TDRV006-SW-82-SRC.tar.gz to the desired target directory. The command ‘tar -xzvf TDRV006-SW-82-SRC.tar.gz’ will extract the files into the local directory.
Be sure that the driver is not opened by any application program. If opened you will get the response ``tdrv006drv: Device or resource busy`` and the driver will still remain in the system until you close all opened files and execute modprobe -r again. TDRV006-SW-82 - Linux Device Driver Page 6 of 31...
This symbol specifies the size of the interrupt routine event record queue. If you have input event loss during multiple Input Event jobs, please double the certain value. TDRV006_MAX_EVENTWAIT_JOBS This symbol specifies the maximum number of concurrent jobs waiting for Input Events. TDRV006-SW-82 - Linux Device Driver Page 7 of 31...
TDRV006 device is named /dev/tdrv006_0, the second /dev/tdrv006_1, and so on. EXAMPLE #include <tdrv006api.h> TDRV006_HANDLE hdl; ** open the specified device hdl = tdrv006Open(“/dev/tdrv006_0”); if (hdl == NULL) /* handle open error */ TDRV006-SW-82 - Linux Device Driver Page 8 of 31...
Page 9
A device handle, or NULL if the function fails. An error code will be stored in errno. ERROR CODES The error codes are stored in errno. The error code is a standard error code set by the I/O system. TDRV006-SW-82 - Linux Device Driver Page 9 of 31...
This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. EXAMPLE #include <tdrv006api.h> TDRV006_HANDLE hdl; TDRV006_STATUS result; ** close the device result = tdrv006Close(hdl); if (result != TDRV006_OK) /* handle close error */ TDRV006-SW-82 - Linux Device Driver Page 10 of 31...
Page 11
On success, TDRV006_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TDRV006_ERR_INVALID_HANDLE The specified device handle is invalid TDRV006-SW-82 - Linux Device Driver Page 11 of 31...
This argument points to a buffer where the current value of I/O lines 32 up to 63 will be returned. Bit 0 returns the value of I/O line 32, bit 1 the value of I/O line 33, and so on. TDRV006-SW-82 - Linux Device Driver Page 12 of 31...
Page 13
On success, TDRV006_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TDRV006_ERR_INVAL A NULL pointer is referenced for an input value TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006-SW-82 - Linux Device Driver Page 13 of 31...
This argument specifies the output value for I/O lines 32 up to 63. Bit 0 specifies the value of I/O line 32, bit 1 the value of I/O line 33, and so on. TDRV006-SW-82 - Linux Device Driver Page 14 of 31...
Page 15
On success, TDRV006_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006-SW-82 - Linux Device Driver Page 15 of 31...
A set bit (1) means the I/O line shall be set to the value specified by out31_0. A reset bit (0) means that the old output value will not be changed. TDRV006-SW-82 - Linux Device Driver Page 16 of 31...
Page 17
On success, TDRV006_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006-SW-82 - Linux Device Driver Page 17 of 31...
This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. outputLine This argument specifies a data bit that shall be set. Allowed values are 0 up to 63. TDRV006-SW-82 - Linux Device Driver Page 18 of 31...
Page 19
On success, TDRV006_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TDRV006_ERR_INVAL An invalid line number is specified TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006-SW-82 - Linux Device Driver Page 19 of 31...
This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. outputLine This argument specifies data bit that shall be reset. Allowed values are 0 up to 63. TDRV006-SW-82 - Linux Device Driver Page 20 of 31...
Page 21
On success, TDRV006_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TDRV006_ERR_INVAL An invalid line number is specified TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006-SW-82 - Linux Device Driver Page 21 of 31...
This argument specifies the direction of I/O lines 32 up to 63. Bit 0 specifies the direction of I/O line 32, bit 1 the direction of I/O line 33, and so on. A set bit (1) configures the line for output, an unset bit (0) configures input (tri-state). TDRV006-SW-82 - Linux Device Driver Page 22 of 31...
Page 23
On success, TDRV006_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006-SW-82 - Linux Device Driver Page 23 of 31...
This argument specifies the time the function is willing to wait for the specified transition. If the specified time has passed the function will return with an error. The timeout is specified in milliseconds. A timeout value of ‘-1’ specifies that the function will never timeout. TDRV006-SW-82 - Linux Device Driver Page 24 of 31...
Page 25
ERROR CODES Error Code Description TDRV006_ERR_INVAL Invalid parameter specified TDRV006_ERR_BUSY The number of waiting processes exceeded the maximum number TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006_ERR_TIMEOUT Timeout occurred. TDRV006-SW-82 - Linux Device Driver Page 25 of 31...
This argument specifies the time the function is willing to wait for the specified transition. If the specified time has passed the function will return with an error. The timeout is specified in milliseconds. A timeout value of ‘-1’ specifies that the function will never timeout. TDRV006-SW-82 - Linux Device Driver Page 26 of 31...
Page 27
ERROR CODES Error Code Description TDRV006_ERR_INVAL Invalid parameter specified TDRV006_ERR_BUSY The number of waiting processes exceeded the maximum number TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006_ERR_TIMEOUT Timeout occurred. TDRV006-SW-82 - Linux Device Driver Page 27 of 31...
This argument specifies the time the function is willing to wait for the specified transition. If the specified time has passed the function will return with an error. The timeout is specified in milliseconds. A timeout value of ‘-1’ specifies that the function will never timeout. TDRV006-SW-82 - Linux Device Driver Page 28 of 31...
Page 29
ERROR CODES Error Code Description TDRV006_ERR_INVAL Invalid parameter specified TDRV006_ERR_BUSY The number of waiting processes exceeded the maximum number TDRV006_ERR_INVALID_HANDLE The device handle is invalid TDRV006_ERR_TIMEOUT Timeout occurred. TDRV006-SW-82 - Linux Device Driver Page 29 of 31...
Need help?
Do you have a question about the TDRV006-SW-82 and is the answer not in the manual?
Questions and answers