Acromag IP520 Module Support

Introduction

This is a driver for the Acromag IP520 EIA/TIA-232E Industry Pack communication module (the companion 422/485 IP521 board is not yet supported).

The driver uses drvIpac for configuration of the carrier board plus access routines for the underlying ST16C554/654 octalUart used in the IP modules. The driver implements a standard VxWorks terminal port making use of the vxWorks tyLib system library.

Configuration Example

The following is an example of a startup script (st.cmd) segment that creates and configures IP carriers, IP520 modules, and tty devices. This example is compatible with both vxWorks and iocsh startup scripts.

# Initialize the drvIpac carriers.
# -------------------------------
# carrier#0
ipacAddMVME162    "A:m=0xe0000000,64 l=3,2"
# carrier#1
ipacAddVIPC616_01 "0x6400,0xB0000000"
# carrier#2
ipacAddTVME200    "602fb00"

# Allocate the number of IP520 modules to support.
# ----------------------------------------------------
IP520Drv 6

# Initialize IP520 modules.
# ----------------------------
# IP520ModuleInit(char *moduleID, char *ModuleType, int irq_num,
#                     char *carrier#, int slot#)
#   moduleID   - assign the IP module a name for future reference.
#   ModuleType - "232", (the IP521 EIA/TIA-422B module is not yet supported).
#   irq_num    - interrupt request number.
#   carrier#   - carrier# assigned from the ipacAddCarrierType() call.
#   slot#      - slot number on carrier; slot[A,B,C,D] -> slot#[0,1,2,3].

# Init two IP520 modules from the MVME162 carrier; the 1st module is in
# slot A, the second module is in slot B.
IP520ModuleInit "Mod0", "232", 0x80, 0, 0
IP520ModuleInit "Mod1", "232", 0x81, 0, 1

# Init two IP520 modules from the 1st SBS VIPC616_01 carrier; the 1st
# module is in slot A, the 2nd module is in slot C.
IP520ModuleInit "Mod2", "232", 0x82, 1, 0
IP520ModuleInit "Mod3", "232", 0x83, 1, 2

# Init two IP520 modules from the 2nd SBS VIPC616_01 carrier; the 1st
# module is in slot B, the second module is in slot D.
IP520ModuleInit "Mod4", "232", 0x84, 2, 1
IP520ModuleInit "Mod5", "232", 0x85, 2, 3

# Create tty devices.
# ------------------
# IP520DevCreate(char *portname, int moduleID, int port#, int rdBufSize,
#                    int wrtBufSize)
#   portname   - assign the port a name for future reference.
#   moduleID   - moduleID from the IP520ModuleInit() call.
#   port#      - port number for this module [0-7].
#   rdBufSize  - read buffer size, in bytes.
#   wrtBufSize - write buffer size, in bytes.

# Create two tty ports on Mod0 with portname based on the convention;
# "/tyGS/carrier#,slot#/moduleID/port#".
IP520DevCreate    "/tyGS/0,0/0",  "Mod0", 0, 512, 512
IP520DevCreate    "/tyGS/0,0/1",  "Mod0", 1, 512, 512

# Initialze all the remaining uninitialized Mod0 ports; i.e., /tyGS0/0/[2-7].
IP520DevCreateAll "/tyGS/0,0/",   "Mod0", 512, 512

# Initialize all the Mod1 ports.
IP520DevCreateAll "/tyGS/0,1/",   "Mod1", 512, 512
# Initialize all the Mod2 ports.
IP520DevCreateAll "/tyGS/1,0/",   "Mod2", 512, 512

# Configure the ports.
# --------------------
# void IP520Config (char *portname, int baud, char parity, int stop,
#                       int bits, char flow)
#   portname - portname from either the IP520DevCreate() call or
#              the IP520DevCreateAll() call.
#   baud     - baudrate; 1200,2400,4800,9600,19200,38400,57600,115200,230400.
#   parity   - even - 'E', odd - 'O', or none - 'N'.
#   stop     - stop bits; 1 or 2.
#   bits     - data bits; 5,6,7 or 8.
#   flow     - flow control; hardware - 'H' or none - 'N'.
IP520Config "/tyGS/0,0/0", 38400, 'N', 1, 8, 'N'

# Ports default to 9600, 'N', 1, 8, 'N'