Tews Technologies TIP810-SW-42 User manual

The Embedded I/O Company
TIP810-SW-42
VxWorks Device Driver
CAN Bus IP
Version 2.0.x
User Manual
Issue 2.0.0
November 2008
TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC
Am Bahnhof 7
25469 Halstenbek, Germany
www.tews.com
Phone: +49 (0) 4101 4058 0
Fax: +49 (0) 4101 4058 19
e-mail: info@tews.com
9190 Double Diamond Parkway,
Suite 127, Reno, NV 89521, USA
www.tews.com
Phone: +1 (775) 850 5830
Fax: +1 (775) 201 0347
e-mail: usa[email protected]m

TIP810-SW-42 - VxWorks Device Driver Page 2 of 36
TIP810-SW-42
VxWorks Device Driver
CAN Bus IP
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.
2004-2008 by TEWS TECHNOLOGIES GmbH
Issue Description Date
1.0 First Issue January 1995
1.1 General Revision September 2003
1.2 Added support for PeliCAN mode July 2004
2.0.0 TEWS Carrier Support added, new address TEWS LLC November 20, 2008

TIP810-SW-42 - VxWorks Device Driver Page 3 of 36
Table of Contents
1 INTRODUCTION.........................................................................................................4
1.1 Device Driver ...................................................................................................................................4
1.2 IPAC Carrier Driver .........................................................................................................................5
2 INSTALLATION..........................................................................................................6
2.1 Include device driver in VxWorks project ....................................................................................6
2.2 Special installation for Intel x86 based targets............................................................................6
3 I/O SYSTEM FUNCTIONS..........................................................................................7
3.1 t810Drv()...........................................................................................................................................7
3.2 t810DevCreate()...............................................................................................................................9
4 I/O INTERFACE FUNCTIONS..................................................................................13
4.1 open() .............................................................................................................................................13
4.2 read() ..............................................................................................................................................15
4.3 write() .............................................................................................................................................18
4.4 ioctl() ..............................................................................................................................................21
4.4.1 FIO_T810_SET_BUSTIMING ............................................................................................23
4.4.2 FIO_T810_SET_FILTER....................................................................................................25
4.4.3 FIO_T810_SET_BUSON....................................................................................................27
4.4.4 FIO_T810_SET_BUSOFF..................................................................................................28
4.4.5 FIO_T810_GET_CANSTATUS..........................................................................................29
4.4.6 FIO_T810_ENABLE_SELFTEST.......................................................................................31
4.4.7 FIO_T810_DISABLE_SELFTEST......................................................................................32
4.4.8 FIO_T810_ENABLE_LISTENONLY...................................................................................33
4.4.9 FIO_T810_DISABLE_ LISTENONLY.................................................................................34
4.4.10 FIO_T810_SET_LIMIT .....................................................................................................35
5 APPENDIX................................................................................................................36
5.1 Predefined Symbols......................................................................................................................36
5.2 Status and Error Codes................................................................................................................36

TIP810-SW-42 - VxWorks Device Driver Page 4 of 36
1 Introduction
1.1 Device Driver
The TIP810-SW-42 VxWorks device driver allows the operation of the TIP810 CAN Bus IP conforming
to the VxWorks I/O system specification. This includes a device-independent interface with open,
read,write and ioctl functions.
After installation of the device driver in the I/O system messages can be transmitted to and received
from the CAN bus by calling the write() or read() functions.
Special I/O operation that does 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 queuing mechanism to prevent simultaneous requests by
multiple users from interfering with each other.
The TIP810-SW-42 device driver supports the following features:
Transmission and receive of Standard and Extended CAN Frames
Standard bit rates from 20 kbit up to 1.0 Mbit and user defined bit rates
Message acceptance filtering
Single-Shot transmission
Listen only mode
Message self reception
Programmable error warning limit
The TIP816-SW-42 supports the modules listed below:
TIP810-10 CAN Bus Industry Pack®
This device driver has only been tested with TIP810 V2.0+ hardware, and does not guarantees
support for V1.0 modules.
To get more information about the features and use of TIP810 devices it is recommended to read the
manuals listed below.
TIP810 User manual
TIP810 Engineering Manual
CARRIER-SW-42 IPAC Carrier User Manual
SJA1000 PeliCAN controller User Manual

TIP810-SW-42 - VxWorks Device Driver Page 5 of 36
1.2 IPAC Carrier Driver
IndustryPack (IPAC) carrier boards have different implementations of the system to IndustryPack bus
bridge logic, different implementations of interrupt and error handling and so on. Also the different byte
ordering (big-endian versus little-endian) of CPU boards will cause problems on accessing the
IndustryPack I/O and memory spaces.
To simplify the implementation of IPAC device drivers which work with any supported carrier board,
TEWS TECHNOLOGIES has designed a so called Carrier Driver that hides all differences of different
carrier boards under a well defined interface.
The TEWS TECHNOLOGIES IPAC Carrier Driver CARRIER-SW-42 is part of this TIP810-SW-42
distribution. It is located in directory CARRIER-SW-42 on the corresponding distribution media.
This IPAC Device Driver requires a properly installed IPAC Carrier Driver. Due to the design of the
Carrier Driver, it is sufficient to install the IPAC Carrier Driver once, even if multiple IPAC Device
Drivers are used.
Please refer to the CARRIER-SW-42 User Manual for a detailed description how to install and setup
the CARRIER-SW-42 device driver, and for a description of the TEWS TECHNOLOGIES IPAC Carrier
Driver concept.
How to use the carrier driver in the application program is shown in the programming example
tip810exa.c.
If the IPAC carrier driver isn’t used for the IPAC carrier setup, the application software has to setup
carrier board hardware, mapping of device memory and interrupt level setup by itself.

