TDRV006-SW-42. VxWorks Device Driver. 64 Digital Inputs/Outputs (Bit I/O) Version 4.0.x. User Manual. Issue December 2017

Similar documents
TPMC500-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. 32 Channel 12 Bit ADC. Version 2.0.x. Issue 2.0.

TPMC851-SW-42. VxWorks Device Driver. Multifunction I/O (16 bit ADC/DAC, TTL I/O, Counter) Version 2.0.x. User Manual. Issue 2.0.

TIP700-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. Digital Output 24V DC. Version 2.0.x. Issue June 2008.

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1.

TPMC821-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. INTERBUS Master G4 PMC. Version 1.4. Issue 1.

TPMC901-SW-95. QNX4 - Neutrino Device Driver. User Manual. The Embedded I/O Company. 6/4/2 Channel Extended CAN-Bus PMC

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC

TDRV010-SW-95. QNX6 - Neutrino Device Driver. Isolated 2x CAN Bus. Version 1.0.x. User Manual. Issue September 2016

TPMC868-SW-42. VxWorks Device Driver. 16 Channel Serial PMC. Version 2.1.x. User Manual. Issue December 2011

TIP670-SW-95. QNX-Neutrino Device Driver. User Manual. The Embedded I/O Company. Digital I/O. Version 1.0.x. Issue August 2008.

CARRIER-SW-42. VxWorks Device Driver. IPAC Carrier. Version 4.2.x. User Manual. Issue July 2018

TPMC860-SW-82. Linux Device Driver. 4 Channel Isolated Serial Interface RS232 Version 1.4.x. User Manual. Issue 1.4.

TIP610-SW-95 QNX-Neutrino Device Driver TIP610 16/20 Channel Digital I/O on SBS PCI40 Carrier

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

TIP114-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. 10 Channel Absolute Encoder Interface (SSI) Version 1.0.

TPMC550-SW-12 OS-9 for PPC Device Driver 8 (4) Channels Isolated 12-bit D/A

TPMC815 ARCNET PMC. User Manual. The Embedded I/O Company. Version 2.0. Issue 1.2 November 2002 D

TIP866-SW-95. QNX-Neutrino Device Driver. 8 Channel Serial Interface IP. Version 2.1.x. User Manual. Issue October 2009

TPMC Digital Inputs/Outputs (Bit I/O) Version 2.0. User Manual. Issue February 2014

TPMC815-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. ARCNET Controller. Version 1.0.x. Issue 1.0 May 2004

CARRIER-SW-82. Linux Device Driver. IPAC Carrier Version 2.2.x. User Manual. Issue November 2017

TDRV002-SW-82. Linux Device Driver. Multi-Channel Serial Interface Version 1.8.x. User Manual. Issue November 2017

TPMC816. Two Independent Channels Extended CAN Bus PMC Module. Version 2.2. User Manual. Issue August 2014

ICS-121. VxWORKS DEVICE DRIVER MANUAL

TCP866-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 8 Channel Serial PMC Version 1.0.x. Issue 1.

TIP120. Motion Controller with Incremental Encoder Interface. Version 1.0. User Manual. Issue August 2014

TPMC Channel Isolated Serial Interface RS232. Version 1.0. User Manual. Issue August 2017

TPMC310. Conduction Cooled PMC Isolated 2 x CAN Bus. Version 1.1. User Manual. Issue June 2014

TPMC Channel Motion Control. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 March 2003 D

TPMC680-SW-82. Linux Device Driver. 64 Digital Input/Output Version 1.1.x. User Manual. Issue April 2010

TIP550. Optically Isolated 8/4 Channel 12-bit D/A. Version 1.2. User Manual. Issue October 2009

TPMC810. Isolated 2x CAN Bus. Version 1.1. User Manual. Issue June 2009

TPMC /8 Digital Inputs (24V) 16/8 Digital Outputs (24V, 0.5A) Version 3.0. User Manual. Issue June 2014

TDRV011-SW-82. Linux Device Driver. Extended CAN Bus Version 1.0.x. User Manual. Issue April 2018

TIP815. ARCNET Controller. Version 1.0. User Manual. Issue September 2009

