Home

User Manual - powerbridge.de

image

Contents

1. int fd int result TDRV009 OPERATION MODE STRUCT OperationMode retrieve current operation mode result devctl fd DCMD_TDRV009_GET_OPERATION_MODE amp OperationMode Sizeof TDRV009 OPERATION MODE STRUCT NULL if result EOK printf Current baudrate d Mn OperationMode Baudrate else process devctl error ERRORS All returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 27 of 54 TEWS TECHNOLOGIES 3 5 3 DCMD TDRV009 SET BAUDRATE NAME DCMD TDRVO009 SET BAUDRATE Setup baudrate of a channel without other changes DESCRIPTION This I O control function sets up the transmission rate for the specific channel This is done without all the other configuration stuff contained in SET OPERATION MODE No channel reset is performed either If async oversampling is enabled the desired baudrate is internally multiplied by 16 It is important that this result can be derived from the selected clocksource A pointer to the caller s message buffer unsigned long and the size of this buffer are passed by the parameters data ptr and n bytes to the device EXAMPLE include tdrv009 h int fds int result unsigned long Baudrate Baudrate 14400 14400 bps result devctl fd DCMD TDRV009 SET BAUDRATE amp Baudrate sizeof unsigned long NULL if result EOK
2. TDRV009 CRC RST FFFF result devctl fd DCMD TDRV009 SET OPI ERATION MODE amp OperationMode Sizeof TDRV009 OPERATION MODE STRUCT NULL if result EOK process devctl error TDRV009 SW 95 QNX6 Neutrino Device Driver Page 20 of 54 TEWS E TECHNOLOGIES ERRORS Error Code Description EINVAL Invalid argument At least one of the supplied arguments is invalid All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 21 of 54 TEWS TECHNOLOGIES 3 5 2 DCMD TDRV009 GET OPERATION MODE NAME DCMD TDRV009 GET OPERATION MODE Retrieve a channel s current operation mode DESCRIPTION This I O control function reads the current channel configuration and returns the value in the buffer supplied by the application A pointer to the callers message buffer TDRV009 OPERATION MODE STRUCT and the size of this structure are passed by the parameters data ptr and n bytes to the device typedef struct TDRV009 COMM TYPE TDRV009 TRANSCEIVER MODE TDRV009 ENABLE DISABLE TDRV009 BRGSOURCE TDRV009 TXCSOURCE unsigned long TDRV009 RXCSOURCE TDRV009 CLKMULTIPLIER unsigned long unsigned char unsigned char TDRV009 PARITY int int TDRV009 ENABLE DISABLE char TDRV009 ENABLE DISABLE TDRV009 CRC CommType TransceiverMode Oversampli
3. TDRV009 ENC FMO FMO data encoding TDRVO009 ENC FM 1 FM1 data encoding TDRV009 ENC MANCHESTER Manchester data encoding TDRV009 SW 95 QNX6 Neutrino Device Driver Page 24 of 54 TEWS TECHNOLOGIES Parity This parameter specifies the parity bit generation used for asynchronous communication Valid values are Value Description TDRV009 PAR DISABLED No parity generation is used TDRV009 PAR EVEN EVEN parity bit TDRV009 PAR ODD ODD parity bit TDRV009 PAR SPACE SPACE parity bit always insert 0 TDRV009 PAR MARK MARK parity bit always insert 1 Stopbits This parameter specifies the number of stop bits to use for asynchronous communication Possible values are 1 or 2 Databits This parameter specifies the number of data bits to use for asynchronous communication Possible values are 5 to 8 UseTermChar This parameter enables or disables the usage of a termination character for asynchronous communication Valid values are Value Description TDRVO009 DISABLED A termination character is not used TDRV009 ENABLED A termination character is used TermChar This parameter specifies the termination character After receiving this termination character the communication controller will forward the received data packet immediately to the host system and use a new data packet for further received data Any 8bit value may be used for this parameter HwHs This parameter enables or disables the hardware handshaking mech
4. TEWS The Embedded I O Company TECHNOLOGIES TDRVO009 SW 95 QNX6 Neutrino Device Driver High Speed Sync Async Serial Interface Version 1 0 x User Manual Issue 1 0 1 February 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 TDRV009 SW 95 QNX6 Neutrino Device Driver High Speed Sync Async Serial Interface Supported Modules TPMC363 TPMC863 TCP863 TAMC863 TPCE863 Issue Description 1 0 0 1 0 1 First Issue General Revision TDRV009 SW 95 QNX6 Neutrino Device Driver TEWS 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 2007 2012 by TEWS TECHNOLOGIES GmbH Date June 15 2007 February 3 2012 Page 2 of 54 Table of Contents 1 INTRODUDGCTION 5n natu tana tou asia uu itn tir kc ee 2 INSTALLATION uicisesisskGsek emer CEb9aYqE CE DUPKRU Len DENR UD UE CRI EUR CHPdaE 2 1 Build the Device Driver 1 eeeeee
5. Neutrino Device Driver Page 6 of 54 TEWS TECHNOLOGIES 3 Device Input Output functions This chapter describes the interface to the device driver I O system 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 TDRV009 named by pathname The flags argument controls how the file is to be opened must be O_RDWR for TDRVO09 devices EXAMPLE int fd fd open dev tdrv009 0 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 ERRORS Returns only Neutrino specific error codes see Neutrino Library Reference TDRV009 SW 95 QNX6 Neutrino Device Driver Page 7 of 54 TEWS E TECHNOLOGIES SEE ALSO Library Reference open TDRV009 SW 95 QNX6 Neutrino Device Driver Page 8 of 54 TEWS 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 norm
6. No parameter is needed for this call EXAMPLE include tdrv009 h int fd int result p Set DTR to HIGH only valid for channel 3 result devctl fd DCMD TDRV009 DTR SET NULL 0 NULL if result EOK process devctl error ERRORS Error Code Description EACCES This function is not supported by the specific channel All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 52 of 54 TEWS TECHNOLOGIES 3 5 20 DCMD TDRV009 DTR CLEAR NAME DCMD TDRVO009 DTR CLEAR Clear DTR signal line only channel 3 DESCRIPTION This I O control function sets the DTR signal line to LOW This function is only available for local module channel 3 No parameter is needed for this call EXAMPLE include tdrv009 h int fd int result p Set DTR to LOW only valid for channel 3 result devctl fd DCMD TDRV009 DTR CLEAR NULL 0 NULL if result EOK process devctl error ERRORS Error Code Description EACCES This function is not supported by the specific channel All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 53 of 54 TEWS TECHNOLOGIES 3 5 21 DCMD TDRVO009 DSR GET NAME DCMD TDRVO009 DSR GET Read state of DSR only channel 3 DESCRIPTION This I O control function retu
7. RCVR ON result devctl fd DCMD TDRV009 SET RECEIVER STATE amp ReceiverState sizeof TDRV009 RECEIVER NULL if result EOK process devctl error TDRV009 SW 95 QNX6 Neutrino Device Driver Page 31 of 54 TEWS E TECHNOLOGIES ERRORS Error Code Description EINVAL Invalid receiver state specified All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 32 of 54 TEWS TECHNOLOGIES 3 5 7 DCMD TDRV009 CLEAR RX BUFFER NAME DCMD TDRV009 CLEAR RX BUFFER Clear the internal receive buffer DESCRIPTION This I O control function clears the internal receive buffer of the corresponding channel No parameter is needed for this call EXAMPLE include int fd int result tdrv009 n result devctl fd DCMD TDRV009 CLEAR RX BUFFER NULL 0 NULL if result EOK process devctl error ERRORS All returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 33 of 54 TEWS TECHNOLOGIES 3 5 8 DCMD TDRVO009 SET EXT XTAL NAME DCMD TDRV009 SET EXT XTAL Specify the externally supplied frequency DESCRIPTION This I O control function sets the frequency of an externally supplied frequency This frequency is used for baudrate calculation and describes the input frequency to the Baud Rate Generator BRG The exte
8. X21 X 21 V 11 TDRV009 TRNSCVR V35 V 35 V 35 V 28 TDRV009 TRNSCVR HRS449 EIA 449 V 11 TDRV009 TRNSCVR V36 V 36 V 11 TDRV009 TRNSCVR HRS232 EIA 232 V 28 TDRV009 TRNSCVR V28 V 28 V 28 TDRV009 TRNSCVR NO CABLE High impedance Oversampling This parameter enables or disables 16times oversampling used for asynchronous communication For communication with standard UARTs it is recommended to enable this feature Valid values are Value Description TDRV009 DISABLED The 16 times oversampling is not used TDRV009 ENABLED The 16 times oversampling is used BrgSource This parameter specifies the frequency source used as input to the BRG Baud Rate Generator Valid values are Value Description TDRV009 BRGSRC XTAL1 XTAL1 oscillator is used for BRG input TDRV009 BRGSRC XTAL2 XTAL2 oscillator is used for BRG input TDRV009 BRGSRC XTALS3 XTAL3 oscillator is used for BRG input TDRV009 BRGSRC RXCEXTERN External clock at RxC input used for BRG input TDRV009 BRGSRC TXCEXTERN External clock at TxC input used for BRG input TDRV009 SW 95 QNX6 Neutrino Device Driver Page 16 of 54 TEWS TECHNOLOGIES TxClkSource This parameter specifies the frequency source used as input to the transmit engine Valid values are Value Description TDRV009 TXCSRC BRG Baud Rate Generator output used for Tx clock TDRV009 TXCSRC BRGDIV16 BRG output divided by 16 used for Tx clock TDRV009 TXCSRC RXCEXTERN External clock at RxC input used for Tx c
9. bytes to the device typedef struct unsigned long Offset unsigned long Value TDRV009 ADDR STRUCT Offset This parameter specifies a byte offset into the communication controller s channel SCC register space Please refer to the hardware user manual for further information Value This parameter returns the 32bit word from the communication controller s channel SCC register space EXAMPLE include tdrv009 h int fds int result TDRVO09 ADDR STRUCT AddrBuf Read a 32bit value Status Register AddrBuf Offset 0x0004 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 37 of 54 TEWS E TECHNOLOGIES result devctl if result EOK printf Value else process devctl fd DCMD TDRV009 SCC REG READ amp AddrBuf sizeof TDRV009 ADDR STRUCT NULL Ox 018X n AddrBuf Value error ERRORS Error Code Description EINVAL Invalid parameter The specified offset is out of range All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 38 of 54 TEWS TECHNOLOGIES 3 5 11 DCMD TDRVO009 REG WRITE NAME DCMD TDRV009 GLOB REG WhITE Directly write to a register DESCRIPTION This I O control function writes one 32bit word to the communication controllers register space relative to the beginning of the register set A pointer to the callers status buffer T
10. 5 15 DCMD TDRV009 WAITFORINTERRUPT NAME DCMD TDRV009 WAITFORINTERRUPT Wait for specific channel interrupt DESCRIPTION This I O control function waits until a specified SCC interrupt or the timeout occurs A pointer to the callers status buffer TDRV0O0O9 WAIT STRUCT and the size of this structure are passed by the parameters data ptr and n bytes to the device typedef struct unsigned long Interrupts int Timeout TDRV009 WAIT STRUCT Interrupts This parameter specifies specific interrupt bits to wait for If one interrupt occurs the value is returned in this parameter Please refer to the hardware user manual for further information on the possible interrupt bits Timeout This parameter specifies the time in seconds to wait for an interrupt If O is specified the function will block indefinitely EXAMPLE int fd int result TDRV0O09 WAIT STRUCT WaitStruct Wait at least 5 seconds for a CTS Status Change CSC interrupt WaitStruct Interrupts 1 lt lt 14 5 WaitStruct Timeout TDRV009 SW 95 QNX6 Neutrino Device Driver Page 47 of 54 TEWS E TECHNOLOGIES result devctl fd DCMD TDRV009 WAITFORINTERRUPT amp WaitStruct sizeof TDRV009 WAIT STRUCT NULL if result EOK printf Interrupt Event occurred n else process devctl error ERRORS Error Code Description EBUSY Too many simultaneous wait jobs active ETIME Timeout The
11. D A termination character is used TermChar This parameter specifies the termination character After receiving this termination character the communication controller will forward the received data packet immediately to the host system and use a new data packet for further received data Any 8bit value may be used for this parameter HwHs This parameter enables or disables the hardware handshaking mechanism using RTS CTS Valid values are Value Description TDRV009 DISABLED Hardware handshaking is not used TDRV009 ENABLED Hardware handshaking is used TDRV009 SW 95 QNX6 Neutrino Device Driver Page 18 of 54 TEWS TECHNOLOGIES Crc This parameter is a structure describing the CRC checking configuration typedef struct TDRV009 CRC TYPE Type TDRV009 ENABLE DISABLE RxChecking TDRV009 ENABLE DISABLE TxGeneration TDRV009 CRC RESET ResetValue TDRV009 CRC Type This parameter describes the CRC type to be used Possible values are Value Description TDRVO009 CRC 16 16bit CRC algorithm is used for checksum TDRV009 CRC 32 32bit CRC algorithm is used for checksum RxChecking This parameter enables or disables the receive CRC checking Possible values are Value Description TDRV009 DISABLED CRC checking will not be used TDRV009 ENABLED CRC checking will be used TxGeneration This parameter enables or disables the transmit CRC generation Possible values are Value Description TDRV009 DISABLED A CRC checksum will be generat
12. DRV009 ADDR STRUCT and the size of this structure are passed by the parameters data ptr and n bytes to the device typedef struct unsigned long Offset unsigned long Value TDRV009 ADDR STRUCT Offset This parameter specifies a byte offset into the communication controller s register space Please refer to the hardware user manual for further information Value This 32bit word will be written to the communication controller s register space Modifying register contents may result in communication problems system crash or other unexpected behavior EXAMPLE include tdrv009 h int fd int result TDRV0O09 ADDR STRUCT AddrBuf Write a 32bit value FIFO Control Register 4 d AddrBuf Offset 0x0034 AddrBuf Value Oxffffffff TDRV009 SW 95 QNX6 Neutrino Device Driver Page 39 of 54 TEWS 4 TECHNOLOGIES result devctl fd DCMD TDRV009 REG WRITE amp AddrBuf sizeof TDRV009 ADDR STRUCT NULL if result EOK process devctl error ERRORS Error Code Description EINVAL Invalid parameter The specified offset is out of range All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 40 of 54 TEWS TECHNOLOGIES 3 5 12 DCMD TDRV009 REG READ NAME DCMD TDRV009 REG READ Directly read from a register DESCRIPTION This I O control function reads one 32bit word from the comm
13. LL 0 NULL if result EOK process devctl error ERRORS Error Code Description EPERM The channel is in handshake mode so this function is not allowed All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 50 of 54 TEWS TECHNOLOGIES 3 5 18 DCMD TDRV009 CTS GET NAME DCMD TDRVO009 CTS GET Read state of CTS DESCRIPTION This I O control function returns the current state of the CTS handshake signal line of the specific channel A pointer to the caller s message buffer unsigned long and the size of this buffer are passed by the parameters data ptr and n bytes to the device Depending on the state of CTS either 0 inactive or 1 active is returned EXAMPLE include tdrv009 h int fd int result unsigned long CtsState Read CTS state result devctl fd DCMD TDRV009 CTS GET amp CtsState sizeof unsigned long NULL if result EOK printf CTS ld n CtsState else process devctl error ERRORS All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 51 of 54 TEWS TECHNOLOGIES 3 5 19 DCMD TDRV009 DTR SET NAME DCMD TDRVO009 DTR SET Set DTR signal line only channel 3 DESCRIPTION This I O control function sets the DTR signal line to HIGH This function is only available for local module channel 3
14. OGIES 3 5 14 DCMD TDRV009 EEPROMREAD NAME DCMD TDRV009 EEPROMREAD Read value from EEPROM DESCRIPTION This I O control function reads one 16bit word from the onboard EEPROM A pointer to the callers status buffer TDRV009_EEPROM_BUFFER and the size of this structure are passed by the parameters data ptr and n bytes to the device typedef struct unsigned long Offset unsigned long Value TDRV009 EEPROM BUFFER Offset This parameter specifies a 16bit word offset into the EEPROM Following offsets are available Offset Access 00h 5Fh R 60h 7Fh R W Value This parameter returns the 16bit word from the EEPROM at the given offset EXAMPLE int fd int result TDRV009 EEPROM BUFFER EepromBuf Read a 16bit value from the EEPROM offset O0 a EepromBuf Offset 0 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 45 of 54 TEWS E TECHNOLOGIES result devctl fd DCMD TDRV009 EEPROMREAD amp EepromBuf sizeof TDRV009 EEPROM BUFFER NULL if result EOK printf Value 0x X n EepromBuf Value else process devctl error ERRORS Error Code Description EINVAL The specified offset address is invalid EIO Error during EEPROM access All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 46 of 54 TEWS TECHNOLOGIES 3
15. ON This I O control function writes one 16bit word into the onboard EEPROM The first part of the EEPROM is reserved for factory usage write accesses to this area will result in an error A pointer to the callers status buffer TDRV009_EEPROM_BUFFER and the size of this structure are passed by the parameters data ptr and n bytes to the device typedef struct unsigned long Offset unsigned long Value TDRV009 EEPROM BUFFER Offset This parameter specifies a 16bit word offset into the EEPROM Following offsets are available Offset Access 00h 5Fh R 60h 7Fh R W Value This parameter specifies the 16bit word to be written into the EEPROM at the given offset EXAMPLE int fd int result TDRV009 EEPROM BUFFER EepromBuf Write a 16bit value into the EEPROM offset 0x61 EepromBuf Offset 0x61 EepromBuf Value 0x1234 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 43 of 54 TEWS 4 TECHNOLOGIES result devctl fd DCMD TDRV009 EEPROMWRITE amp EepromBuf sizeof TDRV009 EEPROM BUFFER NULL if result EOK process devctl error ERRORS Error Code Description EINVAL The specified offset address is invalid or read only EIO Error during EEPROM access All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 44 of 54 TEWS TECHNOL
16. SET Assert RTS handshake line DCMD TDRV009 RTS CLEAR De Assert RTS handshake line DCMD TDRV009 CTS GET Read state of CTS DCMD TDRVO009 DTR SET Set DTR signal line only channel 3 DCMD TDRV00O9 DTR CLEAR Clear DTR signal line only channel 3 DCMD TDRV009 DSR GET Read state of DSR only channel 3 See behind for more detailed information on each control code To use these TDRVO009 specific control codes the header file tdrv009 h must be included by the application 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 Note the TDRVO009 driver always returns standard QNX error codes SEE ALSO Library Reference devctl TDRV009 SW 95 QNX6 Neutrino Device Driver Page 14 of 54 TEWS TECHNOLOGIES 3 5 1 DCOMD TDRV009 SET OPERATION MODE NAME DCMD TDRV009 SET OPERATION MODE Setup a channel s operation mode DESCRIPTION This I O control function sets the desired operation mode for a channel A pointer to the callers message buffer TDRV009 OPERATION MODE STRUCT and the size of this structure are passed by the parameters data ptr and n bytes to the device It is necessary to completely initialize the structure This can be done by calling the O control functio
17. _t write int filedes void buf size_t nbytes DESCRIPTION The write function attempts to write nbyte bytes to the file associated with the open file descriptor filedes from the buffer pointed to by buf EXAMPLE int fd char pData ssize t BytesTransmitted pData char malloc 20 sizeof char sprintf pData Hello World n BytesTransmitted write fd pData strlen pData if BytesTransmitted strlen pData printf Transfer not successful n RETURNS In the case of an error a value of 1 is returned the global variable errno contains the detailed error code Otherwise the number of bytes transmitted is returned ERRORS Returns only Neutrino specific error code see Neutrino Library Reference TDRV009 SW 95 QNX6 Neutrino Device Driver Page 11 of 54 TEWS 4 TECHNOLOGIES SEE ALSO Library Reference write TDRV009 SW 95 QNX6 Neutrino Device Driver Page 12 of 54 3 5 devetl 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 TEWS TECHNOLOGIES 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 opera
18. al 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 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 9 of 54 TEWS TECHNOLOGIES 3 3 read NAME read read from a device SYNOPSIS include lt sys uio h gt include lt unistd h gt size_t read int filedes void buf size_t nbytes DESCRIPTION The read function attempts to read nbyte bytes from the file associated with the open file descriptor filedes into the buffer pointed to by buf EXAMPLE int fd char pData Ssize t BytesReceived pData char malloc 1024 sizeof char BytesReceived read fd pData 1024 if BytesReceived 0 printf Bytes received d Data s n BytesReceived pData RETURNS In the case of an error a value of 1 is returned the global variable errno contains the detailed error code Otherwise the number of bytes received is returned ERRORS Returns only Neutrino specific error code see Neutrino Library Reference SEE ALSO Library Reference read TDRV009 SW 95 QNX6 Neutrino Device Driver Page 10 of 54 TEWS TECHNOLOGIES 3 4 write NAME write write to a device SYNOPSIS include lt sys uio h gt include lt unistd h gt size
19. anism using RTS CTS Valid values are Value Description TDRV009 DISABLED Hardware handshaking is not used TDRV009 ENABLED Hardware handshaking is used Crc This parameter is a structure describing the CRC checking configuration typedef struct TDRV009_CRC_TYPE Type TDRV009 ENABLE DISABLE RxChecking TDRV009 ENABLE DISABLE TxGeneration TDRV009 CRC RESET ResetValue TDRVO09_CRC TDRV009 SW 95 QNX6 Neutrino Device Driver Page 25 of 54 TEWS TECHNOLOGIES Type This parameter describes the CRC type to be used Possible values are Value Description TDRV009 CRC 16 16bit CRC algorithm is used for checksum TDRV009 CRC 32 32bit CRC algorithm is used for checksum RxChecking This parameter enables or disables the receive CRC checking Possible values are Value Description TDRV009 DISABLED CRC checking will not be used TDRV009 ENABLED CRC checking will be used TxGeneration This parameter enables or disables the transmit CRC generation Possible values are Value Description TDRV009 DISABLED A CRC checksum will be generated TDRV009 ENABLED A CRC checksum will not be generated ResetValue This parameter describes the reset value for the CRC algorithm Possible values are Value Description TDRV009 CRC RST FFFF CRC reset value will be OXFFFF TDRV009 CRC RST 0000 CRC reset value will be 0x0000 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 26 of 54 TEWS 4 TECHNOLOGIES EXAMPLE include tdrv009 h
20. c build with make will fail Build the Device Driver Change to the usr src tdrv009 driver directory Execute the Makefile make install After successful completion the driver binary tdrv009 will be installed in the bin directory 2 2 Build the Example Application Change to the usr src tdrv009 example directory Execute the Makefile make install After successful completion the example binary tdrv009exa will be installed in the bin directory TDRV009 SW 95 QNX6 Neutrino Device Driver Page 5 of 54 TEWS TECHNOLOGIES 2 3 Start the Driver Process To start the TDRVO009 device driver you have to enter the process name with optional parameters from the command shell or in the startup script Possible parameters are V For debugging purposes you can start the TDRV009 Resource Manager with the v option The Resource Manager will print versatile information about TDRVO009 configuration and command execution on the terminal window r seconds Specifies the receive timeout in seconds after a pending receive job will be canceled Supply 1 as parameter and the timeout functionality will be disabled and the receive function will block until data is available Default value is 5 seconds t seconds Specifies the transmit timeout in seconds after a pending receive job will be canceled Supply 1 as parameter and the timeout functionality will be disabled and the transmit functio
21. e 3 5 20 DCMD TDRVO009 DTR CLEAR een 3 5 24 DCMD TDRVO009 DSR GET 1 een TDRV009 SW 95 QNX6 Neutrino Device Driver TEWS TECHNOLOGIES Page 3 of 54 TEWS TECHNOLOGIES 1 Introduction The TDRV009 SW 95 QNX Neutrino device driver allows the operation of the TPMC863 product family on QNX Neutrino operating systems The TDRVO009 device driver is basically implemented as a user installable Resource Manager The standard file I O functions open close read write and devctl provide the basic interface for opening and closing a file descriptor and for performing device I O and control operations The TDRV009 SW 95 device driver includes the following functions Setup and configure channels Send and Receive Data Buffers Switch on or off a channel s receiver Read and write onboard registers directly Wait for incoming SCC interrupts VVVVV The TDRV009 SW 95 supports the modules listed below TPMC863 4 Channel High Speed Synch Asynch PMC Serial Interface TPMC363 4 Channel High Speed Synch Asynch PMC Conduction Cooled Serial Interface TCP863 4 Channel High Speed Synch Asynch CompactPCl Serial Interface TAMC863 4 Channel High Speed Synch Asynch AMC Serial Interface TPCE863 4 Channel High Speed Synch Asynch Standard PCI Express Serial Interface In this document all supported modules and devices will be called TDRV009 Specials for a certain device will be advised To get
22. e can be binary OR ed Possible values are Value Description TDRV009 CLKINV NONE no clock inversion TDRV009 CLKINV TXC transmit clock is inverted TDRV009 CLKINV RXC receive clock is inverted TDRV009 SW 95 QNX6 Neutrino Device Driver Page 17 of 54 Encoding TEWS TECHNOLOGIES This parameter specifies the data encoding used for communication Valid values are Value TDRV009 ENC NRZ TDRV009 ENC NRZI TDRV009 ENC FMO TDRVO009 ENC _FM1 TDRV009 ENC MANCHESTER Parity Description NRZ data encoding NRZI data encoding FMO data encoding FM1 data encoding Manchester data encoding This parameter specifies the parity bit generation used for asynchronous communication Valid values are Value TDRV009 PAR DISABLED TDRV009 PAR EVEN TDRV009 PAR ODD Description No parity generation is used EVEN parity bit ODD parity bit TDRV009 PAR SPACE TDRV009 PAR MARK SPACE parity bit always insert 0 MARK parity bit always insert 1 Stopbits This parameter specifies the number of stop bits to use for asynchronous communication Possible values are 1 or 2 Databits This parameter specifies the number of data bits to use for asynchronous communication Possible values are 5 to 8 UseTermChar This parameter enables or disables the usage of a termination character for asynchronous communication Valid values are Value Description TDRV009 DISABLED A termination character is not used TDRV009 ENABLE
23. e expires A pointer to the caller s parameter buffer unsigned long and the size of this buffer are passed by the parameters data ptr and n bytes to the device The time is specified in seconds If no timeout should be used specifiy 1 as value for this control function EXAMPLE include tdrv009 h int fd int result unsigned long TxTimeout Disable Transmit Timeout Xy TxTimeout 1 result devctl fd DCMD TDRV009 SET TX TIMEOUT amp RxTimeout sizeof unsigned long NULL if result EOK process devctl error ERRORS All returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 30 of 54 TEWS TECHNOLOGIES 3 5 6 DCMD TDRVO009 SET RECEIVER STATE NAME DCMD TDRVO009 SET RECEIVER STATE Set operation state of the channel s receiver DESCRIPTION This I O control function sets the state of the receiver module A pointer to the callers parameter buffer TDRV0O9 RECEIVER and the size of this buffer are passed by the parameters data ptr and n bytes to the device Possible values for the new receiver state are Value Description TDRV009 RCVR ON The receiver is enabled TDRV009 RCVR OFF The receiver is disabled EXAMPLE include tdrv009 h int fd int result TDRV009 RECEIVER ReceiverState set receiver to ON ReceiverState TDRV009
24. ed TDRV009 ENABLED A CRC checksum will not be generated ResetValue This parameter describes the reset value for the CRC algorithm Possible values are Value Description TDRV009 CRC RST FFFF CRC reset value will be OXFFFF TDRV009 CRC RST 0000 CRC reset value will be 0x0000 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 19 of 54 TEWS E TECHNOLOGIES EXAMPLE include tdrv009 h int fd int result TDRV009 OPERATION MODE STRUCT OperationMode Configure channel for Async RS232 115200bps 7 OperationMode CommType TDRV009 COMMTYPE ASYNC OperationMode TransceiverMod TDRV009 TRNSCVR RS232 OperationMode Oversampling TDRV009 ENABLED OperationMode BrgSource TDRV009 BRGSRC XTAL1 OperationMode TxClkSource TDRV009 TXCSRC BRG OperationMode TxClkOutput 0 OperationMode RxClkSource TDRV009 RXCSRC BRG OperationMode ClockMultiplier TDRV009 CLKMULT X1 OperationMode Baudrate 115200 OperationMode ClockInversion TDRV009 CLKINV NONE OperationMode Encoding TDRV009 ENC NRZ OperationMode Parity TDRV009 PAR DISABLED OperationMode Stopbits 1 OperationMode Databits 8 OperationMode UseTermChar TDRV009 DISABLED OperationMode TermChar 0 OperationMode HwHs TDRV009 DISABLED OperationMode Crc Type TDRV009 CRC 16 OperationMode Crc RxChecking TDRV009 DISABLED OperationMode Crc TxGeneration TDRV009 DISABLED OperationMode Crc ResetValu
25. eeee eeiam 2 2 Build the Example Application eeereeereeee 2 3 Start the Driver Process eeeeeceeeeee enean nnn nnum aar ar nana nan 3 DEVICE INPUT OUTPUT FUNCTIONS KE EO cS 9 ClOSB co too umet A A MIC MI Ae EDT IN NI KENN DE KE MAUI KE Qe MIENNE II 3 5 1 DCMD TDRV009 SET OPERATION MODE 3 5 2 DCMD TDRV009 GET OPERATION MODE 3 5 3 DCMD TDRVO009 SET BAUDRATE rn 3 5 4 DCMD TDRVO009 SET RX TIMEOUT cen 3 5 5 DCMD TDRVO009 SET TX TIMEOUT cen 3 5 6 DCMD TDRVO009 SET RECEIVER STATE 3 5 7 DCMD TDRVO009 CLEAR RX BUFFER ccce 3 5 8 DCMD TDRVO009 SET EXT XTAL ccce 3 5 9 DCMD TDRVO009 SCC REG WRITE ccce 3 5 10 DCMD TDRVO009 SCC REG READ cene 3 5 11 DCMD TDRVO009 REG WhITE eee 3 5 12 DCMD TDRVO009 REG READ eene een 3 5 13 DCMD TDRV009 EEPROMMWMHRITE eeeeeennnnnnn 3 5 14 DCMD TDRV009 EEPROMREAD eeeeenennnn 3 5 15 DCMD TDRV009 WAITFORINTERRUPT ener 3 5 16 DCMD TDRVO009 RTS SET eese 3 5 17 DCMD TDRVO009 RTS CLEAR eeeeeeeeneneennnnnnnnnn 3 5 18 DCMD TDRVO009 CTS GET eene 3 5 19 DCMD TDRVO009 DTR SET ee
26. er space Please refer to the hardware user manual for further information Value This 32bit word will be written to the communication controller s channel SCC register space Modifying register contents may result in communication problems system crash or other unexpected behavior EXAMPLE include tdrv009 h int fd int result TDRV0O09 ADDR STRUCT AddrBuf Write a 32bit value Termination Character Register ul AddrBuf Offset 0x0048 AddrBuf Value 1 lt lt 15 0x42 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 35 of 54 TEWS E TECHNOLOGIES result devctl fd DCMD TDRV009 SCC REG WRITE amp AddrBuf sizeof TDRV009 ADDR STRUCT NULL if result EOK process devctl error ERRORS Error Code Description EINVAL Invalid parameter The specified offset is out of range All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 36 of 54 TEWS TECHNOLOGIES 3 5 10 DCMD TDRV009 SCC REG READ NAME DCMD TDRV009 SCC REG READ Directly read from an SCC register DESCRIPTION This I O control function reads one 32bit word from the communication controller s register space relative to the beginning of the specific channel s SCC register set A pointer to the callers status buffer TDRV00O9 ADDR STRUCT and the size of this structure are passed by the parameters data ptr and n
27. interrupt did not occur All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 48 of 54 TEWS TECHNOLOGIES 3 5 16 DCMD TDRVO009 RTS SET NAME DCMD TDRV009 RTS SET Assert RTS handshake line DESCRIPTION This I O control function asserts the RTS handshake signal line of the specific channel This function is not available if the channel is configured for hardware handshaking No parameter is needed for this call EXAMPLE include tdrv009 h int Edis int result Assert RTS x result devctl fd DCMD TDRV009 RTS SET NULL 0 NULL if result EOK process devctl error ERRORS Error Code Description EPERM The channel is in handshake mode so this function is not allowed All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 49 of 54 TEWS TECHNOLOGIES 3 5 17 DCMD TDRV009 RTS CLEAR NAME DCMD TDRV009 RTS CLEAR De Assert RTS handshake line DESCRIPTION This I O control function de asserts the RTS handshake signal line of the specific channel This function is not available if the channel is configured for hardware handshaking No parameter is needed for this call EXAMPLE include tdrv009 h int Edis int result De assert RTS x result devctl fd DCMD TDRV009 RTS CLEAR NU
28. lock TDRV009 TXCSRC TXCEXTERN External clock at TxC input used for Tx clock TDRV009 TXCSRC DPLL DPLL output used for Tx clock TxClkOutput This parameter specifies which output lines are used to output the transmit clock e g for synchronous communication The given values can be binary OR ed Valid values are Value Description TDRV009 TXCOUT TXC Transmit clock available at TxC output line TDRV009 TXCOUT RTS Transmit clock available at RTS output line RxClkSource This parameter specifies the frequency source used as input to the receive engine Valid values are Value Description TDRV009 RXCSRC BRG Baud Rate Generator output used for Rx clock TDRV009 RXCSRC RXCEXTERN External clock at RxC input used for Rx clock TDRV009 RXCSRC DPLL DPLL output used for Rx clock ClockMultiplier This parameter specifies the multiplier used for BRG clock input Valid values are Value Description TDRV009 CLKMULT X1 Clock multiplier disabled TDRV009 CLKMULT X4 Selected input clock is multiplied by 4 Bauarate This parameter specifies the desired frequency to be generated by the Baud Rate Generator BRG which can be used as clock input signal The value is derived from the selected clocksource Please note that only specific values depending on the selected oscillator are valid This frequency is internally multiplied by 16 if oversampling shall be used Clockinversion This parameter specifies the inversion of the transmit and or the receive clock This valu
29. more information about the features and use of supported devices it is recommended to read the manuals listed below TPMC863 or compatible User manual TPMC863 or compatible Engineering Manual TDRV009 SW 95 QNX6 Neutrino Device Driver Page 4 of 54 TEWS TECHNOLOGIES 2 Installation 2 1 Following files are located in the directory TDRV009 SW 95 on the distribution media TDRVO009 SW 95 SRC tar gz GZIP compressed archive with driver source code TDRVO009 SW 95 1 0 1 pdf This manual in PDF format ChangeLog txt Release history Release txt Information about the Device Driver Release The GZIP compressed archive TDRV009 SW 95 SRC tar gz contains the following files and directories Directory path tdrv009 driver tdrv009 c Driver source code driver tdrv009 h Definitions and data structures for driver and application driver tdrvOO9def h Device driver include driver commCtrl h Include file for controller chip driver node c Queue management source code driver node h Queue management definitions example tdrv009exa c Example application For installation copy the tar archive into the usr src directory and unpack it e g tar xzvf TDRV009 SW 95 SRC tar gz After that the necessary directory structure for the automatic build and the source files are available underneath the new directory called tdrvoog It is absolutely important to extract the TDRVOOSO tar archive in the usr src directory Otherwise the automati
30. n DCMD TDRV009 GET OPERATION MODE described below typedef struct TDRV009 COMM TYPE TDRV009 TRANSCEIVER MODE TDRV009 ENABLE DISABLE TDRV009 BRGSOURCE TDRV009 TXCSOURCE unsigned long TDRV009 RXCSOURCE TDRV009 CLKMULTIPLIER unsigned long unsigned char unsigned char TDRVO009 PARITY int int TDRV009 ENABLE DISABLE char TDRV009 ENABLE DISABLE TDRV009 CRC CommType TransceiverMode Oversampling BrgSource TxClkSource TxClkOutput RxClkSource ClockMultiplier Baudrate ClocklInversion Encoding Parity Stopbits Databits UseTermChar TermChar HwHs Crc TDRV009 OPERATION MODE STRUCT TDRV009 SW 95 QNX6 Neutrino Device Driver Page 15 of 54 TEWS TECHNOLOGIES CommType This parameter describes the general communication type for the specific channel Possible values are Value Description TDRV009 COMMTYPE ASYNC Asynchronous communication TDRV009 COMMTYPE HDLC ADDRO Standard HDLC communication without address recognition Used for synchronous communication TDRV009 COMMTYPE HDLC TRANSP Extended Transparent mode No protocol processing channel works as simple bit collector TransceiverMode This parameter describes the transceiver mode of the programmable multi protocol transceivers Possible values are Value Description TDRV009 TRNSCVR NOT USED Default V 11 TDRV009 TRNSCVR RS530A EIA 530A V 11 V 10 TDRV009 TRNSCVR RS530 EIA 530 V 11 also suitable for RS422 TDRV009 TRNSCVR
31. n will block until the transfer is completed Default value is 5 seconds m MaxMsgSize Specifies the maximum message size which can be transferred between driver and user application Default value is 4096 bytes b lt TotalRxBufferSize gt Specifies the total size of the internal receive buffer This buffer is organized as a circular buffer consisting of multiple single buffers called Packets to hold the received data The number of packets is calculated out of the total buffer size and the size of one packet see next parameter p lt RxPacketSize gt Specifies the size of a single receive packet This size should be large enough to hold the largest buffer received by the application to prevent a message from splitting into multiple packets Example The following startup call will start the TDRVO009 device driver in verbose mode with 100 receive packets 256 bytes in size tdrv009 v b 25600 p 256 amp After the TDRV009 Resource Manager is started it creates and registers a device for each found serial channel The devices are named dev tdrv009 x where x is the number of the channel served by this device dev tdrv009 O0 dev tdrv009 1 dev tdrv009 2 dev tdrv009 3 dev tdrv009 4 dev tdrv009 5 dev tdrv009 6 dev tdrv009 7 This pathname must be used in the application program to open a path to the desired TDRVO009 channel device fd open dev tdrv009 0 O_RDWR TDRV009 SW 95 QNX6
32. ng BrgSource TxClkSource TxClkOutput RxClkSource ClockMultiplier Baudrate ClocklInversion Encoding Parity Stopbits Databits UseTermChar TermChar HwHs Crc TDRV009 OPERATION MODE STRUCT CommType This parameter describes the general communication type for the specific channel Possible values are Value TDRV009 COMMTYPE ASYNC TDRV009 COMMTYPE HDLC ADDRO TDRV009 COMMTYPE HDLC TRANSP TDRV009 SW 95 QNX6 Neutrino Device Driver Description Asynchronous communication Standard HDLC communication without address recognition Used for synchronous communication Extended Transparent mode No protocol processing channel works as simple bit collector Page 22 of 54 TEWS TECHNOLOGIES TransceiverMode This parameter describes the transceiver mode of the programmable multi protocol transceivers Possible values are Value Description TDRV009 TRNSCVR NOT USED Default V 11 TDRV009 TRNSCVR RS530A EIA 530A V 11 V 10 TDRV009 TRNSCVR RS530 EIA 530 V 11 also suitable for RS422 TDRV009 TRNSCVR X21 X 21 V 11 TDRV009 TRNSCVR V35 V 35 V 35 V 28 TDRV009_TRNSCVR _RS449 EIA 449 V 11 TDRV009 TRNSCVR V36 V 36 V 11 TDRV009 TRNSCVR RS232 EIA 232 V 28 TDRV009 TRNSCVR V28 V 28 V 28 TDRV009 TRNSCVR NO CABLE High impedance Oversampling This parameter enables or disables 16times oversampling used for asynchronous communication For communication with standard UARTs i
33. process devctl error ERRORS Error Code Description EINVAL Invalid argument The supplied baudrate is not valid All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 28 of 54 TEWS TECHNOLOGIES 3 5 4 DCMD TDRV009 SET RX TIMEOUT NAME DCMD TDRV009 SET RX TIMEOUT Setup receive timeout DESCRIPTION This I O control function sets up the receive timeout A pending read operation is cancelled after this time expires A pointer to the caller s parameter buffer unsigned long and the size of this buffer are passed by the parameters data ptr and n bytes to the device The time is specified in seconds If no timeout should be used specifiy 1 as value for this control function EXAMPLE include tdrv009 h int fd int result unsigned long RxTimeout Setup Receive Timeout to 2 seconds RxTimeout 2 result devctl fd DCMD TDRV009 SET RX TIMEOUT amp RxTimeout sizeof unsigned long NULL if result EOK process devctl error ERRORS All returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 29 of 54 TEWS TECHNOLOGIES 3 5 5 DCMD TDRVO0O9 SET TX TIMEOUT NAME DCMD TDRVO009 SET TX TIMEOUT Setup transmit timeout DESCRIPTION This I O control function sets up the transmit timeout A pending write operation is cancelled after this tim
34. rnal frequency may be supplied either at input line TxC or RxC A pointer to the caller s parameter buffer unsigned long containing the frequency in Hz and the size of this buffer are passed by the parameters data ptrand n bytes to the device EXAMPLE include tdrv009 h int fd int result unsigned long ext xtal hz specify an external frequency of 1 MHz ext xtal hz 1000000 result devctl fd DCMD TDRV009 SET EXT XTAL amp ext xtal hz Sizeof unsigned long NULL if result EOK process devctl error ERRORS Error Code Description EINVAL Invalid frequency specified A frequency of 0 is not allowed All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 34 of 54 TEWS TECHNOLOGIES 3 5 9 DCMD TDRV009 SCC REG WRITE NAME DCMD TDRVO009 SCC REG WhITE Directly write to an SCC register DESCRIPTION This I O control function writes one 32bit word to the communication controllers register space relative to the beginning of the specific channel s SCC register set A pointer to the callers status buffer TDRV00O9 ADDR STRUCT and the size of this structure are passed by the parameters data ptr and n bytes to the device typedef struct unsigned long Offset unsigned long Value TDRV009 ADDR STRUCT Offset This parameter specifies a byte offset into the communication controller s channel SCC regist
35. rns the current state of the DSR signal line of the specific channel This function is only available for local module channel 3 A pointer to the callers message buffer unsigned long and the size of this buffer are passed by the parameters data_ptr and n_bytes to the device Depending on the state of DSR either 0 inactive or 1 active is returned EXAMPLE include tdrv009 h int fd int result unsigned long DsrState Read DSR state x result devctl fd DCMD TDRV009 DSR GET amp DsrState sizeof unsigned long NULL if result EOK printf DSR ld n DsrState else process devctl error ERRORS Error Code Description EACCES This function is not supported by the specific channel All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 54 of 54
36. t is recommended to enable this feature Valid values are Value Description TDRV009 DISABLED The 16 times oversampling is not used TDRV009 ENABLED The 16 times oversampling is used BrgSource This parameter specifies the frequency source used as input to the BRG Baud Rate Generator Valid values are Value Description TDRV009 BRGSRC XTAL1 XTAL1 oscillator is used for BRG input TDRV009 BRGSRC XTAL2 XTAL2 oscillator is used for BRG input TDRV009 BRGSRC XTALS3 XTAL3 oscillator is used for BRG input TDRV009 BRGSRC RXCEXTERN External clock at RxC input used for BRG input TDRV009 BRGSRC TXCEXTERN External clock at TxC input used for BRG input TxClkSource This parameter specifies the frequency source used as input to the transmit engine Valid values are Value Description TDRV009 TXCSRC BRG Baud Rate Generator output used for Tx clock TDRV009 TXCSRC BRGDIV16 BRG output divided by 16 used for Tx clock TDRV009 TXCSRC RXCEXTERN External clock at RxC input used for Tx clock TDRV009 TXCSRC TXCEXTERN External clock at TxC input used for Tx clock TDRV009 TXCSRC DPLL DPLL output used for Tx clock TDRV009 SW 95 QNX6 Neutrino Device Driver Page 23 of 54 TEWS TECHNOLOGIES TxClkOutput This parameter specifies which output lines are used to output the transmit clock e g for synchronous communication The given values can be binary OR ed Valid values are Value Description TDRV009 TXCOUT TXC Transmit clock available at TxC o
37. tion The arguments data ptr and n 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 TDRVOO9 driver and should be set to NULL The following devctl command codes are defined in tdrvOO9 h Value DCMD TDRV009 SET OPERATION MODE DCMD TDRV009 GET OPERATION MODE DCMD TDRV009 SET BAUDRATE DCMD TDRV009 SET RX TIMEOUT DCMD TDRV009 SET TX TIMEOUT DCMD TDRV009 SET RECEIVER STATE DCMD TDRV009 CLEAR RX BUFFER DCMD TDRV009 SET EXT XTAL DCMD TDRV009 SCC REG WRITE DCMD TDRV009 SCC REG READ DCMD TDRV009 REG WRITE DCMD TDRV009 EEPROMWRITE TDRV009 SW 95 QNX6 Neutrino Device Driver Description Setup a channel s operation mode Retrieve a channel s current configuration Setup baudrate of a channel Setup receive timeout Setup transmit timeout Set operation state of the channel s receiver Clear the internal receive buffer Specify the externally supplied frequency Directly write to an SCC register Directly read from an SCC register Directly write to a register Write value to EEPROM Page 13 of 54 TEWS TECHNOLOGIES DCMD TDRV009 EEPROMREAD Read value from EEPROM DCMD TDRV009 REG READ Directly read from a register DCMD TDRV009 WAITFORINTERRUPT Wait for specific channel interrupt DCMD TDRVO009 RTS
38. unication controller s register space relative to the beginning of the register set A pointer to the callers status buffer TDRV00O9 ADDR STRUCT and the size of this structure are passed by the parameters data ptr and n bytes to the device typedef struct unsigned long Offset unsigned long Value TDRV009 ADDR STRUCT Offset This parameter specifies a byte offset into the communication controller s register space Please refer to the hardware user manual for further information Value This parameter returns the 32bit word from the communication controller s register space EXAMPLE include tdrv009 h int fd int result TDRV009_ADDR_STRUCT AddrBuf Read a 32bit value Version Register ur AddrBuf Offset Ox00F0 TDRV009 SW 95 QNX6 Neutrino Device Driver Page 41 of 54 TEWS E TECHNOLOGIES result devctl if result EOK printf Value else process devctl fd DCMD TDRV009 REG READ amp AddrBuf sizeof TDRV0O09 ADDR STRUCT NULL 0x 081X n AddrBuf Value error ERRORS Error Code Description EINVAL Invalid parameter The specified offset is out of range All other returned errors are system error conditions TDRV009 SW 95 QNX6 Neutrino Device Driver Page 42 of 54 TEWS TECHNOLOGIES 3 5 13 DCMD TDRV009 EEPROMWRITE NAME DCMD TDRV009 EEPROMWRITE Write value to EEPROM DESCRIPTI
39. utput line TDRV009 TXCOUT RTS Transmit clock available at RTS output line RxClkSource This parameter specifies the frequency source used as input to the receive engine Valid values are Value Description TDRV009 RXCSRC BRG Baud Rate Generator output used for Rx clock TDRV009 RXCSRC RXCEXTERN External clock at RxC input used for Rx clock TDRV009 RXCSRC DPLL DPLL output used for Rx clock ClockMultiplier This parameter specifies the multiplier used for BRG clock input Valid values are Value Description TDRV009 CLKMULT X1 Clock multiplier disabled TDRV009 CLKMULT X4 Selected input clock is multiplied by 4 Bauarate This parameter specifies the desired frequency to be generated by the BRG Baud Rate Generator which can be used as clock input signal The value is derived from the selected clocksource Please note that only specific values depending on the selected oscillator are valid This frequency is internally multiplied by 16 if oversampling shall be used ClockInversion This parameter specifies the inversion of the transmit and or the receive clock This value can be binary OR ed Possible values are Value Description TDRV009 CLKINV NONE no clock inversion TDRV009 CLKINV TXC transmit clock is inverted TDRV009 CLKINV RXC receive clock is inverted Encoding This parameter specifies the data encoding used for communication Valid values are Value Description TDRV009 ENC NRZ NRZ data encoding TDRV009 ENC NRZI NRZI data encoding

Download Pdf Manuals

image

Related Search

Related Contents

Copyright © All rights reserved.
Failed to retrieve file