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

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

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

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

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.

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

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

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

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

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

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

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

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.

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Advcan QNX Driver User Manual V1.02

ICS-121. VxWORKS DEVICE DRIVER MANUAL

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

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

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 Isolated Serial Interface RS232. Version 1.0. User Manual. Issue August 2017

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

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

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

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

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

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

M O T O R O L A C O M P U T E R G R O U P VME DRIVER FOR LINUX USER GUIDE

PRODUCT OVERVIEW ISSUE 4

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

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

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

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

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

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.1 Revision: 0 Date: May 3, 2018

The Peripheral Component Interconnect (PCI) Bus and vxworks

How to set Keil compiler environment v1.0

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.0 Revision: 0 Date: September 18, 2017

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

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line

Solaris Driver for the General Standards PCI-16SDI Adapter

24DSI32 24DSI12 24-bit, 32 Channel Delta-Sigma A/D Boards

libquadflash API 1 General Operations

libnetfilter_log Reference Manual

COMMON-ISDN-API. Version 2.0. Part II. 4 th Edition. Operating Systems

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.

CS240: Programming in C

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

I2C TM Master Library Module (Polled)

CSCE 455/855 Distributed Operating Systems

Robust Programming. Style of programming that prevents abnormal termination and unexpected actions

Linux Device Drivers IOCTL. March 15, 2018

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

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

RCU. ò Walk through two system calls in some detail. ò Open and read. ò Too much code to cover all FS system calls. ò 3 Cases for a dentry:

VFS, Continued. Don Porter CSE 506

ECEN 449 Microprocessor System Design. Review of C Programming. Texas A&M University

Stream Computing using Brook+

Experiment 6 The Real World Interface

An overview of how to write your function and fill out the FUNCTIONINFO structure. Allocating and freeing memory.

VME Basics. Appendix. Introduction to the VMEbus Accessing boards across the VMEbus VMEbus interrupt handling

Advanced Pointer & Data Storage

smxfs Portable FAT File System

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

Application Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification

Structures, Unions Alignment, Padding, Bit Fields Access, Initialization Compound Literals Opaque Structures Summary. Structures

EL6483: Brief Overview of C Programming Language

Lecture 20. Log into Linux. Copy directory /home/hwang/cs375/lecture20 Project 5 due today. Project 6 posted, due Tuesday, April 8. Questions?

So far, system calls have had easy syntax. Integer, character string, and structure arguments.

SPE Runtime Management Library Version 2.2

System Programming. Standard Input/Output Library (Cont d)

The ZL_PMBus API Programmer s Guide

MKXXxxx Internal Flash Memory Instructions Manual

Remote Procedure Call Implementations

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

Process Management 1

Homework / Exam. Return and Review Exam #1 Reading. Machine Projects. Labs. S&S Extracts , PIC Data Sheet. Start on mp3 (Due Class 19)

Neousys Technology Inc. PCIe-PoE354at/PCIe-PoE352at. User s Manual. Rev. A1

ECEN 449 Microprocessor System Design. Review of C Programming

Transcription:

The Embedded I/O Company TIP700-SW-42 VxWorks Device Driver Digital Output 24V DC Version 2.0.x User Manual Issue 2.0.1 June 2008 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 Phone: +49 (0) 4101 4058 0 25469 Halstenbek, Germany Fax: +49 (0) 4101 4058 19 www.tews.com e-mail: info@tews.com TEWS TECHNOLOGIES LLC 9190 Double Diamond Parkway, Suite 127, Reno, NV 89521, USA www.tews.com Phone: +1 (775) 850 5830 Fax: +1 (775) 201 0347 e-mail: usasales@tews.com

TIP700-SW-42 VxWorks Device Driver Digital Output 24V DC Supported Modules: TIP700 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. 1996-2008 by TEWS TECHNOLOGIES GmbH Issue Description Date 1.0 First Issue June 3, 1996 1.1 New Installation Chapter April 28, 1998 1.2 Smaller Changes and Corrections April 2, 2002 2.0.0 New Driver Interface Description July 27, 2007 2.0.1 Carrier Driver description added June 24, 2008 TIP700-SW-42 VxWorks Device Driver Page 2 of 24

Table of Contents 1 INTRODUCTION... 4 1.1 Device Driver...4 1.2 IPAC Carrier Driver...5 2 INSTALLATION... 6 2.1 Include device driver in Tornado IDE project...6 2.2 Special installation for Intel x86 based targets...6 2.3 System resource requirement...7 3 I/O SYSTEM FUNCTIONS... 8 3.1 tip700drv()...8 3.2 tip700devcreate()...10 4 I/O FUNCTIONS... 14 4.1 open()...14 4.2 close()...16 4.3 ioctl()...18 4.3.1 TIP700_READ...20 4.3.2 TIP700_WRITE...21 4.3.3 TIP700_WDENABLE...22 4.3.4 TIP700_WDDISABLE...23 4.3.5 TIP700_WDTRIGGER...24 TIP700-SW-42 VxWorks Device Driver Page 3 of 24

