Home
User Manual - TEWS TECHNOLOGIES
Contents
1. 18 TIP700 SW 82 Linux Device Driver Page 3 of 18 TEWS E TECHNOLOGIES 1 Introduction 1 1 Device Driver The TIP700 SW 82 Linux device driver allows the operation of the TIP700 digital output IPAC conforming to the Linux I O system specification This includes a device independent basic interface with open close write and ioctl functions The TIP700 SW 82 device driver supports the following features writing digital output value enable and disable output watchdog The TIP700 SW 82 device driver supports the modules listed below TIP700 10 16 isolated digital outputs 24V DC IndustryPack amp TIP700 20 8 isolated digital outputs 24V DC IndustryPack amp To get more information about the features and use of TIP700 devices it is recommended to read the manuals listed below TIP700 User Manual CARRIER SW 82 IPAC Carrier User Manual 1 2 IPAC Carrier Driver IndustryPack IPAC carrier boards have different implementations of the system to IndustryPack bus bridge logic different implementations of interrupt 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 un
2. TEWS 2 The Embedded I O Company TECHNOLOGIES TIP700 SW 82 Linux Device Driver Digital Output 24V DC Version 1 2 x User Manual Issue 1 2 3 June 2014 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek Germany Phone 49 0 4101 40580 Fax 49 0 4101 4058 19 e mail info tews com www tews com TIP700 SW 82 Linux Device Driver Digital Output 24V DC Supported Modules TEWS 2 gt TECHNOLOGIES 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 VENUS 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 2004 2014 by TEWS TECHNOLOGIES GmbH Issue Description Date 1 0 First Issue July 11 2003 1 1 Support for DEVFS and SMP February 16 2004 1 2 0 Introduction and installation section modified April 18 2006 1 2 1 General Revision February 25 2009 1 2 2 Address TEWS LLC removed October 28 2010 1 2 3 General Revision June 5 2014 TIP700 SW 82 Linux Device Driver Page 2 of 18 TEWS E TECHNOLOGIES Table of Contents 1 INTRODUC FION Mese ccc c ccm 4 151 Device DIVO R icone exnuxnasecsnc
3. example Makefile Example application make file include config h Driver independent library header file include tpmodule h Kernel independent library header file include tpmodule c Kernel independent library source code file In order to perform an installation extract all files of the archive TIP700 SW 82 SRC tar gz to the desired target directory The command tar xzvf TIP700 SW 82 SRC tar gz will extract the files into the local directory Before building a new device driver the TEWS TECHNOLOGIES IPAC carrier driver must be installed properly because this driver includes the header file ipac carrier h which is part of the IPAC carrier driver distribution Please refer to the IPAC carrier driver user manual in the directory path CARRIER SW 82 on the separate distribution media TIP700 SW 82 Linux Device Driver Page 5 of 18 TEWS TECHNOLOGIES 2 1 Build and install the Device Driver e Login as root e Change to the target directory e Use the parameter CARRIERDIR to specify the location of the TEWS IPAC Carrier Driver To create and install the driver in the module directory lib modules lt version gt misc assuming the carrier driver being located in usr project ipac carrier enter make install CARRIERDIRz usr project ipac carrier If not specifying the CARRIERDIR parameter there may be compiler warnings claiming some undefined ipac symbols These warnings are caused by the IPAC Carrier Driver which is u
4. a device specified by filedes causing the corresponding device to perform the requested operation The argument request specifies the control code for the operation The optional argument argp depends on the selected request and is described for each request in detail later in this chapter The following ioctl codes are defined in tip 700 h Symbol Meaning T700 IOC ENABLE WD Enable output watchdog T700 IOC DISABLE WD Disable output watchdog 1700 TRIGGER WD Trigger output watchdog See behind for more detailed information on each control code To use these TIP700 specific control codes the header file tip700 h must be included in to the application RETURNS On success zero is returned In the case of an error a value of 1 is returned The global variable errno contains the detailed error code TIP700 SW 82 Linux Device Driver Page 13 of 18 TEWS 2 gt TECHNOLOGIES ERRORS Error Code Description EINVAL Invalid argument This error code is returned if the requested ioctl function is unknown Please check the argument request Other function dependant error codes will be described for each ioctl code separately Note the TIP700 driver always returns standard Linux error codes SEE ALSO ioctl man pages TIP700 SW 82 Linux Device Driver Page 14 of 18 TEWS 2 gt TECHNOLOGIES 3 4 1 T700 IOC ENABLE WD NAME T700 IOC ENABLE WD Enable output watchdog DESCRIPTION This ioctl function enab
5. der a well defined interface The TEWS TECHNOLOGIES IPAC Carrier Driver CARRIER SW 82 is part of this TIP700 SW 82 distribution It is located in directory CARRIER SW 82 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 82 User Manual for a detailed description how to install and setup the CARRIER SW 82 device driver and for a description of the TEWS TECHNOLOGIES IPAC Carrier Driver concept TIP700 SW 82 Linux Device Driver Page 4 of 18 TEWS 2 TECHNOLOGIES 2 Installation Following files are located on the distribution media Directory path TIP700 SW 82 TIP700 SW 82 SRC tar gz GZIP compressed archive with driver source code TIP700 SW 82 1 2 2 pdf PDF copy of this manual ChangeLog txt Release history Release txt Release information For installation the files have to be copied to the desired target directory The GZIP compressed archive TIP700 SW 82 SRC tar gz contains the following files and directories Directory path tip700 tip700 c Driver source code tip700def h Driver include file tip700 h Driver include file for application program makenode Script to create device nodes on the file system Makefile Device driver make file example tip700exa c Example application
6. ered implicitly by a write to the output register or by executing this ioctl function The initialization state driver startup of the output watchdog is disabled EXAMPLE include lt tip700 h gt int fd int result result ioctl fd T700 IOC TRIGGER WD if result lt 0 handle ioctl error TIP700 SW 82 Linux Device Driver Page 17 of 18 4 Debugging For debugging output see tip700 c You will find the following symbol undef TIP700_D To enable a debug output replace undef with define EBUG VIEW TEWS 2 gt TECHNOLOGIES The TIP700 DEBUG VIEW symbol controls debugging output from the whole driver TIP700 IPAC Carrier at slot A TIP700 00000000 TIP700 00000000 00000010 00000020 00000030 TIP700 TIP700 TIP700 8 or 16 Digital Outputs version 1 2 x Release Date lt 6 gt Probe new TIP700 mounted on TEWS TECHNOLOGIES IP I O Memory Space 00 01 FF 01 IP ID Memory Space FF 49 FF 50 FF 41 FF 43 FF B3 FF 05 FF 10 FF 00 FF 00 FF 00 FF OC FF D7 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF OO FF 00 FF 00 IOCTL T700 IOC ENABLE WD IOCTL 1700 DISABLE WD TIP700 SW 82 Linux Device Driver Compact PCI Page 18 of 18
7. ice node dev tip700_1 the third TIP700 with device node dev tip700 2 and so on The allocation of device nodes to physical TIP700 modules depends on the search order of the IPAC carrier driver Please refer to the IPAC carrier user manual Loading of the TIP700 device driver will only work if kernel KMOD support is installed necessary carrier board drivers already installed and the kernel dependency file is up to date If KMOD support isn t available you have to build either a new kernel with KMOD installed or you have to install the IPAC carrier kernel modules manually in the correct order please refer to the IPAC carrier driver user manual 2 4 Remove Device Driver from the running Kernel e remove the device driver from the running kernel login as root and execute the following command modprobe tip700drv r If your kernel has enabled a dynamic device file system devfs or sysfs with udev all dev tip700_x nodes will be automatically removed from your file system after this Be sure that the driver isn t opened by any application program If opened you will get the response tip700drv Device or resource busy and the driver will still remain in the system until you close all opened files and execute modprobe r again 2 5 Change Major Device Number The TIP700 driver uses dynamic allocation of major device numbers by default If this isn t suitable for the application it s possible to define a major numbe
8. les the output watchdog facility of the TIP700 If the output watchdog is not retriggered within approximately 120 milliseconds the state of the output register will be set to inactive The watchdog is triggered implicitly by a write to the output register or by executing the ioctl function T700 IOC TRIGGER WD The initialization state driver startup of the output watchdog is disabled EXAMPLE include tip700 h int fd int result result ioctl fd T700 IOC ENABLE WD if result 0 handle ioctl error TIP700 SW 82 Linux Device Driver Page 15 of 18 TEWS 2 gt TECHNOLOGIES 3 4 2 T700 IOC DISABLE WD NAME T700 DISABLE WD Disable output watchdog DESCRIPTION This ioctl function disables the output watchdog facility of the TIP700 The initialization state driver startup of the output watchdog is disabled EXAMPLE include lt tip700 h gt int fd int result result ioctl fd T700 IOC DISABLE WD if result 0 handle ioctl error TIP700 SW 82 Linux Device Driver Page 16 of 18 TEWS 2 gt TECHNOLOGIES 3 4 3 T700 IOC TRIGGER WD NAME 1700 TRIGGER WD Trigger output watchdog DESCRIPTION This ioctl function triggers the output watchdog of the TIP700 If the output watchdog is not retriggered within approximately 120 milliseconds the state of the output register will be set to inactive The watchdog is trigg
9. nknown during compilation of this TIP driver e Also after the first build we have to execute depmod to create a new dependency description for loadable kernel modules This dependency file is later used by modprobe to automatically load the correct IPAC carrier driver modules depmod 2 2 Uninstall the Device Driver e Login as root e Change to the target directory e Toremove the driver from the module directory lib modules version misc enter make uninstall e Update kernel module dependency description file depmod aq 2 3 Install Device Driver into the running Kernel e To load the device driver into the running kernel login as root and execute the following commands modprobe tip700drv e After the first build or if you are using dynamic major device allocation it s necessary to create new device nodes on the file system Please execute the script file makenode to do this If your kernel has enabled a dynamic device file system devfs or sysfs with udev then you have to skip running the makenode script Instead of creating device nodes from the script the driver itself takes creating and destroying of device nodes in its responsibility sh makenode TIP700 SW 82 Linux Device Driver Page 6 of 18 TEWS 2 gt TECHNOLOGIES On success the device driver will create a minor device for each TIP700 module found The first TIP700 can be accessed with device node dev tip700_0 the second TIP700 with dev
10. of 18 TEWS E TECHNOLOGIES ERRORS Error Code Description ENODEV The requested minor device does not exist This is the only error code returned by the driver other codes may be returned by the I O system during open SEE ALSO GNU C Library description Low Level Input Output TIP700 SW 82 Linux Device Driver Page 9 of 18 TEWS E TECHNOLOGIES 3 2 close NAME close close a file descriptor SYNOPSIS include lt unistd h gt int close int filedes DESCRIPTION The close function closes the file descriptor filedes EXAMPLE int fd if close fd 0 handle close error conditions RETURNS The normal return value from close is 0 In the case of an error a value of 1 is returned The global variable errno contains the detailed error code ERRORS Error Code Description ENODEV The requested minor device does not exist This is the only error code returned by the driver other codes may be returned by the I O system during close For more information about close error codes see the GNU C Library description Low Level Input Output SEE ALSO GNU C Library description Low Level Input Output TIP700 SW 82 Linux Device Driver Page 10 of 18 TEWS E TECHNOLOGIES 3 3 write NAME write write to a device SYNOPSIS include lt unistd h gt ssize_t write int filedes void buffer size_t size DESCRIPTION This function
11. r for the driver If the kernel has enabled a dynamic files system the driver will not use the symbol TIP700 MAJOR To change the major number edit the file tip700 c change the following symbol to appropriate value and enter make install to create a new driver TIP700 MAJOR Valid numbers are in range between 0 and 255 A value of 0 means dynamic number allocation Example define 700 MAJOR 122 TIP700 SW 82 Linux Device Driver Page 7 of 18 TEWS E TECHNOLOGIES 3 Device Input Output functions This chapter describes the interface to the device driver I O system 3 1 open NAME open open a file descriptor SYNOPSIS include fcntl h int open const char filename int flags DESCRIPTION The open function creates and returns a new file descriptor for the file named by filename The flags argument controls how the file is to be opened This is a bit mask you create the value by the bitwise OR of the appropriate parameters using the operator in C See also the GNU C Library documentation for more information about the open function and open flags EXAMPLE int fd fd open dev tip700 0 O_RDWR if fd lt 0 handle error condition RETURNS The normal return value from open is a non negative integer file descriptor In the case of an error a value of 1 is returned The global variable errno contains the detailed error code TIP700 SW 82 Linux Device Driver Page 8
12. uanexdcsaananseeenn extasaapansdeansexexeeaees 4 1 2 IPAC Carrier Driver AENEA AERAR EN AAA NARRA KAARSEN KARARAN AARAA ARREA 4 MINS AL ETON 5 2 1 Build and install the Device 6 2 2 Uninstall the Device Driver c c sceeceeeeeeeeeeeeeee ee ee 6 2 3 Install Device Driver into the running 6 2 4 Remove Device Driver from the running 7 2 5 Change Major Device 7 3 DEVICE INPUT OUTPUT FUNCTIONS eere nennen nnne nnne nnn nnns 8 KNEE 8 9 2 086 10 3 3 WING l 11 NOC m 13 3 4 1 T700 ENABLE WD sse aaa aa internen rnnt aaa nnns 15 3 4 2 T700 IOC DISABLE WD sssssssssssesseeeeene entente enne sn nnns sn aa aaia innt senten senten 16 3 43 T700 TRIGGER WD sssssssssssesseeeeee seen en nennen nsns nnns entente resins intet senten 17 4 DEBUGGING M
13. writes to the output registers of the TIP700 associated with the file descriptor filedes from a structure 7700_BUFFER pointed to by buffer The argument size specifies the length of the buffer and must be set to the size of the structure 7700 BUFFER typedef struct unsigned short value T700_BUFFER value This parameter holds the new value for output lines 1 to 16 Where bit 2 corresponds to output line 1 bit 2 to output line 2 and so on EXAMPLE include lt tip700 h gt int fd ssize t num bytes T700 BUFFER io buf io buf value 0x1234 num bytes write fd amp io buf sizeof T700 BUFFER if num bytes sizeof T700 BUFFER process error TIP700 SW 82 Linux Device Driver Page 11 of 18 TEWS 2 gt TECHNOLOGIES RETURNS On success write returns the size of bytes written always the size of 7700 BUFFER In the case of an error a value of 1 is returned The global variable errno contains the detailed error code ERRORS Error Code Description EINVAL This error code is returned if the size of the buffer is wrong SEE ALSO GNU C Library description Low Level Input Output TIP700 SW 82 Linux Device Driver Page 12 of 18 TEWS TECHNOLOGIES 3 4 ioctl NAME ioctl device control functions SYNOPSIS include lt sys ioctl h gt int ioctl int filedes int request void argp DESCRIPTION The ioctl function sends a control code directly to
Download Pdf Manuals
Related Search
Related Contents
LIST OF FIGURES Generic Slave DTM for sercos Slave Devices S208 EasyCreator User Manual - Laboratory ovens KeHE Natural Fall Show 2015 Exhibitor Service Manual Owner`s Manual & Safety Instructions Probador de cables y Multímetro Digital Samsung LE46A568P3M Manual de Usuario rince-bouche au fluorure stanneux avec 5 % de xylitol Copyright © All rights reserved.
Failed to retrieve file