TCP Channel Serial Interface RS232 / RS422 cpci Module. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.

TPMC500. Optically Isolated 32 Channel 12 Bit ADC. Version 1.1. User Manual. Issue January 2014

TDRV009-SW-42. VxWorks Device Driver. High Speed Synch/Asynch Serial Interface. Version 4.0.x. User Manual. Issue 4.0.

TPMC Channel Isolated Serial Interface RS422/RS485. Version 1.0. User Manual. Issue July 2009

TXMC885. Four Channel 10/100/1000 Mbit/s Ethernet Adapter. Version 1.0. User Manual. Issue October 2011

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

TPCE260. PCI Express PMC Carrier. Version 1.0. User Manual. Issue August 2014

TPMC917-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 4 MB SRAM with Battery Backup and 4 Channel Serial Interface Version 1.0.

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

TPMC810-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. Isolated 2x CAN Bus Version 1.2.x. Issue 1.2.

spwr_base & spwr_chan

TPMC x ADC, 16x/0x DAC and 8x Digital I/O. Version 1.0. User Manual. Issue May 2018

TIP SERCOS IP with 2 Encoder Interfaces. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 September 2006 D

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, CA Fax Est.

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

TIP111. Motion Controller with Absolute Encoder Interface (SSI) User Manual. The Embedded I/O Company. Version 1.1. Issue 1.4 September 2005 D

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

TCP Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

VxWorks Device Driver Developer's Guide, 6.7. VxWorks. DEVICE DRIVER DEVELOPER'S GUIDE Volume 2: Writing Class-Specific Device Drivers 6.

DYNAMIC ENGINEERING 150 DuBois Suite C Santa Cruz, CA (831) Fax (831) Est.

Small Logger File System

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

tekdxfxsl FibreXtreme I/O Interface

TPMC / 16 Channels of 16 bit D/A. Version 1.0. User Manual. Issue December 2010

PCI, PCIe, mpcie, cpci, and PC104+ Plus Modules

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA Fax Est.

CS 550 Operating Systems Spring System Call

Lesson 3. The func procedure allows a user to choose the action upon receipt of a signal.

& WizChan. Driver Documentation

Using HAL Device Drivers with the Altera Monitor Program. 1 Introduction. For Quartus II 13.1

TIP Digital Inputs Optically Isolated Version 1.0 Revision A. User Manual. Issue May 1997 D

DRIVER AND LIBRARY FOR DB67 DSP BOARD DRIVER AND LIBRARY FOR DB67 DSP BOARD

NOTE: Debug and DebugSingle are the only MPI library configurations that will produce trace output.

RM0327 Reference manual

Anybus CompactCom. Host Application Implementation Guide. Doc.Id. HMSI Doc. Rev Connecting DevicesTM

DSP/BIOS LINK. Configurable TSK and SWI approach LNK 207 DES. Version <1.00>

The Kernel Abstraction

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 150 DuBois St Suite 3, Santa Cruz CA Fax Est.

DYNAMIC ENGINEERING 150 DuBois, Suite C, Santa Cruz, CA Fax Est

One 32-bit counter that can be free running or generate periodic interrupts

Experiment #3 Semaphores

To obtain the current global trace mask, call meitraceget(...). To modify the global trace mask, call meitraceset(...).

PCI, PCIe, cpci, and PC104+ Plus Modules

AN HONORS UNIVERSITY IN MARYLAND UMBC. AvrX. Yousef Ebrahimi Professor Ryan Robucci

Experiment 6 The Real World Interface

Pci3Ip, Pci5Ip, Pc104pIp, Pc104p4Ip, cpci2ip, cpci4ip and PcieCar IndustryPack Carrier Device Drivers

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

HUNT ENGINEERING HEL_UNPACK.LIB USER MANUAL

10. I/O System Library

1 Do not confuse the MPU with the Nios II memory management unit (MMU). The MPU does not provide memory mapping or management.

DYNAMIC ENGINEERING. 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

Sequential Search (Searching Supplement: 1-2)

TPMC Channel SSI, Incremental Encoder, Counter. Version 1.0. User Manual. Issue January 2017

