TPMC821-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. INTERBUS Master G4 PMC. Version 1.4. Issue 1.

Similar documents
TPMC500-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. 32 Channel 12 Bit ADC. Version 2.0.x. Issue 2.0.

TIP700-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. Digital Output 24V DC. Version 2.0.x. Issue June 2008.

TPMC901-SW-95. QNX4 - Neutrino Device Driver. User Manual. The Embedded I/O Company. 6/4/2 Channel Extended CAN-Bus PMC

TPMC868-SW-42. VxWorks Device Driver. 16 Channel Serial PMC. Version 2.1.x. User Manual. Issue December 2011

TDRV006-SW-42. VxWorks Device Driver. 64 Digital Inputs/Outputs (Bit I/O) Version 4.0.x. User Manual. Issue December 2017

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1.

TPMC851-SW-42. VxWorks Device Driver. Multifunction I/O (16 bit ADC/DAC, TTL I/O, Counter) Version 2.0.x. User Manual. Issue 2.0.

TPMC550-SW-12 OS-9 for PPC Device Driver 8 (4) Channels Isolated 12-bit D/A

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

TPMC815-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. ARCNET Controller. Version 1.0.x. Issue 1.0 May 2004

TIP114-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. 10 Channel Absolute Encoder Interface (SSI) Version 1.0.

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

TIP610-SW-95 QNX-Neutrino Device Driver TIP610 16/20 Channel Digital I/O on SBS PCI40 Carrier

TDRV010-SW-95. QNX6 - Neutrino Device Driver. Isolated 2x CAN Bus. Version 1.0.x. User Manual. Issue September 2016

TIP670-SW-95. QNX-Neutrino Device Driver. User Manual. The Embedded I/O Company. Digital I/O. Version 1.0.x. Issue August 2008.

TPMC860-SW-82. Linux Device Driver. 4 Channel Isolated Serial Interface RS232 Version 1.4.x. User Manual. Issue 1.4.

TPMC Channel Motion Control. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 March 2003 D

CARRIER-SW-82. Linux Device Driver. IPAC Carrier Version 2.2.x. User Manual. Issue November 2017

CARRIER-SW-42. VxWorks Device Driver. IPAC Carrier. Version 4.2.x. User Manual. Issue July 2018

TCP866-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 8 Channel Serial PMC Version 1.0.x. Issue 1.

TPMC815 ARCNET PMC. User Manual. The Embedded I/O Company. Version 2.0. Issue 1.2 November 2002 D

TPMC816. Two Independent Channels Extended CAN Bus PMC Module. Version 2.2. User Manual. Issue August 2014

TCP Channel Serial Interface RS232 / RS422 cpci Module. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.

TPMC810. Isolated 2x CAN Bus. Version 1.1. User Manual. Issue June 2009

TDRV002-SW-82. Linux Device Driver. Multi-Channel Serial Interface Version 1.8.x. User Manual. Issue November 2017

TPMC680-SW-82. Linux Device Driver. 64 Digital Input/Output Version 1.1.x. User Manual. Issue April 2010

TPMC /8 Digital Inputs (24V) 16/8 Digital Outputs (24V, 0.5A) Version 3.0. User Manual. Issue June 2014

TPMC Channel Isolated Serial Interface RS422/RS485. Version 1.0. User Manual. Issue July 2009

TIP866-SW-95. QNX-Neutrino Device Driver. 8 Channel Serial Interface IP. Version 2.1.x. User Manual. Issue October 2009

TIP SERCOS IP with 2 Encoder Interfaces. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 September 2006 D

TPMC310. Conduction Cooled PMC Isolated 2 x CAN Bus. Version 1.1. User Manual. Issue June 2014

TPMC Channel Isolated Serial Interface RS232. Version 1.0. User Manual. Issue August 2017

TPMC810-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. Isolated 2x CAN Bus Version 1.2.x. Issue 1.2.

TDRV011-SW-82. Linux Device Driver. Extended CAN Bus Version 1.0.x. User Manual. Issue April 2018

TIP120. Motion Controller with Incremental Encoder Interface. Version 1.0. User Manual. Issue August 2014

TPMC500. Optically Isolated 32 Channel 12 Bit ADC. Version 1.1. User Manual. Issue January 2014

TPMC Digital Inputs/Outputs (Bit I/O) Version 2.0. User Manual. Issue February 2014

TPMC917-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 4 MB SRAM with Battery Backup and 4 Channel Serial Interface Version 1.0.

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est

TIP111. Motion Controller with Absolute Encoder Interface (SSI) User Manual. The Embedded I/O Company. Version 1.1. Issue 1.4 September 2005 D

TIP815. ARCNET Controller. Version 1.0. User Manual. Issue September 2009

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

ICS-121. VxWORKS DEVICE DRIVER MANUAL

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

spwr_base & spwr_chan

TPMC x ADC, 16x/0x DAC and 8x Digital I/O. Version 1.0. User Manual. Issue May 2018

TPCE260. PCI Express PMC Carrier. Version 1.0. User Manual. Issue August 2014

