RC1000-PP Host:
Miscellaneous Functions


 

PP1000GetCardInfo

 
  PP1000_STATUS PP1000GetCardInfo(
                      PP1000_HANDLE Card
                      PP1000_CARD_INFO * Info);
 

 

Arguments
Card Handle of card to close.
Info Pointer to card information structure to be filled in.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_HANDLE Card is not a valid card handle.
PP1000_NULL_POINTER Info is a NULL pointer.
PP1000_INTERNAL_ERROR Error while talking to driver.
Description

Card must be a valid handle returned by PP1000OpenCard() or PP1000OpenFirstCard().

This function is used to obtain information about an open card. The card information structure that is filled in is defined as follows:

typedef struct
{
   PP1000_DEVICE_NUM CardID;
   unsigned long     PMC1Fitted;
   unsigned long     PMC2Fitted;
   unsigned long     RAMBankFitted[4];
   unsigned long     RAMBankSpace[4];
   PP1000_FPGA_TYPE  FPGAType;
   unsigned long     PhysicalMemoryBase;
   unsigned long *   MemoryBase;
   unsigned long     BoardRevision;
   unsigned long     LogicRevision;
   unsigned long     SerialNum;
   unsigned long     Timeout;
} PP1000_CARD_INFO;

CardID is the ID of the card. This will be the value passed to PP1000OpenCard() if that function was used to open the card handle.

PMC1Fitted and PMC2Fitted are non zero if the respective PMC site is occupied by a PMC compliant daughter module.

RAMBankFitted[] is filled in with the size of each of the RAM banks on the board. The size is given in bytes.

RAMBankSpace[] is filled in with the space assigned to each memory bank. This will be greater than or equal to the value in RAMBankFitted[]. These values should be used to determine the offset of each RAM bank. The size is given in bytes.

FPGAType is filled in with the type of FPGA fitted to the board. Currently, this can be one of the following:

PP1000_FPGA_4085XL
PP1000_FPGA_40150XV
PP1000_FPGA_40200XV
PP1000_FPGA_40250XV
PP1000_FPGA_V1000
PP1000_FPGA_UNKNOWN

PP1000_FPGA_UNKNOWN should only be returned when the card is not functioning correctly.

PhysicalMemoryBase is filled in with the base address of the card's memory banks on the PCI bus. This can be used for card to card DMA transfers (see the PP1000Setup2DDMAChannel() function) or for direct access by another PCI bus master device.

MemoryBase is filled in with a virtual pointer to the RAM banks on the RC1000-PP. This address may be used to read and write the SRAM on the board directly. Accesses should be made as 32 bit words and aligned to 32 bit boundaries. The size of the window is given by the sum of the 4 values in RAMBankSpace[]. Memory banks must be requested with the PP1000RequestMemoryBank() function before they can be accessed.

BoardRevision and LogicRevision are filled in with version numbers for the board and glue logic. Version numbers are 8 bit hexadecimal numbers where the most significant nibble is the major version and the least significant nibble is the minor version. For example, version 2.3 is represented by 0x23.

SerialNum is filled in with the serial number of the card. The serial number is factory set and is guaranteed to be a unique number. (The card ID can be set by the user and so there can be multiple cards with the same ID in one system).

Timeout is filled in with the current value for the timeout on a card in milliseconds. The timeout is used by the library in blocking operations to return when the operation does not complete within the specified time.

 

 

PP1000ReadGPI

 
  PP1000_STATUS PP1000ReadGPI(
                      PP1000_HANDLE Card,
                      unsigned long * Value);
 

 

Arguments
Card Handle of card to close.
Value Pointer to location to receive value from GPI pin.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_HANDLE Card is not a valid card handle.
PP1000_NULL_POINTER Value is NULL.
PP1000_INTERNAL_ERROR Error while talking to driver.
Description

This function is used to read the state of the general purpose input (GPI) pin. The location pointed to by Value will be set to 1 if the FPGA has set the GPI pin or zero if the FPGA has cleared the GPI pin. The FPGA can set the state of the GPI pin using the PP1000SetGPI() Handel-C macro procedure.

