Home

TIP840-SW-42 - powerbridge.de

image

Contents

1. TEWS S The Embedded VO Company TECHNOLOGIES TIP840 SW 42 VxWorks Device Driver 16 8 Channel 12 bit A D Version 2 0 x User Manual Issue 2 0 1 June 2008 TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC Am Bahnhof 7 Phone 49 0 4101 4058 0 9190 Double Diamond Parkway Phone 1 775 840 5830 25469 Halstenbek Germany Fax 49 0 4101 4058 19 Suite 127 Reno NV 89521 USA Fax 1 775 201 0347 www tews com e mail info tews com www tews com e mail usasales tews com TIP840 SW 42 VxWorks Device Driver 16 8 Channel 12 bit A D Supported Modules TIP840 Issue 1 0 1 1 2 0 0 2 0 1 TIP840 SW 42 VxWorks Device Driver General Revision TEWS S 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 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 Date May 1996 November 2003 IPAC Carrier Driver Support April 17 2008 Carrier Driver description added June 24 2008 Page 2 of 22 TEWS amp TECHNOLOGIES Table of Contents 1 INTRODUCTION SG GE EG EG N GN GN
2. function request This argument specifies the function that shall be executed Following functions are defined Function Description FIO TIP840 SETMODE Set differential or single ended mode for AD conversion FIO_TIP840_SETGAIN Set gain for AD conversion FIO_TIP840 READ ADC Read from an ADC channel arg This parameter depends on the selected function request How to use this parameter is described below with the function TIP840 SW 42 VxWorks Device Driver Page 17 of 22 TEWS amp TECHNOLOGIES RETURNS Function dependent value described with the function 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 VO routine ioctl TIP840 SW 42 VxWorks Device Driver Page 18 of 22 TEWS amp TECHNOLOGIES 4 3 1 FIO TIP840 SETMODE NAME FIO TIP840 SETMODE Set differential or single ended mode AD conversion DESCRIPTION This function is used to define if the ADC input multiplexer shall be configured to 16 single ended channels or to 8 differential channels The function specific control parameter arg is a value describing the new AD conversion mode Valid values for the ADC mode are Value Description TIP840 SINGLE TIP840 ADC inputs are configured for single ended
3. Device Driver Page 9 of 22 TEWS amp TECHNOLOGIES 3 2 tip840DevCreate NAME tip840DevCreate Add a TIP840 device to the VxWorks system SYNOPSIS include tip840 h STATUS tip840DevCreate char name int devldx int 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 This string specifies the name of the device that will be used to identify the device for example for open calls devldx This index number specifies the TIP840 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 jipFindDevice function will find the devices For TIP840 devices there is only one devidx per hardware module starting with devidx 0 funcType This parameter is unused and should be set to 0 TIP840 SW 42 VxWorks Device Driver Page 10 of 22 TEWS amp TECHNOLOGIES pParam This parameter points to a structure 7 P840_DEVCONFIG containing the default configuration of the channel The structure TIP840 DEVCONFIG has the following layout and is defined in tip840 h typedef struct struct ipac_resource ipac TIP840 DEVCONFIG ipac Pointer to TIP840 module resource descriptor retrieved by CARRIER Dri
4. Page 22 of 22
5. channels TIP840_DIFF TIP840 ADC inputs are configured for differential channels not supported by TIP840 10 11 EXAMPLE include tip840 h int status int fd Select single ended input mode status ioctl fd FIO TIP840 SETMODE TIP840 SINGLE if status OK ioctl function successful else handle error ERRORS S tip840Drv IMODE Mode not supported TIP840 10 10 only supports single ended mode TIP840 SW 42 VxWorks Device Driver Page 19 of 22 TEWS amp TECHNOLOGIES 4 3 2 HIO TIP840 SETGAIN NAME FIO TIP840 SETGAIN Set gain for AD conversion DESCRIPTION This function is used to define the gain of the programmable amplifier for the ADC inputs The selected gain value must be specified in the function dependent argument arg as follows Value Description TIP840 GAIN 1 Select Gain 1x Valid for TIP840 10 11 20 21 TIP840 GAIN 10 Select Gain 10x Valid for TIP840 10 20 TIP840 GAIN 100 Select Gain 100x Valid for TIP840 10 20 TIP840 GAIN 2 Select Gain 2x Valid for TIP840 11 21 TIP840 GAIN 4 Select Gain 4x Valid for TIP840 11 21 TIP840 GAIN 8 Select Gain 8x Valid for TIP840 11 21 EXAMPLE include tip840 h int status int fd Set gain 1 status ioctl fd FIO TIP840 SETGAIN TIP840 GAIN 1 if status OK ioctl function successful else handle error ERRORS S_tip8
6. 40Drv_IARG Invalid argument TIP840 10 20 only supports 3 different gain levels TIP840 SW 42 VxWorks Device Driver Page 20 of 22 TEWS amp TECHNOLOGIES 4 3 3 HIO TIP840 READ ADC NAME FIO TIP840 READ ADC Read from a ADC channel DESCRIPTION The ioctl function is used to read the value of a specified ADC channel This function will use the ADC mode and gain which has been programmed with the last calls to the ioctl functions FIO_TIP840_SETMODE and FIO_TIP840_SETGAIN The argument arg points to a driver specific VO parameter structure of type TIP840 ADC BUFFER typedef struct unsigned int flags unsigned int channel int data int timeout TIP840_ADC_BUFFER flags If the ADC channel specified by the parameter channel has changed from a previous call of read the data conversion will be automatically delayed until the settling time for the programmable gain amplifier has expired to get the best accuracy of the converted value However this delay can be disabled by setting the flag T P840_IGNORE The flag T P840_CORRECTION will enable the correction of the gain and offset error of the TIP840 with the factory calibration information which is stored in the ID PROM All errors are considered to be linear For each of the programmable gains two correction numbers are used One corrects the offset or zero error and the second corrects the gain error see also Hardware User Manual chapter Data correcti
7. AC 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 interface The TEWS TECHNOLOGIES IPAC Carrier Driver CARRIER SW 42 is part of this TIP840 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 tip840exa 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 interrupt level setup by itself TIP840 SW 42 VxWorks Device Driver Page 5 of 22 TEWS amp TECHNOLOGIES 2 Installation The following files and directories are located on the distribution media Directory path TIP840 SW 42 tip840drv c TIP840 device driver source tip840def h TIP840 driver include file tip840 h TIP840 include file for driver and application t
8. Ge 4 1 1 Device Driver EE ME ER AE OE EE EE EE EEN 4 1 2 IPAC Canter Driver sie ei se oes ie EE EE ee Ee De oos eo EE Ee ek ee ee ek een Pe ee De 5 2 INSTALLATION EERS ese as ee se ee ek N es es Es 6 2 1 Include device driver in Tornado IDE project ese EER RR KERR RR RE RE GR AR RE RE Ge RR RE RE Ge ARK REG Ge RR EE Ee ee 6 2 2 System resource requirement ee see ese KA AR REG ER KEER RE RA AR REG AR RAGE ER Re AR RA AR RR GA ER Re ER RR AR Rae RR Ka ee EE Ee AE 7 3 VO SYSTEMEUMNETIONS REEN EGEE SPEKE GE ROSE KEER KENS RENEE ERENS G KG ERGE ERENS GEGEE 8 ae DA EE EE EE N EE EE EE EE 8 3 2 tp8A0DevCreate is ee EG ge GR Ee ee DO Ge ee dane ee Ge ee 10 4 VO FUNCTIONS issie We ei Ge ee ES We EG Gee Se GR Ge EG GE ve ii 13 Ee IR EE EE EE N N EE EE EE 13 EE EE N N N N EE saae ai 15 ES EER RE EE N N NE ER N EE ER N N NE 17 4 3 1 FIO TIP840 SETMODE iis e dese de ee ee ee se ee ee ee ee de de ee a Ge ee ee ee ee AA Ge AA ee ee ER Re ee AA Ge ee Re 19 432 FIO TIP840 SET GAIN cc sel EES ees ee bee Was ee ge ag VER ER seed NE RES EDE RE aE eek Re Reg EN ee SKEER ie 20 4 3 3 FIO TIP840 READ ADC iese sees ee ee ee de se ee ee annain Ge AA Ge ee ee ee AA AA ee AA ee RR ee Nakai ee Ge ee 21 TIP840 SW 42 VxWorks Device Driver Page 3 of 22 TEWS amp TECHNOLOGIES 1 Introduction 1 1 Device Driver The TIP840 SW 42 VxWorks device driver software allows the operation of the TIP840 IP conforming to the VxWorks VO
9. close int 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 int fd int retval close the device wf retval close fd if retval ERROR Handle error RETURNS A device descriptor number or ERROR if the function fails an error code will be stored in errno TIP840 SW 42 VxWorks Device Driver Page 15 of 22 TEWS amp TECHNOLOGIES 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 VO routine close TIP840 SW 42 VxWorks Device Driver Page 16 of 22 TEWS amp TECHNOLOGIES 4 3 ioctl NAME ioctl performs an I O control function SYNOPSIS include tip840 h int ioctl int fd int request int arg DESCRIPTION Special VO operation that do not fit to the standard basic I O calls will be performed by calling the ioctl function with a specific function code and an optional function dependent argument For details of supported ioctl functions see VxWorks Reference Manual VxWorks Programmer s Guide I O system PARAMETER fd This file descriptor specifies the device to be used The file descriptor has been returned by the open
10. ent gt lt number of devices gt lt device requirement gt 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 TIP840 SW 42 VxWorks Device Driver Page 7 of 22 TEWS amp TECHNOLOGIES 3 I O system functions This chapter describes the driver level interface 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 tip840Drv NAME tip840Drv installs the TIP840 driver in the VO system SYNOPSIS include tip840 h STATUS tip840Drv void DESCRIPTION This function initializes the TIP840 driver and installs it in the VO system The call of this function is the first thing the user has to do before adding any device to the system or performing any VO request EXAMPLE include tip840 h Initialize Driver status tip840Drv if status ERROR Error handling RETURNS OK or ERROR if the function fails TIP840 SW 42 VxWorks Device Driver Page 8 of 22 TEWS amp TECHNOLOGIES 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 TIP840 SW 42 VxWorks
11. evice error The certain TIP840 device seems to be faulty or isn t a TIP840 device at all EISCONN The Device has already been created SEE ALSO VxWorks Programmer s Guide I O System TIP840 SW 42 VxWorks Device Driver Page 12 of 22 TEWS amp TECHNOLOGIES 41 O Functions 4 1 open NAME open open a device or file SYNOPSIS int open const char name int flags int mode DESCRIPTION Before I O can be performed to the TIP840 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 tip840DevCreate must be used flags Not used mode Not used TIP840 SW 42 VxWorks Device Driver Page 13 of 22 TEWS amp TECHNOLOGIES EXAMPLE int fd Open the device named tip840 0 for I O fd open tip840 0 0 0 if f 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 VO routine open TIP840 SW 42 VxWorks Device Driver Page 14 of 22 TEWS amp TECHNOLOGIES 4 2 close NAME close close a device or file SYNOPSIS int
12. ip840exa c Example application include ipac_carrier h Carrier driver interface definitions TIP840 SW 42 2 0 1 pdf PDF copy of this manual Release txt Release information ChangeLog txt Release history 2 1 Include device driver in Tornado IDE project For Including the TIP840 SW 42 device driver into a Tornado IDE project follow the steps below 1 Copy the files from the distribution media into a subdirectory in your project path For example TIP840 2 Add the device drivers 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 TIP840 SW 42 VxWorks Device Driver Page 6 of 22 TEWS amp TECHNOLOGIES 2 2 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 lt 1KB lt 1KB Stack lt 1KB Semaphores 2 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 lt total requirement gt lt driver requirem
13. on channel This parameter specifies the channel to convert For TIP840 20 21 in single ended mode valid range is 1 16 For differential mode use range 1 8 For TIP840 10 11 only channels 1 8 are valid data If this ioctl function succeeds this parameter receives the converted ADC channel data timeout This parameter specifies the maximum time in system ticks the user is wiling to wait for ioctl completion A value of 1 means wait forever a value of 0 means no wait and a value greater than 0 means wait timeout system ticks TIP840 SW 42 VxWorks Device Driver Page 21 of 22 TEWS amp TECHNOLOGIES EXAMPLE include tip840 h TIP840_ADC_BUFFER ADCbuf int fd STATUS status int error Start a conversion on ADC channel 1 and correct the result of the conversion by the factory calibration information ADCbuf flags TIP840_CORRECTION ADCbuf channel 1 status ioctl fd FIO_TIP840_READ ADC int amp ADCbuf if status ERROR printf Device read error errno xh n errnoGet else printf ADC value d n ADCbuf data ERRORS S_tip840Drv_ICHAN Invalid ADC channel number Check if module is configured to differential mode S_tip840Drv_IARG The supplied pointer to the buffer is not valid S objLib OBJ TIMEOUT The conversion timed out or another conversion pending TIP840 SW 42 VxWorks Device Driver
14. system specification This includes a device independent basic VO interface with open close and ioctl functions The TIP840 SW 42 driver includes the following functions gt Reading ADC data optional data correction with factory calibrated data gt Programming gain for ADC channels gt Programming single or differential ADC Inputs The TIP840 SW 42 driver supports the modules listed below TIP840 10 8 single ended channel 12 bit ADC IndustryPack gain 1 10 100 TIP840 11 8 single ended channel 12 bit ADC IndustryPack gain 1 2 4 8 TIP840 20 16 single ended 8 differential channel 12 bit ADC IndustryPack gain 1 10 100 TIP840 21 16 single ended 8 differential channel 12 bit ADC IndustryPack gain 1 2 4 8 To get more information about the features and use of the supported devices it is recommended to read the manuals listed below TIP840 User manual TIP840 Engineering Manual CARRIER SW 42 IPAC Carrier User Manual TIP840 SW 42 VxWorks Device Driver Page 4 of 22 TEWS amp TECHNOLOGIES 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 IP
15. ver ipFindDevice function EXAMPLE include tip840 h STATUS result TIP840_DEVCONFIG tip840Conf struct ipac_resource ipac IPAC CARRIER Driver initialization KR Find an IP module from TEWS TECHNOLOGIES manufacturer 0xB3 7 with model number MODEL TIP840 see tip840 h This module RN uses interrupts and we need only the IO space base address for the KE related driver E result ipFindDevice 0xB3 MODEL_TIP840 0 IPAC_INTO_EN IPAC_LEVEL_SENS IPAC_CLK_8MHZ amp ipac if result OK devConfig ipac amp ipac Create the device tip840 0 xf tip840Conf ipac amp ipac TIP840 SW 42 VxWorks Device Driver Page 11 of 22 TEWS amp TECHNOLOGIES result tip840DevCreate tip840 0 0 0 void amp tip840Conf if result OK Device successfully created else Error occurred when creating the device else printf 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 ERROR CODES The error codes are stored in errno and can be read with the function errnoGet Error code Description S_ioLib_NO_DRIVER Driver not installed run tip840Drv S_tip840Drv_IARG Invalid argument in device configuration buffer Please check all arguments given to tip840DevCreate S_ioLib_DEVICE_ERROR D

Download Pdf Manuals

image

Related Search

Related Contents

  MC-10VB  オーガニック カーボン ヒーター 取扱説明書  un psychiatre condamné aux Assises pour le viol de deux patientes  hp cp1700 a3 printer service manual  Tecumseh RKA5490CXC Performance Data Sheet  Manuel de réparation SOMECA FIAT 780 780DT 880 et 880DT  Impressoras HP LaserJet 9000, 9000n e 9000dn  Corsair CMPSU-750AX A power supply unit  KS50 (E,S) - WEKA Service-Portal - WEKA  

Copyright © All rights reserved.
Failed to retrieve file