TIP550. Optically Isolated 8/4 Channel 12-bit D/A. Version 1.2. User Manual. Issue October 2009

VxWorks Device Driver User s Manual

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

TXMC885. Four Channel 10/100/1000 Mbit/s Ethernet Adapter. Version 1.0. User Manual. Issue October 2011

VxWorks Driver Installation

VME Basics. Appendix. Introduction to the VMEbus Accessing boards across the VMEbus VMEbus interrupt handling

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, CA Fax Est.

24DSI32 24DSI12 24-bit, 32 Channel Delta-Sigma A/D Boards

TCP Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

DYNAMIC ENGINEERING. 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

RCU. ò Walk through two system calls in some detail. ò Open and read. ò Too much code to cover all FS system calls. ò 3 Cases for a dentry:

VFS, Continued. Don Porter CSE 506

Emulation 2. G. Lettieri. 15 Oct. 2014

Chapter 6: Process Synchronization

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

PcieAltBase & PcieAltChan

Advcan QNX Driver User Manual V1.02

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

PRODUCT OVERVIEW ISSUE 4

PMC-DA Channel 16 Bit D/A for PMC Systems REFERENCE MANUAL Version 1.0 June 2001

CSC369 Lecture 2. Larry Zhang

VxWorks Device Driver User s Manual

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

CSC369 Lecture 2. Larry Zhang, September 21, 2015

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

The Peripheral Component Interconnect (PCI) Bus and vxworks

CPCI-SIP. Slave Dual IndustryPack Carrier for 3U CompactPCI systems REFERENCE MANUAL Version 2.0 June 1998

DYNAMIC ENGINEERING 150 DuBois Suite C Santa Cruz, CA (831) Fax (831) Est.

The CCB gpio-104 device-driver

Embedded Systems Programming

1 Do not confuse the MPU with the Nios II memory management unit (MMU). The MPU does not provide memory mapping or management.

Virtual Memory 1. Virtual Memory

Anybus CompactCom. Host Application Implementation Guide. Doc.Id. HMSI Doc. Rev Connecting DevicesTM

Virtual Memory 1. Virtual Memory

The Spin Model Checker : Part I/II

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

ines-ieee488.2 igpib Device Driver Software Manual 1998 ines GmbH

Project #1 Exceptions and Simple System Calls

AET60 API version 1.4 February Introduction...3 Features...3 Application Programming Interface...4

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA (831) Fax (831) Est.

The UtePC/Yalnix Memory System

Experiment #3 Semaphores

PCI-HPDI32A-COS User Manual

Writing Custom SCSI Routines

PCAN-PassThru API. User Manual. Pass-Thru API and Connection of Pass-Thru Software to PEAK CAN Interfaces. Document version 1.1.

TPMC / 16 Channels of 16 bit D/A. Version 1.0. User Manual. Issue December 2010

AET60 BioCARDKey. Application Programming Interface. Subject to change without prior notice

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

PCI, PCIe, cpci, and PC104+ Plus Modules

Transcription:

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

TPMC821-SW-42 INTERBUS Master G4 PMC VxWorks Device Driver 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. 2000-2004 by TEWS TECHNOLOGIES GmbH Issue Description Date 1.0 First Issue January 2000 1.1 Support for Intel x86 based targets June 2000 1.2 General Revision January 2004 TPMC821-SW-42 - VxWorks Device Driver Page 2 of 37

Table of Content 1 INTRODUCTION 4 2 INSTALLATION. 5 2.1 Install the driver to VxWorks system..5 2.2 Including the driver in VxWorks.5 2.3 Hardware and system dependencies..5 2.4 Special installation for Intel x86 based targets.7 3 I/O SYSTEM FUNCTIONS 8 3.1 tp821drv().8 3.2 tp821devcreate()..9 4 I/O INTERFACE FUNCTIONS. 11 4.1 open() 11 4.2 read().13 4.3 write() 18 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_NOWAIT27 4.4.4 FIO_TP821_GET_DIAG29 4.4.5 FIO_TP821_CONFIGURE31 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 5 APPENDIX. 36 5.1 Predefined Symbols.36 5.2 Additional Error Codes..37 TPMC821-SW-42 - VxWorks Device Driver Page 3 of 37

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. This driver invokes a mutual exclusion and binary semaphore mechanism to prevent simultaneous requests by multiple tasks from interfering with each other. To prevent the application program for losing data, incoming messages will be stored in a message FIFO with a depth of 100 messages. This device driver supports the following features: use all possible bus operation modes o o o o asynchronous mode without consistency locking asynchronous mode with consistency locking bus synchronous mode program synchronous mode use bit commands use mailbox commands read data write data control the host interrupt request reset hardware error TPMC821-SW-42 - VxWorks Device Driver Page 4 of 37

