GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCBD / V1-4-1
Constituent: lcbd     Tag: linux-gcc
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | _LCBD_load_cbp |
Callback routine and parameter for LCBD_load asychronous completion. More... | |
struct | _LCBD_dib |
LCBD Device information block. More... | |
Defines | |
#define | LCBD_OK 0 |
Success return code, note that this is not an LCBD message code, but may be used as one. | |
#define | LCBD_K_EVENT_BASE_IGNORE (unsigned int *)(-1) |
Instructs LCBD_load to ignore setting the event base address. | |
#define | LCBD_K_EVENT_BASE_ALLOCATE (unsigned int *)( 0) |
Instructs LCBD_load to automatically allocate an event buffer and assign the starting address as the event base. | |
Typedefs | |
typedef enum _LCBD_LOAD_OPTIONS_M | LCBD_LOAD_OPTIONS_M |
Typedef for enum _LCBD_LOAD_OPTIONS_M. | |
typedef void(* | LCBD_load_cb )(void *prm, LCBD lcb, unsigned int status) |
Callback for LCBD_load asynchronous completion. | |
typedef _LCBD_load_cbp | LCBD_load_cbp |
Typedef for struct _LCBD_load_cbp. | |
typedef enum _LCBD_CLK_EDGE_OPTIONS_M | LCBD_CLK_EDGE_OPTIONS_M |
Typedef for enum _LCBD_CLK_EDGE_OPTIONS_M. | |
typedef enum _LCBD_STATE | LCBD_STATE |
Typedef for enum LCBD_STATE. | |
typedef enum _LCBD_STATE | LCBD_state |
Typedef for enum LCBD_state. | |
typedef enum _LCBD_STATE_M | LCBD_STATE_M |
Typedef for enum LCBD_STATE_M. | |
typedef enum _LCBD_QUES_M | LCBD_QUES_M |
Typedef for enum _LCBD_QUES_M. | |
typedef enum _LCBD_FPGA_SUP_K | LCBD_FPGA_SUP_K |
Typedef for enum _LCBD_FPGA_SUP_K. | |
typedef _LCBD_dib | LCBD_dib |
Typedef for struct _LCBD_dib. | |
typedef enum _LCBD_M_ENABLE_DISABLE | LCBD_M_ENABLE_DISABLE |
Typedef for enum _LCBD_M_ENABLE_DISABLE. | |
typedef enum _LCBD_WIDTH_K | LCBD_WIDTH_K |
Typedef for enum _LCBD_WIDTH_K. | |
typedef enum _LCBD_FABRIC_K | LCBD_FABRIC_K |
Typedef for enum _LCBD_fabric_select. | |
Enumerations | |
enum | _LCBD_LOAD_OPTIONS_M { LCBD_LOAD_OPTIONS_M_FABRIC_ASIS = 0, LCBD_LOAD_OPTIONS_M_FABRIC_PRIMARY = COMPOSE(FABRIC, 0), LCBD_LOAD_OPTIONS_M_FABRIC_REDUNDANT = COMPOSE(FABRIC, 1), LCBD_LOAD_OPTIONS_M_INTERRUPT_DEFAULT = 0, LCBD_LOAD_OPTIONS_M_INTERRUPT_PCI = COMPOSE (INTERRUPT,0), LCBD_LOAD_OPTIONS_M_INTERRUPT_PID = COMPOSE (INTERRUPT,1), LCBD_LOAD_OPTIONS_M_ICLK_ASIS = 0, LCBD_LOAD_OPTIONS_M_ICLK_LEADING_EDGE = COMPOSE(ICLK, 0), LCBD_LOAD_OPTIONS_M_ICLK_TRAILING_EDGE = COMPOSE(ICLK, 1), LCBD_LOAD_OPTIONS_M_OCLK_ASIS = 0, LCBD_LOAD_OPTIONS_M_OCLK_LEADING_EDGE = COMPOSE(OCLK, 0), LCBD_LOAD_OPTIONS_M_OCLK_TRAILING_EDGE = COMPOSE(OCLK, 1), LCBD_LOAD_OPTIONS_M_BOARD_ID_ASIS = 0, LCBD_LOAD_OPTIONS_M_LATP8_ASIS = 0, LCBD_LOAD_OPTIONS_M_LATP8_BIT = COMPOSE(LATP8, 0), LCBD_LOAD_OPTIONS_M_LATP8_BYTE = COMPOSE(LATP8, 1), LCBD_LOAD_OPTIONS_M_CSR } |
Defines the load options word. More... | |
enum | _LCBD_CLK_EDGE_OPTIONS_M { LCBD_CLK_EDGE_OPTIONS_M_ICLK_IGNORE = 0x0, LCBD_CLK_EDGE_OPTIONS_M_ICLK_LEADING = COMPOSE (ICLK, 0), LCBD_CLK_EDGE_OPTIONS_M_ICLK_TRAILING = COMPOSE (ICLK, 1), LCBD_CLK_EDGE_OPTIONS_M_OCLK_IGNORE = 0x0, LCBD_CLK_EDGE_OPTIONS_M_OCLK_LEADING = COMPOSE (OCLK, 0), LCBD_CLK_EDGE_OPTIONS_M_OCLK_TRAILING = COMPOSE (OCLK, 1) } |
Defines the options word of LCBD_clk_edge_set. More... | |
enum | _LCBD_STATE { LCBD_STATE_ERROR = -1, LCBD_STATE_ONLINE = 0, LCBD_STATE_OFFLINE = 1, LCBD_STATE_UNINITIALIZED = 2, LCBD_STATE_UNLOADING = 3 } |
The state of the LCB driver. More... | |
enum | _LCBD_STATE_M { LCBD_STATE_M_ONLINE = (1 << LCBD_STATE_ONLINE), LCBD_STATE_M_OFFLINE = (1 << LCBD_STATE_OFFLINE), LCBD_STATE_M_UNINITIALIZED = (1 << LCBD_STATE_UNINITIALIZED), LCBD_STATE_M_UNLOADING = (1 << LCBD_STATE_UNLOADING) } |
The state of the LCB driver as a bit value. More... | |
enum | _LCBD_QUES_M { LCBD_QUES_M_RESULT = 1, LCBD_QUES_M_EVENT = 2, LCBD_QUES_M_BOTH = (LCBD_QUES_M_RESULT | LCBD_QUES_M_EVENT) } |
Enumerates the LCBD ques as a bit mask selection. More... | |
enum | _LCBD_FPGA_SUP_K { LCBD_FPGA_SUP_K_MIN = -1, LCBD_FPGA_SUP_K_NOT = -1, LCBD_FPGA_SUP_K_GOLDEN = 0, LCBD_FPGA_SUP_K_BACKWARD = 1, LCBD_FPGA_SUP_K_USER = 2, LCBD_FPGA_SUP_K_CNT = 4 } |
Enumerates the possible driver FPGA support levels. More... | |
enum | _LCBD_M_ENABLE_DISABLE { LCBD_M_ENABLE_RESULT = (1 << 0), LCBD_M_ENABLE_EVENT = (1 << 1), LCBD_M_ENABLE_CLK_ON = (1 << 2), LCBD_M_ENABLE_CLK_OFF = (1 << 3), LCBD_M_ENABLE_CLKS = (LCBD_M_ENABLE_CLK_ON | LCBD_M_ENABLE_CLK_OFF), LCBD_M_ENABLE_ALL, LCBD_M_DISABLE_RESULT = (1 << (0+4)), LCBD_M_DISABLE_EVENT = (1 << (1+4)), LCBD_M_DISABLE_CLK_ON = (1 << (2+4)), LCBD_M_DISABLE_CLK_OFF = (1 << (3+4)), LCBD_M_DISABLE_CLKS, LCBD_M_DISABLE_ALL, LCBD_M_ENABLE_CBUF = (1 << 12), LCBD_M_DISABLE_CBUF = (1 << 13) } |
Enumerates the IRQ enable/disable/pending bits. More... | |
enum | _LCBD_WIDTH_K { LCBD_WIDTH_K_BIT = 0, LCBD_WIDTH_K_BYTE = 1 } |
Enumeration of the two possible values of the event fabric data width, either bit-wide or byte-wide. More... | |
enum | _LCBD_FABRIC_K { LCBD_FABRIC_K_PRIMARY = 0, LCBD_FABRIC_K_REDUNDANT = 1 } |
Value of the parameter to LCBD_fabric_select routine. More... | |
Functions | |
unsigned int | LCBD_allow (unsigned char pci_version, unsigned char latp_version) |
Adds the specified PCI and LATP version number combination as being supported by this driver. | |
LCBD | LCBD_create (LCBD lcb) |
Preinitializes the LCBD device control block. | |
LCBD | LCBD_get (void) |
Returns a pointer to the driver control structute. | |
unsigned int | LCBD_load (LCBD lcb, unsigned int options, unsigned int *event_base) |
Initializes the LCB hardware and LCBD software. | |
unsigned int | LCBD_load_cancel (LCBD lcb) |
Cancels the Waiting for the LCBD_load_init completion. | |
unsigned int | LCBD_load_init (LCBD lcb, unsigned int options, unsigned int *event_base, LCBD_load_cb notify, void *prm) |
Initializes the LCB hardware and LCBD software. | |
void | LCBD_load_notify (void *semaphore, LCBD lcb, unsigned int status) |
Pre-canned LCBD load notification callback routine. | |
unsigned int | LCBD_load_wait (LCBD lcb) |
Waits for the LCBD_load_init completion. | |
unsigned int | LCBD_unload (LCBD lcb) |
Unloads the LCB driver. | |
unsigned int | LCBD_board_id_set (LCBD lcb, int new_board_id, int *org_board_id) |
Sets the LATp board Id, returning the orginal board id. | |
unsigned int | LCBD_clk_edge_set (LCBD lcb, unsigned int new_options, unsigned int *old_options) |
Sets the clock options. | |
unsigned int | LCBD_width_set (LCBD lcb, int new_width, int *org_width) |
Sets the LATp event fabric data path width, returning the original data path width setting. | |
unsigned int | LCBD_fabric_read (LCBD lcb) |
Reads the fabric select register. | |
unsigned int | LCBD_fabric_select (LCBD lcb, unsigned int fabric) |
Sets the fabric to specified value. | |
unsigned int | LCBD_faults_read (LCBD lcb, unsigned int clear, unsigned int *prv, unsigned int *cur) |
Reads the LATp faults register and, optionally, clears the specified bits. | |
unsigned int | LCBD_drain (LCBD lcb, int which) |
Drains the specified ques. | |
unsigned int | LCBD_pci_cfg_status_clear (LCBD lcb) |
Clears the PCI configuration space status word. | |
const LCBD_dib * | LCBD_dib_locate (const LCBD lcb) |
Returns a readonly pointer to the LCB's device information block. | |
void | LCBD_dib_show (const LCBD_dib *dib) |
Shows (prints to the terminal) the Device Information Block. | |
unsigned int | LCBD_enable (LCBD lcb, unsigned int enables) |
Sets the enable/disable flags controlling the EVENT and RESULT interrupts. | |
LCBD_state | LCBD_state_get (LCBD lcb) |
Returns the current state of the driver. |
JJRussell -- russell@slac.stanford.edu
CVS $Id
unsigned int loadLcbd (unsigned int *circularBuffer) { // Get pre-initialized driver handle lcb = LCBD_create (); // Load the driver status = LCBD_load (lcb, LCBD_LOAD_OPTIONS_M_FABRIC_PRIMARY | LCBD_LOAD_OPTIONS_M_SET_INTERRUPT_DEFAULT circularBuffer); // Install the result, event and notification service tasks // using the default priorities status = LCBD_rst_handler_create (lcb, LCBD_RST_K_DEFAULT_PRIORITY); status = LCBD_evt_handler_create (lcb, LCBD_EVT_K_DEFAULT_PRIORITY); status = LCBD_nut_handler_create (lcb, LCBD_NUT_K_DEFAULT_PRIORITY); // Set the callback handler for the protocol #1 status = LCBD_evt_cb_set (lcb, 1, eventHander, eventParameter); // Set event interrupt conditions 50% on FIFO LCBD_evt_conds_set (lcb, LCBD_EVT_COND_50_FULL); // Enable the result and event interrupts status = LCBD_enable (lcb, LCBD_M_ENABLE_EVENT | LCBD_M_ENABLE_RESULT)); // Enable the event flow into the LCB's circular buffer status = LCBD_evt_enable (lcb, 1); return status; }
|
Typedef for enum _LCBD_CLK_EDGE_OPTIONS_M.
|
|
Typedef for struct _LCBD_dib.
|
|
Typedef for enum _LCBD_FPGA_SUP_K.
|
|
Callback for LCBD_load asynchronous completion.
|
|
Typedef for enum _LCBD_LOAD_OPTIONS_M.
status = LCBD_load (lcb, LCBD_LOAD_OPTIONS_M_FABRIC_REDUNDANT | LCBD_LOAD_OPTIONS_M_INTERRUPT_PID | LCBD_LOAD_OPTIONS_M_ICLK_ASIS | LCBD_LOAD_OPTIONS_M_OCLK_ASIS | LCBD_LOAD_OPTIONS_M_BOARD_ID_N(23) | LCBD_LAOD_OPTIONS_M_LATP8_BYTE eventBase); |
|
Typedef for enum _LCBD_M_ENABLE_DISABLE.
|
|
Typedef for enum _LCBD_WIDTH_K.
|
|
|
Value of the parameter to LCBD_fabric_select routine.
|
|
Enumerates the possible driver FPGA support levels.
|
|
Defines the load options word.
|
|
Enumerates the IRQ enable/disable/pending bits.
|
|
Enumerates the LCBD ques as a bit mask selection.
|
|
The state of the LCB driver.
|
|
The state of the LCB driver as a bit value.
|
|
Enumeration of the two possible values of the event fabric data width, either bit-wide or byte-wide.
|
|
Adds the specified PCI and LATP version number combination as being supported by this driver.
|
|
Sets the LATp board Id, returning the orginal board id.
|
|
Sets the clock options.
|
|
Preinitializes the LCBD device control block.
|
|
Returns a readonly pointer to the LCB's device information block.
|
|
Shows (prints to the terminal) the Device Information Block.
|
|
Drains the specified ques.
|
|
Sets the enable/disable flags controlling the EVENT and RESULT interrupts.
|
|
Reads the fabric select register.
|
|
Sets the fabric to specified value.
|
|
Reads the LATp faults register and, optionally, clears the specified bits.
// Just read the faults register status = LCBD_faults_read (lcb, 0, &faults, NULL); // Read and clear the faults register status = LCBD_faults_read (lcb, -1, &faults, NULL);
|
|
Returns a pointer to the driver control structute.
|
|
Initializes the LCB hardware and LCBD software.
|
|
Cancels the Waiting for the LCBD_load_init completion.
|
|
Initializes the LCB hardware and LCBD software.
status = LCBD_load_init (lcb, options, event_base, LBCD_load_notify, NULL); // The only errors are catastophic if (status != LCBD_OK) return status; // Now do a bunch of other stuff.... call_a_bunch_of_other_stuff (lots_of_parameters); // Done doing other stuff, now wait till the driver is fully initialized status = LCBD_load_wait (lcb); if (status != LCBD_OK) return status; . |
|
Pre-canned LCBD load notification callback routine.
|
|
Waits for the LCBD_load_init completion.
|
|
Clears the PCI configuration space status word.
|
|
Returns the current state of the driver.
|
|
Unloads the LCB driver.
|
|
Sets the LATp event fabric data path width, returning the original data path width setting.
|