CLD SC58x CDC Library v.1.00 Users Guide Users Guide Revision For Use With Analog Devices ADSP-SC58x Series Processors. Closed Loop Design, LLC

de facto standard C library Contains a bunch of header files and APIs to do various tasks

Core Engine. R XML Specification. Version 5, February Applicable for Core Engine 1.5. Author: cappatec OG, Salzburg/Austria

ssj1708 User s Manual Version 1.3 Revised February 2nd, 2009 Created by the J1708 Experts

Airence C Library v1.2 for Windows

Transcription:

The Embedded I/O Company TDRV006-SW-42 VxWorks Device Driver 64 Digital Inputs/Outputs (Bit I/O) Version 4.0.x User Manual Issue 4.0.0 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

TDRV006-SW-42 VxWorks Device Driver 64 Digital Inputs/Outputs (Bit I/O) Supported Modules: TPMC681 This document contains information, which is proprietary to TEWS TECHNOLOGIES GmbH. Any reproduction without written permission is forbidden. TEWS TECHNOLOGIES GmbH has made any effort to ensure that this manual is accurate and complete. 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. 2006-2017 by TEWS TECHNOLOGIES GmbH Issue Description Date 1.0.0 First Issue July 7, 2006 1.0.1 New Address TEWS LLC, ChangeLog.txt added in file list December 3, 2006 2.0.0 New ioctl() function: FIO_TDRV006_WRITE_MASKED, description for API and VxBus-support added, Address TEWS LLC removed January 26, 2010 2.0.1 Legacy vs. VxBus Driver modified March 26, 2010 2.1.0 New function tdrv006init() November 8, 2011 2.1.1 Formation of Document corrected November 9, 2011 3.0.0 API changed (header file, return value, handle) Legacy I/O function description removed February 20, 2012 4.0.0 VxWorks 7 support, new installation guide December 18, 2017 TDRV006-SW-42 VxWorks Device Driver Page 2 of 27

Table of Contents 1 INTRODUCTION... 4 1.1 Device Driver... 4 2 API DOCUMENTATION... 5 2.1 General Functions... 5 2.1.1 tdrv006open... 5 2.1.2 tdrv006close... 7 2.2 Device Access Functions... 9 2.2.1 tdrv006read... 9 2.2.2 tdrv006write... 11 2.2.3 tdrv006writemasked... 13 2.2.4 tdrv006setoutputline... 15 2.2.5 tdrv006clearoutputline... 17 2.2.6 tdrv006outputenable... 19 2.2.7 tdrv006waitforlowtohigh... 21 2.2.8 tdrv006waitforhightolow... 23 2.2.9 tdrv006waitforanytrans... 25 3 DEBUGGING AND DIAGNOSTIC... 27 TDRV006-SW-42 VxWorks Device Driver Page 3 of 27

1 Introduction 1.1 Device Driver The TDRV006-SW-42 VxWorks device driver software allows the operation of the TPMC681 PMC conforming to the VxWorks I/O system specification. The TDRV006-SW-42 release contains independent driver sources for the old legacy (pre-vxbus) and the new VxBus-enabled (GEN1 + GEN2) driver model. The VxBus-enabled driver is recommended for new developments with later VxWorks 6.x and 7.x releases and mandatory for VxWorks SMP systems. Both drivers, legacy and VxBus, share the same application programming interface (API) and invoke a mutual exclusion and binary semaphore mechanism to prevent simultaneous requests by multiple tasks from interfering with each other. The TDRV006-SW-42 device driver supports the following features: configure direction of I/O lines set output value of output lines read value of I/O lines wait for input line events The TDRV006-SW-42 supports the modules listed below: TPMC681 64 bit digital I/O PMC In this document all supported modules and devices will be called TDRV006. Specials for certain devices will be advised. To get more information about the features and use of the supported devices it is recommended to read the manuals listed below. TEWS TECHNOLOGIES VxWorks Device Drivers - Installation Guide TPMC681 User Manual TDRV006-SW-42 VxWorks Device Driver Page 4 of 27