2 Installation The software is delivered on a 3½" HD diskette. Following files are located on the diskette: tp821drv.c tpmc821.h tp821def.h tp821exa.c tpmctime.h tpmc_pci.c tpmc_pci.h tp821_pci.c tpxxxhwdep.c tpxxxhwdep.h TPMC821 Device Driver Source TPMC821 Include File for driver and application TPMC821 Driver Include File TPMC821 Example Application Include file with delay macro PCI dependent functions PCI dependent include TPMC821 PCI MMU mapping for Intel x86 based targets Collection of hardware dependent functions Include for hardware dependent functions For installation the files have to be copied to the desired target directory. 2.1 Install the driver to VxWorks system To install the TPMC821 device driver to the VxWorks system following steps have to be done: Build the object code of the TPMC821 device driver Link or load the driver object file to the VxWorks system Call the tp821drv() function to install the driver. 2.2 Including the driver in VxWorks How to include the device drive in the VxWorks system is described in the VxWorks and Tornado manuals. 2.3 Hardware and system dependencies The TPMC821 can be mounted to different hardware. This will sometimes need some hardware dependant adaptation. PCI Initialization The hardware must be configured before starting the driver. The following points must be guaranteed: 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

BSP dependencies The tpmc_pci.c file has to be adapted, because there are some hardware and system dependent values (only PowerPC targets). Please check the following values: PCI_MEM_BRIDGE_OFFSET This must be set to the offset, which is added by the PCI bridge (refer to BSP) when accessing PCI memory. PCI_IO_BRIDGE_OFFSET This must be set to the offset, which is added by the PCI bridge (refer to BSP) when accessing PCI I/O spaces. int_dev_no (array) This array defines the interrupt vectors/levels for #INTA of the different device position (first index = bus number, second index = device number). These values or the size of the table have to be adapted (if using busses with higher bus numbers). The interrupt vectors/levels depend on BSP. Time factor A counter constant is the last thing, which has to be configured. This constant is used for a delay, which is needed by the INTERBUS G4 controller in synchronous mode. The constant and a wait macro (waiting 5µs) are placed in the file tpmctime.h. There is a little function tp821_testtime() in the example code, which will help to find the right constant. This value should always be calibrated when using a synchronous operation mode. 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

2.4 Special installation for Intel x86 based targets The TPMC821 device driver is fully adapted for Intel x86 based targets. This is done by conditional compilation directives inside the source code and controlled by the VxWorks global defined macro CPU. If the contents of this macro are equal to I80386, I80386 or PENTIUM special Intel x86 conforming code and function calls will be included. The second problem for Intel x86 based platforms can t be solved by conditional compilation directives. Due to the fact that some Intel x86 BSP s doesn t map PCI memory spaces of devices which are not used by the BSP, the required CAN controller device registers can t be accessed. To solve this problem a MMU mapping entry has to be added for the required TPMC821 PCI memory spaces prior the MMU initialization (usrmmuinit()) is done. Please examine the BSP documentation or contact the BSP Vendor whether the BSP perform automatic PCI and MMU configuration or not. If the PCI and MMU initialization is done by the BSP the function tp821pciinit() won t be included and the user can skip to the following steps. The C source file tp821pci.c contains the function tp821pciinit(). This routine finds out all TPMC821 devices and adds MMU mapping entries for all used PCI memory spaces. Please insert a call to this function after the PCI initialization is done and prior to MMU initialization (usrmmuinit()). If the Tornado 2.0 project facility is used, the right place to call the function tp821pciinit() is at the end of the function syshwinit() in syslib.c (can be opened from the project Files window). If Tornado 1.0.1 compatibility tools are used insert the call to tp821pciinit() at the beginning of the root task (usrroot()) in usrconfig.c. Be sure that the function is called prior to MMU initialization otherwise the TPCM821 PCI spaces remains unmapped and an access fault occurs during driver initialization. Please insert the following call at a suitable place in either syslib.c or usrconfig.c: tp821pciinit(); To link the driver object modules to VxWorks, simply add all necessary driver files to the project. If Tornado 1.0.1 Standard BSP Builds is used add the object modules to the macro MACH_EXTRA inside the BSP Makefile (MACH_EXTRA = tp821drv.o tp821pci.o ). The function tp821pciinit() was designed for and tested on generic Pentium targets. If another 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

3 I/O system functions This chapter describes the driver-level interface to the I/O system. The purpose of these functions is to install the driver in the I/O system, add and initialize devices. 3.1 tp821drv() NAME tp821drv() - installs the TPMC821 driver in the I/O system. SYNOPSIS void tp821drv(void) DESCRIPTION This function installs the TPMC821 driver in the I/O system. 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

3.2 tp821devcreate() NAME tp821devcreate() - adds TPMC821 device to the system and initializes device hardware. SYNOPSIS STATUS tp821devcreate ( char *name, /* name of the device to create */ int busno, /* bus number where the module is moutned */ int deviceno, /* device number where the module is mounted */ int functionno /* function number, must be always 0 */ ) DESCRIPTION This routine is called to add a device to the system that will be serviced by the TPMC821 driver. This function must be called before performing any I/O request to this driver. There are several device dependent arguments required for the device initialization and allocation of the system resources. PARAMETER The argument name specifies the name, which will select the device in future calls. The arguments busno and deviceno specify the position of the TPMC821. These values are system dependent (refer to the carrier manual). The argument functionno must be left 0. This value selects the module function. The TPMC821 supports only one function. 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