1 Introduction 1.1 Device Driver The TIP700-SW-42 VxWorks device driver software allows the operation of the TIP700 IPAC conforming to the VxWorks I/O system specification. This includes a device-independent basic I/O erface with open(), close() and ioctl() functions. The TIP700-SW-42 device driver supports the following features: Write output value Read back the contents of the output Enabling, disabling and triggering the output watchdog The TIP700-SW-42 supports the modules listed below: TIP700-10 16 isolated digital outputs 24V DC IPAC TIP700-20 8 isolated digital outputs 24V DC IPAC To get more information about the features and use of TIP700 devices it is recommended to read the manuals listed below. TIP700 User manual TIP700 Engineering Manual CARRIER-SW-42 IPAC Carrier User Manual TIP700-SW-42 VxWorks Device Driver Page 4 of 24

1.2 IPAC Carrier Driver IndustryPack (IPAC) carrier boards have different implementations of the system to IndustryPack bus bridge logic, different implementations of errupt and error handling and so on. Also the different byte ordering (big-endian versus little-endian) of CPU boards will cause problems on accessing the IndustryPack I/O and memory spaces. To simplify the implementation of IPAC device drivers which work with any supported carrier board, TEWS TECHNOLOGIES has designed a so called Carrier Driver that hides all differences of different carrier boards under a well defined erface. The TEWS TECHNOLOGIES IPAC Carrier Driver CARRIER-SW-42 is part of this TIP700-SW-42 distribution. It is located in directory CARRIER-SW-42 on the corresponding distribution media. This IPAC Device Driver requires a properly installed IPAC Carrier Driver. Due to the design of the Carrier Driver, it is sufficient to install the IPAC Carrier Driver once, even if multiple IPAC Device Drivers are used. Please refer to the CARRIER-SW-65 User Manual for a detailed description how to install and setup the CARRIER-SW-42 device driver, and for a description of the TEWS TECHNOLOGIES IPAC Carrier Driver concept. How to use the carrier driver in the application program is shown in the programming example tip700exa.c. If the IPAC carrier driver isn t used for the IPAC driver setup, the application software has to setup carrier board hardware, mapping of device memory and errupt level setup by itself. TIP700-SW-42 VxWorks Device Driver Page 5 of 24

2 Installation Following files are located on the distribution media: Directory path TIP700-SW-42 : tip700drv.c tip700def.h tip700.h tip700exa.c include/ipac_carrier.h TIP700-SW-42-2.0.1.pdf Release.txt ChangeLog.txt TIP700 device driver source TIP700 driver include file TIP700 include file for driver and application Example application Carrier driver erface definitions PDF copy of this manual Release information Release history 2.1 Include device driver in Tornado IDE project For Including the TIP700-SW-42 device driver o a Tornado IDE project follow the steps below: (1) Copy the files from the distribution media o a subdirectory in your project path. (For example:./tip700) (2) Add the device driver s C-files to your project. Make a right click to your project in the Workspace window and use the Add Files... topic. A file select box appears, and the driver files can be selected. (3) Now the driver is included in the project and will be built with the project. For a more detailed description of the project facility please refer to your Tornado User s Guide. 2.2 Special installation for Intel x86 based targets The TIP700 device driver is fully adapted for Intel x86 based targets. This is done by conditional compilation directives inside the source code and controlled by the VxWorks global defined macro CPU_FAMILY. If the content of this macro is equal to I80X86 special Intel x86 conforming code and function calls will be included. TIP700-SW-42 VxWorks Device Driver Page 6 of 24

2.3 System resource requirement The table gives an overview over the system resources that will be needed by the driver. Resource Driver requirement Devices requirement Memory < 1 KB < 1 KB Stack < 1 KB --- Semaphores --- --- Memory and Stack usage may differ from system to system, depending on the used compiler and its setup. The following formula shows the way to calculate the common requirements of the driver and devices. <total requirement> = <driver requirement> + (<number of devices> * <device requirement>) The maximum usage of some resources is limited by adjustable parameters. If the application and driver exceed these limits, increase the according values in your project. TIP700-SW-42 VxWorks Device Driver Page 7 of 24

