Home
User Manual - powerbridge.de
Contents
1. esee enne nennt ettet nnns tris ettet nennen 21 3 2 5 tdrvOOSOUtputSelBiIs coe terere teet ere ree esee 23 3 2 6 tdrvoOSOQuitputGleaiBits 2 25 327 tdrvOOSEVOntWall eere t et unte catu e EE E tuu a eoe ue 27 3 2 8 1 0 29 3 2 9 tdrvOO3DebouncerbDisable enne nnne 31 3 2 10 tdrvoO3WatchdogEnable nnne 33 3 2 11 tdrvoO3WatchdogDisable ener enne nnne 35 3 2 12 1 eene nenne enne n nnne enne 37 4 LEGACY SYSTEM FUNCTIONS 39 e SEL e 39 5 DEBUGGING AND DIAGNOSTIC odii 40 TDRV003 SW 42 VxWorks Device Driver Page 3 of 40 TEWS 2 gt TECHNOLOGIES 1 Introduction The TDRV003 SW 42 VxWorks device driver software allows the operation of the modules supported by TDRV003 conforming to the VxWorks system specification The TDRV003 SW 42 release contains independent driver sources for the old legacy pre VxBus and the new VxBus enabled driver model The VxBus enabled driver is recommended for new developments with later VxWorks 6 x releases and mandatory for VxWorks SMP systems Both drivers legacy and VxBus
2. 1 INTRODUC FION iat 4 INST ALTON 5 2 1 VXBUS DFIVGE cesson nnno usare nur Rush non RENE EEA eea A Ka n ep annaa eE eaaa anaandaa 6 2 2 VxBus Driver Installation 6 2 2 1 Dir ct BSP Bullds eite Ds ase a E eee dne uv Era deg a DX vu add 8 2 3 Legacy Driver Installation eese 8 2 3 1 Include Device Driver in VxWorks Projects sseeseene enm enne 8 2 3 2 Special Installation for Intel x86 based Targets 8 2 8 8 BSP dependent 4 1 entente nennen 9 2 3 4 System Resource 4 enne nnne nnne 10 2 4 Special Config rallOris 2c era eaer aa saan nnne Ea eere reae e a eI occu aperia Faune ru 10 APIDOCUMENTATION aaan 11 3 1 General FURCIORS 11 3 1 1 TORVOOS OPEN 11 B12 1957003036 13 3 2 Device Access Functions 1 esee 15 3 2 1 TOPVOOSIMPUTREAG kaspan 15 3 2 2 17 3 2 3 drvOOSOQUtputReadl ee ent 19 3 24 00
3. TEWS 2 gt TECHNOLOGIES 3 2 11 tdrvoO3WatchdogDisable NAME tdrvO03WatchdogDisable disable output watchdog SYNOPSIS TDRVOOS STATUS tdrv003WatchdogDisable TDRVO0OS HANDLE hdl DESCRIPTION This function disables the watchdog timer for the output lines PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function EXAMPLE include tdrv003api h TDRV003 HANDLE hdi TDRVO0OO3 STATUS result Disable output watchdog result tdrv003WatchdogDisable hdl if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 35 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRV003 SW 42 VxWorks Device Driver Page 36 of 40 TEWS 2 gt TECHNOLOGIES 3 2 12 tdrvoO3WatchdogReset NAME tdrvO0O3WatchdoghReset reset output watchdog error SYNOPSIS TDRVOOS STATUS tdrv003WatchdogReset TDRVO0OS HANDLE hdl DESCRIPTION This device function resets an output watchdog error This function must be called after a device function returns the error code TDRV003_ERR_IO PARAMETERS hal This argument specifies the device handle
4. TEWS 2 Embedded I O Company TECHNOLOGIES TDRV003 SW 42 VxWorks Device Driver 16 8 Digital Inputs and 16 8 Digital Outputs Version 4 0 x User Manual Issue 4 0 0 July 2013 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 TDRV003 SW 42 VxWorks Device Driver 16 8 Digital Inputs and 16 8 Digital Outputs 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 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 2005 2013 by TEWS TECHNOLOGIES GmbH Issue Description Date 1 0 0 First Issue October 14 2005 1 0 1 New Address TEWS LLC general revision October 21 2008 2 0 0 API documentation added September 6 2010 2 0 1 General Revision January 25 2011 3 0 0 VxWorks 6 9 support 64 bit support February 07 2012 4 0 0 API modified Basic I O functions removed July 04 2013 TDRV003 SW 42 VxWorks Device Driver Page 2 of 40 TEWS E TECHNOLOGIES Table of Contents
5. USERDEFINED IO OFFSET The value of this definition must be set to the offset between CPU Bus and PCI Bus Address for PCI space access USERDEFINED LEV2VEC The value of this definition must be set to the difference of the interrupt vector used to connect the ISR and the interrupt level stored to the PCI header Another definition allows a simple adaptation for BSPs that utilize a pcilntConnect function to connect shared PCI interrupts If this function is defined in the used BSP the definition of USERDEFINED SEL PCIINTCONNECT should be enabled The definition by command line option is made by D lt definition gt Please refer to the BSP documentation and header files to get information about the interrupt connection function and the required offset values TDRV003 SW 42 VxWorks Device Driver Page 9 of 40 TEWS TECHNOLOGIES 2 3 4 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 52 Bytes 52 Bytes max jobs 12 Bytes Stack 200 Byte Semaphores 0 lt max jobs gt max jobs TDRV003_NUMJOBS 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 requirement gt lt number of
6. result tdrv003EventWait hdl TDRV003 ANY TR 1 lt lt 15 5000 if result TDRV003 OK handle error RETURNS On success TDRV003_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRVOOS ERR BUSY No more free entries in the drivers queue to handle concurrent event controlled read requests Increase the queue size see also 2 4 TDRVOOS ERR TIMEOUT The requested event does not occur within the specified time timeout TDRV003 SW 42 VxWorks Device Driver Page 28 of 40 TEWS 2 gt TECHNOLOGIES 3 2 8 tdrv0OO3DebouncerEnable NAME tdrv003DebouncerEnable configure and enable debouncer circuit SYNOPSIS TDRVOOS STATUS tdrvO03DebouncerEnable TDRV003_ HANDLE hdl unsigned short debounceTimer DESCRIPTION This function configures and enables the input debouncer circuit PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function debounce Timer This argument specifies the debouncer time The debouncer time is specified in approx 7us steps Please refer to the corresponding Hardware User Manual for a calculation formula and a table of values EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result Enable the debou
7. 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 VxWorks User s Guide e g Tornado Workbench etc 2 3 2 Special Installation for Intel x86 based Targets The TDRVO00OSG device driver is fully adapted for Intel x86 based targets This is done by conditional compilation directives inside the source code and controlled by the VxWorks global defined macro CPU FAMILY If the content of this macro is equal to 80X86 special Intel x86 conforming code and function calls will be included The second problem for Intel x86 based platforms can t be solved by conditional compilation directives Due to the fact that some Intel x86 BSP s doesn t map PCI memory spaces of devices which are not used by the BSP the required device memory spaces can t be accessed To solve this problem a MMU mapping entry has to be added for the required 003 PCI memory spaces prior the MMU initialization usrMmulnit is done The C source file tdrvOO3pci c contains the function tdrvOOSPcilnit This routine finds out all TDRVO00S devices and adds MMU mapping entries for all used PCI memory spaces Please insert a call to this function after the PCI initialization is done and prior to MMU initialization usrMmulnit TDRV003 SW 42 VxWorks Device Driver Page 8 of 40 TEWS 2 gt TECHNOLOGIES The right place to call the functi
8. of output line 1 bit 1 specifies the new state for output line 2 and so on EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result set OUTPUT1 and OUTPUT16 and clear all other result tdrv0030utputWrite hdl 0x8001 if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 17 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRVOOS ERR IO The output register is locked by a watchdog failure Execute the function tdrvoO3WatchdogReset to reset the watchdog error TDRV003 SW 42 VxWorks Device Driver Page 18 of 40 TEWS 2 gt TECHNOLOGIES 3 2 3 tdrv0O3OutputRead NAME tdrvOO3OutputRead read current state of output lines SYNOPSIS TDRVO00OS STATUS tdrv0030utputRead TDRV0OS HANDLE hdl unsigned short pOutputBuf DESCRIPTION This function reads the current state of the output lines PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function pOutputBuf This argument points to a buffer where the value will be returned TDRV003 SW 42 VxWorks Device Driver Page 19 of 40 TEWS 2 gt TECHNOL
9. share the same application programming interface API and device independent basic I O interface with open close and ioctl functions The basic I O interface is only for backward compatibility with existing applications and should not be used for new developments Both drivers invoke a mutual exclusion and binary semaphore mechanism to prevent simultaneous requests by multiple tasks from interfering with each other The TDRV003 SW 42 device driver supports the following features read the actual input value write a new output value wait for selectable input events match high low any transition on the input line s enable and disable the output watchdog acknowledge watchdog errors configure enable and disable input debouncing VVVVVV The TDRV003 SW 42 supports the modules listed below TPMC670 16 8 Digital Input 24V PMC 16 8 Digital Output 24V 0 5A 50 pin connector TPMC671 16 Digital Input 24V PMC 16 Digital Output 24V 0 5A 64 pin connector In this document all supported modules and devices will be called TDRV003 Specials for certain devices will be advised To get more information about the features and use of TDRV003 devices it is recommended to read the manuals listed below TPMC670 TPMC671 User Manual TPMC670 TPMC671 Engineering Manual TDRV003 SW 42 VxWorks Device Driver Page 4 of 40 TEWS 2 gt TECHNOLOGIES 2 Installation The following files are located on the distrib
10. to the hardware module retrieved by a call to the corresponding open function EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result Reset watchdog error result tdrv003WatchdogReset hdl if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 37 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRV003 SW 42 VxWorks Device Driver Page 38 of 40 TEWS E TECHNOLOGIES 4 Legacy I O System Functions This chapter describes functions which are relevant only for the legacy TDRV003 driver 4 1 tdrvOO3Pcilnit NAME tdrv003Pcilnit Generic PCI device initialization SYNOPSIS void tdrvOOS3Pcilnit DESCRIPTION This function is required only for Intel x86 VxWorks platforms The purpose is to setup the MMU mapping for all required TDRV003 PCI spaces base address register and to enable the 003 device for access The global variable tdrvOO3Status obtains the result of the device initialization and can be polled later by the application before the driver will be installed Value Meaning gt 0 Initialization successfully completed The value of tdrvOO3Status is equal to the
11. unsigned short plnputBuf DESCRIPTION This function reads the current state of the input lines PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function This argument points to a buffer where the value will be returned TDRV003 SW 42 VxWorks Device Driver Page 15 of 40 TEWS E TECHNOLOGIES EXAMPLE include tdrv003api h TDRV003_ HANDLE hdl TDRV003_STATUS result unsigned short data result tdrv00O3InputRead hdl amp data if result TDRV003 OK handle error RETURNS On success TDRV003_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVO0OS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRV003 SW 42 VxWorks Device Driver Page 16 of 40 TEWS 2 gt TECHNOLOGIES 3 2 2 tdrv003OutputWrite NAME tdrv0O3OutputWrite write a new value to the output port SYNOPSIS TDRVO0OS STATUS tdrvOOS3OutputWrite TDRV0OOS HANDLE hdl unsigned short outputValue DESCRIPTION This function writes a new value to the output port PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function output Value This argument specifies the new output value Bit 0 specifies the new state
12. 2 VxWorks Device Driver Page 11 of 40 TEWS E TECHNOLOGIES RETURNS A device descriptor pointer or NULL if the function fails An error code will be stored in errno ERROR CODES All error codes are standard error codes set by the I O system TDRV003 SW 42 VxWorks Device Driver Page 12 of 40 TEWS 2 gt TECHNOLOGIES 3 1 2 tdrv003Close NAME tdrvO03Close Closes a Device SYNOPSIS TDRVOOS STATUS tdrv003Close TDRV0OS HANDLE hdl DESCRIPTION This function closes previously opened devices PARAMETERS hal This value specifies the device handle to the hardware module retrieved by a call to the corresponding open function EXAMPLE include tdrv003api h TDRV0O0O3 HANDLE hdl TDRV00O3 STATUS result close file descriptor to device result tdrv003Close hdl if result TDRV003 OK handle close error TDRV003 SW 42 VxWorks Device Driver Page 13 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRVO003 or an appropriate error code ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRV003 SW 42 VxWorks Device Driver Page 14 of 40 TEWS E TECHNOLOGIES 3 2 Device Access Functions 3 2 1 tdrvOO3InputRead NAME tdrvOOS3InputRead read state of input lines SYNOPSIS TDRVO00OS STATUS tdrvOO3InputRead TDRVO0OS HANDLE hdl
13. CPU PENTIUM4 TOOL diab VXBUILD SMP To build 64 bit libraries the argument VXBUILD LP64 must be added to the command line gt make TOOL gnu CPU CORE VXBUILD LP64 For 64 bit SMP enabled libraries a build command may look like this gt make TOOL gnu CPU CORE VXBUILD LP64 SMP To integrate the TDRVO003 driver with the VxWorks development tools Workbench the component configuration file 40tdrv003 cdf must be copied to the directory installDir vxworks 6 x target config comps VxWorks gt cd WindRiver vxworks 6 7 target 3rdparty tews tdrv003 gt copy 40tdrv003 cdf Windriver vxworks 6 7 target config comps vxWorks In VxWorks 6 7 and newer releases the kernel configuration tool scans the CDF file automatically and updates the CxrCat txt cache file to provide component parameter information for the kernel configuration tool as long as the timestamp of the copied CDF file is newer than the one of the CxrCat txt If your copy command preserves the timestamp force to update the timestamp by a utility such as touch In earlier VxWorks releases the CxrCat txt file may not be updated automatically In this case remove or rename the original CxrCat txt file and invoke the make command to force recreation of this file C gt cd Windriver vxworks 6 7 target config comps vxWorks C gt del CxrCat txt gt make After successful completion of all steps above and restart of the Wind River Workbench the TDRV003 dri
14. OGIES EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result unsigned short data result tdrv003OutputRead hdl amp data if result TDRV003 OK handle error RETURNS On success TDRV003_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRVOOS ERR IO The output register is locked by a watchdog failure Execute the function tdrvoO3WatchdogReset to reset the watchdog error TDRV003 SW 42 VxWorks Device Driver Page 20 of 40 TEWS 2 gt TECHNOLOGIES 3 2 4 tdrvOO3OutputWriteMask NAME tdrvOOSOutputWriteMask writes a masked value to the output port SYNOPSIS TDRVO0OS STATUS tdrvOO3OutputWriteMask TDRV0OS HANDLE hdl unsigned short outputValue unsigned short mask DESCRIPTION This control function writes a masked value to the output port Only those bits in value for which the corresponding bit position in the mask is set to 1 will be changed in the output port PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function output Value This argument specifies the masked value for the output port Bit 0 corresponds to the first output line bit 1 corresponds to the second output line and so on mask This argument speci
15. a call to the corresponding open function outputBits This argument specifies a mask of relevant bits to set Bit 0 corresponds to the first output line bit 1 corresponds to the second output line and so on Bits which are set 1 in this mask will be set in the corresponding bits in the output port EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result set OUTPUT1 and OUTPUT16 to active state result tdrv003OutputSetBits hdl 1 15 1 0 if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 23 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRVOOS ERR IO The output register is locked by a watchdog failure Execute the function tdrvoO3WatchdogReset to reset the watchdog error TDRV003 SW 42 VxWorks Device Driver Page 24 of 40 TEWS 2 gt TECHNOLOGIES 3 2 6 tdrvO0O3OutputClearBits NAME tdrv0O3OutputClearBits clear specific output lines SYNOPSIS TDRVOOS STATUS tdrvOOS3OutputClearBits TDRV0OS HANDLE hdl unsigned short outputBits y DESCRIPTION This function clears specific bits in the output port to inactive state 0 PARAMETERS hdl This argument sp
16. 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 2 4 Special Configurations The value TDRV00O3 NUMJOBS defined in tdrv003def h specifies the maximum number of jobs that can be handled at the same time for a device System resources will be allocated while driver start to prevent extra time during normal application operation This value may be changed to increase the maximum number of jobs or decreased to save system resources The driver must be built again after changing TDRV003_NUMJOBS TDRV003 SW 42 VxWorks Device Driver Page 10 of 40 TEWS E TECHNOLOGIES 3 API Documentation 3 1 General Functions 3 1 1 tdrv0O3Open NAME tdrvOOSOpen Opens a Device SYNOPSIS TDRVO003 HANDLE tdrv003Open char deviceName DESCRIPTION Before I O can be performed to a device a file descriptor must be opened call to this function PARAMETERS deviceName This parameter points to a null terminated string that specifies the name of the device The first TDRV003 device is named tdrv003 0 the second device is named tdrv003 1 and so on EXAMPLE include tdrv003api h TDRV003 HANDLE hdl open file descriptor to device hdl tdrv003Open tdrv003 0 if hdl NULL handle open error TDRV003 SW 4
17. ecifies the device handle to the hardware module retrieved by a call to the corresponding open function outputBits This argument specifies a mask of relevant bits to clear Bit O corresponds to the first output line bit 1 corresponds to the second output line and so on Bits which are set 1 in this mask will be cleared in the corresponding bits in the output port EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result clear OUTPUT1 and OUTPUT16 result tdrv0030utputSetBits hdl 1 15 1 0 if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 25 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRVOOS ERR IO The output register is locked by a watchdog failure Execute the function tdrvoO3WatchdogReset to reset the watchdog error TDRV003 SW 42 VxWorks Device Driver Page 26 of 40 TEWS 2 gt TECHNOLOGIES 3 2 7 tdrvOO3EventWait NAME tdrv003EventWait wait for a specific input event SYNOPSIS TDRVOOS STATUS tdrvOO3EventWait TDRV0OS HANDLE hdl unsigned short mode unsigned short mask long timeout JP DESCRIPTION This function waits for an event rising
18. en API function tdrv003Show Probed Modules 0 TPMC671 Bus 4 Dev 2 DevId 0x029f VenId 0x1498 Init OK vxDev 0xffff800000005580 Associated Devices 0 TPMC671 tdrv003 0 Device Statistics tdrv003 0 open count interrupt count Current Input Value Current Output Value Active pending Jobs Debouncer disabled Watchdog disabled 0 0 0x0000 0x0000 0 TDRV003 SW 42 VxWorks Device Driver Page 40 of 40
19. fies the mask for relevant bits Bit 0 corresponds to the first output line bit 1 corresponds to the second output line and so on Only those bits in outputValue for which the corresponding bit position in this mask is set to 1 will be changed in the output port TDRV003 SW 42 VxWorks Device Driver Page 21 of 40 TEWS 2 gt TECHNOLOGIES EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result clear OUTPUT1 and set OUTPUT16 and leave all other lines unchanged result tdrv003OutputWriteMask hdl 0 8000 0x8001 if result TDRV003 OK handle error RETURNS On success TDRV003_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRVOOS ERR IO The output register is locked by a watchdog failure Execute the function tdrvoO3WatchdogReset to reset the watchdog error TDRV003 SW 42 VxWorks Device Driver Page 22 of 40 TEWS 2 gt TECHNOLOGIES 3 2 5 tdrv0O3OutputSetBits NAME tdrvOO3OutputSetBits set specific output lines SYNOPSIS TDRVOOS STATUS tdrvOO3OutputSetBits TDRV0OS HANDLE hdl unsigned short outputBits y DESCRIPTION This function sets specific bits in the output port to active state 1 PARAMETERS hdl This argument specifies the device handle to the hardware module retrieved by
20. ion Hardware dependent interface functions and definitions Page 5 of 40 TEWS SE TECHNOLOGIES 2 1 Legacy vs VxBus Driver In later VxWorks 6 x releases the old VxWorks 5 x legacy device driver model was replaced by VxBus enabled device drivers Legacy device drivers are tightly coupled with the BSP and the board hardware The VxBus infrastructure hides all BSP and hardware differences under a well defined interface which improves the portability and reduces the configuration effort A further advantage is the improved performance of calls by using the method interface and bypassing the VxWorks basic I O interface VxBus enabled device drivers are the preferred driver interface for new developments The checklist below will help you to make a decision which driver model is suitable and possible for your application Legacy Driver VxBus Driver VxWorks 5 x releases VxWorks 6 6 and later releases VxWorks 6 5 and earlier WE Aes releases SMP systems only the VxBus VxWorks 6 x releases without OME Sale VxBus PCI bus support 64 bit systems only the VxBus driver is 64 bit compatible TEWS TECHNOLOGIES recommends not using the VxBus Driver before VxWorks release 6 6 In previous releases required header files are missing and the support for 3 party drivers may not be available 2 2 VxBus Driver Installation Because Wind River doesn t provide a standard installation method f
21. ncer with a debounce time of ims result tdrv003DebouncerEnable hdl 147 if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 29 of 40 TEWS E TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRV003 SW 42 VxWorks Device Driver Page 30 of 40 TEWS 2 gt TECHNOLOGIES 3 2 9 tdrv00O3DebouncerDisable NAME tdrvoO3DebouncerDisable disable debouncer circuit SYNOPSIS TDRVOOS STATUS tdrvOO3DebouncerDisable TDRVO0OS HANDLE hdl DESCRIPTION This function disables the input debouncer circuit PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result Disable the debouncer circuit result tdrv003DebouncerDisable hdl if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 31 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The s
22. number of mapped PCI spaces 0 No TDRV003 device found 0 Initialization failed The value of tdrv0O3Status amp OxFF is equal to the number of mapped spaces until the error occurs Possible cause Too few entries for dynamic mappings in sysPhysMemDesc Remedy Add dummy entries as necessary syslib c EXAMPLE extern void tdrv00O3Init tdrv00O3PciInit TDRV003 SW 42 VxWorks Device Driver Page 39 of 40 TEWS 2 gt TECHNOLOGIES 5 Debugging and Diagnostic The TDRV003 device driver provides a function and debug statements to display versatile information of the driver installation and status on the debugging console If the VxBus driver is used the TDRVO003 show routine is included in the driver by default and can be called from the VxWorks shell If this function is not needed or program space is rare the function can be removed from the code by un defining the macro INCLUDE TDRV00O3 SHOW in tdrvOO3drv c The tdrv003Show function only if VxBus is used displays detailed information about probed modules assignment of devices respective device names to probed TDRV003 modules and device statistics If TDRVOOS3 modules were probed but no devices were created it may be helpful to enable debugging code inside the driver code by defining the macro TDRV003_ DEBUG in tdrvOO3drv c In contrast to VxBus TDRV003 devices legacy TDRV003 devices must be created manually This will be done with the first call to the tdrv0O3Op
23. on tarvOOS3Pcilnit is at the end of the function sysHwinit in sysLib c it can be opened from the project Files window tdrv003PciInit Be sure that the function is called prior to MMU initialization or otherwise the TDRV003 PCI spaces remain unmapped and an access fault occurs during driver initialization Modifying the sysLib c file will change the sysLib c in the BSP path Remember this for future projects and recompilations 2 3 3 BSP dependent Adjustments The driver includes a file called include tdhal h which contains functions and definitions for BSP adaptation It may be necessary to modify them for BSP specific settings Most settings can be made automatically by conditional compilation set by the BSP header files but some settings must be configured manually There are two ways of modification first you can change the include tdhal h and define the corresponding definition and its value or you can do it using the command line option D There are offset definitions USERDEFINED MEM OFFSET USERDEFINED IO OFFSET and USERDEFINED LEV2VEC that must be configured if a corresponding warning message appears during compilation These definitions always need values Definition values can be assigned by command line option D lt definition gt lt value gt Definition Description USERDEFINED MEM OFFSET The value of this definition must be set to the offset between CPU Bus and PCl Bus Address for PCI memory space access
24. or 87 party VxBus device drivers the installation procedure needs to be done manually In order to perform a manual installation extract all files from the archive TDRV003 SW 42 VXBUS zip to the typical 3 party directory installDir vxworks 6 x target 3rdparty whereas installDir must be substituted by the VxWorks installation directory After successful installation the TDRV003 device driver is located the vendor and driver specific directory installDir vxworks 6 x target 3rdparty tews tdrv003 At this point the TDRVOOS driver is not configurable and cannot be included with the kernel configuration tool in a Wind River Workbench project To make the driver configurable the driver library for the desired processor CPU and build tool TOOL must be built in the following way 1 Open a VxWorks development shell e g CAWindRiverwrenv exe p vxworks 6 7 2 Change into the driver installation directory installDir vxworks 6 x target 3rdparty tews tdrv003 3 Invoke the build command for the required processor and build tool with optional VXBUILD argument make CPU cpuName TOOL tool VXBUILD xxx TDRV003 SW 42 VxWorks Device Driver Page 6 of 40 TEWS 2 gt TECHNOLOGIES For Windows hosts this may look like this gt WindRiver vxworks 6 7 target 3rdparty tews tdrv003 C make CPU PENTIUMA TOOL diab To compile SMP enabled libraries the argument VXBUILD SMP must be added to the command line gt make
25. or falling edge or both at the specified input lines The function is blocked until at least one of the specified events or a timeout occurs PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function mode This argument specifies the kind of event to wait for The following event types are defined in tdrvOOS3api h Event Type Description TDRVO0OS HIGH TR Wait for a low to high transition on a specified input line TDRVOOS LOW TR Wait for a high to low transition on a specified input line TDRVOOS ANY TR Wait for any transition on a specified input line mask This argument specifies a bit mask of input lines to wait for the specified edge event Bit 0 corresponds to the first input line bit 1 corresponds to the second input line and so on Only one bit shall be set in the mask otherwise the occurred event cannot be determined exactly If more than one bit is set in the mask the function is completed the moment a relevant transition at least at one specified bit position occurs timeout Specifies the amount of time in milliseconds the caller is willing to wait for the specified event to occur A value of 0 means wait indefinitely TDRV003 SW 42 VxWorks Device Driver Page 27 of 40 TEWS 2 gt TECHNOLOGIES EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result wait at least 5 s for any edge at INPUT16
26. pecified TDRVOOS HANDLE is invalid TDRV003 SW 42 VxWorks Device Driver Page 32 of 40 TEWS 2 gt TECHNOLOGIES 3 2 10 tdrvoO3WatchdogEnable NAME tdrvOO3WatchdogEnable enable output watchdog SYNOPSIS TDRVOOS STATUS tdrv003WatchdogEnable TDRVO0OS HANDLE hdl DESCRIPTION This function enables the watchdog timer for the output lines The watchdog function is activated after the next write operation to the device Please remember that if the watchdog is enabled and no write access occurs within 120 ms all outputs go into the inactive 0 state To unlock the output register and leave the inactive state the function tdrvO03WatchdogReset must be executed PARAMETERS hal This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function EXAMPLE include tdrv003api h TDRV003 HANDLE hdl TDRV003_STATUS result Enable output watchdog result tdrv003WatchdogEnable hdl if result TDRV003 OK handle error TDRV003 SW 42 VxWorks Device Driver Page 33 of 40 TEWS 2 gt TECHNOLOGIES RETURNS On success TDRV003 OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRVOOS ERR INVALID HANDLE The specified TDRVOOS HANDLE is invalid TDRV003 SW 42 VxWorks Device Driver Page 34 of 40
27. ution media Directory path TDRV003 SW 42 TDRV003 SW 42 4 0 0 pdf PDF copy of this manual TDRV003 SW 42 VXBUS zip Zip compressed archive with VxBus driver sources TDRV003 SW 42 LEGACY zip Zip compressed archive with legacy driver sources ChangeLog txt Release history Release txt Release information The archive TDRV003 SW 42 VXBUS zip contains the following files and directories Directory path tews tdrv003 tdrvOO3drv c 003 device driver source tdrvO03def h TDRVOOS driver include file tdrv003 h TDRVOOS include file for driver and application tdrvO03api h tdrvO03api c TDRVO003 API include file TDRV003 API file Makefile Driver Makefile 40tdrv003 cdf Component description file for VxWorks development tools tdrv003 dc Configuration stub file for direct BSP builds tdrv003 dr Configuration stub file for direct BSP builds include tvxbHal h Hardware dependent interface functions and definitions apps tdrv003exa c Example application The archive TDRV003 SW 42 LEGACY zip contains the following files and directories Directory path tdrv003 tdrvOO3drv c tdrv003def h tdrv003 h tdrvOO3pci c tdrvO03api h tdrvO03api c tdrv003exa c include tdhal h TDRV003 SW 42 VxWorks Device Driver TDRV003 device driver source TDRVOOS driver include file TDRVOOS include file for driver and application 003 device driver source for x86 based systems TDRV003 API include file TDRV003 API file Example applicat
28. ver can be included in VxWorks projects by selecting the TEWS TDRV003 Driver component in the hardware default Device Drivers folder with the kernel configuration tool TDRV003 SW 42 VxWorks Device Driver Page 7 of 40 TEWS E TECHNOLOGIES 2 2 1 Direct BSP Builds In development scenarios with the direct BSP build method without using the Workbench or the vxprj command line utility the TDRVOOS3 configuration stub files must be copied to the directory installDir vxworks 6 x target config comps src hwif Afterwards the vxbUsrCmaLine c file must be updated by invoking the appropriate make command C cd WindRiver vxworks 6 7 target 3rdparty tews tdrv003 gt copy tdrv003 dc WindriverNvxworks 6 7NtargetNconfigNcompsNsrcMhwif C gt copy tdrv003 dr Windriver vxworks 6 7 target config comps src hwif gt cd Windriver vxworks 6 7 target config comps srce hwif C make vxbUsrCmdLine c 2 3 Legacy Driver Installation 2 3 1 Include Device Driver in VxWorks Projects For including the TDRV003 SW 42 device driver into a VxWorks project e g Tornado IDE or Workbench follow the steps below 1 Extract all files from the archive TDRV003 SW 42 LEGACY zip to your project directory 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 in the tdrv003 directory can
Download Pdf Manuals
Related Search
Related Contents
HOBO 4-Channel Analog Data Logger (UX120 SurfRAID TRITON 8FA User`s Manual Shure 27EU3222B User's Manual Parts & Service Manual Philips LivingColors EP9307 Users Guide ダウンロード(サイズ:1.23MB) Copyright © All rights reserved.