background image

TIP675-SW-42 – VxWorks Device Driver

Page 5 of 31

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 TIP675-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-65 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
tip675exa.c.

If the IPAC carrier driver isn’t used for the IPAC driver setup, the application software has to setup
carrier board hardware, mapping of device memory and interrupt level setup by itself.

Summary of Contents for TIP675-SW-42

Page 1: ...Issue 1 2 1 June 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 Dia...

Page 2: ...lete 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 th...

Page 3: ...r in Tornado IDE project 6 2 2 System resource requirement 7 3 I O SYSTEM FUNCTIONS 8 3 1 tip675Drv 8 3 2 tip675DevCreate 10 4 I O FUNCTIONS 13 4 1 open 13 4 2 close 15 4 3 ioctl 17 4 3 1 FIO_T675_SET...

Page 4: ...cludes the following functions reading the input register writing the output register programming direction of every I O line configure simultaneous update feature connect interrupt callback functions...

Page 5: ...AC Carrier Driver CARRIER SW 42 is part of this TIP675 SW 42 distribution It is located in directory CARRIER SW 42 on the corresponding distribution media This IPAC Device Driver requires a properly i...

Page 6: ...rmation ChangeLog txt Release history 2 1 Include device driver in Tornado IDE project For Including the TIP675 SW 42 device driver into a Tornado IDE project follow the steps below 1 Copy the files f...

Page 7: ...phores Memory and Stack usage may differ from system to system depending on the used compiler and its setup The following formula shows the way to calculate the common requirements of the driver and d...

Page 8: ...tip675Drv installs the TIP675 driver in the I O system SYNOPSIS include tip675 h STATUS tip675Drv void DESCRIPTION This function initializes the TIP675 driver and installs it in the I O system The cal...

Page 9: ...e 9 of 31 ERROR CODES The error codes are stored in errno and can be read with the function errnoGet The error code is a standard error code set by the I O system see VxWorks Reference Manual SEE ALSO...

Page 10: ...tion 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 dev...

Page 11: ...retrieved by CARRIER Driver ipFindDevice function EXAMPLE include tip675 h STATUS result TIP675_DEVCONFIG tip675Conf struct ipac_resource ipac IPAC CARRIER Driver initialization Find an IP module fro...

Page 12: ...e stored in errno ERROR CODES The error codes are stored in errno and can be read with the function errnoGet Error code Description S_ioLib_NO_DRIVER Driver not installed run tip675Drv S_tip675Drv_IAR...

Page 13: ...int open const char name int flags int mode DESCRIPTION Before I O can be performed to the TIP675 device a file descriptor must be opened by invoking the basic I O function open PARAMETER name Specifi...

Page 14: ...Handle error RETURNS A device descriptor number or ERROR if the function fails an error code will be stored in errno ERROR CODES The error codes are stored in errno and can be read with the function e...

Page 15: ...e SYNOPSIS int close int fd DESCRIPTION This function closes opened devices PARAMETER fd This file descriptor specifies the device to be closed The file descriptor has been returned by the open functi...

Page 16: ...ERROR if the function fails an error code will be stored in errno ERROR CODES The error codes are stored in errno and can be read with the function errnoGet The error code is a standard error code set...

Page 17: ...uide I O system PARAMETER fd This file descriptor specifies the device to be used The file descriptor has been returned by the open function request This argument specifies the function that shall be...

Page 18: ...e function RETURNS Function dependent value described with the function or ERROR if the function fails an error code will be stored in errno ERROR CODES The error codes are stored in errno and can be...

Page 19: ...direction mask T675_DIRECTION_STR will be passed in the ioctl argument arg to the driver typedef struct unsigned short dir_1_16 unsigned short dir_17_32 unsigned short dir_33_48 T675_DIRECTION_STR di...

Page 20: ...ection Line 1 24 output Line 25 32 input dBuf out_1_16 0xFFFF dBuf out_17_32 0x00FF dBuf out_33_48 0x0000 retval ioctl fd FIO_T675_SET_DIR int dBuf if retval ERROR handle function specific error condi...

Page 21: ...g line unsigned long arg base Base address of the IP s I O space inBuf Current content of the IP s input registers for a buffer description refer to the FIO_T675_READ ioctl function line I O line at w...

Page 22: ...ned argument will be passed in the 4 th argument to the user supplied callback function This argument could be a semaphore ID a message ID or whatever funcPtr This parameter contains a pointer to a fu...

Page 23: ...GE IsfPar funcPtr callback IsfPar arg 0 retval ioctl fd FIO_T675_INSTALL_ISF int IsfPar if retval ERROR handle function specific error conditions ERRORS S_t675Drv_ILINE Specified I O line out of range...

Page 24: ...r and the edge must be passed in the ioctl argument arg to the driver typedef struct unsigned short io_line unsigned short edge T675_REMOVE_ISF_STR io_line I O line specifying the callback function to...

Page 25: ...O line 24 Interrupt on hi transition RsfPar io_line 24 RsfPar edge T675_POS_EDGE retval ioctl fd FIO_T675_REMOVE_ISF int RsfPar if retval ERROR handle function specific error conditions ERRORS S_t675D...

Page 26: ...the inputs and outputs to be latched on the rising edge of the external clock while setting arg to T675_NEG_EDGE will latch the inputs and outputs on the falling edge EXAMPLE include tip675 h int fd...

Page 27: ...IP675 After driver startup the simultaneous update feature is disabled The optional argument must be set to 0 EXAMPLE include tip675 h int fd int retval Disable simultaneous update of inputs and outpu...

Page 28: ...struct unsigned short in_1_16 unsigned short in_17_32 unsigned short in_33_48 T675_READ_STR in_1_16 Returns the content of the input register for I O line 1 up to 16 Line 1 is assigned to bit 0 line 2...

Page 29: ...fd retval ioctl fd FIO_T675_READ int rBuf if retval ERROR handle function specific error conditions else printf Input 1 16 04X n rBuf in_1_16 printf Input 17 32 04X n rBuf in_17_32 printf Input 33 48...

Page 30: ...rt out_1_16 unsigned short out_17_32 unsigned short out_33_48 T675_WRITE_STR out_1_16 Specifies the output value that will be written into the output register for I O line 1 up to 16 Line 1 is assigne...

Page 31: ...s 48 1 of the device associated with fd wBuf out_1_16 0x9abc wBuf out_17_32 0x5678 wBuf out_33_48 0x1234 retval ioctl fd FIO_T675_WRITE int wBuf if retval ERROR handle function specific error conditio...

Reviews: