Tews Technologies TPMC821-SW-42 User Manual

Vxworks device driver interbus master g4 pmc

Advertisement

Quick Links

The Embedded I/O Company
TPMC821-SW-42
TEWS TECHNOLOGIES GmbH
Am Bahnhof 7
Phone: +49-(0)4101-4058-0
e-mail: info@tews.com
VxWorks Device Driver
INTERBUS Master G4 PMC
Version 1.4
User Manual
Issue 1.2
January 2004
25469 Halstenbek / Germany
Fax: +49-(0)4101-4058-19
www.tews.com
TEWS TECHNOLOGIES LLC
1 E. Liberty Street, Sixth Floor
Phone: +1 (775) 686 6077
e-mail: usasales@tews.com
Reno, Nevada 89504 / USA
Fax: +1 (775) 686 6024
www.tews.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TPMC821-SW-42 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

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.
  • Page 3: Table Of Contents

    4.4 ioctl() ..............................22 4.4.1 FIO_TP821_BIT_CMD ....................23 4.4.2 FIO_TP821_MBX_WAIT ....................25 4.4.3 FIO_TP821_MBX_NOWAIT ..................27 4.4.4 FIO_TP821_GET_DIAG ....................29 4.4.5 FIO_TP821_CONFIGURE.....................31 4.4.6 FIO_TP821_SET_HOST_FAIL..................33 4.4.7 FIO_TP821_REMOVE_HOST_FAIL................34 4.4.8 FIO_TP821_CLEAR_HWERROR .................35 APPENDIX........................ 36 5.1 Predefined Symbols........................36 5.2 Additional Error Codes.........................37 TPMC821-SW-42 - VxWorks Device Driver Page 3 of 37...
  • Page 4: Introduction

    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.
  • Page 5: Installation

    • 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...
  • Page 7: Special Installation For Intel X86 Based Targets

    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...
  • Page 8: O System Functions

    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...
  • Page 9: Tp821Devcreate()

    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...
  • Page 11: O Interface Functions

    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...
  • Page 13: Read()

    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 14 Segment values (before calling the read function): segment: itemNumber: itemType: TP821_BYTE itemOffset: 0x008 data: (8 byte) segment: itemNumber: itemType: TP821_LWORD itemOffset: 0x000 data: (2 longwords) End segment: itemNumber: itemType: TP821_END itemOffset: 0x000 data: (none) TPMC821-SW-42 - VxWorks Device Driver Page 14 of 37...
  • Page 15 TP821_BYTE itemOffset: 0x008 data: 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 segment: itemNumber: itemType: TP821_LWORD itemOffset: 0x000 data: 0x12345678, 0x9ABCDEF0 End segment: itemNumber: itemType: TP821_END itemOffset: 0x000 data: (none) TPMC821-SW-42 - VxWorks Device Driver Page 15 of 37...
  • Page 16 /* End segment */ pSeg = NEXT_SEGMENT(pSeg); pSeg->itemType = TP821_END; pSeg->itemNumber = 0; pSeg->dataOffset = 0; size += SEGMENT_SIZE(pSeg); result = read(tp821_dev, &segmentBuffer, size); if (result != ERROR) /* read successfully completed */ TPMC821-SW-42 - VxWorks Device Driver Page 16 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...
  • Page 18: Write()

    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...
  • Page 19 TP821_BYTE itemOffset: 0x008 data: 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 segment: itemNumber: itemType: TP821_LWORD itemOffset: 0x000 data: 0x12345678, 0x9ABCDEF0 End segment: itemNumber: itemType: TP821_END itemOffset: 0x000 data: (none) TPMC821-SW-42 - VxWorks Device Driver Page 19 of 37...
  • Page 20 = 1; pSeg->dataOffset = 0; pSeg->u.word[0] = 0x1234; size += SEGMENT_SIZE(pSeg); /* End segment */ pSeg = NEXT_SEGMENT(pSeg); pSeg->itemType = TP821_END; pSeg->itemNumber = 0; pSeg->dataOffset = 0; size += SEGMENT_SIZE(pSeg); TPMC821-SW-42 - VxWorks Device Driver Page 20 of 37...
  • Page 21 (result != ERROR) /* write successfully completed */ else /* write failed */; RETURNS ERROR or length of data buffer INCLUDE FILES vxworks.h tpmc821.h SEE ALSO ioLib, basic I/O routine - write() TPMC821-SW-42 - VxWorks Device Driver Page 21 of 37...
  • Page 22: Ioctl()

    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...
  • Page 23: Fio_Tp821_Bit_Cmd

    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...
  • Page 25: Fio_Tp821_Mbx_Wait

    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...
  • Page 27: Fio_Tp821_Mbx_Nowait

    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...
  • Page 29: Fio_Tp821_Get_Diag

    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...
  • Page 30 Diagnostic Register : %04Xh\n", cntrlBuf.diag.diagReg); printf("Hardware Failure : %s\n", cntrlBuf.diag.hardwareFail ? "TRUE" : "FALSE" ); printf("Initialization done : %s\n", cntrlBuf.diag.initComplete ? "TRUE" : "FALSE" ); else /* ERROR while execution */ TPMC821-SW-42 - VxWorks Device Driver Page 30 of 37...
  • Page 31: Fio_Tp821_Configure

    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...
  • Page 32 10 seconds mailbox timeout: 3 seconds -----------------------------------------------------------*/ cntrlBuf.config.op_mode TP821_ASYNC; cntrlBuf.config.dt_timeout cntrlBuf.config.mb_timeout result = ioctl(tp821_dev, FIO_TP821_CONFIGURE, &cntrlBuf); if (result != ERROR) /* Device successfully configured */ else /* ERROR while configuration */ TPMC821-SW-42 - VxWorks Device Driver Page 32 of 37...
  • Page 33: Fio_Tp821_Set_Host_Fail

    Set host fail interrupt -----------------------------------------------------------*/ result = ioctl(tp821_dev, FIO_TP821_SET_HOST_FAIL, 0); if (result != ERROR) /* setting host fail interrupt request succeeded */ else /* setting host fail interrupt request failed */ TPMC821-SW-42 - VxWorks Device Driver Page 33 of 37...
  • Page 34: Fio_Tp821_Remove_Host_Fail

    Remove host fail interrupt -----------------------------------------------------------*/ result = ioctl(tp821_dev, FIO_TP821_REMOVE_HOST_FAIL, 0); if (result != ERROR) /* removing host fail interrupt request succeeded */ else /* removing host fail interrupt request failed */ TPMC821-SW-42 - VxWorks Device Driver Page 34 of 37...
  • Page 35: Fio_Tp821_Clear_Hwerror

    #include “tpmc821.h” STATUS result; /*----------------------------------------------------------- Reset hardware error flag -----------------------------------------------------------*/ result = ioctl(tp821_dev, FIO_TP821_CLEAR_HWERROR, 0); if (result != ERROR) /* resetting hardware error succeeded */ else /* resetting hardware error failed */ TPMC821-SW-42 - VxWorks Device Driver Page 35 of 37...
  • Page 36: Appendix

    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...
  • Page 37: Additional Error Codes

    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...

Table of Contents