VxWorks Driver Installation

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

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.

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

VxWorks Device Driver Developer's Guide. VxWorks DEVICE DRIVER DEVELOPER S GUIDE 6.2

VxWorks Device Driver Developer's Guide. VxWorks 6.0 DEVICE DRIVER DEVELOPER S GUIDE

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

VxWorks Device Driver Developer's Guide, 6.7. VxWorks. DEVICE DRIVER DEVELOPER'S GUIDE Volume 3: Legacy Drivers and Migration 6.7

VxWorks Device Driver Developer's Guide, 6.6. VxWorks. DEVICE DRIVER DEVELOPER'S GUIDE Volume 3: Legacy Drivers and Migration 6.6

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

SIO-DLL. Serial I/O DLL. User Manual

W90N745. System Library. User's Manual

The Peripheral Component Interconnect (PCI) Bus and vxworks

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

BASICS OF THE RENESAS SYNERGY TM

ML410 VxWorks Workbench BSP and System Image Creation for the BSB Design Using EDK 8.2i SP2. April

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.

Real Time Embedded Systems. Lecture 10 January 31, 2012 Interrupts

Data Structures. Home

This resource describes how to program the myrio in C to perform timer interrupts.

8051 Timers and Serial Port

BASICS OF THE RENESAS SYNERGY PLATFORM

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

8051 Serial Communication

CODE TIME TECHNOLOGIES. Abassi RTOS. I2C Support

VxWorks BSP Developer's Guide. VxWorks 6.0 BSP DEVELOPER S GUIDE. edition 2

Implementing In-Application Programming on the ADuC702x

GSM FUNCTION APPLIED IN WIRELESS SOLUTION

Generalised User Interface for Embedded Applications using an LCD screen and keypad.

Writing Custom SCSI Routines

SISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:

Interrupts and Serial Communication on the PIC18F8520

Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology

DEVICE DRIVERS AND TERRUPTS SERVICE MECHANISM Lesson-15: Writing Device Driving ISRs in a System

Emulating an asynchronous serial interface (USART) via software routines

Wind River USB for VxWorks 6 Programmer's Guide. Wind River USB for VxWorks 6 PROGRAMMER S GUIDE 2.3

Embedded System Curriculum

VxWorks Architecture Supplement. VxWorks ARCHITECTURE SUPPLEMENT 6.2

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

SISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:

CprE 288 Introduction to Embedded Systems Exam 1 Review. 1

Exceptions, Interrupts, and Timers

Micrel KSZ8852HL Step-by-Step Programmer s Guide

Development Board (Quick start) LDM-MCp Q208 Evolution

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

VxWorks BSP User Guide. Ref: BSPUG0120

Software Serial Port Implemented with the PCA

Getting Started with QAC / QAC++

cifx Device Driver Driver Manual VxWorks V5.5 / V6.2 / V6.7 / V6.9 / V7.0 Hilscher Gesellschaft für Systemautomation mbh

Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text

Communication Setting Sample

VxWorks Device Driver Developer's Guide, 6.7. VxWorks. DEVICE DRIVER DEVELOPER'S GUIDE Volume 1: Fundamentals of Writing Device Drivers 6.

Generic Serial Flash Interface Intel FPGA IP Core User Guide

Chapters 2, 3: bits and pieces. Chapters 2 & 3. Chapters 2, 3: bits and pieces. Chapters 2, 3: bits and pieces. Using C. A last word about hardware

Anybus CompactCom. Host Application Implementation Guide HMSI ENGLISH

UM2045 User manual. Getting started with the X-CUBE-NFC3 near field communication transceiver software expansion for STM32Cube.

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

Lecture 6: Real-Time Timing + Real-Time Objects

Salvo Compiler Reference Manual HI-TECH PICC-18

Introduction to Lab. 3

ToolStick-EK TOOLSTICK USER S GUIDE. 1. Kit Contents. 2. ToolStick Overview. Green and Red LEDs. C8051F321 provides USB debug interface.

SISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:

VISTA - CTI Multi-port Serial Adapter. Install Guide

Chapter. Overview. Tornado BSP Training Workshop Copyright Wind River Systems 1-1 Wind River Systems

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

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz II

