Home
PIO-D96 User Manual
Contents
1. Int_source Description PIO D96 PIOD96_P2C0 Enable P2C0 PIOD96_P5CO Enable P5CO PIOD96_P8CO Enable P8CO PIOD96_P11C0 Enable P11C0 PIOD96_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 0 Return Please refer to Section 2 1 Error Code 2 3 10 PIODA_IntRemove e Description This subroutine removes the IRQ service routine 0 Syntax WORD PIODA_IntRemove WORD fd WORD sig_ id O Parameter fd The file descriptor of device file that get from function PIODIO_Open sig_id The number of signal is defined by user e Return PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 9 If returned value PIODA_NOERROR it means that sending data to I O port successfully Otherwise please refer to Section 2 1 Error Code PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 10 3 PIO D96 Demo Programs For Linux 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 4 or the later driver version compiled and installation the related demo programs development library and declaration header files for different development e
2. 6 User s Manual Ver 1 0 SEP 2007 PMH 008 13 6 2 3 4 2 3 5 2 3 6 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 The code 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 The code PIODA_MODULE_NAME_GET_ERROR PIODA_READ_EEPROM_ERROR only for PIO DA16 device or 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 PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 7 2 3 7 2 3 8 2 3 9 If returned value lt 0 it means that changing port status DI or DO failure PIODA Digital_Output Description This subroutine sends the 8 bits data to the specified I O port Syntax WORD PIO
3. DA _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 If returned value PIODA_NOERROR it means that sending data to I O port successfully Otherwise 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_Input 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 If returned value PIODA_NOERROR it means that reading data from DI port successfully Otherwise please refer to Section 2 1 Error Code PIODA_Intinstall Description This subroutine installs the IRQ service routine PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 8 e Syntax WORD PIODA _IntInstall WORD fd HANDLE hisr WORD signal WORD int_source WORD activemode O 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
4. PIO D96 User s 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 2004 by ICP DAS All rights are reserved Trademark The names used for identification only may be registered trademarks of their respective companies PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 1 Tables of Content Linux Software Installati n issisescscisscsiicssssescssecbeassvassaxscasaswassssennssasenosvecssanveussassoacss 3 1 1 Linux Driver Installing Procedure cece eeseeseeseeseeseeseeseeeeesnseeesneeeeseseesneeeeanerseees 3 1 2 Linux Driver Uninstalling Procedure xiii 3 Static Libary Function Description oocoooocs 4 2 1 Table of ErrorCode and ErrorString ue sesessesessesneesesneeesueesesneesesneesesneesesneeseaes 5 22 F ncton ESCH OMS i siestiiccthiescsctelnciatttes tetas sient a et ue Sit eee 5 2 3 Digital VOFUNCTIONS ida 6 2 3 1 PIODA GetDriverVersion a e i i 6 Za PIODA sGetlibary V tstOnwae nas sn
5. cineiceae eae 6 233 PIODA Opens ia 6 DSA PIODARClOSC had tek cet cto La nd dd 7 Za PIODA Du VE ii tl da 7 2 3 0 PIODA PortDICAS iu 7 2 3 1 PIODA Digital Outputs dl 8 2 3 8 PIODA Digital put con 8 239 PIODA Antlnstal lice a it 8 2 3 10 PIODA _IntRemove wii cccccecescscssescsvscescscssscsvscessscsesvavsceevscssnsvavscesees 9 PIO D96 Demo Programs For Linux ccsscccssssccsssccssscssssccssssssesssscsseessesees 11 Sal DEMO Code POUM oi 11 3 2 Demo Code POLAR ai i bd aeons 11 Bo PGT COS Meets 12 3 4 Demo code aie i eh dada 12 PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 2 1 Linux Software Installation The PIO D96 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 Copy the linux driver ixpio 0 20 4 tar gz or the later driver version in the directory NAPDOS Linux of the companion CD to the linux host that you want to install driver Step 2 Decompress the tarball ixpio 0 20 4 tar gz Step 3 Type cd to the directory containing the package s source code and type configure to configure the package for your system Step 4 Type make to compile the package Step 5 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 Uninstall
6. fined Interrupt active mode error 10 PIODA_ADD_SIGNAL_ERROR Add signal condition error 2 2 Function Descriptions Table 2 2 Function Definition WORD PIODA_ GetDriverVersion void WORD PIODA_ GetLibaryVersion void int PIODA_Open char dev_file WORD PIODA_Close WORD fd WORD PIODA_DriverInit WORD 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 D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 5 2 3 Digital I O FUNCTIONS 2 3 1 2 3 2 2 3 3 PIODA GetDriverVersion Description To show the version number of PIO PISO linux driver Syntax WORD PIODIO_ GetDriverVersion Void Parameter None Return The code PIODA_NOERROR Please refer to Section 2 1 Error Code PIODA_GetLibaryVersion Description To show the version number of PIO PISO linux static libary Syntax WORD PIODIO_ GetLibaryVersion void Parameter None Return The code PIODA_NOERROR Please refer to Section 2 1 Error Code PIODA_Open Description To open device file Syntax int PIODIO_Open char dev_file Parameter 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 PIO D9
7. ing 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 D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 3 2 Static Libary Function Description The static libary 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 libary will call the module ixpio to access the hardware system Function Call into Libary Development Toolkit Services Call into Kernel Mode Device Control Figure 2 1 PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 4 2 1 Table of ErrorCode and ErrorString Table 2 1 Hb Error ID Error String O PIODA _ NOERROR OK No error 1 PIODA_MODULE_NAME_GET_ERROR Module name can t get from file proc ixpio ixpio 2 PIODA_DEVICE DIO _INIT_ERROR Initial digital 1 O port 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 PIODA_CONFIGURE_INTERRUPT_ERROR Configure interrupt error PIODA_ACTIVEMODE_DEFINED_ERROR De
8. nvironments are presented as follows Table 3 1 Driver Name Directory Path File Name Description Include piodio h PIO PISO library header lib libpio a PIO PISO static libary ixpio 0 20 4 ah port c Digital input and output demo examples piod96 port_a c Dl and DO demo with libary int c Interrupt demo Int_a c Interrupt demo with libary 3 1 Demo code port c This demo program is used to output data from port 1 and read data from port 2 port 0 3 2 Demo 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 read data from port 0 port 2 PIO D96 User s Manual Ver 1 3 JUN 2004 PMH 008 13 11 3 3 Demo code int c This demo program uses P2CO0 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 if sig edge 0 the interrupt triggered at low signal 3 4 Demo code int_a c This demo program coded by using the static library libpio a to enable P2CO as interrupt source The interrupt will be triggered when the signal is low PIO D96 User s Manual Ver 1 0 SEP 2007 PMH 008 13 12
Download Pdf Manuals
Related Search
Related Contents
Pyramid Technologies PEQ-60 User's Manual Calentador para piscinas Manual de instalación & Modo de Empleo DULCODOS® Pool DSPa PRC pH / Redox Gear Head PB2200BLU Philips Forecast Revolution Tunturi C405 User's Manual Fours à pain, mode d`emploi Princess 221201 mixer Manual P040 CDX-505RF Copyright © All rights reserved.
Failed to retrieve file