Home
TIP610-SW-82 - powerbridge.de
Contents
1. T610_RW_BUFFER io_buf result ioctl fd T610 IOCG READ POL amp io buf if result gt 0 printf Polarity Port A 02Xh n io_buf portA printf Polarity Port B 02Xh n io_buf portB printf Polarity Port C 1Xh n io_buf portC else printf Read polarity failed gt Error d n errno ERRORS EFAULT Invalid pointer to the read buffer SEE ALSO ioctl man pages TIP610 SW 82 Linux Device Driver Page 22 of 28 TEWS amp TECHNOLOGIES 3 5 4 T610_lIOCS_WRITE_POL NAME T610_IOCS_WRITE_POL Write new port polarity configuration DESCRIPTION This ioctl function attempts to write to the port polarity registers of the TIP610 associated with the open file descriptor filedes from the write buffer pointed to by argp The write buffer T670_RW_BUFFER has the following layout typedef struct unsigned char portA unsigned char portB unsigned char portC unsigned char wrenaPort T610_RW_BUFFER PT610_RW_BUFFER portA portB portC These parameters contain the new values for the corresponding port polarity register AO ina particular bit position specifies the corresponding bit path of the port as non inverting that is a HIGH level at the I O connector is a 1 If a bit is written with 1 the data path is programmed inverting After reset the data path is non inverting wrenaPort Set of bit flags that control the write port polarity operation If the corres
2. unsigned char portB unsigned char portC unsigned char wrenaPort T610_RW_BUFFER PT610_RW_BUFFER portA portB portC These parameters receive the contents of the corresponding port direction register A O in bit position specifies the corresponding bit of the port as an output bit while a 1 specifies it as an input wrenaPort It s not used for this ioctl function TIP610 SW 82 Linux Device Driver Page 17 of 28 TEWS amp TECHNOLOGIES EXAMPLE inte ds int result T610_RW_BUFFER io_buf result ioctl fd T610_IOCG_READ DIR amp io_buf Check the result of the last device I O control operation if result gt 0 printf Direction Port A 02Xh n io_buf portA printf Direction Port B 02Xh n io_buf portB printf Direction Port C 1Xh n io_buf portcC else printf Read direction failed gt Error d n errno SEE ALSO ioctl man pages TIP610 SW 82 Linux Device Driver Page 18 of 28 TEWS amp TECHNOLOGIES 3 5 2 T610_lIOCS _WRITE_DIR NAME T610_IOCS_WRITE_DIR Write new port direction configuration DESCRIPTION This ioctl function attempts to write to the port direction registers of the TIP610 associated with the open file descriptor filedes from the write buffer pointed to by argp The write buffer T670_RW_BUFFER has the following layout typedef struct unsigned char portA unsigned char portB u
3. ORTC Inhibit PORTA from writing a io_buf portA E 0x003 io_buf portB OxBB io_buf portC 0x04 io_buf wrenaPort T610_ENABLE _PORTB T610_ENABLE PORTC NumBytes write fd amp io_buf sizeof io_buf if NumBytes gt 0 Data successful written RETURNS On success write returns the size of the structure T610_RW_BUFFER In the case of an error a value of 1 is returned The global variable errno contains the detailed error code ERRORS EINVAL Invalid argument This error code is returned if the size of the write buffer is too small EFAULT Invalid pointer to the write buffer SEE ALSO GNU C Library description Low Level Input Output TIP610 SW 82 Linux Device Driver Page 14 of 28 TEWS amp TECHNOLOGIES 3 5 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 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 T P610 h Value Meaning T610_IOCG_READ_DIR Read current port direction configurat
4. Output TIP610 SW 82 Linux Device Driver Page 9 of 28 TEWS amp 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 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 TIP610 SW 82 Linux Device Driver Page 10 of 28 TEWS amp TECHNOLOGIES 3 3 read NAME read read from a device SYNOPSIS include lt unistd h gt ssize_t read int filedes void buffer size_t size DESCRIPTION The read function attempts to read the port registers of the TIP610 associated with the open file descriptor filedes into the read buffer pointed to by buffer Remember the values depend on the port configuration polarity and direction A pointer to the callers read buffer T610_RW_BUFFER and the size of this structure is passed by th
5. TENS S The Embedded I O Company TECHNOLOGIES TIP610 SW 82 Linux Device Driver Digital I O Version 1 1 x User Manual Issue 1 2 February 2004 TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC Am Bahnhof 7 25469 Halstenbek Germany 1 E Liberty Street Sixth Floor Reno Nevada 89504 USA Phone 49 0 4101 4058 0 Fax 49 0 4101 4058 19 Phone 1 775 686 6077 Fax 1 775 686 6024 e mail info tews com www tews com e mail usasales tews com www tews com TEWS amp TECHNOLOGIES TIP610 SW 82 Digital I O Linux Device Driver 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 2004 by TEWS TECHNOLOGIES GmbH Issue Description Date 1 0 First Issue July 20 2001 1 1 Changes for driver installation August 23 2001 1 2 Support for IPAC CARRIER DRIVER DEVFS and SMP February 10 2004 TIP610 SW 82 Linux Device Driver Page 2 of 28 TEWS amp TECHNOLOGIES Table of Contents 1 Jy 2 8 0 Led e Rae eearer ovarian nies ane ro enar Sr n
6. dynamic number allocation Example define TIP610_MAJOR 122 TIP610 SW 82 Linux Device Driver Page 7 of 28 TEWS amp 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 lt fentl h gt 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 TIP610 SW 82 Linux Device Driver Page 8 of 28 TEWS amp TECHNOLOGIES EXAMPLE int fd fd open dev tip610_0 O_RDWR 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 ERRORS 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 For more information about open error codes see the GNU C Library description Low Level Input Output SEE ALSO GNU C Library description Low Level Input
7. e write to a device SYNOPSIS include lt unistd h gt ssize_t write int filedes void buffer size_t size DESCRIPTION The write function attempts to write to the port registers of the TIP610 associated with the open file descriptor filedes from the buffer pointed to by buffer A pointer to the callers write buffer T610_RW_BUFFER and the size of this structure is passed by the parameters buffer and size to the device typedef struct unsigned char portA unsigned char portB unsigned char portC unsigned char wrenaPort T610_RW_BUFFER PT610_RW_BUFFER portA portB portC These parameters receive the actual state of the corresponding port registers wrenaPort Set of bit flags that controls the write operation If the corresponding port flag is set the port register will be written otherwise the port is inhibit from write The following flags could be OR ed T610_ENABLE_ PORTA The contents of the member portA will be written to the corresponding PORTA register lines 9 16 T610_ENABLE_PORTB The contents of the member portC will be written to the corresponding PORTB register lines 1 8 T610_ENABLE_PORTC The contents of the member portC will be written to the corresponding PORTC register lines 17 20 TIP610 SW 82 Linux Device Driver Page 13 of 28 TEWS amp TECHNOLOGIES EXAMPLE int fd ssize_t NumBytes T610_RW_BUFFER io_buf AK Write 0xBB to PORTB and 0x04 to P
8. e parameters buffer and size to the device typedef struct unsigned char portA unsigned char portB unsigned char portC unsigned char wrenaPort T610_RW_BUFFER PT610_RW_BUFFER portA portB portC These parameters receive the actual state of the corresponding port registers wrenaPort Is not used for the read function TIP610 SW 82 Linux Device Driver Page 11 of 28 TEWS amp TECHNOLOGIES EXAMPLE int fd ssize_t num_bytes T610_RW_BUFFER io_buf Send the read request to the driver num_bytes read fd amp io_buf sizeof io_buf Check the result of the last device I O operation if num_bytes gt 0 printf nRead input lines successful n printf Port A 02Xh n io_buf portA printf Port B 02Xh n io_buf portB printf Port C 02Xh n io_buf portcC else printf nRead failed gt Error d n errno RETURNS On success read returns the size of the structure T610_lIO BUFFER In the case of an error a value of 1 is returned The global variable errno contains the detailed error code ERRORS EINVAL Invalid argument This error code is returned if the size of the read buffer is too small EFAULT Invalid pointer to the read buffer SEE ALSO GNU C Library description Low Level Input Output TIP610 SW 82 Linux Device Driver Page 12 of 28 TEWS amp TECHNOLOGIES 3 4 write NAME writ
9. e Login as root e Change to the target directory e Toremove the driver from the module directory ib modules lt version gt misc enter make uninstall TIP610 SW 82 Linux Device Driver Page 5 of 28 TEWS amp TECHNOLOGIES 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 tip610drv 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 the device file system devfs 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 On success the device driver will create a minor device for each TIP610 module found The first TIP610 can be accessed with device node dev tip610_0 the second TIP610 or the second channel of the first TIP610 with device node dev tip610_1 and so on The allocation of device nodes to physical TIP610 modules depends on the search order of the IPAC carrier driver Please refer to the IPAC carrier user manual Loading of the TIP610 device driver will only work if kernel KMOD support is installed necessary carrier board driv
10. ers 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 To remove the device driver from the running kernel login as root and execute the following command modprobe tip610drv r If your kernel has enabled devfs all dev tip610_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 tip610drv Device or resource busy and the driver will still remain in the system until you close all opened files and execute modprobe r again TIP610 SW 82 Linux Device Driver Page 6 of 28 TEWS amp TECHNOLOGIES 2 5 Change Major Device Number The TIP610 driver use dynamic allocation of major device numbers by default If this isn t suitable for the application it s possible to define a major number for the driver If the kernel has enabled devfs the driver will not use the symbol TIP610_MAJOR To change the major number edit the file tip610drv c change the following symbol to appropriate value and enter make install to create a new driver TIP610_ MAJOR Valid numbers are in range between 0 and 255 A value of 0 means
11. eveses teeteeiaveeltv aceervadavesiess 19 35 3 T610 IOCG READ POL siratini aeaaea aeaaeai aiaei iaaa 21 3 5 4 1610 1OCS WRITE POL 00 cccc cece eeeeceenneeeeeaeeeeaaesaaeaeeaaeeesaaaeseaaaeseaeeeeaaeeeeaaeseeeaeneaes 23 3 5 5 T610_ IOCX_EVENT_ READ 2 00 ceccceccceeceeeeecee tees eee aeeeeaeeseeeeeseaeeeseaeeseneeeseaeeesaeeneaeeseaes 25 4 EOE UGG IN Gis aici dcnsccsiin aac naan aca aes aa a 28 TIP610 SW 82 Linux Device Driver Page 3 of 28 TEWS amp TECHNOLOGIES 1 Introduction The TIP610 SW 82 Linux device driver allows the operation of a TIP610 IPAC module on Linux operating systems with kernel version 2 4 4 or higher installed Because the TIP610 device driver is stacked on the TEWS TECHNOLOGIES IPAC carrier driver it s necessary to install also the appropriate IPAC carrier driver Please refer to the IPAC carrier driver user manual for further information The TIP610 device driver includes the following features reading the actual port values writing new port values configure port directions configure port polarity wait for selectable input events match high low any transition on the input line s of port A and port B VVVVV TIP610 SW 82 Linux Device Driver Page 4 of 28 TEWS amp TECHNOLOGIES 2 Installation The software is delivered on a PC formatted 31 HD diskette The directory A TIP610 SW 82 contains the following files TIP610 SW 82 paf This manual in PDF format TIP610 SW 82 tar
12. gz GZIP compressed archive with driver source code The GZIP compressed archive TIP610 SW 82 tar gz contains the following files and directories tip6 10 tip6 1 Odrv c Driver source code tip6 10 tip61 Odef h Driver include file tip610 tip610 h Driver include file for application program tip610 makenode Script to create device nodes on the file system tip610 makefile Device driver make file tip610 example example c Example application tip6 10 example makefile Example application make file In order to perform an installation extract all files of the archive TIP610 SW 82 tar gz to the desired target 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 A CARRIER SW 82 on the distribution diskette 2 1 Build and install the device driver e Login as root e Change to the target directory e To create and install the driver in the module directory lib modules lt version gt misc enter make install 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 aq 2 2 Uninstall the device driver
13. ion T610_IOCS_WRITE_DIR Write new port direction configuration T610_IOCG_READ_POL Read current port polarity configuration T610_IOCS_WRITE_POL Write new port polarity configuration T610_lIOCX_EVENT_READ Read port after specified input event occur See behind for more detailed information on each control code To use these TIP610 specific control codes the header file TIP610 h must be included in the application TIP610 SW 82 Linux Device Driver Page 15 of 28 TEWS amp TECHNOLOGIES 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 ERRORS 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 TIP610 driver always returns standard Linux error codes SEE ALSO ioctl man pages TIP610 SW 82 Linux Device Driver Page 16 of 28 TEWS amp TECHNOLOGIES 3 5 1 T610_lIOCG_READ_DIR NAME T610_lIOCG_READ_DIR Read current port direction configuration DESCRIPTION This ioctl function attempts to read the contents of all port direction registers of the TIP610 associated with the open file descriptor filedes into the read buffer pointed to by argp The read buffer 7670_RW_BUFFER has the following layout typedef struct unsigned char portA
14. n ticks the caller is willing to wait for the specified event to occur A value of 0 means wait indefinitely EXAMPLE int int T61 fd result O_EVRD_1 BUFF xx xk kR kk kk oy ev_ ev ev_ ev_ ev_ ev res if printf Port A ER ev_buf Read the input port after bat bit bit pit buf buf buf buf buf buf ult 0 0 TAF OC mode maskA 0xC3 matchA 0x82 maskB matchi B 0 timeo ut 100 T610_MATCH TEWS S TECHNOLOGIES If a high transition at the specified input bit position occurs the driver reads the input port A 1 value in maskA maskB specifies the bit position of the input port If you specify more than one bit position the events are OR ed That means the read is completed if a high transition at least at one relevant bit position occur If a low transition at the specified input bit position occurs the driver reads the input port A 1 value in maskA maskB specifies the bit position of the input port If you specify more than one bit position the events are OR ed That means the read is completed if a low transition at least at one relevant bit position occur If a high or low transition at the specified input bit position occurs the driver reads the input port A 1 value in maskA maskB specifies the bit position of the input port If you specify more than one bit position the e
15. nsigned char portC unsigned char wrenaPort T610_RW_BUFFER PT610_RW_BUFFER portA portB portC These parameters contain the new values for the corresponding port direction register A 0 in bit position specifies the corresponding bit of the port as an output bit while a 1 specifies it as an input All bits of port A and B must have the same direction The direction of port C can be setup individually for each bit A reset forces all bits to O output but this causes no problems because the port isn t enabled at this moment wrenaPort Set of bit flags that control the write port direction operation If the corresponding port flag is set the port direction register will be written otherwise the port direction register is inhibit from write The following flags could be OR ed T610_ENABLE_PORTA The contents of the member portA will be written to the corresponding PORTA direction register lines 9 16 T610_ENABLE_PORTB The contents of the member portC will be written to the corresponding PORTB direction register lines 1 8 T610_ENABLE_PORTC The contents of the member portC will be written to the corresponding PORTC direction register lines 17 20 TIP610 SW 82 Linux Device Driver Page 19 of 28 TENSE TECHNOLOGIES EXAMPLE int fd int result T610_RW_BUFFER io_buf xx Set direction for ae Port A inp t Port B output Port C bit 2 input bit 0 1 3 output ig io_buf portA OxFF i
16. o_buf portB 0x00 io_buf portC 0x04 io_buf wrenaPort T610_ENABLE_ PORTA T610_ENABLE_PORTB T610_ENABLE_PORTC result ioctl fd T610 IOCS_WRITE_DIR amp 1io buf if result lt 0 handle ioctl error ERRORS EFAULT Invalid pointer to the write buffer SEE ALSO ioctl man pages TIP610 SW 82 Linux Device Driver Page 20 of 28 TEWS amp TECHNOLOGIES 3 5 3 T610_lIOCG_READ_POL NAME T610_IOCG_READ_POL Read current port polarity configuration DESCRIPTION This ioctl function attempts to read the contents of all port polarity registers of the TIP610 associated with the open file descriptor filedes into the read buffer pointed to by argp The read buffer 7670_RW_BUFFER has the following layout typedef struct unsigned char portA unsigned char portB unsigned char portC unsigned char wrenaPort T610_RW_BUFFER PT610_RW_BUFFER portA portB portC These parameters receive the contents of the corresponding port polarity register A O ina particular bit position specifies the corresponding bit path of the port as non inverting that is a HIGH level at the I O connector is a 1 If a bit is written with 1 the data path is programmed inverting After reset the data path is non inverting wrenaPort It s not used for this ioctl function TIP610 SW 82 Linux Device Driver Page 21 of 28 TEWS amp TECHNOLOGIES EXAMPLE int fd int result
17. ponding port flag is set the port polarity register will be written otherwise the port polarity register is inhibit from write The following flags could be OR ed T610_ENABLE_ PORTA The contents of the member portA will be written to the corresponding PORTA polarity register lines 9 16 T610_ENABLE_PORTB The contents of the member portC will be written to the corresponding PORTB polarity register lines 1 8 T610_ENABLE_PORTC The contents of the member portC will be written to the corresponding PORTC polarity register lines 17 20 TIP610 SW 82 Linux Device Driver Page 23 of 28 TEWS amp TECHNOLOGIES EXAMPLE int fd int result T610_RW_BUFFER io_buf Port A bit 0 3 non inverting bit 4 7 inverting Port B non inverting x Port C unchanged io_buf portA OxFO io_buf portB 0x00 io_buf portC 0x00 io_buf wrenaPort T610_ENABLE PORTA T610_ENABLE_PORTB result ioctl fd T610_IOCS_WRITE_POL amp io_buf if result lt 0 handle ioctl error ERRORS EFAULT Invalid pointer to the write buffer SEE ALSO ioctl man pages TIP610 SW 82 Linux Device Driver Page 24 of 28 TEWS amp TECHNOLOGIES 3 5 5 T610_lIOCX_EVENT_READ NAME T610_IOCX_EVENT_READ Read port after specified input event occur DESCRIPTION The ioctl function reads the contents of the input ports after a specified event occur Possible even
18. rc or arto harem nmrNMceN Mantra eianene cere 4 2 INSTALLATION wiscsdscstscstccwsncscccnssandcasencstncsencsccavancsancsenerenasancsancsencsanesennsddasadssaaaiaisddas 5 2 1 Build and install the device Criver cccecccesccesseeeeseeeeeeneeesceeeeseeeeeeeeeseaeseseeeenseeeseaeseaneeeenseeeeeeees 5 2 2 Uninstall the device driver ccccsccsseeeseeeeeseeesseeeeneneeeeseeeseaeeaseeeenseeessaaesaseeeeneeaescaesaseeeenseeseeeeeas 5 2 3 Install device driver into the running kernel cseecceseeeeeeeeeeeeeeeseeeeeeeeeeseaeseneeeeneeeeseeeseneeeenseees 6 2 4 Remove device driver from the running kernel ccccseeccceseeeceeeseeeeeensneeeeeenseeeeeenseeneeenneeeeeennens 6 2 5 Change Major Device NUMDEL ssecceseeeseeeeeseeeenseeeeeeeeeseaeseneeeeneeeeseaeseasneeeneesescaesaseeeenseeeeeeneas 7 3 DEVICE INPUT OUTPUT FUNCTIONS nnssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 8 Bil OPEN aoea tec ec ri sceweceeveueetn A E sh ccvesbs ectusernusenees 8 Bid CIOSO iscesied tssSovoders sh cecten E A A 10 Bi OA E E E A E E A E bad ence babes sca E E E 11 IA WE ana E ston claw Gcuucect sbdvetent lund SteGuuscucdsucustansceudeeavaesusteblestuescunnede 13 3 9 OCU aaa 2ecce ceca e a ca aaa aaa a a a leas cove a ent 15 3 5 1 T610 IOCG READ DI Pryscticecsiscncctscteetetenccrcexs useka aaia a aaa A a a ERARE 17 35 2 T60 IOCS WRITE DIR sevcsctsscccces saved cceeveccteotsdevnetes Serato leceeltias d
19. tion of the call When this happens you should try the call again Page 27 of 28 TEWS amp TECHNOLOGIES 4 Debugging For debugging output see tip610drv c You will find the two following symbols undef TIP610_DEBUG_INTR undef TIP610_DEBUG_VIEW To enable a debug output replace undef with define The TIP610_DEBUG_INTR symbol controls debugging output from the ISR TIP610 interrupt entry TIP610 IACK 0 vector 0004 The TIP610_ DEBUG_VIEW symbol controls debugging output from the remaining part of the driver TIP610 Probe new TIP610 mounted on lt TEWS TECHNOLOGIES Compact PCI IPAC Carrier gt at slot B TIP610 Create minor node dev tip610_0 devfs TIP610 IP I O Memory Space 00000000 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 00000010 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 IP I O Memory Space after initialization 00000000 FF F9 FF 00 FF 00 FF 84 FF FB FF 00 FF 00 FF 84 00000010 FF F9 FF 00 FF 00 FF 84 FF FB FF 00 FF 00 FF 84 TIP610 SW 82 Linux Device Driver Page 28 of 28
20. ts are rising or falling edge or both at a specified input bit or a pattern match of masked input bits A pointer to the callers read buffer T610_EVRD_BUFFER is passed by the argument argp to the driver The 7670_EVRD_BUFFER structure has the following layout typedef struct unsigned char portA unsigned char portB unsigned char portC unsigned char maskA unsigned char maskB unsigned char matchA unsigned char matchB unsigned char mode unsigned long timeout T610_EVRD_BUFFER PT610_EVRD_BUFFER portA portB portC These parameters receive the contents of the corresponding port registers maskA maskB These parameters specify a bit mask A 1 value marks the corresponding bit position as relevant matchA matchB These parameters specify a pattern that must match to the contents of the input port Only the bit positions specified by maskA maskB must compare to the input port mode It specifies the event mode for this read request Possible is one of the following modes T610_MATCH The driver reads the input port if the masked input bits match to the specified pattern The input mask must be specified in the parameter maskA maskB A 1 value in maskA maskB means than the input bit value must match identically to the corresponding bit in the matchA matchB parameter TIP610 SW 82 Linux Device Driver Page 25 of 28 T610_HIGH_TR T610_LOW_TR T610_ANY_TR timeout Specifies the amount of time i
21. vents are OR ed That means the read is completed if a transition at least at one relevant bit position occur bit 0 1 6 7 are relevant port B isn t relvant ticks ioctl fd T610_IOCX_EVENT_READ amp ev_buf result gt 0 TIP610 SW 82 Linux Device Driver 302Xh n ev_buf portA Page 26 of 28 B 02Xh n Cz SO02xKh n printf Port printf Port else handle read error ct ct TEWS amp TECHNOLOGIES ev_buf portB ev_buf portC x Read the input port after a high transition at input line 8 occured Port B bit 7 ev_buf mode T610_HIGH_TR ev_buf maskB 1 lt lt 7 high transition at bit 7 ev_buf maskA 0 ev_buf timeout 100 ticks result ioctl fd T610_ IOCX_EVENT READ amp ev_buf if result gt 0 printf Port A 02Xh n ev_buf portA printf Port B 02Xh n ev_buf portB printf Port C 02Xh n ev_buf portcC else handle read error ERRORS EFAULT EBUSY ETIME EINTR SEE ALSO ioctl man pages TIP610 SW 82 Linux Device Driver Invalid pointer to the read buffer The maximum number of concurrent read requests is exceeded Increase the value of the symbol MAX_REQUESTS in tip61Odef h The allowed time to finish the read request is elapsed Interrupted function call an asynchronous signal occurred and prevented comple
Download Pdf Manuals
Related Search
Related Contents
LG LD40E User's Manual NComputing N-series Thin Client Firmware End User License Agreement Modell 2250 Bedienungsanleitung IntesisBox PA-AC-MBS-1 v2.1 ボップルサインミニ 取扱説明書 Zebra WA3016-G2 Manual de Instalación, Operación y Mantenimiento Copyright © All rights reserved.
Failed to retrieve file