RETURNS OK or ERROR INCLUDE FILES tpmc821.h TPMC821-SW-42 - VxWorks Device Driver Page 10 of 37

4 I/O interface functions This chapter describes the interface to the basic I/O system used for communication over the INTERBUS. 4.1 open() NAME open() - opens a device or file. SYNOPSIS int open ( const char *name, /* name of the device to open */ int flags, /* not used for TPMC821 driver, must be 0 */ int mode /* not used for TPMC821 driver, must be 0 */ ) DESCRIPTION Before I/O can be performed to the TPMC821 device, a file descriptor must be opened by invoking the basic I/O function open(). PARAMETER The parameter name selects the device which shall be opened. The parameters flags and mode are not used and must be 0. EXAMPLE /*----------------------------------------------------------- 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

INCLUDE FILES vxworks.h tpmc821.h SEE ALSO iolib, basic I/O routine - open() TPMC821-SW-42 - VxWorks Device Driver Page 12 of 37

4.2 read() NAME read() reads data from the specified TPMC821 device. SYNOPSIS int read ( int fd, /* device descriptor from opened TPMC821 device */ char *buffer, /* pointer to the data buffer */ size_t maxbytes /* not used */ ) PARAMETER The parameter fd is a file descriptor specifying the device which shall be used. The argument buffer points to a driver-specific I/O parameter block. This buffer is segmented into parts with the data structure of the type TP821_RW_SEGMENT (see below). The parameter maxbytes is not used by the TPMC821 Device Driver. data structure TP821_RW_SEGMENT typedef struct unsigned short itemnumber; /* number of items (bytes, w..) */ unsigned short itemtype; /* TP821_BYTE TP821_WORD.. */ unsigned short dataoffset; /* Byte Off. in DATA IN/OUT reg */ union unsigned char byte[1]; unsigned short word[1]; unsigned long lword[1]; u; TP821_RW_SEGMENT; The argument itemnumber specifies how many elements of the specified type will follow. The itemtype specifies the length of the data element. Allowed values are: TP821_END TP821_BYTE TP821_WORD TP821_LWORD Specifies the last segment of a segment list for data commands, no data follows. Specifies a segment with byte data. The union part byte will be used (Datalength = itemnumber * 1 byte). Specifies a segment with word data. The union part word will be used (Datalength = itemnumber * 2 byte). 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

The argument dataoffset specifies the offset in the data area of the TPMC821. The specified data will be read from the data in base address + dataoffset (in byte). The union u marks the first element of the data area of the segment. The area size is not specified by this array. It is specified with the itemnumber argument. The data structure TP821_RW_SEGMENT will be put over the data buffer. There are two MACROS defined in tpmc821.h, which will help setting up the data buffer. The 1 st function SEGMENT_SIZE(pSeg) calculates the length of the data segment. The data segment must be specified with the segment pointer in pseg. The 2 nd function NEXT_SEGMENT(pSeg) calculates the start of the next segment. The actual data segment must be specified with the segment pointer in pseg. The new data pointer will be the return value (see example below). Example The transmitted data shall be split into two segments and an end segment. The 1 st segment shall have a size of 8 bytes, the 2 nd segment shall have a size of 2 longwords. The contents of the 1 st segment shall be read from data offset 8 and the 2 nd segment shall be read from position 0. The data buffer segmentation will have the following layout. Segment values (before calling the read function): 1 st segment: itemnumber: 8 itemtype: itemoffset: data: TP821_BYTE 0x008 (8 byte) 2 nd segment: itemnumber: 2 itemtype: itemoffset: data: TP821_LWORD 0x000 (2 longwords) End segment: itemnumber: 0 itemtype: itemoffset: data: TP821_END 0x000 (none) TPMC821-SW-42 - VxWorks Device Driver Page 14 of 37

The data buffer has the following layout (before calling the read function): Offset +0 +1 +2 +3 +4 +5 +6 +7 +0x00 0x00 0x08 0x00 0x01 0x00 0x08 xx xx +0x08 xx xx xx xx xx xx 0x00 0x02 +0x10 0x00 0x04 0x00 0x00 xx xx xx xx +0x18 xx xx xx xx 0x00 0x00 0x00 0x00 +0x20 0x00 0x00 xx xx xx xx xx xx The data input area of the TPMC821: Offset +0 +1 +2 +3 +4 +5 +6 +7 +0x00 0x12 0x34 0x56 0x78 0x9A 0xBC 0xDE 0xF0 +0x08 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 The data buffer has the following layout (after calling the read function): Offset +0 +1 +2 +3 +4 +5 +6 +7 +0x00 0x00 0x08 0x00 0x01 0x00 0x08 0x00 0x11 +0x08 0x22 0x33 0x44 0x55 0x66 0x77 0x00 0x02 +0x10 0x00 0x04 0x00 0x00 0x12 0x34 0x56 0x78 +0x18 0x9A 0xBC 0xDE 0xF0 0x00 0x00 0x00 0x00 +0x20 0x00 0x00 xx xx xx xx xx xx Segment values (after calling the read function): 1 st segment: itemnumber: 8 itemtype: itemoffset: data: TP821_BYTE 0x008 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 2 nd segment: itemnumber: 2 itemtype: itemoffset: data: TP821_LWORD 0x000 0x12345678, 0x9ABCDEF0 End segment: itemnumber: 0 itemtype: itemoffset: data: TP821_END 0x000 (none) TPMC821-SW-42 - VxWorks Device Driver Page 15 of 37

