Home

PIO-D144/D168

image

Contents

1. PIODA_ACTIVEMODE DEFINED ERROR PIODA ADD SIGNAL ERROR PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 10 2 3 11 PIODA NOERROR Please refer to Section 2 1 Error Code PIODA IntRemove Description This subroutine removes the IRQ service routine Syntax WORD PIODA IntRemove WORD fd WORD sig id Parameter fd The file descriptor of device file that get from function PIODIO Open sig id The number of signal is defined by user Return PIODA CONFIGURE INTERRUPT ERROR PIODA NOERROR Please refer to Section 2 1 Error Code PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 11 3 PIO D144 D168 Linux Demo All of demo programs will not work normally if PIO PISO linux driver would not be installed correctly During the installation process of PIO PISO linux driver the install scripts ixpio inst will setup the correct kernel driver After driver version 0 20 15 or the later driver version compiled and installation the related demo programs development library and declaration header files for different development environments are presented as follows Table 3 1 Driver Name Directory Path Pile Description Name Include piodio h PIO PISO library header Lib libpio a PIO PISO static library ixpio 0 20 15 port c Digital input demo port2 c Digital input and output demo examples piod144 port a c Dl and DO demo with library
2. PIODA Devicelnit Description To send initial value to the D O latch register of active port Syntax WORD PIODA_Devicelnit WORD fd Parameter fd The file descriptor of device file that get from function PIODIO_Open Return PIODA DEVICE DIO INIT ERROR PIODA NOERROR Please refer to Section 2 1 Error Code PIODA PortDirCfs Description To change Digital I O port status DI or DO Syntax WORD PIODA PortDirCfs WORD fd WORD port boolean io Parameter fd The file descriptor of device file that get from function PIODIO Open port The port number that want to change status DI or DO io The value O means digital output The value 1 means digital input Return PIODA DEVICE DIO INIT ERROR PIODA NOERROR Please refer to Section 2 1 Error Code PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 8 2 3 8 2 3 9 PIODA Digital_Output Description This subroutine sends the 8 bits data to the specified I O port Syntax WORD PIODA _Digital_Output WORD fd WORD port byte data Parameter fd The file descriptor of device file that get from function PIODIO_Open port The output port number data 8 bits data Return PIODA DIGITAL OUTPUT ERROR PIODA NOERROR Please refer to Section 2 1 Error Code PIODA Digital Input Description This subroutine reads the 8 bits data from the specified I O port Syntax WORD PIODA Digital Inp
3. 4 2 1 Table of ErrorCode and ErrorString Table 2 1 E Error ID Error String 0 PIODA NOERROR OK No error 1 PIODA MODULE NAME GET ERROR Module name cant get from file proc ixpio ixpio 2 PIODA DEVICE DIO INIT ERROR Configure port DI O error 3 PIODA ACTIVE PORT ERROR Select I O port error 4 PIODA PORT DEFINED ERROR Port number out of range 5 PIODA DIGITAL OUTPUT ERROR Digital output error 6 PIODA DIGITAL INPUT ERROR Digital input error 7 PIODA INT SOURCE DEFINED ERROR Interrupt source defined error 8 PIODA CONFIGURE INTERRUPT ERR Configure interrupt error OR 9 PIODA ACTIVEMODE DEFINED ERRO Defined Interrupt active R mode error 10 PIODA ADD SIGNAL ERROR Add signal condition error 2 2 Function Descriptions Table 2 2 Function Definition char PIODA GetDriverVersion void char PIODA GetLibraryVersion void int PIODA Open char dev file WORD PIODA Close WORD fd WORD PIODA DriverInit WORD WORD PIODA Devicelnit WORD fd WORD PIODA PortDirCfs WORD WORD boolean WORD PIODA Digital Output WORD WORD byte WORD PIODA Digital Input WORD WORD WORD WORD PIODA Intinstall WORD HANDLE WORD WORD WORD WORD PIODA IntRemove WORD WORD PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 5 2 3 Digital I O FUNCTIONS 2 3 1 PIODA GetDriverVersion e Description To get the version of
4. examples piod168 int c Interrupt demo int2 c Interrupt demo Int_a c Interrupt demo with library 3 1Demo code port c This demo program is used to read data from port 2 and get out if read data error or port 2 bit 7 0 3 2Demo code port2 c This demo program is used to output digital from port 1 and input digital data from port 0 PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 12 3 3Demo code port_a c This demo program coded by using the static library libpio a It is used to output digital from port 1 and input digital data from port 0 3 4Demo code int c This demo program uses P2C0 P2C1 P2C2 P2C3 as interrupt source The interrupt will be triggered according to the argument sig bedge if value 1 then the interrupt triggered at high signal and low signal or sig edge if value 1 then interrupt triggered at high signal Otherwise the interrupt triggered at low signal 3 5Demo code int2 c This program configures driver to send signals in different signal id for the four interrupt channels 3 6 Demo code int_a c This demo program coded by using the static library libpio a to enable P2C0 as interrupt source The interrupt will be triggered when the signal is low PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 13
5. 0 20 15 tar gz or the later driver version in the directory NAPDOS Linux of the companion CD or download the latest driver from our website to the linux host You must use the root identity to compile and install PIO PISO linux driver Decompress the tarball ixpio tar gz Type cd to the directory containing the package s source code and type configure to configure the package for your linux system Type make to compile the package You can type ixpio inst to install the PIO PISO driver module and build the device file ixpioX in the device directory dev automatically 1 2 Linux Driver Uninstalling Procedure Step 1 Type cd to the directory containing the package s source code Step 2 Type ixpio remove to remove the PIO PISO driver module PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 3 2 Static Library Function Description The static library is the collection of function calls of the PIO DIO cards for linux kernel 2 4 x and 2 6 x system The application structure is presented as following figure The user application program developed by C C language can call library libpio a in user mode And then static library will call the module ixpio to access the hardware system Function Call into Library Development Toolkit Services Call into Kernel Mode Device Control Figure 2 1 PIO D144 D168 Linux User s Manual Ver 3 0 May 2013
6. GetDiiver Version nccccccccccccccccccccesescsscecececesesssesesesessseseseseseseeess 2 3 2 PIODA_GetLibraryVersion sists cena is 2 3 3 PIODA DIEI tenet deca ieteat A tpa cu tuae DUE UM 2 3 4 PIODA CIOSe Ao ete reete oa eee ete eee irai TE EE Tode 2 39 PIODADrbverlnit etit deett oe teilen desine 2 3 0 PIODA Device itte etae AS 20 47 PIODA BROTE E on ere ata Cte p a 2 3 8 JIODA Digital OUInDHE idexsetohtsvvdaui iocis do pup dad dud 2 3 9 PIODA Digital dH AA dace sco ont o a Er aa e oe qae vidi 2 390 PIODA Inilnstall e t ege eae 2 3 11 PIODA_IntRemove cncccnccninnnnnnnncnnncnnnnnnananinononnnnnnnananncnnncnnononananacinicnnos PIO D144 D168 Linux Demo e cecceeeeenee rennen nnn nha nra 3 1 3 2 3 3 3 4 3 5 3 6 DEMO CODE PORTO lid a A vst bee te ve R DEMO CODEPORT2 sc ette a ii cd eatas aaa a adictas da DEMO CODE PORT AC isaac iii DEMO CODESINEC 5 ose a re vae Wi Pe A PERUS DEMO CODE INTA in nette e oe es ete o oeste ire ads ae read DEMO CODE INTA O on tee itecto tet m used Eee se butt totes PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 2 1 Linux Software Installation The PIO D144 D168 can be used in linux kernel 2 4 X and 2 6 X For Linux O S the recommended installation and uninstall steps are given in Sec 1 1 1 2 1 1 Linux Driver Installing Procedure Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Copy the linux driver ixpio
7. PIO D144 D168 Digital I O Card Linux Software Manual Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assume no liability for damages consequent to the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use nor for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2003 by ICP DAS All rights are reserved Trademark The names used for identification only may be registered trademarks of their respective companies PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 1 Tables of Contents Linux Software Installation 2 c cceecceeceeceeeeeeceeccneceeceeseneceescnseneceeseneees 1 1 1 2 LINUX DRIVER INSTALLING PROCEDURE ect e nenne en nn eser ener nnns LINUX DRIVER UNINSTALLING PROCEDURE cccoccccnoccnonccnonccnnnoccnncccnnncinonacinnncnns Static Library Function Description eeeeeeeeeeeeeeeeee 2 1 TABLE OF ERRORCODE AND ERRORSTRING cccccsecececcescececcesecccenescececceseeces 2 2 FUNCTION DESCRIPTIONS orris nosicie riii i n i a i i ii 2 3 Mer VO FUNETION Su tdt E ooi 2 3 1 PIODA_
8. PIO PISO linux driver e Syntax char PIODIO GetDriverVersion Void 9 Parameter None 9 Return The version of PIO PISO linux driver 2 3 2 PIODA GetLibraryVersion e Description To get the version of PIO PISO linux static library e Syntax char PIODIO GetLibraryVersion void 9 Parameter None e Return The version of PIO PISO linux static library 2 3 3 PIODA Open e Description To open device file e Syntax int PIODIO Open char dev file 9 Parameter PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 6 2 3 4 2 3 5 dev file The path of device file Return The file descriptor of device file If the file descriptor lt 0 it means that open device file failure PIODA Close Description To close device file Syntax Word PIODIO Close WORD fd Parameter fd The file descriptor of device file that get from function PIODIO Open Return PIODA NOERROR Please refer to Section 2 1 Error Code PIODA Driverlnit Description To allocates the computer resource for the device This function must be called once before applying other PIODA functions Syntax WORD PIODA Driverlnit WORD fd Parameter fd The file descriptor of device file that get from function PIODIO Open Return PIODA MODULE NAME GET ERROR PIODA NOERROR Please refer to Section 2 1 Error Code PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 7 2 3 6 2 3 7
9. ut WORD fd WORD port WORD di data Parameter fd The file descriptor of device file that get from function PIODIO Open port The input port number di data A variable address used to storage the 8 bits input data Return PIODA DIGITAL INPUT ERROR PIODA NOERROR Please refer to Section 2 1 Error Code PIO D144 D168 Linux User s Manual Ver 3 0 May 2013 9 2 3 10 PIODA Intinstall Description This subroutine installs the IRQ service routine Syntax WORD PIODA_Intinstall WORD fd HANDLE hisr WORD signal WORD int source WORD activemode Parameter fd The file descriptor of device file that get from function PIODIO Open hisr Address of a Event handle The handle function will be called when the interrupt happened signal The number of signal is defined by user Int source Please refer to the following table 2 3 Table 2 3 Card No Int source Description PIO PIOD144 168 P2CO Enable P2CO D144 D168 PIOD144 168 P2C1 Enable P2C1 PIOD144 168 P2C2 Enable P2C2 PIOD144 168 P2C3 Enable P2C3 PIOD144 168 ALL INT Enable All Int Source activemode The value 0 means interrupt happened when signal is low The value 1 means interrupt happened when signal is high The value 2 means interrupt happened when signal is low or high Return PIODA CONFIGURE INTERRUPT ERROR PIODA INT SOURCE DEFINED ERROR PIODA ACTIVE PORT ERROR

Download Pdf Manuals

image

Related Search

PIO D144/D168

Related Contents

Samsung SL-M3820DW Felhasználói kézikönyv  MOSKITO-F  SLT 110 - Jungheinrich  TED 5000 FOOTPRINTS User Manual  Definitive Technology MYTHOS XTR-SSA5 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file