2 API Documentation 2.1 General Functions 2.1.1 tdrv006open NAME tdrv006open() open a device. SYNOPSIS TDRV006_HANDLE tdrv006open ( char *DeviceName ) DESCRIPTION Before I/O can be performed to a device, a file descriptor must be opened by a call to this function. If the legacy TDRV006 driver is used, this function will also install the legacy driver and create devices with the first call. The VxBus TDRV006 driver will be installed automatically by the VxBus system. The tdrv006open function can be called multiple times (e.g. in different tasks). PARAMETER DeviceName This parameter points to a null-terminated string that specifies the name of the device. The first TDRV006 device is named /tdrv006/0, the second device is named /tdrv006/1 and so on. TDRV006-SW-42 VxWorks Device Driver Page 5 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE hdl; /* ** open file descriptor to device */ hdl = tdrv006open( /tdrv006/0 ); if (hdl == NULL) { /* handle open error */ } RETURNS 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-42 VxWorks Device Driver Page 6 of 27

2.1.2 tdrv006close NAME tdrv006close() close a device. SYNOPSIS TDRV006_STATUS tdrv006close ( TDRV006_HANDLE hdl ) DESCRIPTION This function closes previously opened devices. PARAMETER hdl 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 TDRV006_STATUS hdl; result; /* ** close file descriptor to device */ result = tdrv006close(hdl); if (result!= TDRV006_OK) { /* handle close error */ } TDRV006-SW-42 VxWorks Device Driver Page 7 of 27

RETURNS 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 TDRV006_ERR_INVALID_HANDLE Description The device handle is invalid TDRV006-SW-42 VxWorks Device Driver Page 8 of 27

2.2 Device Access Functions 2.2.1 tdrv006read NAME tdrv006read read current input value of the I/O lines SYNOPSIS TDRV006_STATUS tdrv006read ( TDRV006_HANDLE hdl, unsigned int *in31_0, unsigned int *in63_32 ) DESCRIPTION This function reads the current input value of the I/O lines. PARAMETER hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. in31_0 in63_32 This argument points to a buffer where the current value of I/O lines 0 up to 31 will be returned. Bit 0 returns the value of I/O line 0, bit 1 the value of I/O line 1, and so on. 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-42 VxWorks Device Driver Page 9 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS UINT32 UINT32 hdl; result; in_low; in_high; /* ** read current state of I/O lines */ result = tdrv006read(hdl, &in_low, &in_high); if (result!= TDRV006_OK) { /* handle error */ } else { printf( INPUT: 0x%08X%08X\n, in_high, in_low); } RETURN VALUE 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 TDRV006_ERR_INVAL TDRV006_ERR_INVALID_HANDLE Description A NULL pointer is referenced for an input value The device handle is invalid TDRV006-SW-42 VxWorks Device Driver Page 10 of 27

2.2.2 tdrv006write NAME tdrv006write set output value SYNOPSIS TDRV006_STATUS tdrv006write ( TDRV006_HANDLE hdl, unsigned int out31_0, unsigned int out63_32 ) DESCRIPTION This function sets the output value. The specified value will only appear on the I/O lines which are configured for output. PARAMETER hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. out31_0 out63_32 This argument specifies the output value for I/O lines 0 up to 31. Bit 0 specifies the value of I/O line 0, bit 1 the value of I/O line 1, and so on. 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-42 VxWorks Device Driver Page 11 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Set output value (set I/O lines 0-15) */ result = tdrv006write(hdl, 0x0000FFFF, 0x00000000); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVALID_HANDLE Description The device handle is invalid TDRV006-SW-42 VxWorks Device Driver Page 12 of 27

2.2.3 tdrv006writemasked NAME tdrv006writemasked set output value for specified I/O lines SYNOPSIS TDRV006_STATUS tdrv006writemasked ( TDRV006_HANDLE hdl, unsigned int out31_0, unsigned int out63_32, unsigned int mask31_0, unsigned int mask63_32 ) DESCRIPTION This function sets the output value for specified I/O lines. The mask specifies which I/O bits shall be set to the specified output value and which shall keep the current value. This specified value will only appear on the I/O lines which are configured for output. PARAMETER hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. out31_0 out63_32 mask31_0 This argument specifies the output value for I/O lines 0 up to 31. Bit 0 specifies the value of I/O line 0, bit 1 the value of I/O line 1, and so on. 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. This argument specifies the output mask for output lines 0 up to 31. Bit 0 specifies the mask for I/O line 0, bit 1 the value for I/O line 1, and so on. A set bit (1) means the bit 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-42 VxWorks Device Driver Page 13 of 27

