Summary of Contents for Tews Technologies TPMC821-SW-42
Page 1
VxWorks Device Driver INTERBUS Master G4 PMC Version 1.4 User Manual Issue 1.2 January 2004 TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC Am Bahnhof 7 25469 Halstenbek / Germany 1 E. Liberty Street, Sixth Floor Reno, Nevada 89504 / USA Phone: +49-(0)4101-4058-0...
Page 2
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.
1 Introduction The TPMC821-SW-42 VxWorks device driver allows the operation of the TPMC821 PMC conforming to the VxWorks system specification. This includes a device-independent basic I/O interface with open(), 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 ioctl() function with a specific function code and an optional function dependent argument.
• The PCI spaces of the TPMC821 (PLX9050) must be set up to unused PCI areas. Memory and I/O accesses must be enabled in the PCI configuration space (see example below). • The PCI interrupts must be set up (Interrupt routing and handler). TPMC821-SW-42 - VxWorks Device Driver Page 5 of 37...
Page 6
It is not necessary for asynchronous operation modes. The device driver uses this delay during the interrupt function. This may delay other tasks and interrupts (the times will be < 100µs). TPMC821-SW-42 - VxWorks Device Driver Page 6 of 37...
BSP is used, please refer to BSP documentation or contact the technical support for required adaptation. If strange errors appeared after system startup with the new build system please carrying out a VxWorks build clean and build all. TPMC821-SW-42 - VxWorks Device Driver Page 7 of 37...
The call of this function is the first thing the user has to do before adding any device to the system or performing any I/O request. RETURNS OK or ERROR (if the driver cannot be installed) INCLUDE FILES tpmc821.h TPMC821-SW-42 - VxWorks Device Driver Page 8 of 37...
EXAMPLE #include "tpmc821.h" int status; /*----------------------------------------------------------- Create a device "/tp821A" to select TPMC821 is mounted to bus 0 and device 16 -----------------------------------------------------------*/ status = tp821DevCreate("/tp821A", 0, 16, 0); TPMC821-SW-42 - VxWorks Device Driver Page 9 of 37...
Page 10
RETURNS OK or ERROR INCLUDE FILES tpmc821.h TPMC821-SW-42 - VxWorks Device Driver Page 10 of 37...
Open the device named "/tpmc821A" for I/O -----------------------------------------------------------*/ fd = open("/tpmc821A", 0, 0); RETURNS A device descriptor number or ERROR (if the device does not exist or no device descriptors are available) TPMC821-SW-42 - VxWorks Device Driver Page 11 of 37...
Page 12
INCLUDE FILES vxworks.h tpmc821.h SEE ALSO ioLib, basic I/O routine - open() TPMC821-SW-42 - VxWorks Device Driver Page 12 of 37...
Specifies a segment with word data. The union part word will be used (Datalength = itemNumber * 2 byte). TP821_LWORD Specifies a segment with longword data. The union part lword will be used (Datalength = itemNumber * 4 byte). TPMC821-SW-42 - VxWorks Device Driver Page 13 of 37...
Page 17
/* read failed */; RETURNS ERROR or length of data buffer INCLUDES vxworks.h tpmc821.h SEE ALSO ioLib, basic I/O routine - read() TPMC821-SW-42 - VxWorks Device Driver Page 17 of 37...
Specifies a segment with word data. The union part word will be used (Datalength = itemNumber * 2 byte). TP821_LWORD Specifies a segment with longword data. The union part lword will be used (Datalength = itemNumber * 4 byte). TPMC821-SW-42 - VxWorks Device Driver Page 18 of 37...
The structure arg depends on the selected request (see description below). RETURNS OK or ERROR (if an error occurred) INCLUDE FILES vxworks.h tpmc821.h SEE ALSO ioLib, basic I/O routine - ioctl() TPMC821-SW-42 - VxWorks Device Driver Page 22 of 37...
The parameter for the command bit operation is specified in the cmdParam argument. More information about the command bits and the parameter values can be found in the User Manuals for the INTERBUS Generation 4 which is parts of the TPMC821-DOC Engineering Documentation. TPMC821-SW-42 - VxWorks Device Driver Page 23 of 37...
Page 24
/* use command bit 0 cntrlBuf.bcmd.cmdParam = /* parameter not used result = ioctl(tp821_dev, FIO_TP821_BIT_CMD, &cntrlBuf); if (result != ERROR) /* Bit command successfully executed */ else /* ERROR while execution */ TPMC821-SW-42 - VxWorks Device Driver Page 24 of 37...
More information about the mailbox commands and the parameters can be found in the User Manuals for the INTERBUS Generation 4 which is parts of the TPMC821-ED Engineering Documentation. TPMC821-SW-42 - VxWorks Device Driver Page 25 of 37...
Page 26
/* max. Size of ResultPar 100 */ cntrlBuf.mbx.resultSize = 100; cntrlBuf.mbx.resultBuffer = ResultPar; result = ioctl(tp821_dev, FIO_TP821_MBX_WAIT, &cntrlBuf); if (result != ERROR) /* Mailbox command successfully executed */ else /* ERROR while execution */ TPMC821-SW-42 - VxWorks Device Driver Page 26 of 37...
The argument resultSize and resultBuffer are not used by this function. More information about the mailbox commands and the parameters can be found in the User Manuals for the INTERBUS Generation 4 which is parts of the TPMC821-ED Engineering Documentation. TPMC821-SW-42 - VxWorks Device Driver Page 27 of 37...
Page 28
/* no result Parameter */ cntrlBuf.mbx.resultSize = 0; cntrlBuf.mbx.resultBuffer = NULL; result = ioctl(tp821_dev, FIO_TP821_MBX_NOWAIT, &cntrlBuf); if (result != ERROR) /* Mailbox command successfully started */ else /* ERROR while execution */ TPMC821-SW-42 - VxWorks Device Driver Page 28 of 37...
The hardwareFail argument returns TRUE if a hardware failure occurred or FALSE if no hardware failure occurred. The initComplete argument returns TRUE if the INTERBUS firmware has completed initialization. If it is still initializing FALSE value will be returned. TPMC821-SW-42 - VxWorks Device Driver Page 29 of 37...
The argument dt_timout specifies a new timeout value for data accesses. This value must be specified in seconds. The argument mb_timout specifies a new timeout value for mailbox accesses. This value must be specified in seconds. TPMC821-SW-42 - VxWorks Device Driver Page 31 of 37...
Special function code to set the host fail interrupt request Special function code to removing the host FIO_TP821_REMOVE_HOST_FAIL fail interrupt request FIO_TP821_CLEAR_HWERROR Special function code for removing the hardware error flag, which disables data accesses TPMC821-SW-42 - VxWorks Device Driver Page 36 of 37...
Specified buffer size is too small. S_tp821Drv_TIMEOUT 0x08210008 Request timed out. S_tp821Drv_ILLBIT 0x08210009 An illegal bit has been specified. S_tp821Drv_BUSSTOPPED 0x0821000A The specified access is not working with a stopped INTERBUS. TPMC821-SW-42 - VxWorks Device Driver Page 37 of 37...
Need help?
Do you have a question about the TPMC821-SW-42 and is the answer not in the manual?
Questions and answers