hapregs.h File Reference


Detailed Description

FPGA Register Library Interface.


This interface can be used in C and C++ Applications. Include this header file in your source code and link against libhapregs. A shared version of this lib (libhapregs.so) is installed on every camera.

Author:
Thomas Berndorfer
Date:
2008/01/10

#include <stdint.h>

Include dependency graph for hapregs.h:

Go to the source code of this file.

Functions

int CloseReg32 (void *board)
 Close the FPGA register interface (optional).
void * OpenReg32 (void)
 Open the FPGA register interface (optional).
int ReadReg32 (void *board, unsigned long address, uint32_t *value)
 Read a 32bit register from an FPGA design.
int WriteReg32 (void *board, unsigned long address, uint32_t value)
 Write a 32bit value to an FPGA design register.


Function Documentation

int CloseReg32 ( void *  board  ) 

Close the FPGA register interface (optional).

This is an optional function that may be called to close the internally used file descriptor to the regsiter driver. (which is accessed through /dev/fpgapi0). This may be useful when the user want's to have control over register access from concurrently running applications. By default Linux closes the opened file descpriptor when the application process terminates.

Parameters:
board Specifies the corresponding interface which should be closed. Currently this parameter can be specified as zero because this parameter is reserved for future use.
Returns:
0 ... on success
<0 ... on error

void* OpenReg32 ( void   ) 

Open the FPGA register interface (optional).

This is an optional function that may be called to control the point of time where this interface should open the register driver (which is accessed through /dev/fpgapi0). This may be useful when the user want's to have control over register access from concurrently running applications. By default the first call to ReadReg32() or WriteReg32() tries to open the driver interface automatically. This function returns a handle to the corresponding register interface (known as board handle). This handle is currently ignored and reserved for future use on hardware platforms with several FPGA design APIs.

Returns:
0 ... on error
!=0 ... on success (handle)

int ReadReg32 ( void *  board,
unsigned long  address,
uint32_t *  value 
)

Read a 32bit register from an FPGA design.

Parameters:
board Specifies the corresponding register interface handle. Currently this parameter can be specified as zero because it is reserved for future use.
address specifies the register address in the FPGA design's register address space (starting at 0)
value pointer to 32bit variable to hold the result
Returns:
0 ... on success
<0 ... on error

int WriteReg32 ( void *  board,
unsigned long  address,
uint32_t  value 
)

Write a 32bit value to an FPGA design register.

Parameters:
board Specifies the corresponding register interface handle. Currently this parameter can be specified as zero because it is reserved for future use.
address specifies the register address in the FPGA design's register address space (starting at 0)
value 32bit value to be written to the register
Returns:
0 ... on success
<0 ... on error


Generated on Mon Mar 15 16:11:05 2010 for Festo Camera API by  doxygen 1.5.6