Home

User Manual - powerbridge.de

image

Contents

1. TENSES The Embedded I O Company TECHNOLOGIES TDRV002 SW 95 QNX6 Neutrino Device Driver Multiple Channel Serial Interface Version 1 2 x User Manual Issue 1 2 0 April 2012 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 TDRV002 SW 95 QNX6 Neutrino Device Driver Multiple Channel Serial Interface Supported Modules TPMC371 TPMC372 TPMC375 TPMC376 TPMC377 TPMC460 TPMC461 TPMC462 TPMC463 TPMC465 TPMC466 TPMC467 TPMC470 TCP460 TCP461 TCP462 TCP463 TCP465 TCP466 TCP467 TCP469 TCP470 TXMC375 Issue 1 0 0 TENSES 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 Date September 27 2005 1 0 1 TPMC467 TCP467 support added modified file list February 2 2007 1 0 2 Modification for devc devices and QNX6 3 x with SPx February 23 2007 1 0 3 Description of installation corrected Avoiding Data Loss added O
2. Page 10 of 19 TEWSS TECHNOLOGIES lt P7 gt This value specifies the setting of the Auto RS485 Operation configuration A 7 sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces lt Rx gt Specifies the receive FIFO trigger level The value must be between 1 and 63 for TPMCxxx and TCPxxx and between 1 and 255 for TXMCxxx 56 is a value that fits into most applications and systems lt Tx gt Specifies the transmit FIFO trigger level The value must be between 1 and 63 for TPMCxxx and TCPxxx and between 1 and 255 for TXMCxxx 8 is a value that fits into most applications and systems The configuration entries will always be scanned from the beginning of the file and the 1 matching configuration will be used This allows the specification of general configurations and some special that will be used for specifies channels Values for configuration parameters lt PO gt lt P7 gt are described in detail in the modules hardware user manual EXAMPLE 1 All channels shall get the same configuration Setup all channel for RS232 with trigger levels of 56 for Rx and 8 for Tx 00000000 56 8 2 Setup the first module different to the other modules Setup all channels of the 1 module for RS232 and all other channels for RS422 RS485 RTERM with trigger levels of 56 for Rx and 8 for Tx 0 00000000 56 8 10010000 56 8 3 Li
3. QNX6 Neutrino Device Driver Page 13 of 19 TENSES TECHNOLOGIES ERRORS Returns only Neutrino specific error codes see Neutrino Library Reference SEE ALSO Library Reference open TDRV002 SW 95 QNX6 Neutrino Device Driver Page 14 of 19 TENSES 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 Returns only Neutrino specific error code see Neutrino Library Reference SEE ALSO Library Reference close TDRV002 SW 95 QNX6 Neutrino Device Driver Page 15 of 19 TEWS amp TECHNOLOGIES 3 3 devctl NAME devctl device control functions SYNOPSIS include lt sys types h gt include lt unistd h gt include lt devctl h gt int devctl int filedes int dcmd void data_ptr size_t n_bytes int dev_info_ptr DESCRIPTION The devctl function sends a control code directly to a device specified by filedes causing the corresponding device to perform the requested operation The argument dcmd specifies the control code for the operation The arguments data ptr and n
4. bytes depends on the command and will be described for each command in detail later in this chapter Usually data_ptr points to a buffer that passes data between the user task and the driver and n_bytes defines the size of this buffer The argument dev_info_ptr is unused for the special devctl functions of the TDRV002 driver and should be set to NULL The following devctl command codes are defined in tdrv002 h and can be used in addition to the standard devctl functions for tty devices DCMD_TDRV002_SET_TRANSC Configure programmable transceiver interface See behind for more detailed information on each control code To use these TDRV002 specific control codes the header file tdrv002 h must be included by the application Value Description TDRV002 SW 95 QNX6 Neutrino Device Driver Page 16 of 19 TENSES TECHNOLOGIES RETURNS On success EOK is returned In the case of an error the appropriate error code is returned by the function not in errno ERRORS Returns only Neutrino specific error codes see Neutrino Library Reference Other function dependent error codes will be described for each devctl code separately The TDRV002 driver always returns standard QNX error codes SEE ALSO Library Reference devctl TDRV002 SW 95 QNX6 Neutrino Device Driver Page 17 of 19 TENSES TECHNOLOGIES 3 3 1 TDRV002_DCMD_SET_TRANSC NAME TDRV002_DCMD_SET_TRANSC setup programmable transceiver DES
5. CRIPTION This special devctl function configures programmable transceivers The function allows changing the transceiver configuration while the driver process is running A pointer to the new configuration value unsigned char and the size of the value 1 byte are passed by the parameters data_ptr and n_bytes to the device For a more detailed description of programming the transceivers please refer to the corresponding hardware User Manual The configuration value is an ORed value of the following defines tdrv002 h Definition Description TDRV002_CFG_RS485 RS232 If set RS485 interface is selected else RS232 interface is selected TDRV002_CFG_HDPLX If set half duplex interface is selected else full duplex interface is selected TDRV002_CFG_RENA If set auto RS485 receiver is enabled else auto RS485 receiver is disabled TDRV002_CFG_RTERM If set receive termination is enabled else receive termination is disabled TDRV002_CFG_TTERM If set transmit termination is enabled else transmit termination is disabled TDRV002_CFG_SLEWLIMIT If set slew limit mode is selected else slew limit mode is disabled TDRV002_CFG_SHDN If set transceiver is shut down else transceiver works in the configured mode TDRV002_CFG_AUTO_RS485 If set the UART controller uses auto RS485 mode else UART controller does not use the auto RS485 mode TDRV002 SW 95 QNX6 Neutrino Device Driver Page 18 of 19 TENSES TECHNOLOGIES There are also some typi
6. Software flow control e Edited Enabled S e Edited Enabled e S Edited Disabled E Raw Disabled s E Raw Disabled E s Raw Enabled u number Append number to the device name prefix dev ser The default is 3 which mean the first TDRV002 device is dev ser3 additional devices are given increasing numbers V Print out debug information L filename Specifies the filename of the configuration file which defines the setup for FIFO trigger levels and programmable interfaces A detailed description of the configuration file can be found in the chapter Configuration File Most of the options above are standard options for serial communications manager Please refer also to related QNX6 documentation if necessary TDRV002 SW 95 QNX6 Neutrino Device Driver Page 7 of 19 TENSES TECHNOLOGIES DESCRIPTION The devc tdrv002 manager is based on the standard QNX6 devc ser8250 serial communications manager and can support any number of serial ports and TDRV002 modules The devc tdrv002 manager searches the entire PCl bus for TDRV002 devices and creates devices for each serial channel The first device created depends on the u option If the u option is omitted the first TDRV002 serial device is dev ser3 If a TPMC461 8 channel and a TPMC462 4 channel are used the devices dev ser3 dev ser4 dev ser10 will be created for the TPMC461 dev ser71 dev ser14 will be created for the TPMC462 The order of devic
7. X system releases 6 3 x without a Service Pack copy common mk nops to common mk and start the build process Build the Device Driver 1 Change to the usr src tdrv002 driver directory 2 Execute the Makefile make install After successful completion the driver binary will be installed in the bin directory TDRV002 SW 95 QNX6 Neutrino Device Driver Page 6 of 19 TENSES TECHNOLOGIES 2 2 Start the Driver Process To start the TDRV002 device driver respective the TDRV002 serial communications manager you have to enter the process name with optional parameter from the command shell or in the startup script devc tdrv002 options amp OPTIONS b number Initial baud rate default 9600 C size The size of the canonical buffer in bytes default 1024 E Start in raw mode the default Software flow control is disabled by default e Start in edit mode default raw Software flow control is enabled by default F Disable hardware flow control default to hardware flow control enabled f Enable hardware flow control default I number The size of the interrupt input buffer in bytes default 8192 O number The size of the interrupt output buffer in bytes default 8192 S s Disable enable software flow control The default depends on the mode in raw mode E the default its disabled in edited mode e it s enabled The order in which you specify the E or e and S or s options matters Options Mode
8. ample nto x86 Makefile tdrv002 example nto Makefile tdrv002 example common mk tdrv002 example example c tdrv002 example Makefile tdrv002 configExa nto x86 o Makefile tdrv002 configExa nto x86 Makefile tdrv002 configExa nto Makefile tdrv002 configExa common mk tdrv002 configExa configExa c tdrv002 configExa Makefile In order to perform an installation extract all files of the archive TDRV002 SW 95 SRC tar gz to the usr src directory The command tar xzvf TDRV002 SW 95 SRC tar gz will extract the files into the local directory After that the necessary directory structure for the automatic build and the source files are available underneath the new directory called tdrv002 TDRV002 SW 95 QNX6 Neutrino Device Driver Page 5 of 19 2 1 TENSE TECHNOLOGIES Its absolute important to create the tdrv002 project directory in the usr src directory otherwise the automatic build with make will fail For building the device driver it is necessary that the QNX serial DDK is installed Installer QNX Realtime Platform Software Development Device Driver Kits Character Serial DDK targeting x86 For Serial DDKs not using the pm library please use common mk nopm instead of common mk build file In detail for QNX system releases before 6 3 0 copy common mk nopm to common mk and start the build process For Serial DDKs not using the ps library please use common mk nops instead of common mk build file In detail for QN
9. cal transceiver configuration predefined in tdrv002 h which can be used instead of building an own configuration value Definition TDRV002_INTF_OFF TDRV002_INTF_RS232 TDRV002_INTF_RS422 TDRV002_INTF_RS485FDM TDRV002_INTF_RS485FDS TDRV002_INTF_RS485HD EXAMPLE include lt tdrv002 h gt int ttyDev int retVal unsigned char config Description Shutdown mode disable interface RS232 mode RS422 Multidrop Full Duplex RS485 Full Duplex Master RS485 Full Duplex Slave RS485 Half Duplex ttyDev open dev ser3 O_RDWR if ttyDev 1 device not opened gt error handling setup RS422 interface us config TDRVO02_INTF_RS422 retVal devctl ttyDev predefined value TDRV002_DCMD_SET_TRANSC amp config sizeof config NULL if retVal EOK setting transceiver interfac failed gt close ttyDev ERRORS There are no special error codes TDRV002 SW 95 QNX6 Neutrino Device Driver rror handling Page 19 of 19
10. ctober 7 2010 Address TEWS LLC removed 1 1 0 TPMC377 TPMC470 TCP469 and TCP470 support added May 4 2011 1 2 0 New Files added to file list TXMC375 support added April 4 2013 devctl function TDRV002_DCMD_SET_TRANSC added TDRV002 SW 95 QNX6 Neutrino Device Driver Page 2 of 19 TENSES TECHNOLOGIES Table of Contents 1 NT UC TIN PAn E E E A E E E 4 2 INSTALLATION wes u u tote cvenas tnsiaxcesesssnsvancsantvanscussvencvaxdvendcwstvenswandrausrucncdscvenivandvexces 5 2 1 Build the Device Driver uu u LULU exhaled nee el 6 2 2 Start the Driver PTrFoOCeSS uu u RS dete 7 2 3 Contiguratiom Files ccc uu lu nu Sa 10 2 4 Avoiding Data Loss IILI ILIIIIiIi aa cd swa RE 12 3 DEVICE INPUT OUTPUT FUNCTIONS J J 13 s 1 OPO a u mu D m E ma am maps une 13 39 2 CIOSC 2 u E SSS u uuu a een etna dels ended tees etal Wie ne ote 15 BiB devet aasawa sasawa aaa ev A AE E A 16 3 3 1 TDRV002_DCMD_SET_TRANSC I n 18 TDRV002 SW 95 QNX6 Neutrino Device Driver Page 3 of 19 TENSES TECHNOLOGIES 1 Introduction The TDRV002 SW 95 QNX6 Neutrino device driver is a full duplex serial device driver which allows the operation of TDRV002 serial devices on Intel x86 based QNX6 Neutrino operating systems The TDRV002 SW 95 device driver is based on the standard QNX6 8250 serial communication manager Due to this way of implementation the driver in
11. device driver with default parameters first created device is dev ser3 9600 baud see also options above devc tdrv002 F amp Start the device driver with default parameters and change baud rate to 38400 devc tdrv002 F b 38400 amp Start the device driver with default parameters The first created device is dev ser5 deve tdrv002 F u 5 amp Start the device driver with default parameters and configuration information from tdrv002config txt deve tdrv002 L tdrv002config txt amp TDRV002 SW 95 QNX6 Neutrino Device Driver Page 9 of 19 TENSES TECHNOLOGIES 2 3 Configuration File This chapter describes the syntax used in the configuration file Each line starts with a prefix a specifies a line with comment and a specifies a line with configuration data Leading spaces will be ignored Behind the prefix all character will be ignored Behind the prefix only valid characters are allowed The line must have the following syntax S lt mod gt lt chan gt lt P0 gt lt P1 gt lt P2 gt lt P3 gt lt P4 gt lt P5 gt lt P6 gt lt P7 gt lt Rx gt lt Tx gt lt mod gt Selects the module the configuration should be set to 0 selects the 1 found module 7 the a and so on A configuration that should be used for all modules can be specified with lt chan gt Selects the channel the configuration should be set to 0 selects the 1 c
12. e creation of the devices on different modules depends on the PCI devicelD Ascending order TPMC371 TPMC372 TPMC460 TCP460 TCP470 TXMC375 Usually the device names dev ser1 and dev ser2 are assigned to the default PC serial ports therefore the TDRV002 devices can start with dev ser3 default If there are additional onboard serial devices you have to start with a higher device number for the TDRV002 devices by defining an appropriate number with the u option please check also the dev directory A read request by default returns when at least 1 character is available To increase efficiency you can control three parameters to control when a read is satisfied Time Return after a specified amount of time has elapsed c_cc VTIME Min Return when this number of characters is in the input buffer c_cc VMIN Char Return if the forwarding character is in the input buffer c_cc VEND These parameters and others are set using library routines see tcgetattr txsetattr readcond and TimerTimeout in the Library Reference The following fields and flags are supported in the termios structure Field Supported fields and flags c cc All characters c_iflag BRKINT ICRNL IGNBRK IXON c_oflag OPOST c_cflag CLOCAL CSIZE CSTOPB PARENB PARODD c_lflag ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH TDRV002 SW 95 QNX6 Neutrino Device Driver Page 8 of 19 TENSES TECHNOLOGIES EXAMPLES Start the
13. hannel of the module 1 the 2 and so on A configuration that should be used for all channels of a specified module can be specified with lt P0 gt This value specifies the setting of the RS485 RS232 configuration A T sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces lt P1 gt This value specifies the setting of the HDPLX configuration A 7 sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces lt P2 gt This value specifies the setting of the RENA configuration A 7 sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces lt P3 gt This value specifies the setting of the RTERM configuration A 7 sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces lt P4 gt This value specifies the setting of the T TERM configuration A T sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces lt P5 gt This value specifies the setting of the SLEW LIMIT configuration A 7 sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces lt P6 gt This value specifies the setting of the SHDN configuration A T sets this bit and a 0 resets the bit This value is ignored for non programmable interfaces TDRV002 SW 95 QNX6 Neutrino Device Driver
14. ke 2 but 4 channel of the 1 module should also be RS422 R485 RTERM 0 3 10010000 56 8 0 00000000 56 8 10010000 56 8 TDRV002 SW 95 QNX6 Neutrino Device Driver Page 11 of 19 TEWS amp TECHNOLOGIES 2 4 Avoiding Data Loss If higher baud rates are used or system load is high it may be necessary to change the serial configurations First FIFO trigger levels can be modified and second the size of the SW buffers can be increased The receive trigger level specifies the number of characters that have to be in the FIFO to generate the interrupt The remaining space in the FIFO specifies the time before a data overrun will occur and data gets lost Therefore changing the configuration may be necessary if there is a high interrupt load on the system and the ISR may be delayed The FIFO trigger level is defined in the configuration file See 2 3 Configuration File Example 1 Configuration receive trigger level is set to 56 115200 8N1 8 Characters space in FIFO when interrupt occurs FIFO size 64 trigger level 56 gt time until the FIFO must be read is at least 0 69 ms 8 10Bit 115200Baud Example 2 Configuration receive trigger level is set to 16 115200 8N1 48 Characters space in FIFO when interrupt occurs FIFO size 64 trigger level 16 gt time until the FIFO must be read is at least 4 16 ms 48 10Bit 115200Baud The example shows calculations for FIFO with a depth of 64 character
15. ompactPCl TCP466 4 Chan Serial Interface prog Transceiver CompactPCl TCP467 4 Chan Serial Interface prog Transceiver CompactPCl TCP469 8 Chan Isolated Serial Interface prog Transc CompactPCl TCP470 4 Chan Isolated Serial Interface prog Transc CompactPCl TXMC375 8 Chan Serial Interface prog Transceiver XMC Conduction Cooled In this document all supported modules and devices will be called TDRV002 Specials for certain devices will be advised TDRV002 SW 95 QNX6 Neutrino Device Driver Page 4 of 19 TENSES TECHNOLOGIES 2 Installation The directory TDRV002 SW 95 on the distribution media contains the following files TDRV002 SW 95 SRC tar gz Driver source archive TDRV002 SW 95 1 2 0 pdf This manual in PDF format Release txt Release information ChangeLog txt Release history The TAR archive TDRV002 SW 95 SRC tar gz contains the following files and directories tdrv002 driver nto x86 o Makefile tdrv002 driver nto x86 Makefile tdrv002 driver nto Makefile tdrv002 driver common mk tdrv002 driver common mk nops tdrv002 driver common mk nopm tdrv002 driver externs c tdrv002 driver externs h tdrv002 driver init c tdrv002 driver intr c tdrv002 driver main c tdrv002 driver Makefile tdrv002 driver options c tdrv002 driver devctlext c tdrv002 driver proto h tdrv002 driver tedit c tdrv002 driver tdrv002 h tdrv002 driver tto c tdrv002 driver tdrvO02config txt tdrv002 example nto x86 o0 Makefile tdrv002 ex
16. s if UARTS with a FIFO depth of 256 characters are used the calculation must be adapted with the corresponding FIFO size Changing the FIFO trigger level also changes the interrupt load Decreasing the Rx FIFO trigger level will increase the number of interrupts The second modification changing sizes of SW buffers is useful if the interrupts can be handled in time but there is still loss of data The size of the SW buffers can be specified when the driver is started See 2 2 Start the Driver Process TDRV002 SW 95 QNX6 Neutrino Device Driver Page 12 of 19 TENSES TECHNOLOGIES 3 Device Input Output functions This chapter describes the interface to the device driver I O system used for the special devctl functions 3 1 open NAME open open a file descriptor SYNOPSIS include lt sys types h gt include lt sys stat h gt include lt fcntl h gt int open const char pathname int flags DESCRIPTION The open function creates and returns a new file descriptor for the TDRV002 named by pathname The flags argument controls how the file is to be opened TDRV002 devices must be opened O_RDWR EXAMPLE int fd fd open dev ser3 O_RDWR if fd 1 Handle error 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 TDRV002 SW 95
17. terface and function is compatible to the standard QNX6 serial device manager All standard utility programs for configuration e g stty and maintaining terminal interfaces can be used in the same manner Additional supported features gt Receive and transmit FIFO trigger levels are configurable during driver start up gt Configuration of programmable interface If hardware supports programmable interface The TDRV002 SW 95 device driver supports the modules listed below TPMC371 8 Channel Serial Interface PMC Conduction Cooled TPMC372 4 Channel Serial Interface PMC Conduction Cooled TPMC375 8 Chan Serial Interface prog Transceiver PMC Conduction Cooled TPMC376 4 Chan Serial Interface prog Transceiver PMC Conduction Cooled TPMC377 4 Chan Isolated Serial Interface prog Transc PMC Conduction Cooled TPMC460 16 Channel Serial Interface PMC TPMC461 8 Channel Serial Interface PMC TPMC462 4 Channel Serial Interface PMC TPMC463 4 Channel Serial Interface PMC TPMC465 8 Chan Serial Interface prog Transceiver PMC TPMC466 4 Chan Serial Interface prog Transceiver PMC TPMC467 4 Chan Serial Interface prog Transceiver PMC TPMC470 4 Chan Isolated Serial Interface prog Transc PMC TCP460 16 Channel Serial Interface CompactPCl TCP461 8 Channel Serial Interface CompactPCl TCP462 4 Channel Serial Interface CompactPCl TCP463 4 Channel Serial Interface CompactPCl TCP465 8 Chan Serial Interface prog Transceiver C

Download Pdf Manuals

image

Related Search

Related Contents

Bedienungsanleitung RotoGen 1000  FORNECIMENTO DE ENERGIA ELÉTRICA EM TENSÃO 88/138kV  Impression 35 l`heure d`un nouvel Élan  Manuel d`installation  ASUS GIGAX1024P User's Manual  1 Function description  Easy to add on. Easy to use. Flush Frame Patio Door Unit  Chlorine, Free and Total by Colorimeteric DPD  AXIS Camera Recorder Manuel dell`utilisateur    

Copyright © All rights reserved.
Failed to retrieve file