EXAMPLE #include "tpmc821.h" unsigned char segmentbuffer[100]; TP821_RW_SEGMENT *pseg; unsigned long result; int size; /*----------------------------------------------------------- Read data from an open TPMC821 device, read data from offset 0, read the same data with byte, word and longword length, the length shall always be 4 byte -----------------------------------------------------------*/ size = 0; /* Checking buffer overrun (size always < 100) */ /* pointer to the first segment */ pseg = (TP821_RW_SEGMENT*)&segmentBuffer; pseg->itemtype = TP821_BYTE; pseg->itemnumber = 4; pseg->dataoffset = 0; size += SEGMENT_SIZE(pSeg); /* same data read as word */ pseg = NEXT_SEGMENT(pSeg); pseg->itemtype = TP821_WORD; pseg->itemnumber = 2; pseg->dataoffset = 0; size += SEGMENT_SIZE(pSeg); /* same data read as longword */ pseg = NEXT_SEGMENT(pSeg); pseg->itemtype = TP821_LWORD; pseg->itemnumber = 1; pseg->dataoffset = 0; size += SEGMENT_SIZE(pSeg); /* 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

else /* 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

4.3 write() NAME write() writes data to the specified TPMC821 device. SYNOPSIS int write ( int fd, /* device descriptor from opened TPMC821 device */ char *buffer, /* pointer to the data buffer */ size_t bytes /* not used */ ) PARAMETER The parameter fd is a file descriptor specifying the device which shall be used. The argument buffer points to a driver-specific I/O parameter block. This data structure is named TP821_RW_SEGMENT (see below). The parameter bytes is not used by the TPMC821 Device Driver. data structure TP821_RW_SEGMENT typedef struct unsigned short itemnumber; /* number of items (bytes, w..) */ unsigned short itemtype; /* TP821_BYTE TP821_WORD.. */ unsigned short dataoffset; /* Byte Off. in DATA IN/OUT reg */ union unsigned char byte[1]; unsigned short word[1]; unsigned long lword[1]; u; TP821_RW_SEGMENT; The argument itemnumber specifies how many elements of the specified type will follow. The itemtype specifies the length of the data element. Allowed values are: TP821_END TP821_BYTE TP821_WORD TP821_LWORD Specifies the last segment of a segment list for data commands, no data follows. Specifies a segment with byte data. The union part byte will be used (Datalength = itemnumber * 1 byte). Specifies a segment with word data. The union part word will be used (Datalength = itemnumber * 2 byte). 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 argument dataoffset specifies the offset in the data area of the TPMC821. The specified data will be written to the data in base address + dataoffset (in byte). The union u marks the first element of the data area of the segment. The area size is not specified by this array. It is specified with the itemnumber argument. The data structure TP821_RW_SEGMENT will be put over the data buffer. There are two MACROS defined in tpmc821.h, which will help setting up the data buffer. The 1 st function SEGMENT_SIZE(pSeg) calculates the length of the data segment. The data segment must be specified with the segment pointer in pseg. The 2 nd function NEXT_SEGMENT(pSeg) calculates the start of the next segment. The actual data segment must be specified with the segment pointer in pseg. The new data pointer will be the return value (see example below). Example There are two data segments that shall be transmitted. The 1 st segment has a size of 8 bytes, the 2 nd segment shall have a size of 2 longwords. The contents of the 1 st segment shall be written to data offset 8 and the 2 nd segment shall be written to position 0. The data buffer segmentation will have the following layout. Segment values: 1 st segment: itemnumber: 8 itemtype: itemoffset: data: TP821_BYTE 0x008 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 2 nd segment: itemnumber: 2 itemtype: itemoffset: data: TP821_LWORD 0x000 0x12345678, 0x9ABCDEF0 End segment: itemnumber: 0 itemtype: itemoffset: data: TP821_END 0x000 (none) TPMC821-SW-42 - VxWorks Device Driver Page 19 of 37