TIP810-SW-42 - VxWorks Device Driver Page 6 of 36
2Installation
Following files are located on the distribution media:
Directory path ‘TIP810-SW-42’:
tip810drv.c TIP810 Driver source
tip810.h TIP810 Driver include file for driver and application
tip810def.h TIP810 Driver private include file
tip810exa.c TIP810 Driver usage example program
sja1000.h Header file for the SJA1000 CAN Controller (TIP810 V2.0+)
pca82c200.h Header file for the PCA82C200 CAN Controller (TIP810 V1.0)
include/ipac_carrier.h Carrier driver interface definitions
TIP810-SW-42-2.0.0.pdf PDF copy of this manual
Release.txt Release information
ChangeLog.txt Release history
2.1 Include device driver in VxWorks project
For including the TIP810-SW-42 device driver into a VxWorks project (e.g. Tornado IDE or
Workbench) follow the steps below:
Copy the files from the distribution media into a subdirectory in your project path.
(For example: ./TIP810)
Add the device drivers C-files to your project.
Now the driver is included in the project and will be built with the project.
For a more detailed description of the project facility please refer to your VxWorks User’s
Guide (e.g. Tornado, Workbench, etc.)
2.2 Special installation for Intel x86 based targets
The TIP810 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_FAMILY. If the content of this macro is equal to I80X86 special Intel x86 conforming code and
function calls will be included.

TIP810-SW-42 - VxWorks Device Driver Page 7 of 36
3I/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 t810Drv()
NAME
t810Drv() - installs the TIP810 driver in the I/O system
SYNOPSIS
#include “tip810.h”
STATUS tip810Drv(void)
DESCRIPTION
This function installs the TIP810 driver in the I/O system.
A call to this function is the first thing the user has to do before adding any device to the
system or performing any I/O request.
EXAMPLE
#include "tip810.h”
STATUS result;
/*-------------------
Initialize Driver
-------------------*/
result = tip810Drv();
if (result == ERROR)
{
/* Error handling */
}

TIP810-SW-42 - VxWorks Device Driver Page 8 of 36
RETURNS
OK or ERROR. If the function fails an error code will be stored in errno.
ERROR CODES
Error codes are only set by system functions. The error codes are stored in errno and can be read with
the function errnoGet().
SEE ALSO
VxWorks Programmer’s Guide: I/O System

TIP810-SW-42 - VxWorks Device Driver Page 9 of 36
3.2 t810DevCreate()
NAME
t810DevCreate() - add a TIP810 device to the system and initialize device hardware
SYNOPSIS
#include “tip810.h”
STATUS t810DevCreate
(char *name,
int devIdx,
int funcType,
void *pParam
)
DESCRIPTION
This routine adds the selected device to the VxWorks system. The device hardware will be setup and
prepared for use.
This function must be called before performing any I/O request to this device.
PARAMETER
name This string specifies the name of the device that will be used to identify the device, for example
for open() calls.
devIdxThis index number specifies the device to add to the system.
The device number of one TIP810-10 will be assigned as n.
Example: A system with 2 TIP810-10 will assign the following device indices:
Module Device Index
1st TIP810-10 0
2nd TIP810-10 1
funcType
This parameter is unused and should be set to 0.

TIP810-SW-42 - VxWorks Device Driver Page 10 of 36
pParam
This parameter points to a structure (TIP810_DEVCONFIG) containing the default configuration
of the channel.
The structure (TIP810_DEVCONFIG) has the following layout and is defined in tip810.h:
typedef struct
{struct ipac_resource *ipac;
int nMsg;
T810_FILTER filter;
T810_TIMING timing;
} TIP810_DEVCONFIG;
ipac Pointer to TIP810 module resource descriptor, retrieved by CARRIER Driver
ipFindDevice() function
nMsg This argument defines the size of the device read FIFO for buffering incoming messages
which passes the acceptance filter.
filter The argument filter sets the acceptance filter code and mask register(s). For more details
see FIO_T810_SET_FILTER ioctl function.
timing The argument timing selects the transfer rate of the CAN bus. For more details see
FIO_T810_SET_BUSTIMING ioctl function.
Table of contents
Other Tews Technologies Controllers manuals
Popular Controllers manuals by other brands

Digiplex
Digiplex DGP-848 Programming guide

YASKAWA
YASKAWA SGM series user manual

Sinope
Sinope Calypso RM3500ZB installation guide

Isimet
Isimet DLA Series Style 2 Installation, Operations, Start-up and Maintenance Instructions

LSIS
LSIS sv-ip5a user manual

Airflow
Airflow Uno hab Installation and operating instructions