3 I/O system functions This chapter describes the driver-level erface to the I/O system. The purpose of these functions is to install the driver in the I/O system, add and initialize devices. 3.1 tip700drv() NAME tip700drv() - installs the TIP700 driver in the I/O system SYNOPSIS #include tip700.h STATUS tip700drv(void) DESCRIPTION This function initializes the TIP700 driver and installs it in the I/O system. A call to this function is the first thing the user has to do before adding any device to the system or performing any I/O request. EXAMPLE #include "tip700.h /*------------------- Initialize Driver -------------------*/ status = tip700drv(); if (status == ERROR) /* Error handling */ TIP700-SW-42 VxWorks Device Driver Page 8 of 24

RETURNS OK, or ERROR if the function fails an error code will be stored in errno. ERROR CODES The error codes are stored in errno and can be read with the function errnoget(). The error code is a standard error code set by the I/O system (see VxWorks Reference Manual). SEE ALSO VxWorks Programmer s Guide: I/O System TIP700-SW-42 VxWorks Device Driver Page 9 of 24

3.2 tip700devcreate() NAME tip700devcreate() Add a TIP700 device to the VxWorks system SYNOPSIS #include tip700.h STATUS tip700devcreate ( char *name, devidx, functype, void *pparam ) DESCRIPTION This routine adds the selected device to the VxWorks system. The device hardware will be setup and prepared for use. This function must be called before performing any I/O request to this device. PARAMETER name devidx functype This string specifies the name of the device that will be used to identify the device, for example for open() calls. This index number specifies the TIP700 minor device number to add to the system. If modules of the same type are installed the device numbers will be assigned in the order the IPAC CARRIER ipfinddevice() function will find the devices. For TIP700 devices there is only one devidx per hardware module starting with devidx = 0. This parameter is unused and should be set to 0. TIP700-SW-42 VxWorks Device Driver Page 10 of 24

pparam This parameter pos to a structure (TIP700_DEVCONFIG) containing the default configuration of the channel. The structure (TIP700_DEVCONFIG) has the following layout and is defined in tip700.h: typedef struct struct ipac_resource *ipac; TIP700_DEVCONFIG; ipac Poer to TIP700 module resource descriptor, retrieved by CARRIER Driver ipfinddevice() function EXAMPLE #include "tip700.h STATUS TIP700_DEVCONFIG struct ipac_resource result; tip700conf; ipac; /* IPAC CARRIER Driver initialization */ /* ** Find an IP module from TEWS TECHNOLOGIES (manufacturer = 0xB3) ** with model number MODEL_TIP700_10 (see tip700.h). ** This module uses both errupt lines and need an IACK cycle, ** we need only the IO space base address for the related driver. */ result = ipfinddevice(0xb3, MODEL_TIP700_10, 0, IPAC_INT0_EN IPAC_INT1_EN IPAC_LEVEL_SENS IPAC_IACK_CYC IPAC_CLK_8MHZ, &ipac); TIP700-SW-42 VxWorks Device Driver Page 11 of 24

if (result == OK) tip700conf.ipac = &ipac; /*------------------------------------------------------- Create the device "/tip700/0" -------------------------------------------------------*/ tip700conf.ipac = &ipac; result = tip700devcreate( "/tip700/0", 0, 0, (void*)&tip700conf); if (result == OK) /* Device successfully created */ else /* Error occurred when creating the device */ else prf("error: No IP found on supported IP carrier boards\n"); RETURNS OK, or ERROR if the function fails an error code will be stored in errno. TIP700-SW-42 VxWorks Device Driver Page 12 of 24

ERROR CODES The error codes are stored in errno and can be read with the function errnoget(). Error code S_ioLib_NO_DRIVER EINVAL EISCONN ENOTSUP Description The driver has not been started. Invalid input argument The device has already been created The detected model type is not supported SEE ALSO VxWorks Programmer s Guide: I/O System TIP700-SW-42 VxWorks Device Driver Page 13 of 24

4 I/O Functions 4.1 open() NAME open() - open a device or file. SYNOPSIS open ( const char *name, flags, mode ) DESCRIPTION Before I/O can be performed to the TIP700 device, a file descriptor must be opened by invoking the basic I/O function open(). PARAMETER name Specifies the device which shall be opened, the name specified in tip700devcreate() must be used flags Not used mode Not used TIP700-SW-42 VxWorks Device Driver Page 14 of 24

EXAMPLE fd; /*------------------------------------------ Open the device named "/tip700/0" for I/O ------------------------------------------*/ fd = open("/tip700/0", 0, 0); if (fd == ERROR) /* handle error */ RETURNS A device descriptor number, or ERROR if the function fails an error code will be stored in errno. ERROR CODES The error codes are stored in errno and can be read with the function errnoget(). The error code is a standard error code set by the I/O system (see VxWorks Reference Manual). SEE ALSO iolib, basic I/O routine - open() TIP700-SW-42 VxWorks Device Driver Page 15 of 24