The data buffer has the following layout: Offset +0 +1 +2 +3 +4 +5 +6 +7 +0x00 0x00 0x08 0x00 0x01 0x00 0x08 0x00 0x11 +0x08 0x22 0x33 0x44 0x55 0x66 0x77 0x00 0x02 +0x10 0x00 0x04 0x00 0x00 0x12 0x34 0x56 0x78 +0x18 0x9A 0xBC 0xDE 0xF0 0x00 0x00 0x00 0x00 +0x20 0x00 0x00 xx xx xx xx xx xx The data output area of the TPMC821 (after writing): Offset +0 +1 +2 +3 +4 +5 +6 +7 +0x00 0x12 0x34 0x56 0x78 0x9A 0xBC 0xDE 0xF0 +0x08 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 EXAMPLE #include "tpmc821.h" unsigned char TP821_RW_SEGMENT unsigned long int segmentbuffer[100]; *pseg; result; size; /*----------------------------------------------------------- Write data to an open TPMC821 device, write data to offset 0, write one word with data (0x1234) -----------------------------------------------------------*/ size = 0; /* Checking buffer overrun (size always < 100) */ /* pointer to the first segment */ pseg = (TP821_RW_SEGMENT*)&segmentBuffer; pseg->itemtype = TP821_WORD; pseg->itemnumber = 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