mask63_32 This argument specifies the output mask for output lines 32 up to 63. Bit 0 specifies the mask for I/O line 32, bit 1 the value for I/O line 33, and so on. A set bit (1) means the bit shall be set to the value specified by out63_32. A reset bit (0) means that the old output value will not be changed. EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Set a part of the output value (set/reset I/O lines 0-15 and 48-63) */ result = tdrv006writemasked(hdl, 0x12345678, 0x87654321, 0x0000FFFF, 0xFFFF0000); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVALID_HANDLE Description The device handle is invalid TDRV006-SW-42 VxWorks Device Driver Page 14 of 27

2.2.4 tdrv006setoutputline NAME tdrv006setoutputline set a specified output line SYNOPSIS TDRV006_STATUS tdrv006setoutputline ( TDRV006_HANDLE hdl, int outputline ) DESCRIPTION This function sets a single bit of the output value. This specified value will only appear if the corresponding I/O line is configured for output. PARAMETER hdl 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-42 VxWorks Device Driver Page 15 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Set I/O line 32 */ result = tdrv006setoutputline(hdl, 32); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVAL TDRV006_ERR_INVALID_HANDLE Description An invalid line number is specified The device handle is invalid TDRV006-SW-42 VxWorks Device Driver Page 16 of 27

2.2.5 tdrv006clearoutputline NAME tdrv006clearoutputline reset a specified I/O line SYNOPSIS TDRV006_STATUS tdrv006clearoutputline ( TDRV006_HANDLE hdl, int outputline ) DESCRIPTION This function resets a single bit of the output value. This specified value will only appear if the corresponding I/O line is configured for output. PARAMETER hdl 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 reset. Allowed values are 0 up to 63. TDRV006-SW-42 VxWorks Device Driver Page 17 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Clear I/O line 32 */ result = tdrv006clearoutputline(hdl, 32); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVAL TDRV006_ERR_INVALID_HANDLE Description An invalid line number is specified The device handle is invalid TDRV006-SW-42 VxWorks Device Driver Page 18 of 27

2.2.6 tdrv006outputenable NAME tdrv006outputenable set the I/O line direction SYNOPSIS TDRV006_STATUS tdrv006outputenable ( TDRV006_HANDLE hdl, unsigned int enaout31_0, unsigned int enaout63_32 ) DESCRIPTION This function sets the I/O line direction. The value specifies which I/O lines shall be configured for output and which I/O lines should be used for input. PARAMETER hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. enaout31_0 This argument specifies the direction of I/O lines 0 up to 31. Bit 0 specifies the direction of I/O line 0, bit 1 the direction of I/O line 1, and so on. A set bit (1) configures the line for output, an unset bit (0) configures input (tri-state). enaout63_32 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-42 VxWorks Device Driver Page 19 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Enable I/O lines 0-8 for ouput */ result = tdrv006outputenable(hdl, 0x000001FF, 0x00000000); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVALID_HANDLE Description The device handle is invalid TDRV006-SW-42 VxWorks Device Driver Page 20 of 27

2.2.7 tdrv006waitforlowtohigh NAME tdrv006waitforlowtohigh wait until a low to high transition occurs SYNOPSIS TDRV006_STATUS tdrv006waitforlowtohigh ( TDRV006_HANDLE hdl, int inputline, int timeout ) DESCRIPTION This function waits until a low to high transition occurs on the specified input line or the specified timeout time has passed. PARAMETER hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. inputline timeout This argument specifies the input line which shall be observed for a low to high transition. Allowed values are 0 up to 63. 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. TDRV006-SW-42 VxWorks Device Driver Page 21 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Wait for a low-to-high transition on input line 0 ** Timeout after 1000 ms */ result = tdrv006waitforlowtohigh (hdl, 0, 1000); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVAL TDRV006_ERR_BUSY TDRV006_ERR_INVALID_HANDLE TDRV006_ERR_TIMEOUT Description Invalid parameter specified Another task is already waiting for a transition of the specified input line The device handle is invalid Timeout occurred. TDRV006-SW-42 VxWorks Device Driver Page 22 of 27