4.2 close() NAME close() close a device or file SYNOPSIS STATUS close ( ) fd DESCRIPTION This function closes opened devices. PARAMETER fd This file descriptor specifies the device to be closed. The file descriptor has been returned by the open() function. EXAMPLE STATUS fd; retval; /*---------------- close the device ----------------*/ retval = close(fd); if (retval == ERROR) /* handle error */ TIP700-SW-42 VxWorks Device Driver Page 16 of 24

RETURNS A device descriptor number, or ERROR if the function fails, an error code will be stored in errno. ERROR CODES The error codes are stored in errno and can be read with the function errnoget(). The error code is a standard error code set by the I/O system (see VxWorks Reference Manual). SEE ALSO iolib, basic I/O routine - close() TIP700-SW-42 VxWorks Device Driver Page 17 of 24

4.3 ioctl() NAME ioctl() - performs an I/O control function. SYNOPSIS #include tip700.h ioctl ( ) fd, request, arg DESCRIPTION Special I/O operation that does not fit to the standard basic I/O calls (read, write) will be performed by calling the ioctl() function. PARAMETER fd This file descriptor specifies the device to be used. The file descriptor has been returned by the open() function. request This argument specifies the function that shall be executed. Following functions are defined: Function Description TIP700_READ TIP700_WRITE TIP700_WDENABLE TIP700_WDDISABLE TIP700_WDTRIGGER Read content of output register Write data to output register Enable Watchdog Disable Watchdog Trigger Watchdog arg This parameter depends on the selected function (request). How to use this parameter is described below with the function. RETURNS Function dependent value (described with the function) or ERROR if the function fails an error code will be stored in errno. TIP700-SW-42 VxWorks Device Driver Page 18 of 24

ERROR CODES The error codes are stored in errno and can be read with the function errnoget(). The error code is a standard error code set by the I/O system (see VxWorks Reference Manual). SEE ALSO iolib, basic I/O routine - ioctl() TIP700-SW-42 VxWorks Device Driver Page 19 of 24

4.3.1 TIP700_READ This I/O control function reads back the current content of the output register. The function specific control parameter arg is a poer on an unsigned short value. EXAMPLE #include tip700.h unsigned short fd; usvalue; retval; /*------------------------------------ Read current output value ------------------------------------*/ retval = ioctl(fd, TIP700_READ, ()&usvalue); if (retval!= ERROR) /* function succeeded */ prf("value: 0x%04X\n", usvalue); else /* handle the error */ TIP700-SW-42 VxWorks Device Driver Page 20 of 24

4.3.2 TIP700_WRITE This I/O control function writes a value to the output register. For TIP700-10 modules, 16bit are value. For TIP700-20 modules, only the lower 8bit will be used. The function specific control parameter arg is a poer on an unsigned short value. EXAMPLE #include tip700.h unsigned short fd; usvalue; retval; /*------------------------------------ Write value to output register ------------------------------------*/ usvalue = 0x1234; retval = ioctl(fd, TIP700_WRITE, ()&usvalue); if (retval!= ERROR) /* function succeeded */ else /* handle the error */ TIP700-SW-42 VxWorks Device Driver Page 21 of 24

4.3.3 TIP700_WDENABLE This I/O control function enables the watchdog. The function specific control parameter arg is not used. Note that the watchdog must be triggered at least every 120ms, otherwise all outputs will be reset to 0. EXAMPLE #include tip700.h fd; retval; /*----------------------- Enable Watchdog -----------------------*/ retval = ioctl(fd, TIP700_WDENABLE, 0); if (retval!= ERROR) /* function succeeded */ else /* handle the error */ TIP700-SW-42 VxWorks Device Driver Page 22 of 24

4.3.4 TIP700_WDDISABLE This I/O control function disables the watchdog. The function specific control parameter arg is not used. EXAMPLE #include tip700.h fd; retval; /*----------------------- Disable Watchdog -----------------------*/ retval = ioctl(fd, TIP700_WDDISABLE, 0); if (retval!= ERROR) /* function succeeded */ else /* handle the error */ TIP700-SW-42 VxWorks Device Driver Page 23 of 24

4.3.5 TIP700_WDTRIGGER This I/O control function triggers the watchdog. The function reads the current output value, and writes it back to the output register, which triggers the watchdog. If the watchdog is enabled, call this function at least every 120ms. Otherwise the output register will be reset to 0. The function specific control parameter arg is not used. EXAMPLE #include tip700.h fd; retval; /*----------------------- Trigger Watchdog -----------------------*/ retval = ioctl(fd, TIP700_WDTRIGGER, 0); if (retval!= ERROR) /* function succeeded */ else /* handle the error */ TIP700-SW-42 VxWorks Device Driver Page 24 of 24