result = write(tp821_dev[device], &segmentbuffer, size); if (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

4.4 ioctl() NAME ioctl() - performs an I/O control function. SYNOPSIS int ioctl ( int fd, /* device descriptor from opened TPMC821 device */ int request, /* select of control function */ int arg /* parameter buffer */ ) DESCRIPTION Special I/O operation that do not fit to the standard basic I/O calls (read, write) will be performed by calling the ioctl() function. PARAMETER The parameter fd specifies the device descriptor of the opened TPMC821 device. The parameter request specifies the function which shall be executed. 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

4.4.1 FIO_TP821_BIT_CMD This function code is used to execute a bit command. The bit command starts and executes a standard function. These functions and command bits are defined by the INTERBUS Master Firmware. The request dependent argument arg points to a union named TP821_CNTRL_STRUCT. data union TP821_CNTRL_STRUCT: typedef union TP821_IOC_BCMD_STRUCT bcmd; /* FIO_TP821_BIT_CMD */ TP821_IOC_MBX_STRUCT mbx; /* FIO_TP821_MBX_WAIT */ /* FIO_TP821_MBX_NOWAIT */ TP821_IOC_DIAG_STRUCT diag; /* FIO_TP821_GET_DIAG */ TP821_IOC_CONFIG_STRUCT config; /* FIO_TP821_CONFIGURE */ TP821_CNTRL_STRUCT; For this function code the bcmd option is used. bcmd is a data structure named TP821_IOC_BCMD_STRUCT. data structure TP821_IOC_BCMD_STRUCT: typedef struct int cmdbit; /* Command bit (0..13) */ unsigned short cmdparam; /* Command parameter */ TP821_IOC_BCMD_STRUCT; The argument cmdbit specifies the command bit. 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

EXAMPLE #include <vxworks.h> #include tpmc821.h STATUS TP821_CNTRL_STRUCT result; cntrlbuf; /*----------------------------------------------------------- Call standard function with a bit command, start data transfer (bit 0), (no parameter) -----------------------------------------------------------*/ cntrlbuf.bcmd.cmdbit = (1 << 0); /* use command bit 0 */ cntrlbuf.bcmd.cmdparam = 0; /* 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

4.4.2 FIO_TP821_MBX_WAIT This function executes a mailbox command on the specified TPMC821 and waits for completion and a result will be returned. The request dependent argument arg points to a union named TP821_CNTRL_STRUCT. data union TP821_CNTRL_STRUCT: typedef union TP821_IOC_BCMD_STRUCT bcmd; /* FIO_TP821_BIT_CMD */ TP821_IOC_MBX_STRUCT mbx; /* FIO_TP821_MBX_WAIT */ /* FIO_TP821_MBX_NOWAIT */ TP821_IOC_DIAG_STRUCT diag; /* FIO_TP821_GET_DIAG */ TP821_IOC_CONFIG_STRUCT config; /* FIO_TP821_CONFIGURE */ TP821_CNTRL_STRUCT; For this function code the mbx option is used. mbx is a data structure named TP821_IOC_MBX_STRUCT. data structure TP821_IOC_MBX_STRUCT: typedef struct int cmdsize; /* Command size in words */ unsigned short* cmdbuffer; /* Pointer to parameter buffer */ int resultsize; /* Result size in words */ unsigned short* resultbuffer; /* Pointer to result buffer */ TP821_IOC_MBX_STRUCT; The argument cmdsize specifies the length of the command buffer cmdbuffer, which will be transmitted to the TPMC821. The resultsize argument must specify the maximal length of result buffer ResultBuffer. When calling the function, after execution it returns the valid length of the resultbuffer. 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

EXAMPLE #include <vxworks.h> #include tpmc821.h STATUS result; unsigned short RequestPar[100]; unsigned short ResultPar[100]; TP821_CNTRL_STRUCT cntrlbuf; /*----------------------------------------------------------- Make a mailbox command and wait for completion, create a configuration service -----------------------------------------------------------*/ RequestPar[0] = 0x0710; /* Create Configuration Service */ RequestPar[1] = 1; /* 1 parameter follow */ RequestPar[2] = 1; /* number of frames to generate */ /* 3 words used in RequestPar */ cntrlbuf.mbx.cmdsize = 3; cntrlbuf.mbx.cmdbuffer = RequestPar; /* 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

4.4.3 FIO_TP821_MBX_NOWAIT This function executes a mailbox command on the specified TPMC821 and do not wait for completion. The request dependent argument arg points to a union named TP821_CNTRL_STRUCT. data union TP821_CNTRL_STRUCT: typedef union TP821_IOC_BCMD_STRUCT bcmd; /* FIO_TP821_BIT_CMD */ TP821_IOC_MBX_STRUCT mbx; /* FIO_TP821_MBX_WAIT */ /* FIO_TP821_MBX_NOWAIT */ TP821_IOC_DIAG_STRUCT diag; /* FIO_TP821_GET_DIAG */ TP821_IOC_CONFIG_STRUCT config; /* FIO_TP821_CONFIGURE */ TP821_CNTRL_STRUCT; For this function code the mbx option is used. mbx is a data structure named TP821_IOC_MBX_STRUCT. data structure TP821_IOC_MBX_STRUCT: typedef struct int cmdsize; /* Command size in words */ unsigned short* cmdbuffer; /* Pointer to parameter buffer */ int resultsize; /* Result size in words */ unsigned short* resultbuffer; /* Pointer to result buffer */ TP821_IOC_MBX_STRUCT; The argument cmdsize specifies the length of the command buffer cmdbuffer, which will be transmitted to the TPMC821. 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

EXAMPLE #include <vxworks.h> #include tpmc821.h STATUS result; unsigned short RequestPar[100]; TP821_CNTRL_STRUCT cntrlbuf; /*----------------------------------------------------------- Make a mailbox command and wait for completion, reset controller Board (make cold start) -----------------------------------------------------------*/ RequestPar[0] = 0x0956; /* Reset Controller Board Service */ RequestPar[1] = 1; /* 1 parameter follow */ RequestPar[2] = 0; /* Cold start */ /* 3 words used in RequestPar */ cntrlbuf.mbx.cmdsize = 3; cntrlbuf.mbx.cmdbuffer = RequestPar; /* 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

4.4.4 FIO_TP821_GET_DIAG This function returns diagnostic information from the specified TPMC821. The request dependent argument arg points to a union named TP821_CNTRL_STRUCT. data union TP821_CNTRL_STRUC': typedef union TP821_IOC_BCMD_STRUCT bcmd; /* FIO_TP821_BIT_CMD */ TP821_IOC_MBX_STRUCT mbx; /* FIO_TP821_MBX_WAIT */ /* FIO_TP821_MBX_NOWAIT */ TP821_IOC_DIAG_STRUCT diag; /* FIO_TP821_GET_DIAG */ TP821_IOC_CONFIG_STRUCT config; /* FIO_TP821_CONFIGURE */ TP821_CNTRL_STRUCT; For this function code the diag option is used. diag is a data structure named TP821_IOC_DIAG_STRUCT. data structure TP821_IOC_DIAG_STRUCT: typedef struct unsigned short sysfailreg; /* contents of Sysfail Register */ unsigned short configreg; /* contents of Config Register */ unsigned short diagreg; /* contents of Diag. Register */ unsigned char hardwarefail; /* HW failure has been detected */ unsigned char initcomplete; /* HW init has completed with success */ TP821_IOC_DIAG_STRUCT; The returned values of sysfailreg, configreg and diagreg are the actual values of the corresponding hardware registers Status Sysfail Register, Configuration Register and Master Diagnostic Status Register. Information about these registers and their flags can be found in the User Manuals for the INTERBUS Generation 4 which is parts of the TPMC821-ED Engineering Documentation. 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

EXAMPLE #include <vxworks.h> #include tpmc821.h STATUS result; TP821_CNTRL_STRUCT cntrlbuf; /*----------------------------------------------------------- Read diagnostic values from the specified device -----------------------------------------------------------*/ result = ioctl(tp821_dev, FIO_TP821_GET_DIAG, &cntrlbuf); if (result!= ERROR) /* diagnostic values successfully read */ printf("status Sysfail Register : %04Xh\n", cntrlbuf.diag.sysfailreg); printf("configuration Register : %04Xh\n", cntrlbuf.diag.configreg); printf("master 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

4.4.5 FIO_TP821_CONFIGURE This function can be used to announce a changing of the operation mode to the driver and to change the timeout values for mailbox and data accesses. The request dependent argument arg points to a union named TP821_CNTRL_STRUCT. data union TP821_CNTRL_STRUCT: typedef union TP821_IOC_BCMD_STRUCT bcmd; /* FIO_TP821_BIT_CMD */ TP821_IOC_MBX_STRUCT mbx; /* FIO_TP821_MBX_WAIT */ /* FIO_TP821_MBX_NOWAIT */ TP821_IOC_DIAG_STRUCT diag; /* FIO_TP821_GET_DIAG */ TP821_IOC_CONFIG_STRUCT config; /* FIO_TP821_CONFIGURE */ TP821_CNTRL_STRUCT; For this function code the config option is used. config is a data structure named TP821_IOC_CONFIG_STRUCT. data structure TP821_IOC_CONFIG_STRUCT: typedef struct unsigned long op_mode; /* operation mode */ long dt_timeout; /* Data Timeout in seconds */ long mb_timeout; /* Mailbox Timeout in seconds */ TP821_IOC_CONFIG_STRUCT; The argument op_mode announces the new operation mode. Detailed information about the operation modes and how to start them can be found in the User Manuals for the INTERBUS Generation 4 which is parts of the TPMC821-ED Engineering Documentation. Possible values are: TP821_ASYNC TP821_ASYNC_LOCK TP821_BUSSYNC TP821_PRGSYNC asynchronous operation mode (default) asynchronous operation mode with consistency locking bus synchronous mode program synchronous 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

EXAMPLE #include <vxworks.h> #include tpmc821.h STATUS result; TP821_CNTRL_STRUCT cntrlbuf; /*----------------------------------------------------------- Announce new operation mode (asynchronous without lock) data timeout: 10 seconds mailbox timeout: 3 seconds -----------------------------------------------------------*/ cntrlbuf.config.op_mode = TP821_ASYNC; cntrlbuf.config.dt_timeout = 10; cntrlbuf.config.mb_timeout = 3; 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

4.4.6 FIO_TP821_SET_HOST_FAIL This function sets the host interrupt request to announce a serious host system failure. How to use the host interrupt is described in the TIP821 User Manual and in the User Manuals for the INTERBUS Generation 4 which are parts of the TPMC821-ED Engineering Documentation. The request dependent argument arg is not used for this function. EXAMPLE #include <vxworks.h> #include tpmc821.h STATUS result; /*----------------------------------------------------------- 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

4.4.7 FIO_TP821_REMOVE_HOST_FAIL This function removes the host interrupt request which announces a serious host system failure. How to use the host interrupt is described in the TIP821 User Manual and in the User Manuals for the INTERBUS Generation 4 which is parts of the TPMC821-ED Engineering Documentation. The request dependent argument arg is not used for this function. EXAMPLE #include <vxworks.h> #include tpmc821.h STATUS result; /*----------------------------------------------------------- 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

4.4.8 FIO_TP821_CLEAR_HWERROR This function clears the hardware error flag, which is set on service interrupt requests generated on hardware failures of the INTERBUS Master. More information about the service interrupt request can be found in the TIP821 User Manual and in the User Manuals for the INTERBUS Generation 4 which is parts of the TPMC821-ED Engineering Documentation. The request dependent argument arg is not used for this function. EXAMPLE #include <vxworks.h> #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

5 Appendix This chapter describes the symbols which are defined in the file tpmc821.h. 5.1 Predefined Symbols Segment Types TP821_END 0 Specify the last segment of a segment list for data commands TP821_BYTE 1 Specify a segment with byte data TP821_WORD 2 Specify a segment with word data TP821_LWORD 4 Specify a segment with longword data Operating Modes TP821_ASYNC 1 Specify asynchronous operation mode without consistency locking TP821_ASYNC_LOCK 2 Specify asynchronous operation mode with consistency locking TP821_BUSSYNC 3 Specify bus synchronous operation mode TP821_PRGSYNC 4 Specify program synchronous operation mode Special Control Functions FIO_TP821_BIT_CMD 110 Special function code selecting the bit command FIO_TP821_MBX_WAIT 111 Special function code selecting the mailbox command waiting for a result FIO_TP821_MBX_NOWAIT 112 Special function code selecting the mailbox command, not waiting for a result FIO_TP821_GET_DIAG 113 Special function code selecting the diagnostic function, which reads the device state FIO_TP821_CONFIGURE 114 Special function code selecting the function to configure the device parameter FIO_TP821_SET_HOST_FAIL 115 Special function code to set the host fail interrupt request FIO_TP821_REMOVE_HOST_FAIL 116 Special function code to removing the host fail interrupt request FIO_TP821_CLEAR_HWERROR 117 Special function code for removing the hardware error flag, which disables data accesses TPMC821-SW-42 - VxWorks Device Driver Page 36 of 37

5.2 Additional Error Codes If the device driver creates an error the error codes are stored in the errno. They can be read with the VxWorks function errnoget() or printerrno(). S_tp821Drv_NXIO 0x08210001 There is no TPMC821 mounted to the specified location. S_tp821Drv_ICMD 0x08210002 An illegal function code has been selected. S_tp821Drv_MEMERR 0x08210003 Driver can not allocate memory. S_tp821Drv_PARAERR 0x08210004 An illegal parameter value has been specified. S_tp821Drv_DEVERR 0x08210005 A device I/O error occurred (TPMC821 is not ready). S_tp821Drv_BUSY 0x08210006 Selected device is already busy. S_tp821Drv_ILLBUFSIZE 0x08210007 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