|
VIClib - A VIC8250 control libraryOriginal Version by F Meiers(Cern) Modified for LynxOs by Neil Geddes (RAL) Documentation by Norman Gee (RAL) VIClib is a collection of C callable functions allowing simple (basic) user control of VIC8250 operation. A set of utilities is provided to allow direct terminal access to the functions. Command Utilities
Calling Sequences
LinkingCommand Utilitiesv50ground - initialise VIC.Syntaxv50ground <base eg 8> DescriptionInitialise the VIC at the specified local base address. The memory management unit and mailbox are cleared.v50mmuena - enable VIC memory management unit.Syntaxv50mmuena <base eg 8> <a24,a32,vsb> DescriptionEnable the memory management unit of the VIC at the specified local base address for standard (a24) or extended (a32) addressing.v50pagvme - map a remote crate.Syntaxv50pagvme <base eg 8> <a24,a32,vsb> <page> <rmt-crate> <amod> <rmt-page> DescriptionMap a 1-Megabyte page of address space (a24 or a32) in a remote crate to the specified local page. In the remote crate, VME cycles will use the specified address modifier (amod) regardless of the address modifier used in the local crate. Care should be taken to ensure that no other module in the local crate is using the same page.v50pagmem - map remote VIC memory.Syntaxv50pagmem <base eg 8> <a24,a32,vsb> <page> <rmt-crate> DescriptionMap a 1-Megabyte page of remote VIC memory in a remote crate to the specified local page. Care should be taken to ensure that no other module in the local crate is using the same page.v50show - display VIC settings.Syntaxv50show <base eg 8> DescriptionDisplays the VIC settings. An example of the output following v50ground and after setting up mapping is shown below:After V50ground... ZCIO 0 A: 00 ........ B: F0 ++++.... C: 01 ZCIO 1 A: 00 ........ B: 00 ........ C: 00 ZCIO 2 A: 00 ........ B: 00 ........ C: 00 ZCIO 3 A: 00 ........ B: 00 ........ C: 00 crate 1 csrr 0 online-broadcall 200 After enabling mapping to remote crate with ... v50mmuena 2 a24 v50pagvme 2 a24 c 9 39 c ZCIO 0 A: 00 ........ B: F0 ++++.... C: 01 ZCIO 1 A: 00 ........ B: 00 ........ C: 05 ZCIO 2 A: 00 ........ B: 00 ........ C: 00 ZCIO 3 A: 00 ........ B: 00 ........ C: 00 A24 00C -> cr:9 am:39 00C sw:0 stat:00 crate 1 csrr 0 online-broadcall 200The first four lines give information from Zilog I/O controllers, each of which as three ports A, B, and C. For ports A and B both the hex value and the binary bit pattern are displayed.
Zilog 0: VIC Control & Status Register
Zilog 1:VSB Control & Status Register
Zilog 2:VME/VMV Interrupt Request Controller
Zilog 3:VSB/VMV Interrupt Request Controller If any mapping is enabled, a list is given. In the example, A24 addresses on local page C are mapped to remote crate 9 page C using address modifier 39. The next line gives the VIC CSR contents. The last line gives a bitmap of online crates. v50sysrst - reset remote crate.Syntaxv50sysrst <base eg 8> <crate> DescriptionIssue a VME system reset in the specified remote crate.Calling SequencesVicZgInit - Initialise Zilog I/O controllers.Calling Sequence#include "viccsr.h" long VicZgInit(vicCsr) struct vicCsr *vicCsr ; DescriptionInitialize the four Z8536 controllers. The devices are first reset and at the end data ports are enabled, but interrupts are left disabled. Return Value: 0VicMmuClear - Clear Memory Management.Calling Sequence#include "viccsr.h" void VicMmuClear (vicCsr) struct vicCsr *vicCsr ; DescriptionClear the memory management RAM.VicMbxClear - Clear Mailbox.Calling Sequence#include "viccsr.h" void VicMbxClear (vicCsr) struct vicCsr *vicCsr ; DescriptionClear the Mailbox flags.VicMmuCntrl - Read and Write MMU RAM.Calling Sequence#include "viccsr.h" long VicMmuCntrl (vicCsr,fct,code) struct vicCsr *vicCsr ; long fct ; unsigned long code ; DescriptionRead and write the MMU RAM control bits in ZCIO dev 1 port C. Input: fct = type of access (0 = read, 1 = write 2 = OR existing content with code 3 = AND existing content with code code = MMU control bits Output: New MMU control bits or -1 on error.VicVmvRstSet - Reset a Remote Crate.Calling Sequence#include "viccsr.h" void VicVmvRstSet (pVicCsr,crate,val) struct vicCsr *pVicCsr ; int crate ; long val ; DescriptionGenerates s VME Sysreset cycle in the specified crate. Any non-zero value will cause the reset to be generated.VicMmuSetPageVme - Map a remote VME page to a local page.Calling Sequence#include "viccsr.h" int VicMmuSetPageVme (vicCsr,space,page,crate,amod,rmtpage) struct vicCsr *vicCsr ; int space ; unsigned long page ; unsigned long crate ; int amod ; unsigned long rmtpage ; DescriptionMaps a remote page to the local crate. See the v50pagvme utility for definition of arguments.VicMmuSetPageBMem - Map Remote Vic Memory to a Local Page.Calling Sequencepagmem #include "viccsr.h" int VicMmuSetPageBMem (vicCsr,space,page,crate) struct vicCsr *vicCsr ; int space ; register unsigned long page ; DescriptionMaps a remote vic memory to the local crate. See the v50pagmem utility for definition of arguments.LinkingApplications using the VIC8250 package must be linked with libvic8250.a |