Home

User Manual - powerbridge.de

image

Contents

1. TDRV009 SW 82 Linux Device Driver Meaning Configure channel operation mode Read current channel configuration Setup transmission rate Configure receiver state Clear receive buffer Configure externally supplied clock frequency Specify a timeout for read operations Read the transmit error counter Read the transmit success counter Write value to EEPROM Read value from EEPROM Write value to register space Read value from register space Read value from SCC register space Write value to SCC register space Wait for specific channel interrupt Page 16 of 57 TEWS amp TECHNOLOGIES TDRVO009_IOC_RTS_ SET Assert RTS handshake line TDRVO009_IOC_RTS CLEAR De Assert RTS handshake line TDRVO009_IOCG_CTS_GET Read state of CTS TDRV009_IOC_DTR_SET Set DTR signal line only channel 3 TDRV009_IOC_DTR_CLEAR Clear DTR signal line only channel 3 TDRV009_IOCG_DSR_GET Read state of DSR only channel 3 See behind for more detailed information on each control code To use these TDRV009 specific control codes the header file tdrv009 h must be included in the application RETURNS On success zero is returned In the case of an error a value of 1 is returned The global variable errno contains the detailed error code ERRORS Error code Description EINVAL Invalid argument This error code is returned if the requested ioctl function is unknown Please check the argument request EFAULT Parameter data can not be copied
2. process Ioctl error ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp TDRV009 SW 82 Linux Device Driver Page 54 of 57 TENSE TECHNOLOGIES 3 5 20 TDRV009_IOC_DTR_SET NAME TDRV009_IOC_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 The function dependent argument argp is not used for this function Example include tdrv009 h int d int retval Set DTR to HIGH only valid for channel 3 retval ioctl fd TDRV009_IOC_DTR_SET 0 if retval lt 0 process Ioctl error ERROR CODES Error code Description EACCES This function is not supported by the specific channel TDRV009 SW 82 Linux Device Driver Page 55 of 57 TENSE TECHNOLOGIES 3 5 21 TDRV009_IOC_DTR_CLEAR NAME TDRV009_IOC_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 The function dependent argument argp is not used for this function Example include tdrv009 h int d int retval Set DTR to LOW only valid for channel 3 retval ioctl fd TDRV009_IOC_DTR_CLEAR 0 if
3. SE AddrBuf Offset 0x0004 retval ioctl fd TDRV0O09_IOCG_SCCREGREAD int amp AddrBuf if retval gt 0 printf Value 0x 1X n AddrBuf Value else handle the error TDRV009 SW 82 Linux Device Driver Page 48 of 57 TEWS amp TECHNOLOGIES ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp EACCES The specified offset is invalid TDRV009 SW 82 Linux Device Driver Page 49 of 57 TENSE TECHNOLOGIES 3 5 16 TDRV009_IOCX_WAITFORINTERRUPT NAME TDRV009_IOCX_WAITFORINTERRUPT Wait for specific channel interrupt DESCRIPTION This I O control function waits until a specified SCC interrupt or the timeout occurs The function specific control parameter argp is a pointer to a TDRVO09_WAIT_STRUCT structure 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 system ticks to wait for an interrupt If 0 is specified the function will block indefinitely EXAMPLE include tdrv009 h int fd TDRV009_WAIT STRUCT WaitStruct
4. 0x0034 AddrBuf Value Oxffffffff retval ioctl fd TDRVOO9_ITOCS_REGWRITE int amp AddrBuf if retval lt 0 handle the error ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp EACCES The specified offset is invalid TDRV009 SW 82 Linux Device Driver Page 43 of 57 TENSE TECHNOLOGIES 3 5 13 TDRV009_IOCG_REGREAD NAME TDRV009_IOCG_REGREAD Read value from register space DESCRIPTION This I O control function reads one 32bit word from the communication controller s register space relative to the beginning of the register set The function specific control parameter argp is a pointer to a TDRV009_ADDR_STRUCT structure 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 TDRV009_ADDR_STRUCT AddrBuf int retval ja Read a 32bit value Version Register ZS AddrBuf Offset 0x00F0 retval ioctl fd TDRVOO09_IOCG_REGREAD int amp AddrBuf if retval gt 0 printf Value 0x 1X n AddrB
5. Linux Device Driver Page 52 of 57 TENSE TECHNOLOGIES 3 5 18 TDRV009_IOC_RTS_CLEAR NAME TDRV009_IOC_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 The function dependent argument argp is not used for this function Example include tdrv009 h int d int retval De assert RTS retval ioctl fd TDRV009_IOC_RTS_CLEAR 0 if retval lt 0 process Ioctl error ERROR CODES Error code Description EPERM The channel is in handshake mode so this function is not allowed TDRV009 SW 82 Linux Device Driver Page 53 of 57 TENSE TECHNOLOGIES 3 5 19 TDRV009_IOCG_CTS_GET NAME TDRV009_IOCG_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 The function dependent argument argp passes a pointer to an unsigned long value to the driver Depending on the state of CTS either 0 inactive or 1 active is returned Example include tdrv009 h int fd int retval unsigned long CtsState Read CTS state retval ioctl fd TDRVO09_IOCG_CTS_GET int amp CtsState if retval gt 0 printf CTS ld n CtsState else
6. TENSES The Embedded I O Company TECHNOLOGIES TDRV009 SW 82 Linux Device Driver High Speed Synch Asynch Serial Interface Version 1 0 x User Manual Issue 1 0 3 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 82 Linux Device Driver High Speed Synch Asynch Serial Interface Supported Modules TENSE 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 Ui complete However TEWS TECHNOLOGIES GmbH TCP863 reserves the right to change the product described TAMC863 in this document at any time without notice TPCE863 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 Issue Description Date 1 0 0 First Issue April 23 2007 1 0 1 UDEV description added syntax errors corrected August 08 2007 1 0 2 Address TEWS LLC removed General Revision August 19 2010 1 0 3 General Revision February 7 2012 TDRV009 SW 82 Linux Device Driver Page 2 of 57 TENSE TECHNOLOGIES Table of Contents 1 UE Oe TON EE 4 2 INSTALLATION BE 5 2 1 Build and install the Device Driver
7. 0x1234 TDRVO09_IOCS_EEPROMWRITE int amp EepromBuf if retval lt 0 handle the error ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp EACCES The specified offset address is invalid or read only TDRV009 SW 82 Linux Device Driver Page 39 of 57 TENSE TECHNOLOGIES 3 5 11 TDRV009_IOCG_EEPROMREAD NAME TDRV009_IOCG_EEPROMREAD Read value from EEPROM DESCRIPTION This I O control function reads one 16bit word from the onboard EEPROM The function specific control parameter argp is a pointer to a TDRVO0O9_EEPROM_BUFFER structure typedef struct unsigned long Offset unsigned long Value TDRVOO9_EEPROM_BUFFER Offset This parameter specifies a 16bit word offset into the EEPROM Following offsets are available Offset Access 00h GER R 60h ZER R W Value This parameter returns the 16bit word from the EEPROM at the given offset EXAMPLE include tdrv009 h int fd TDRV009_EEPROM_ BUFFER RepromBuf int retval J Read a 16bit value from the EEPROM offset 0 F EepromBuf Offset 0 retval ioct1 fd TDRV009_IOCG_EEPROMREAD int amp EepromBuf TDRV009 SW 82 Linux Device Driver Page 40 of 57 TEWS amp TECHNOLOGIES if retval gt 0 printf Va
8. 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 TDRVO009_ ENG EM FMO data encoding TDRV009_ENC_FM1 FM1 data encoding TDRV009_ ENG MANCHESTER Manchester data encoding TDRV009 SW 82 Linux Device Driver Page 27 of 57 TENSE 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
9. 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 TDRV0O09_IOCS SET OPERATION MODE 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 This function specifies the desired frequency which should be generated by the Baud Rate Generator BRG The function dependent parameter argp passes an unsigned long value containing the desired baudrate to the device driver EXAMPLE include tdrv009 h int fd unsigned long Baudrate int retval Set baudrate to 14400bps Baudrate 14400 retval ioctl fd TDRVO09_IOCT_SET_BAUDRATE int Baudrate if retval gt 0 function succeeded else handle the error ERROR CODES Error code Description EINVAL Invalid parameter specified TDRV009 SW 82 Linux Device Driver Page 31 of 57 TENSE TECHNOLOGIES 3 5 4 TDRV009_IOCT_SET_RECEIVER_STATE NAME TDRV009_IOCT_SET_RECEIVER_STATE Configure receiver state DESCRIPTION This command sets the channel s receiver either to active or inactive The parameter argp passed to this loctl function defines the new state of the receiver Possible values are Value Description TDRV009_RCVR_ON The receiver is enabled TDRV009_RCVR_OFF The receiver is disabled Example inc
10. 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 TDRVO009_ 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 mechanism using RTS CTS Valid values are Value Description TDRV009_ DISABLED Hardware handshaking is not used TDRV009_ ENABLED Hardware handshaking is used Cre This parameter is a structure describing the CRC checking configuration typedef struct TDRV009_CRC_TYPE Type TDRVOO9_ENABLE_ DISABLE RxChecking TDRVO0O9_ ENABLE DISABLE TxGeneration TDRV009_CRC_RESET ResetValue TDRVO09_CRC TDRVO009 SW 82 Linux Device Driver Page 28 of 57 TENSE 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
11. int retval TDRVO009 SW 82 Linux Device Driver Page 50 of 57 TEWS amp TECHNOLOGIES Wait at least 5 seconds 5 HZ fora CTS Staus Change CSC interrupt WaitStruct Interrupts 1 lt lt 14 WaitSrtuct Timeout 5 HZ retval ioctl fd TDRV0O09_IOCX_WAITFORINTERRUPT int amp WaitStruct if retval gt 0 printf Interrupts else handle the error Ox 1X n WaitStruct Interrupts ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp EBUSY Too many simultaneous wait jobs active ETIME Timeout happened TDRV009 SW 82 Linux Device Driver Page 51 of 57 TENSE TECHNOLOGIES 3 5 17 TDRV009_IOC_RTS_SET NAME TDRV009_IOC_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 The function dependent argument argp is not used for this function Example include tdrv009 h int d int retval Assert RTS retval ioctl fd TDRV009_IOC_RTS_SET 0 if retval lt 0 process Ioctl error ERROR CODES Error code Description EPERM The channel is in handshake mode so this function is not allowed TDRV009 SW 82
12. c cccccssssssseeeeeeeeceeesssneeeeeeaeeeenassaeeeeeeenaeaesseaseeeseoneeanenees 5 2 2 Uninstall the Device Driver cisiciscsisisiiaisceeici ceevivdseeed isdeestivcccned case OAEEN GENEE NENNEN Kee 6 2 3 Install Device Driver into the running Kernel cccesseseceeeeeseeeeneeseeenneeseeesneeseeesneesesesnenseessnees 6 2 4 Remove Device Driver from the running Kernel eeeeeeeeeeeeeeeeeeeeeeeeeeneenaeeeeeseeneeneeneeeeees 6 2 5 Change Major Device NUMDEL csseccsseeeeeseeeseeeeeseeeeneeeeseaesasaeeenseeessaesesaaesasneeeneeeesnaesaseeeenenaeees 7 3 DEVICE INPUT OUTPUT FUNCTIONS nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnm 8 31 EE 8 Bed CLOSE EEN 10 BBs COAG E 12 KE WU 14 Be oo d EEN 16 3 5 1 TDRVO009_IOCS SET OPERATION MODE ccc ccccccececececeeeessaeceeeeeeeceesseaeeeeeeeens 18 3 5 2 TDRVO009_IOCG_GET_OPERATION MODE eccccccecsececcceceessaeaeeeeeeeseesseaeeeeeeeens 25 3 5 3 TDRVO009_IOCT SET BAUDRATE ana eae aaan aaka aai taaa 31 3 5 4 TDvVOoO0 OCT GET RECEIWNER GIATE 32 3 5 5 TDRV009_IOC_CLEAR_RX_BUFFER esssssesssssssssesesesesesesesrsrsrsrsrersrsrsrsrsrsrsrerererene 33 3 5 6 TDRVO009_ OCT SET EXT STALL 34 3 5 7 TDRV009_IOCT SET READ TIMEOUT 35 3 5 8 TDRVO009_IOCQ_GET_TX_COUNT ERROR 36 3 5 9 TDRV009_IOCQ_GET_TX_COUNT Ok 37 3 5 10 TDRV009_ IOCS EEPROMWDITIE 38 3 5 11 TDRV009_IOCG_EEPROMREAD ssesesesesssesesesesssrsesesesrsrsesrsrsrsrsrsrsrsrsrsrsrensre
13. error TDRV009 SW 82 Linux Device Driver Page 12 of 57 TENSE TECHNOLOGIES RETURNS On success read returns the number of bytes In the case of an error a value of 1 is returned The global variable errno contains the detailed error code ERRORS Error code Description EFAULT Error copying data from kernelspace to userspace SEE ALSO GNU C Library description Low Level Input Output TDRV009 SW 82 Linux Device Driver Page 13 of 57 TENSE TECHNOLOGIES 3 4 write NAME write write to a device SYNOPSIS include lt unistd h gt ssize_t write int filedes void buffer size_t size DESCRIPTION This function attempts to writes a data buffer to the TDRV009 channel associated with the file descriptor filedes The user specifies a character buffer pointed to by buffer The argument size specifies the length of the buffer The function performs a non blocking write operation i e the function returns immediately after inserting the data into the transmit queue EXAMPLE int id ssize_t num_bytes char buffer 100 send some text sprintf buffer Hello World num_bytes write fd buffer strlen buffer if num_bytes strlen buffer process error RETURNS On success write returns the number of bytes written In the case of an error a value of 1 is returned The global variable errno contains the detailed error code TDRV009 SW 82 Linux Dev
14. retval lt 0 process Ioctl error ERROR CODES Error code Description EACCES This function is not supported by the specific channel TDRV009 SW 82 Linux Device Driver Page 56 of 57 TENSE TECHNOLOGIES 3 5 22 TDRV009_IOCG_DSR_GET NAME TDRV009_IOCG_DSR_GET Read state of DSR only channel 3 DESCRIPTION This I O control function returns the current state of the DSR signal line of the specific channel This function is only available for local module channel 3 The function dependent argument argp passes a pointer to an unsigned long value to the driver Depending on the state of DSR either 0 inactive or 1 active is returned Example include tdrv009 h int fd int retval unsigned long DsrState f Read DSR state S retval ioctl fd TDRV0O09_IOCG_DSR_GET int amp DsrState if retval gt 0 printf DSR ld n DsrState else process Ioctl error ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp TDRV009 SW 82 Linux Device Driver Page 57 of 57
15. to the drivers context Other function dependent error codes will be described for each ioctl code separately Note the TDRV009 driver always returns standard Linux error codes SEE ALSO ioctl man pages TDRV009 SW 82 Linux Device Driver Page 17 of 57 TENSE TECHNOLOGIES 3 5 1 TDRV009_IOCS_SET_OPERATION_MODE NAME TDRV009_IOCS_SET_OPERATION_MODE Configure channel operation mode DESCRIPTION This I O control function configures the channel s operation mode The function specific control parameter argp is a pointer to a TDRVO09_OPERATION_MODE_STRUCT structure It is necessary to completely initialize the structure This can be done by calling the I O control function TDRV009_lIOCG_GET_OPERATION_MODE described below A call to this function must be done prior to any communication operation because after driver startup the channel s transceivers are disabled typedef struct TDRV009_ COMM_TYPE TDRV009_TRANSCEIVER_MODE TDRVO09_ENABLE DISABLE CommType TransceiverMode Oversampling TDRV009_ BRGSOURCE BrgSource TDRV009_TXCSOURCE TxClkSource unsigned long TxClkOutput TDRV009_ RXCSOURCE RxClkSource TDRVO09_CLKMULTIPLIER ClockMultiplier unsigned long Baudrate unsigned char ClockInversion unsigned char Encoding TDRVO09_PARITY Parity int Stopbits int Databits TDRV0O09_ENABLE DISABLE UseTermChar char TermChar TDRVO0O9_ENABLE_DISABLE HwHs TDRV009_CRC Cre TDRVO09_OPERATION_MODE_ST
16. 9 device driver source tdrvO009def h TDRVO009 driver include file commCtrl h Include file for controller chip tdrv009 h TDRVO009 include file for driver and application makenode Script to create device nodes on the file system Makefile Device driver make file example tdrv009exa c Example application example Makefile Example application make file include config h Driver independent library header file include tpmodule h Driver and kernel independent library header file include tpmodule c Driver and kernel independent library source file In order to perform an installation extract all files of the archive TDRVO09 SW 82 SRC tar gz to the desired target directory The command tar xzvf TDRV009 SW 82 SRC tar gz will extract the files into the local directory e Login as root and change to the target directory e Copy tdrv009 h to usr include 2 1 Build and install the Device Driver e Login as root e Change to the target directory e To create and install the driver in the module directory lib modules lt version gt misc enter make install e To update the device driver s module dependencies enter depmod aq TDRV009 SW 82 Linux Device Driver Page 5 of 57 TENSE TECHNOLOGIES 2 2 Uninstall the Device Driver e Login as root e Change to the target directory e To remove the driver from the module directory ib modules lt version gt misc enter make uninstall 2 3 Install Device Driver into the runn
17. 9_COMMTYPE_ASYNC TDRVO09_TRNSCVR _RS232 T OperationMode Oversampling OperationMode BrgSource OperationMode TxClkSource OperationMode TxC1lkOutput OperationMode RxClkSource OperationMode ClockMultiplier OperationMode Baudrate OperationMode ClockInversion OperationMode Encoding OperationMode Parity OperationMode Stopbits OperationMode Databits OperationMode UseTermChar OperationMode TermChar OperationMode HwHs OperationMode Crc Type OperationMode Crce RxChecking OperationMode Crc TxGeneration TDRV009_ENABLED TDRV009_BRGSRC_XTAL1 TDRV009_TXCSRC_BRG TDRV009_RXCSRC_BRG TDRV009_CLKMULT_X1 115200 TDRV009_CLKINV_NON TDRV009_ENC_NRZ TDRV009_PAR_DISABL Gl Kn fl is TDRV009_DISABLED TDRV009_DISABLED TDRVO009_CRC_16 TDRV0O09_DISABLED TDRV009_DISABLED OperationMode Crc ResetValu retval ioctl fd TDRVOO9_IOCS_S if retval else gt 0 function succeeded handle the error TDRVO09_CRC_RST_FFFF ET _OPERATION_MODE int amp OperationMode TDRVO009 SW 82 Linux Device Driver Page 23 of 57 TEWS amp TECHNOLOGIES ERROR CODES Error code Description EINVAL Invalid parameter specified At least one parameter inside the structure is invalid TDRV009 SW 82 L
18. C_RXCEXTERN TDRV009_RXCSRC_DPLL Baud Rate Generator output used for Rx clock External clock at RxC input used for Rx clock 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 TDRV009_CLKMULT_X4 Clock multiplier disabled Selected input clock is multiplied by 4 Baudrate 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 value can be binary OR ed Possible values are Value TDRVO009_CLKINV_NONE TDRVO009_CLKINV_TXC TDRVO009_CLKINV_RXC Description no clock inversion transmit clock is inverted receive clock is inverted TDRVO009 SW 82 Linux Device Driver Page 20 of 57 Encoding TENSE TECHNOLOGIES This parameter specifies the data encoding used for communication Valid values are Value TDRV009_ENC_NRZ TDRV009_ENC_NRZI TDRV009_ENC_FMO TDRV009_ENC_FM1 TDRV009_ENC_MANCHESTER Parity Description NRZ data encoding NRZI data encoding FMO data encoding FM1 data encoding Manchester data encodi
19. ES Write a 32bit value Termination Character Register Wi AddrBuf Offset 0x0048 AddrBuf Value 1 lt lt 15 0x42 retval ioctl fd TDRVO09_IOCS_SCCREGWRITE int amp AddrBuf if retval lt 0 handle the error ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp EACCES The specified offset is invalid TDRV009 SW 82 Linux Device Driver Page 47 of 57 TENSE TECHNOLOGIES 3 5 15 TDRV009_IOCG_SCCREGREAD NAME TDRV009_IOCG_SCCREGREAD Read value from SCC register space 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 The function specific control parameter argp is a pointer to a TDRVO09_ADDR_STRUCT structure typedef struct unsigned long Offset unsigned long Value TDRVOO9_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 fd TDRV009_ADDR_STRUCT AddrBuf int retval Read a 32bit value Status Register
20. Mode This parameter describes the transceiver transceivers Possible values are Value TDRV009_TRNSCVR_NOT_USED TDRV009_TRNSCVR _RS530A TDRV009_TRNSCVR _RS530 TDRV009_TRNSCVR _ X21 TDRVO009_TRNSCVR _V35 TDRV009_TRNSCVR _RS449 TDRVO009_TRNSCVR _V36 TDRV009_TRNSCVR _RS232 TDRV009_TRNSCVR _V28 TDRVO009_TRNSCVR _NO_CABLE Oversampling TENSE TECHNOLOGIES mode of the programmable multi protocol Description Default V 11 EIA 530A V 11 V 10 EIA 530 V 11 also suitable for RS422 X 21 V 11 V 35 V 35 V 28 EIA 449 V 11 V 36 V 11 EIA 232 V 28 V 28 V 28 High impedance 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 TDRVO009_ 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 TDRV009_BRGSRC_XTAL1 TDRV009_BRGSRC_XTAL2 TDRV009_BRGSRC_XTAL3 TDRV009_BRGSRC_RXCEXTERN TDRV009_BRGSRC_TXCEXTERN TxClkSource Description XTAL1 oscillator is used for BRG input XTAL2 oscillator is used for BRG input XTAL3 oscillator is used for BRG input External clock at RxC input used for BRG input External clock at TxC input used for BRG input This parameter specifies the f
21. RUCT TDRV009 SW 82 Linux Device Driver Page 18 of 57 TENSE 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 TDRVO09_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 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 u
22. ce Driver Page 21 of 57 Cre TENSE TECHNOLOGIES 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 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 82 Linux Device Driver Page 22 of 57 TEWS amp TECHNOLOGIES EXAMPLE include tdrv009 h int fd TDRV009_OPERATION_MODE_STRUCT OperationMode int retval Configure channel for Async RS232 115200bps 7 OperationMode CommType OperationMode TransceiverMod TDRV00
23. counter for the corresponding channel The transmit error counter is reset after a call to this function The parameter argp passes a pointer to an unsigned long value to the device driver where the error count is returned Example include tdrv009 h int fd int retval unsigned long ErrorCount Read Transmit Error Counter retval ioctl fd TDRV009_IOCQ_GET_TX_COUNT Wi ErrorCount ERROR Qh ast retval gt 0 printf ErrorCount else process Ioctl error ERROR CODES Error code EFAULT TDRV009 SW 82 Linux Device Driver ld n ErrorCount Description Parameter data can not be copied to or from the driver s context Please check the argument argp Page 36 of 57 TENSE TECHNOLOGIES 3 5 9 TDRV009 IOCQ_GET_TX_COUNT_OK NAME TDRV009_IOCQ_GET_TX_COUNT_OK Read the transmit success counter DESCRIPTION This I O control function returns the global transmit success counter for the corresponding channel The transmit success counter is reset after a call to this function The parameter argp passes a pointer to an unsigned long value to the device driver where the success count is returned Example include tdrv009 h int lt td int retval unsigned long OkCount Read Transmit Error Counter retval ioctl fd TDRVO09_IOCQ_GET_TX_COUNT_OK W
24. e system until you close all opened files and execute modprobe r again TDRVO009 SW 82 Linux Device Driver Page 6 of 57 TENSE TECHNOLOGIES 2 5 Change Major Device Number This paragraph is only for Linux kernels without DEVFS installed The TDRVO009 device driver uses dynamic allocation of major device numbers per default If this isn t suitable for the application it s possible to define a major number for the driver To change the major number edit the file tdrvOO9def h change the following symbol to appropriate value and enter make install to create a new driver TDRV009_ MAJOR Valid numbers are in range between 0 and 255 A value of 0 means dynamic number allocation Example define TDRV009_MAJOR 122 Be sure that the desired major number is not used by other drivers Please check proc devices to see which numbers are free Keep in mind that it is necessary to create new device nodes if the major number for the TDRVO009 driver has changed and the makenode script is not used TDRVO009 SW 82 Linux Device Driver Page 7 of 57 TENSE 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 fentl h gt int open const char filename int flags DESCRIPTION The open function creates and returns a new file descriptor for the file named by
25. ency may be supplied either at input line TxC or RxC The function dependent argument argp passes the clock frequency in Hz Example include tdrv009 h int d int retval Specify 1000000Hz 1MHz as external clock frequency g retval ioctl fd TDRV009_IOCT_SET_EXT_XTAL 1000000 if retval lt 0 process Ioctl error ERROR CODES Error code Description EINVAL Invalid parameter The specified frequency must be larger than 0 TDRV009 SW 82 Linux Device Driver Page 34 of 57 TENSE TECHNOLOGIES 3 5 7 TDRV009 IOCT_SET_READ_TIMEOUT NAME TDRV009_IOCT_SET_READ_TIMEOUT Specify a timeout for read operations DESCRIPTION This I O control function specifies the timeout used for read operations The parameter argp passes an unsigned long value containing the new timeout value in jiffies Le system ticks to the device driver Example include tdrv009 h int d int retval specify the read timeout 100 clock ticks Wi retval ioctl fd TDRV009_IOCT_SET_ READ TIMEOUT 100 if retval lt 0 process Ioctl error TDRV009 SW 82 Linux Device Driver Page 35 of 57 TENSE TECHNOLOGIES 3 5 8 TDRV009_lIOCQ_GET_TX_COUNT_ERROR NAME TDRV009_IOCQ_GET_TX_COUNT_ERROR Read the transmit error counter DESCRIPTION This I O control function returns the global transmit error
26. filename The flags argument controls how the file is to be opened This is a bit mask you create the value by the bitwise OR of the appropriate parameters using the operator in C See also the GNU C Library documentation for more information about the open function and open flags EXAMPLE int eds fd open dev tdrv009_0 O_RDWR if fd 1 handle error condition 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 TDRVO009 SW 82 Linux Device Driver Page 8 of 57 TEWS amp TECHNOLOGIES ERRORS Error code Description ENODEV The requested minor device does not exist This is the only error code returned by the driver other codes may be returned by the I O system during open For more information about open error codes see the GNU C Library description Low Level Input Output SEE ALSO GNU C Library description Low Level Input Output TDRV009 SW 82 Linux Device Driver Page 9 of 57 TENSE 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 t
27. he case of an error a value of 1 is returned The global variable errno contains the detailed error code ERRORS Error code Description ENODEV The requested minor device does not exist This is the only error code returned by the driver other codes may be returned by the I O system during close For more information about close error codes see the GNU C Library description Low Level Input Output TDRVO009 SW 82 Linux Device Driver Page 10 of 57 TEWS amp TECHNOLOGIES SEE ALSO GNU C Library description Low Level Input Output TDRVO009 SW 82 Linux Device Driver Page 11 of 57 TEWS amp TECHNOLOGIES 3 3 read NAME read read data from a specified device SYNOPSIS include lt unistd h gt ssize_t read int filedes void butter size_t size DESCRIPTION This function attempts to read an input buffer from a TDRVOO9 channel associated with the file descriptor fildes The argument size specifies the length of the buffer Available data up to size bytes is copied into the user s buffer pointed to by buffer The function performs a blocking read operation i e the functions waits until data is available or the specified timeout expires see SET_READ_TIMEOUT EXAMPLE int fd char buffer 100 int retval Read data from TDRV009 device retval read fd buffer 100 if retval gt 0 printf d bytes read n retval else handle the read
28. i amp OkCount if retval gt 0 printf OkCount else process Ioctl error ERROR CODES Error code EFAULT TDRV009 SW 82 Linux Device Driver S1d n OkCount Description Parameter data can not be copied to or from the driver s context Please check the argument argp Page 37 of 57 TENSE TECHNOLOGIES 3 5 10 TDRV009_IOCS_EEPROMWRITE NAME TDRV009_IOCS_EEPROMWRITE Write value to EEPROM DESCRIPTION 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 The function specific control parameter argp is a pointer to a TDRVO0O9_EEPROM_BUFFER structure typedef struct unsigned long Offset unsigned long Value TDRVOO9_EEPROM_BUFFER Offset This parameter specifies a 16bit word offset into the EEPROM Following offsets are available Offset Access 00h 5Fh R 60h ZER R W Value This parameter specifies the 16bit word to be written into the EEPROM at the given offset EXAMPLE include tdrv009 h int fd TDRV009_EEPROM_BUFFER RepromBuf int retval TDRVO009 SW 82 Linux Device Driver Page 38 of 57 TEWS amp TECHNOLOGIES Write a 16bit value into the EEPROM offset 0x61 EepromBuf Offset EepromBuf Value retval ioctl fd 0x61
29. ice Driver Page 14 of 57 TEWS amp TECHNOLOGIES ERRORS Error code Description ENOMEM Error getting memory for DMA transfer EFAULT Error copying data from userspace into kernelspace EBUSY No free transmit descriptor available after timeout SEE ALSO GNU C Library description Low Level Input Output TDRV009 SW 82 Linux Device Driver Page 15 of 57 3 5 ioctl NAME ioctl device control functions SYNOPSIS include lt sys ioctl h gt int ioctl int filedes int request void argp DESCRIPTION TEWS amp TECHNOLOGIES The ioctl function sends a control code directly to a device specified by filedes causing the corresponding device to perform the requested operation The argument request specifies the control code for the operation The optional argument argp depends on the selected request and is described for each request in detail later in this chapter The following ioctl codes are defined in tdrv009 h Symbol TDRV009_IOCS_SET_ OPERATION _MODE TDRV009_IOCG_GET_OPERATION_MODE TDRVO009_IOCT_SET_BAUDRATE TDRVO09_IOCT_SET_RECEIVER_STATE TDRVO009_IOC_CLEAR_RX_BUFFER TDRVO009_IOCT_SET_EXT_XTAL TDRVO009_IOCT_SET_READ_TIMEOUT TDRV009_IOCQ_GET_TX_COUNT_ERROR TDRV009_IOCQ_GET_TX_COUNT_OK TDRVO09_IOCS_EEPROMWRITE TDRV009_IOCG_EEPROMREAD TDRVO09_IOCS_ REGWRITE TDRVO009_IOCG_REGREAD TDRVO09_IOCS_SCCREGWRITE TDRV009_IOCG_SCCREGREAD TDRVO009_IOCX_WAITFORINTERRUPT
30. ing Kernel e To load the device driver into the running kernel login as root and execute the following commands modprobe tdrv009drv e After the first build or if you are using dynamic major device allocation it is necessary to create new device nodes on the file system Please execute the script file makenode to do this If your kernel has enabled a device file system devfs or sysfs with udev then you have to skip running the makenode script Instead of creating device nodes from the script the driver itself takes creating and destroying of device nodes in its responsibility sh makenode On success the device driver will create a minor device for each compatible channel found The first channel of the first TDRV0O09 device can be accessed with device node dev tdrv009_0 the second channel with device node dev tdrv009_1 and so on The assignment of device nodes to physical TDRV009 devices depends on the search order of the PCI bus driver 2 4 Remove Device Driver from the running Kernel e Toremove the device driver from the running kernel login as root and execute the following command modprobe r tdrv009drv If your kernel has enabled devfs or sysfs udev all dev tdrv009_x nodes will be automatically removed from your file system after this Be sure that the driver is not opened by any application program If opened you will get the response tdrv009drv Device or resource busy and the driver will still remain in th
31. inux Device Driver Page 24 of 57 TENSE TECHNOLOGIES 3 5 2 TDRV009_IOCG_GET_OPERATION_MODE NAME TDRV009_IOCG_GET_OPERATION_MODE Read current channel configuration DESCRIPTION This I O control function returns the channel s current operation mode The function specific control parameter argp is a pointer to a TDRV009_OPERATION_MODE_STRUCT structure 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 TDRVO0O9_ENABLE_DISABLE TDRVO009_CRC CommType TransceiverMode Oversampling BrgSource TxClkSource TxClkOutput RxClkSource ClockMultiplier Baudrate ClockInversion Encoding Parity Stopbits Databits UseTermChar TermChar HwHs Cre TDRVO09_OPERATION_MODE_STRUCT 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 TDRV009 SW 82 Linux Device Driver processing channel works as simple bit collector Page 25 of 57 Transceiver
32. lude tdrv009 h int fd int retval SS nable the receiver retval ioctl fd TDRVO009_IOCT_SET_RECEIVER_STATE TDRV009_RCVR_ON if status lt 0 process Ioctl error ERROR CODES Error code Description EINVAL Invalid parameter specified TDRV009 SW 82 Linux Device Driver Page 32 of 57 TENSE TECHNOLOGIES 3 5 5 TDRV009_IOC_CLEAR_RX_BUFFER NAME TDRV006_IOC_ WRITE Write value to output buffer DESCRIPTION This I O control function removes all received data from the channel s receive buffer and flushes the hardware FIFO as well The function dependent argument argp is not used for this function Example include tdrv009 h int d int retval Clear receive buffer xy retval ioctl fd TDRV009_IOC_CLEAR_RX_BUFFER 0 if retval lt 0 process Ioctl error ERROR CODES Error code Description EIO Error during reset or init of the receivers hardware DMA engine TDRV009 SW 82 Linux Device Driver Page 33 of 57 TENSE TECHNOLOGIES 3 5 6 TDRV009_IOCT_SET_EXT_XTAL NAME TDRV009_IOCT_SET_EXT_XTAL Configure externally supplied clock frequency DESCRIPTION This I O control function specifies the frequency of an externally provided clock This frequency is used for baudrate calculation and describes the input frequency to the Baud Rate Generator BRG The external frequ
33. lue 0x X n else handle the error EepromBuf Value ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp EACCES Specified offset is invalid and may not be accessed TDRV009 SW 82 Linux Device Driver Page 41 of 57 TENSE TECHNOLOGIES 3 5 12 TDRV009_IOCS_REGWRITE NAME TDRV009_IOCS_REGWRITE Write value to register space DESCRIPTION This I O control function writes one 32bit word to the communication controllers register space relative to the beginning of the register set The function specific control parameter argp is a pointer to a TDRV0O09_ADDR_STRUCT structure 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 controllers register space Modifying register contents may result in communication problems system crash or other unexpected behavior EXAMPLE include tdrv009 h int fd TDRV009_ADDR_STRUCT AddrBuf int retval TDRV009 SW 82 Linux Device Driver Page 42 of 57 TEWS amp TECHNOLOGIES Write a 32bit value FIFO Control Register 4 Wi AddrBuf Offset
34. ng This parameter specifies the parity bit generation used for asynchronous communication Valid values are Value TDRV009_PAR_DISABLED TDRV009_PAR_EVEN TDRV009_PAR_ODD TDRV009_PAR_SPACE Description No parity generation is used EVEN parity bit ODD parity bit 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 TDRV009_ ENABLED A termination character is not used 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 TDRV009_ ENABLED Hardware handshaking is not used Hardware handshaking is used TDRV009 SW 82 Linux Devi
35. 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 82 Linux Device Driver Page 29 of 57 TEWS amp TECHNOLOGIES EXAMPLE include tdrv009 h int fd TDRV009_OPERATION_MODE_STRUCT OperationMode int retval Retrieve current configuration ZS retval ioctl fd TDRVO09_IOCG_GET_OPERATION_MODE int amp OperationMode if retval gt 0 function succeeded printf Current speed d bps n OperationMode Baudrate else handle the error ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp TDRV009 SW 82 Linux Device Driver Page 30 of 57 TENSE TECHNOLOGIES 3 5 3 TDRV009_IOCT_SET_BAUDRATE NAME TDRV009_IOCT_SET_BAUDRATE Setup transmission rate DESCRIPTION
36. reates devices with dynamically allocated or fixed major device numbers DEVFS and SYSFS UDEV support for automatic device node creation VVVVVVVV The TDRV009 SW 82 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 Advanced Mezzanine Card 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 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 TDRVO009 SW 82 Linux Device Driver Page 4 of 57 TENSE TECHNOLOGIES 2 Installation Following files are located on the distribution media Directory path TDRV009 SW 82 TDRV009 SW 82 1 0 3 pdf This manual in PDF format TDRV009 SW 82 SRC tar gz GZIP compressed archive with driver source code ChangeLog txt Release history Release txt Release information The GZIP compressed archive TDRV009 SW 82 SRC tar gz contains the following files and directories Directory path tdrv009 tdrv009 c TDRVO00
37. requency source used as input to the transmit engine Valid values are Value TDRV009_TXCSRC_BRG TDRV009_TXCSRC_BRGDIV16 TDRV009_TXCSRC_RXCEXTERN TDRV009_TXCSRC_TXCEXTERN TDRV009_TXCSRC_DPLL TDRV009 SW 82 Linux Device Driver Description Baud Rate Generator output used for Tx clock BRG output divided by 16 used for Tx clock External clock at RxC input used for Tx clock External clock at TxC input used for Tx clock DPLL output used for Tx clock Page 26 of 57 TENSE 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 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 Baudrate This parameter specifies the desired frequency to be generated by the BRG
38. rsesrene 40 3 5 12 TDRV009_ IOCS REOGWDITE 42 3 5 13 TDRV009_ IOCG REGREAID cccccccecscessessceeeeeeeeeeeeeeeeeeaeaeaeaeaeaeaeaeaeauaeaeaeaeaeanaeaes 44 3 5 14 TDRVO009_IOCS GCCHREGWRITE 46 3 5 15 TDRV009_IOCG_SCCREGREAD cc cccccccccscsececceeceesesseaeceeeeeeseseaseaeceeeeseeesseaeaeeeesess 48 3 5 16 TDRVOOg IOCN WATTEORINTERRURT 50 3 5 17 TDORVO09 IOC RTS SET EE 52 3 5 18 TDRV009_IOC RTS CLEAR usvcseccsssssecstessunsctsnsncssdacannsctsnasecennvasaceansancssananccdcaannsecaancnenes 53 3 5 19 TDRVO009 IOCG CTS iGET EE 54 3 5 20 TDRVO09 OC 2 DT RESET EE 55 3 5 21 TDRVO09 IOC DT e EE 56 3 5 22 TDRVO009 IOCG DSR GE EE 57 TDRV009 SW 82 Linux Device Driver Page 3 of 57 TEWS amp TECHNOLOGIES 1 Introduction The TDRV009 SW 82 Linux device driver allows the operation of the TDRV009 compatible devices conforming to the Linux I O system specification This includes a device independent basic I O interface with open close read write and ioctl functions Special I O operation that do not fit to the standard I O calls will be performed by calling the oct function with a specific function code and an optional function dependent argument The TDRV009 SW 82 device driver supports the following features setup and configure serial channels send and receive data buffers character oriented read and write onboard registers directly read and write access to onboard EEPROM control handshake lines wait for interrupts C
39. sed 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_XTAL3 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 TDRVO009 SW 82 Linux Device Driver Page 19 of 57 TENSE TECHNOLOGIES TxClkSource This parameter specifies the frequency source used as input to the transmit engine Valid values are Value Description TDRV009_TXCSRC_BRG TDRV009_TXCSRC_BRGDIV16 TDRV009_TXCSRC_RXCEXTERN TDRV009_TXCSRC_TXCEXTERN TDRV009_TXCSRC_DPLL Baud Rate Generator output used for Tx clock BRG output divided by 16 used for Tx clock External clock at RxC input used for Tx clock External clock at TxC input used for Tx clock 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 TDRV009_TXCOUT_RTS Transmit clock available at TxC output line 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 TDRV009_RXCSR
40. uf Value else handle the error TDRVO009 SW 82 Linux Device Driver Page 44 of 57 TEWS amp TECHNOLOGIES ERROR CODES Error code Description EFAULT Parameter data can not be copied to or from the driver s context Please check the argument argp EACCES The specified offset is invalid TDRV009 SW 82 Linux Device Driver Page 45 of 57 TENSE TECHNOLOGIES 3 5 14 TDRV009_IOCS_SCCREGWRITE NAME TDRV009_IOCS_SCCREGWRITE Write value to SCC register space 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 The function specific control parameter argp is a pointer to a TDRVO09_ADDR_STRUCT structure typedef struct unsigned long Offset unsigned long Value TDRVOO9_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 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 TDRV009_ADDR_STRUCT AddrBuf int retval TDRV009 SW 82 Linux Device Driver Page 46 of 57 TEWS amp TECHNOLOGI

Download Pdf Manuals

image

Related Search

Related Contents

FlyDVB-T User Manual Multi-Language  Mini HiFi System - CONRAD Produktinfo.  HP LaserJet Enterprise MFP M630h    Pichet d`eau alcaline de 9 tasses  Intenso Music Dancer 8GB  dreamGEAR ISOUND-5900 USB cable  Guía del usuario de la aplicación VersaMail®  154ML FRA.pub  Line Array - Renkus  

Copyright © All rights reserved.
Failed to retrieve file