2.2.8 tdrv006waitforhightolow NAME tdrv006waitforhightolow wait until a high to low transition occurs SYNOPSIS TDRV006_STATUS tdrv006waithightolow ( TDRV006_HANDLE hdl, int inputline, int timeout ) DESCRIPTION This function waits until a high to low transition occurs on the specified input line or the specified timeout time has passed. PARAMETER hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. inputline timeout This argument specifies the input line which shall be observed for a high to low transition. Allowed values are 0 up to 63. 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. This time is specified in milliseconds. TDRV006-SW-42 VxWorks Device Driver Page 23 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Wait for a high-to-low transition on input line 0 ** Timeout after 1000 ms */ result = tdrv006waitforhightolow (hdl, 0, 1000); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVAL TDRV006_ERR_BUSY TDRV006_ERR_INVALID_HANDLE TDRV006_ERR_TIMEOUT Description Invalid parameter specified Another task is already waiting for a transition of the specified input line The device handle is invalid Timeout occurred. TDRV006-SW-42 VxWorks Device Driver Page 24 of 27

2.2.9 tdrv006waitforanytrans NAME tdrv006waitforanytrans wait until a transition occurs SYNOPSIS TDRV006_STATUS tdrv006foranytrans ( TDRV006_HANDLE hdl, int inputline, int timeout ) DESCRIPTION This function waits until a transition (high to low or low to high) occurs on the specified input line or the specified timeout time has passed. PARAMETER hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. inputline timeout This argument specifies the input line which shall be observed for a transition. Allowed values are 0 up to 63. 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. This time is specified in milliseconds. TDRV006-SW-42 VxWorks Device Driver Page 25 of 27

EXAMPLE #include tdrv006api.h TDRV006_HANDLE TDRV006_STATUS hdl; result; /* ** Wait for a transition on input line 0 ** Timeout after 1000 ms */ result = tdrv006waitforanytrans (hdl, 0, 1000); if (result!= TDRV006_OK) { /* error handling */ } RETURN VALUE 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 TDRV006_ERR_INVAL TDRV006_ERR_BUSY TDRV006_ERR_INVALID_HANDLE TDRV006_ERR_TIMEOUT Description Invalid parameter specified Another task is already waiting for a transition of the specified input line The device handle is invalid Timeout occurred. TDRV006-SW-42 VxWorks Device Driver Page 26 of 27

3 Debugging and Diagnostic The TDRV006 device driver provides functions and debug statements to display versatile information of the driver installation and status on the debugging console. The TDRV006 VxBus device driver offers a special show function to display driver information. By default the TDRV006 show routine is included in the driver and can be called from the VxWorks shell. If this function is not needed or program space is rare the function can be removed from the code by un-defining the macro INCLUDE_TDRV006_SHOW in tdrv006drv.c The tdrv006show function displays detailed information about probed modules, assignment of devices respective device names to probed TDRV006 modules and device statistics. If TDRV006 modules were probed but no devices were created it may be helpful to enable debugging code inside the driver code by defining the macro TDRV006_DEBUG in tdrv006drv.c. Certain debug information can be selected by assigning one or more (logical OR) TDRV_DBG_xxx values to variable tdrv006debug. In contrast to VxBus TDRV006 devices, legacy TDRV006 devices must be created manually. This will be done with the first call to the tdrv006open API function. -> tdrv006show Probed Modules: [0] TDRV006: Bus=4, Dev=2, DevId=0x02a9, VenId=0x1498, Init=OK, vxdev=0xffff800000005380 Associated Devices: [0] TDRV006: /tdrv006/0 Device Statistics: /tdrv006/0: open count = 0 interrupt count = 0 value = 0 = 0x0 TDRV006-SW-42 VxWorks Device Driver Page 27 of 27