Chapter 2. Overview of Architecture and Microcontroller-Resources

Operating System. Hanyang University. Hyunmin Yoon Operating System Hanyang University

AN HONORS UNIVERSITY IN MARYLAND UMBC. AvrX. Yousef Ebrahimi Professor Ryan Robucci

Emulating an asynchronous serial interface (ASC0) via software routines

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

BlueStorm Universal PCI User Manual

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

Software Development Advanced

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

Lecture 3: Concurrency & Tasking

Errata details published in this document refer to the following silicon: netx100, Revision A (Step A, ROM Rev. 2, Boot loader major vers.

AN Sleep programming for NXP bridge ICs. Document information

Digi document reference number: _A

Release Notes for ADuCM302x EZ-KIT Lite Board Support Package 1.0.2

ML410 VxWorks BSP and System Image Creation for the BSB Design Using EDK 8.2i SP1. April

ESC(LP)-100. Eight Channel Low Profile RS-232 Asynchronous Communications Adapter. for PCI bus. User's Manual

Context Switching & Task Scheduling

Using HAL Device Drivers with the Altera Monitor Program. 1 Introduction. For Quartus II 13.1

QSC(LP)-100. User's Manual

Version 1.5 8/10/2010

Interrupt handling. Purpose. Interrupts. Computer Organization

Release Notes for ADuCM302x EZ-KIT Lite Board Support Package 1.0.3

Boot ROM Design Specification

UART Application Kit for Digi Embedded Linux User's Manual

University of Massachusetts Amherst Computer Systems Lab 1 (ECE 354) LAB 1 Reference Manual

80C51 Block Diagram. CSE Overview 1

Getting Started with Qorivva Fast

embos Real Time Operating System CPU & Compiler specifics for ARM core with ARM RealView Developer Suite 3.0 Document Rev. 1

AN10955 Full-duplex software UART for LPC111x and LPC13xx

MCS-51 Serial Port A T 8 9 C 5 2 1

Embedded Systems. 5. Operating Systems. Lothar Thiele. Computer Engineering and Networks Laboratory

VALLIAMMAI ENGINEERING COLLEGE

I/O and Device Drivers

NUC123xxxAN Series Errata Sheet. Errata Sheet for 32-bit NuMicro Family Rev May 19, 2016

Transcription:

VxWorks Driver Installation Document: CTI_SIO_Install Revision: 1.01 Date: January 4, 2010

VxWorks Driver Installation 2 of 16 VxWorks Driver Installation 1. HISTORY... 3 2. HARDWARE REQUIREMENTS... 4 3. DRIVER FILES... 4 4. CONFIGURATION... 4 4.1. BSP Files... 4 4.1.1. config.h... 4 4.1.1.1. INCLUDE_CTI_U550... 4 4.1.1.2. INCLUDE_CTI_U650... 5 4.1.1.3. INCLUDE_CTI_U850... 5 4.1.1.4. INCLUDE_CTI_EXAR17XX5XPCI... 5 4.1.1.5. CTI_PCI_MAXBOARDS... 5 4.1.1.6. CTI_PCI_MAXCHANS... 5 4.1.1.7. INCLUDE_CTI_AUTO485POLLER... 5 4.1.1.8. CTI_DEFAULT_BAUD... 6 4.1.1.9. CTI_AUTO485SWITCHBAUD... 6 4.1.1.10. CTI_AUTO485POLLER_DELAY... 6 4.1.1.11. CTI_SYS_PCI_INTCONNECT()... 6 4.1.1.12. CTI_SYS_INTCONNECT()... 6 4.1.1.13. CTI_SYS_INTENABLE()... 7 4.1.1.14. CTI_SYS_IN_BYTE()... 7 4.1.1.15. CTI_SYS_OUT_BYTE()... 7 4.1.1.16. CTI_SYS_IN_WORD()... 8 4.1.1.17. CTI_SYS_OUT_WORD()... 8 4.1.1.18. CTI_SYS_IN_LONG()... 8 4.1.1.19. CTI_SYS_OUT_LONG()... 9 4.1.2. syslib.c... 9 4.1.2.1. syshwinit()... 9 4.1.2.2. syshwinit2()... 10 4.2. Driver Files...10 4.2.1. sysctiserial.c... 10 4.2.1.1. Storage... 10 4.2.1.2. Configuration... 11 4.2.1.3. Interrupts... 12 4.2.1.4. Enumeration... 13 4.3. Tornado Projects...14 4.3.1. Connect Tech Inc. SIO... 14 4.3.2. Use alternate base name... 14 5. EXAMPLES...14 5.1. pcp3cti_1...14 5.2. pcp3cti_2...14 5.3. pcp3cti_3...15 6. INSTALLATION CHECKLIST...16

VxWorks Driver Installation 3 of 16 1. History Rev Author Date Changes 0.00 CJD Aug. 24, 2005 Original draft. 1.00 CJD Sept. 8, 2005 Added installation checklist. Added 3 rd sample BSP. Fixed minor mistakes. 1.01 RAC Jan. 4, 2010 Adapted for both Tornado and Workbench builds.

VxWorks Driver Installation 4 of 16 2. Hardware Requirements This driver supports the following products: Xtreme/104 switchable Xtreme/104 232 BlueStorm/LP Xtreme/104-Plus 3. Driver Files Copy the following files into your BSP directory (<WIND_INST>\target\config\<BSP_NAME>): 00cti.cdf ctisio.c ctisio.h sysctiserial.c usrctiserial.c 4. Configuration 4.1. BSP Files The following files should be modified to support the CTI SIO driver. These modifications can be done in any other way as appropriate, but the following are suggestions made based on the Pentium III BSP. For sample modified files, refer to the files (of the same name) located within the driver distribution package. Sample files are from the Pentium III BSP. Note; file names and locations of information may differ in your BSP. <WIND_INST>\target\config\<BSP_NAME>\config.h <WIND_INST>\target\config\<BSP_NAME>\sysLib.c The sample files included with the driver package should not be copied over any files in your BSP. These sample files are included only so that you can see the required changes in the context of complete files. 4.1.1. config.h Add a section to your config.h file so that there is a place for the driver options. If your config.h has an if-def block used to determine when to define INCLUDE_PCI, it is advised that you place this new section above that if-def block. This suggestion is made so that the if-def section can be modified to define INCLUDE_PCI when needed by any included CTI boards. The section for CTI driver configuration should surrounded by a check for INCLUDE_CTI_SIO being defined. Connect Tech Inc. serial driver options #if defined(include_cti_sio) # define INCLUDE_CTI_U550 support for 550 UARTs #endif defined(include_cti_sio) A complete list of the available configuration options follows: 4.1.1.1. INCLUDE_CTI_U550

VxWorks Driver Installation 5 of 16 Define INCLUDE_CTI_U550 to include support for Xtreme/104 products that utilize 550 UARTs. This can be determined by examining the UART chips on the Xtreme/104 board itself, or by contacting CTI support staff. #define INCLUDE_CTI_U550 4.1.1.2. INCLUDE_CTI_U650 Define INCLUDE_CTI_U650 to include support for Xtreme/104 products that utilize 650 UARTs. This can be determined by examining the UART chips on the Xtreme/104 board itself, or by contacting CTI support staff. #define INCLUDE_CTI_U650 4.1.1.3. INCLUDE_CTI_U850 Define INCLUDE_CTI_U850 to include support for Xtreme/104 products that utilize 850 UARTs. This can be determined by examining the UART chips on the Xtreme/104 board itself, or by contacting CTI support staff. #define INCLUDE_CTI_U850 4.1.1.4. INCLUDE_CTI_EXAR17XX5XPCI Define INCLUDE_CTI_EXAR17XX5XPCI to include support for BlueStorm/LP and Xtreme/104- Plus products. You should also include you BSP s PCI support if these products are to be used. #define INCLUDE_CTI_EXAR17XX5XPCI 4.1.1.5. CTI_PCI_MAXBOARDS CTI_PCI_MAXBOARDS is used to define the maximum number of CTI PCI boards that can be enumerated. If not defined the default is 1. #define CTI_PCI_MAXBOARDS X where X is the maximum number of boards 4.1.1.6. CTI_PCI_MAXCHANS CTI_PCI_MAXCHANS is used to define the maximum number of serial channels that can be used by enumerated CTI PCI devices. This number is not the maximum per CTI PCI device, it is the maximum total number of channels across all CTI PCI devices. If not defined the default is 8. #define CTI_PCI_MAXCHANS X where X is the maximum number of channels 4.1.1.7. INCLUDE_CTI_AUTO485POLLER

VxWorks Driver Installation 6 of 16 When using half-duplex RS485, the receiver and transmitter need to be toggled on and off depending on whether data is being sent or received. On CTI products that do not utilize UARTs with the capability to do this automatically, the driver must perform the toggling. This can be done in one of two ways; Using the interrupt service routine (ISR) of the channel; Using a watchdog timer as a poller. In order to use the watchdog timer INCLUDE_CTI_AUTO485POLLER must be defined. #define INCLUDE_CTI_AUTO485POLLER 4.1.1.8. CTI_DEFAULT_BAUD CTI_DEFAULT_BAUD is used to define the default baud rate when the serial channels are initialized. If not defined the default is 9600. #define CTI_DEFAULT_BAUD X where X is the default baud rate in bps 4.1.1.9. CTI_AUTO485SWITCHBAUD When using the CTIAUTO485SWITCHED auto 485 direction control method, CTI_AUTO485SWITCHBAUD defines the baud rate used to switch between ISR and poller methods. When the baud rate is less than CTI_AUTO485SWITCHBAUD the ISR method is used, else the poller method is used. If not defined the default is 9600. #define CTI_AUTO485SWITCHBAUD X where X is the baud rate in bps 4.1.1.10. CTI_AUTO485POLLER_DELAY When the poller auto 485 direction control method is being used a watchdog timer performs a polling operation to look for the end of a transmit. This watchdog timer is set to expire every CTI_AUTO485POLLER_DELAY ticks. If not defined the default is 1. #define CTI_AUTO485POLLER_DELAY X where X is the delay in ticks 4.1.1.11. CTI_SYS_PCI_INTCONNECT() The CTI_SYS_PCI_INTCONNECT() macro is used to connect a PCI device interrupt to an interrupt service routine. The default definition of this macro uses pciintconnect(). * _intlevel_ - interrupt level to connect _isr_ to * _isr_ - interrupt service routine to connect to _intlevel_ * _arg_ - argument to be passed to _isr_ * _result_ - STATUS result of the macro #define CTI_SYS_PCI_INTCONNECT(_intLevel_, _isr_, _arg_, _result_) \ place desired code here \ 4.1.1.12. CTI_SYS_INTCONNECT()

VxWorks Driver Installation 7 of 16 The CTI_SYS_INTCONNECT() macro is used to connect a device interrupt to an interrupt service routine. The default definition of this macro uses intconnect(). * _intlevel_ - interrupt level to connect _isr_ to * _isr_ - interrupt service routine to connect to _intlevel_ * _arg_ - argument to be passed to _isr_ * _result_ - STATUS result of the macro #define CTI_SYS_INTCONNECT(_intLevel_, _isr_, _arg_, _result_) \ place desired code here \ 4.1.1.13. CTI_SYS_INTENABLE() The CTI_SYS_INTENABLE() macro is used to enable an interrupt level. The default definition of this macro uses sysintenablepic(). * _intlevel_ - interrupt level to enable * _result_ - STATUS result of the macro #define CTI_SYS_INTENABLE(_intLevel_, _result_) \ place desired code here \ 4.1.1.14. CTI_SYS_IN_BYTE() The CTI_SYS_IN_BYTE() macro is used to read an 8 bit value. The default definition of this macro uses sysinbyte() for port I/O and does a direct assignment for memory I/O. * _iomode_ - I/O mode (CTIIOPORT or CTIIOMEM) * _address_ - address to read from * _value_ - receives 8 bit value read from _address_ #define CTI_SYS_IN_BYTE(_ioMode_, _address_, _value_) \ if((_iomode_) == CTIIOPORT) place port I/O code here \ \ else place memory I/O code here \ \ 4.1.1.15. CTI_SYS_OUT_BYTE() The CTI_SYS_OUT_BYTE() macro is used to write an 8 bit value. The default definition of this macro uses sysoutbyte() for port I/O and does a direct assignment for memory I/O.

VxWorks Driver Installation 8 of 16 * _iomode_ - I/O mode (CTIIOPORT or CTIIOMEM) * _address_ - address to write to * _value_ - 8 bit value to write to _address_ #define CTI_SYS_OUT_BYTE(_ioMode_, _address_, _value_) \ if((_iomode_) == CTIIOPORT) place port I/O code here \ \ else place memory I/O code here \ \ 4.1.1.16. CTI_SYS_IN_WORD() The CTI_SYS_IN_WORD() macro is used to read a 16 bit value. The default definition of this macro uses sysinword() for port I/O and does a direct assignment for memory I/O. * _iomode_ - I/O mode (CTIIOPORT or CTIIOMEM) * _address_ - address to read from * _value_ - receives 16 bit value read from _address_ #define CTI_SYS_IN_WORD(_ioMode_, _address_, _value_) \ if((_iomode_) == CTIIOPORT) place port I/O code here \ \ else place memory I/O code here \ \ 4.1.1.17. CTI_SYS_OUT_WORD() The CTI_SYS_OUT_WORD() macro is used to write a 16 bit value. The default definition of this macro uses sysoutword() for port I/O and does a direct assignment for memory I/O. * _iomode_ - I/O mode (CTIIOPORT or CTIIOMEM) * _address_ - address to write to * _value_ - 16 bit value to write to _address_ #define CTI_SYS_OUT_WORD(_ioMode_, _address_, _value_) \ if((_iomode_) == CTIIOPORT) place port I/O code here \ \ else place memory I/O code here \ \ 4.1.1.18. CTI_SYS_IN_LONG()

VxWorks Driver Installation 9 of 16 The CTI_SYS_IN_LONG() macro is used to read a 32 bit value. The default definition of this macro uses sysinlong() for port I/O and does a direct assignment for memory I/O. * _iomode_ - I/O mode (CTIIOPORT or CTIIOMEM) * _address_ - address to read from * _value_ - receives 32 bit value read from _address_ #define CTI_SYS_IN_BYTE(_ioMode_, _address_, _value_) \ if((_iomode_) == CTIIOPORT) place port I/O code here \ \ else place memory I/O code here \ \ 4.1.1.19. CTI_SYS_OUT_LONG() The CTI_SYS_OUT_LONG() macro is used to write a 32 bit value. The default definition of this macro uses sysoutlong() for port I/O and does a direct assignment for memory I/O. * _iomode_ - I/O mode (CTIIOPORT or CTIIOMEM) * _address_ - address to write to * _value_ - 32 bit value to write to _address_ #define CTI_SYS_OUT_LONG(_ioMode_, _address_, _value_) \ if((_iomode_) == CTIIOPORT) place port I/O code here \ \ else place memory I/O code here \ \ 4.1.2. syslib.c Add a section to your syslib.c file that includes the file sysctiserial.c. This file includes the CTI SIO driver and defines routines used to configure the CTI serial channels. This section should come after the PCI configuration files have been included and should be surrounded by a check for INCLUDE_CTI_SIO being defined. #if defined(include_cti_sio) # include "sysctiserial.c" #endif defined(include_cti_sio) In addition to including the driver and driver configuration routines, the routines syshwinit() and syshwinit2() need to be modified to call the serial configuration routines defined in sysctiserial.c. 4.1.2.1. syshwinit()

VxWorks Driver Installation 10 of 16 During syshwinit(), sysctiserialhwinit() should be called to initially configure the CTI serial channels. This call should be made after any PCI initialization in order for CTI PCI adapters to be configured. #if defined(include_cti_sio) sysctiserialhwinit(); #endif defined(include_cti_sio) 4.1.2.2. syshwinit2() During syshwinit2(), sysctiserialhwinit2() should be called to connect and enable interrupts used by the CTI serial channels. #if defined(include_cti_sio) sysctiserialhwinit2(); #endif defined(include_cti_sio) 4.2. Driver Files The file sysctiserial.c, which is included into syslib.c, needs to be configured to properly match the setup of your system. 4.2.1. sysctiserial.c sysctiserial.c contains rountines used to configure any CTI serial adapters you have. The configuration includes: storage for board and channel structures board/channel configuration and initialization interrupt connecting and enabling channel enumeration The code in this section is only meant to serve as a short example. For a more complete sample refer to the sample BSP s provided with the driver files. For a description of routine parameters refer to the documentation for that routine. 4.2.1.1. Storage Each board and channel must have a corresponding structure allocated for it. This is typically done by declaring local variables in the file sysctiserial.c. Typically one board structure (CTI_BOARD) is defined for each non-pci CTI adapter. LOCAL CTI_BOARD ctixt1board; LOCAL CTI_BOARD ctixt2board; For each of the non-pci adapters, an array of channel structures should be defined as well. The size of these arrays depends on the number of channels supported by the adapters.

VxWorks Driver Installation 11 of 16 LOCAL CTI_CHAN ctixt1chans[8]; LOCAL CTI_CHAN ctixt2chans[4]; For PCI adapters, only one instance of CTI_PCI_DEVICESET need be defined. The maximum number of supported adapters and channels should be defined with CTI_PCI_MAXBOARDS and CTI_PCI_MAXCHANS (see section 4.1.1 - config.h for more information on CTI_PCI_MAXBOARDS and CTI_PCI_MAXCHANS). #if defined(include_pci) LOCAL CTI_PCI_DEVICESET ctipcidevset; #endif defined(include_pci) 4.2.1.2. Configuration During syshwinit() sysctiserialhwinit() should be called. This is where the board and channels structures declared in the previous section are configured and initialized. Each non-pci board structure should be configured using ctiboardconfig() and initialized using ctiboardhrdinit(). PCI adapters should be enumerated and initialized using ctipciconfig() and ctipcihrdinit().

VxWorks Driver Installation 12 of 16 void sysctiserialhwinit( void ) { if(ok == ctiboardconfig( &ctixt1board, CTIU650, CTIIOPORT, 0x300, 0x340, 0 if status port not being used 0x05, 7372800, 4, 1 if using extended baud rates ctixt1chans, 8, NULL, NULL, 0xFF)) { if(sysbp) { ctiboardhrdinit(&ctixt1board); if(ok == ctiboardconfig( &ctixt2board, CTIU850, CTIIOPORT, 0x200, 0x240, 0 if status port not being used 0x0A, 7372800, 4, 1 if using extended baud rates ctixt2chans, 4, NULL, NULL, 0xF)) { if(sysbp) { ctiboardhrdinit(&ctixt2board); #if defined(include_pci) if(ok == ctipciconfig(&ctipcidevset, NULL, NULL)) { if(sysbp) { ctipcihrdinit(&ctipcidevset); #endif defined(include_pci) 4.2.1.3. Interrupts sysctiserialhwinit2() should be called during syshwinit2() and is responsible for connecting and enabling interrupts used by the CTI adapters. The operations of connecting an interrupt to an interrupt service routine as well as enabling the interrupt have been encapsulated into driver rountines ctiboardintconnect() and ctipciintconnect(). The behaviour of these routines is controlled by the macros CTI_SYS_INTCONNECT(), CTI_SYS_PCI_INTCONNECT(), and CTI_SYS_INTENABLE(). These macros can be redefined from their default behaviour. See section 4.1.1 - config.h for

VxWorks Driver Installation 13 of 16 more information on CTI_SYS_INTCONNECT(), CTI_SYS_PCI_INTCONNECT(), and CTI_SYS_INTENABLE(). These routines do not have to be used and in some cases may not be sufficient. The specifics of their operation can be seen in ctisio.c. void sysctiserialhwinit2( void ) { ctiboardintconnect(&ctixt1board); ctiboardintconnect(&ctixt2board); #if defined(include_pci) ctipciintconnect(&ctipcidevset); #endif defined(include_pci) 4.2.1.4. Enumeration Each serial channel must be associated with a device. The CTI serial channels are enumerated using sysctiserialchanget(). This routine takes an index value specifying which channel structure to retrieve, and effectively acts as a look-up table for the channels. The order in which the channels are returned determines the order in which the channels are associated with device names. SIO_CHAN* sysctiserialchanget( int channel serial channel ) { if((channel >= 0) && (channel < 8)) { return((sio_chan*)&ctixt1chans[channel]); else if((channel >= 8) && (channel < (8 + 4))) { return((sio_chan*)&ctixt2chans[channel - 8]); #if defined(include_pci) else if((channel >= (8 + 4)) && (channel < (8 + 4 + ctipcidevset.cchans))) { return((sio_chan*) &(ctipcidevset.pchans[channel - 8-4])); #endif defined(include_pci) return((sio_chan*)error); The total number of channels needs to be reported using sysctiserialgetnumchans(). This routine simply needs to return the total number of channels being used across all CTI adapters.

VxWorks Driver Installation 14 of 16 UINT16 sysctiserialgetnumchans( void ) { UINT16 retval = 0; retval += 8; retval += 4; #if defined(include_pci) retval += ctipcidevset.cchans; #endif defined(include_pci) return(retval); 4.3. Tornado/WorkBench Projects Bootable VxWorks image projects based on a BSP containing the CTI driver files will have a new folder available under hardware\peripherals\serial called Connect Tech Inc.. This folder contains components for controlling the CTI serial driver. A description of the components follows: 4.3.1. Connect Tech Inc. SIO This component controls INCLUDE_CTI_SIO (used earlier when including the CTI serial driver in the BSP). 4.3.2. Use alternate base name If this component is not included, the CTI serial channels will be named /tyco/x where X is the channel index value and is based on the defined NUM_TTY value so that the names do not collide with other serial devices. However, it may be desireable to use a different base name. By including the Use alternate base name component, the default behaviour is to name the CTI serial channels /tycti/x where X is the channel index value starting at 0. The Use alternate base name component has a parameter called CTI_TY_NAME_BASE which can be used to set a base name other than /tycti/. 5. Examples Included with the driver files are three example BSP s. These example BSP s are based on the Pentium III BSP from WindRiver. A description of each of the example BSP s follows: 5.1. pcp3cti_1 This example is based on the following CTI serial adapters: Xtreme/104 RS-232 8 channels. Base I/O address is 0x300. IRQ is 10. Status port is in use. Extended baud rates not in use. BlueStorm/LP RS-232 4 channels. 5.2. pcp3cti_2 This example is based on the following CTI serial adapters:

VxWorks Driver Installation 15 of 16 Xtreme/104 1 4 RS-232 channels. Base I/O address is 0x300. IRQ is 10. Status port is in use. Extended baud rates not in use. Xtreme/104 2 8 channels. Base I/O address is 0x200. Channels 1, 3, 5, and 7 are on IRQ 5, channels 2, 4, 6, and 8 are on IRQ 9. See Mode 2 in the Interrupt Selection section of the Xtreme/104 manual. Status port is not in use. Extended baud rates in use. Channels 1 and 2 are RS-232, channels 3, 4, and 5 are RS-485 full-duplex, channels 6, 7, and 8 are RS-485 half-duplex. Xtreme/104-Plus Switchable 4 channels. Channels 1 and 2 are RS-485 full-duplex, channels 3 and 4 are RS-232. 5.3. pcp3cti_3 This example is based on the following CTI serial adapters: BlueStorm/LP 8 RS-232 channels.

VxWorks Driver Installation 16 of 16 6. Installation Checklist Task Copy driver files into BSP directory Modify config.h to include desired support Modify syslib.c to include sysctiserial.c Modify syshwinit() to call sysctiserialhwinit() Modify syshwinit2() to call sysctiserialhwinit2() Modify sysctiserial.c to include required storage Modify sysctiserialhwinit() to configure adapters Modify sysctiserialhwinit2() to connect interrupts Modify sysctiserialchanget() to return requested channel structures Modify sysctiserialgetnumchans() to return total number of channels Include the Connect Tech Inc. SIO component into Tornado/Workbench projects