Card must be a valid handle returned by PP1000OpenCard() or PP1000OpenFirstCard().

 

 

PP1000ReadStatus

 
  PP1000_STATUS PP1000ReadStatus(
                      PP1000_HANDLE Card,
                      unsigned char * Status);
 

Arguments
Card Handle of card to close.
Status Pointer to location to receive value from status port.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_HANDLE Card is not a valid card handle.
PP1000_TIMEOUT Operation timed out before FPGA read from port.
PP1000_INTERNAL_ERROR Error while talking to driver.
PP1000_CARD_BUSY Card is not ready..
Description

This function is used to read from the status port on a card. The function will block until the FPGA has written to the status port. The FPGA can write to the status port using the PP1000WriteStatus() Handel-C macro procedure.

Status may be a NULL pointer in which case the synchronisation between FPGA and host will occur but the data will be dropped.

Card must be a valid handle returned by PP1000OpenCard() or PP1000OpenFirstCard().

This function times out, if unsuccessful, after the period set for by using PP1000SetTimeOut().

 

PP1000ResetFPGA

 
  PP1000_STATUS PP1000ResetFPGA(
                      PP1000_HANDLE Card);
 

 

Arguments
Card Handle of card to close.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_HANDLE Card is not a valid card handle.
PP1000_INTERNAL_ERROR Error while talking to driver.
PP1000_TIMEOUT Operation timed out before reset could complete.
Description

This function is used to pulse the F_RST_L pin on an FPGA. This pin can be used by the user FPGA program as a reset line since it has no effect on any other part of the RC1000-PP hardware or support software.

Card must be a valid handle returned by PP1000OpenCard() or PP1000OpenFirstCard().

This function times out, if unsuccessful, after the period set for by using PP1000SetTimeOut().

 

 

PP1000SetGPO

 
  PP1000_STATUS PP1000SetGPO(
                      PP1000_HANDLE Card,
                      unsigned long Value);
 

 

Arguments
Card Handle of card to close.
Value Non-zero to set GPO, zero to clear GPO.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_HANDLE Card is not a valid card handle.
PP1000_INTERNAL_ERROR Error while talking to driver.
Description

This function is used to set the state of the general purpose output (GPO) pin. When Value is non-zero, this pin on the FPGA will be set to 1, when Value is zero, this pin on the FPGA will be set to zero. This pin can be read on the FPGA using the PP1000ReadGPO() Handel-C macro expression.

Card must be a valid handle returned by PP1000OpenCard() or PP1000OpenFirstCard().

 

PP1000SetTimeOut

 
  PP1000_STATUS PP1000SetTimeOut(
                      PP1000_HANDLE Card
                      unsigned long Time);
 

 

Arguments
Card Handle of card to set timeout on.
Time Length of timeout in milliseconds.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_HANDLE Card is not a valid card handle.
Description

Card must be a valid handle returned by PP1000OpenCard() or PP1000OpenFirstCard().

The RC1000-PP support software uses timeouts on operations that can block to force completion of functions even if the operation is not complete. This function is used to set the length of the timeout used on a board.

Timeouts may be disabled on a card by specifying a length of PP1000_TIMEOUT_INFINITE.

 

PP1000WriteControl

 
  PP1000_STATUS PP1000WriteControl(
                      PP1000_HANDLE Card,
                      unsigned char Control);
 

 

Arguments
Card Handle of card to close.
Control Value to write to card.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_HANDLE Card is not a valid card handle.
PP1000_TIMEOUT Operation timed out before FPGA read from port.
PP1000_INTERNAL_ERROR Error while talking to driver.
PP1000_CARD_BUSY Card is not ready.
Description

This function is used to write to the control port on a card. The function will block until the FPGA has read from the control port. The FPGA can read from the control port using the PP1000ReadControl() Handel-C macro procedure.

Card must be a valid handle returned by PP1000OpenCard() or PP1000OpenFirstCard().

This function times out, if unsuccessful, after the period set for by using PP1000SetTimeOut().