Cascade Driver for Hilscher Fieldbus CIF Cards: Version 4.1
Prev |  | Next

# cardInit

cardInit -- initializes CIF cards.

## Synopsis

    (cardInit)
    (cardInit card_id)
    (cardInit card_id  hardware_address [size_Kbytes [ inter ]]]])

## Parameters

`card_id`

  The ID associated with the card initialized by this command. Up to 4 cards can be simultaneously accessed by the same driver, numbered `0` to `3`. If no parameters are specified, then the command will scan the system for a new CIF card (that has not yet been initialized by the driver), and assign it the next available ID number, repeating the process until up to 4 cards have been detected.

`hardware_address`

  The hardware location of the CIF card's dual-port mapped memory block. If no hardware address or an address of `0` is specified, then the command will scan the system for a CIF card that has not yet been initialized by the driver (and that matches the size parameter, if specified). The address is normally specified as a hexadecimal number by preceding the address with `0x`. The address may be specified as a complete byte address or as a segment address (`< 0x10000`).

`size_Kbytes`

  The size of the CIF card's dual-port mapped memory block, in Kbytes, normally `2`, `8` or `16`. If no size, or a size of `0`, is specified, then the command will automatically determine the size of the CIF card. If the hardware address is specified as `0`, but the size is `> 0`, then the command will scan the system for a CIF card with the specified size.

`intr`

  For ISA cards, if `intr > 0`, then `intr` specifies the interrupt associated with the card, otherwise the card will use polling mode only. For PCI cards, if `intr >= 0`, then the interrupt line assigned by the BIOS to the card is used, otherwise the card will use polling mode only. If `intr` is not specified, then this is equivalent to `intr = 0`, which as described above, defaults to polling for ISA cards and the assigned interrupt for PCI cards. The assignment `intr = -1` should be specified to always force polling mode if desired.

  | Shared interrupts are not supported, so if the same interrupt is associated with more than one card, only the first will use interrupt mode, and the remainder will use polling mode.

## Returns

OK if successful, otherwise

        (error "cardInit -1 (time) Unable to locate a valid CIF card")

## Description

This command initializes one or more CIF cards. A card must be initialized before it can be used. At least one card must be initialized from the configuration file to prevent the driver from terminating. The driver can interface with up to 4 cards. Each card is uniquely identified by its card ID, between `0` and `3`. The command can be used without parameters, causing the driver to auto-detect all CIF cards in the system. Alternatively, each card can be specified, with its ID, address, size and interrupt. This command is normally executed from the configuration file.

## Example

In the following example, the driver will scan for all CIF cards in the system, identifying up to 4 cards, and assigning consecutive device IDs. ISA cards will default to polling mode, while PCI cards will use interrupt mode (provided no two cards share the same interrupt).

        (initCard)

In the following example, the system will initialize device ID `0` at address `0xD0000`, and automatically determine the card size.

        (initCard 0 0xD000)

In the following example, the system will attempt to find and initialize an 8K CIF card (Note an address of 0 was specified, triggering the automatic detection). Interrupt mode will be used, on the assigned interrupt line if the card is PCI, otherwise on interrupt 5.

        (initCard 1 0 8 5)

Prev | Home | Next
cardGroup | Up | cardIoStatus

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.