GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCBD / V1-4-2
Constituent: lcbd     Tag: mv2304
#include "LCBD/LCB_cr.h"
#include "LCBD/LCBD_cr.h"
#include "PBI/Attribute.h"
#include "PBI/Inline.h"
Include dependency graph for LCBC.h:
This graph shows which files directly or indirectly include this file:
Defines | |
#define | LCBC_MAP_TYPE_BY_OPCODE |
Defines a 32-bit integer that functions as a map of the command type indexed by opcode. | |
#define | LCBC_TYPE_BY_OPCODE_FULL(_map, _opcode) |
Maps an opcode to a command item type. | |
#define | LCBC_TYPE_BY_OPCODE(_opcode) LCBC_TYPE_BY_OPCODE_FULL(LCBC_MAP_TYPE_BY_OPCODE, _opcode) |
Maps an opcode to a result item type. | |
Typedefs | |
typedef enum _LCBC_TYPE | LCBC_TYPE |
Typedef for enum _LCBC_TYPE. | |
typedef unsigned int | LCBC_processor (void *prm, const LCB_ci *ci) |
Callback routine for LCBC_process. | |
Enumerations | |
enum | _LCBC_TYPE { LCBC_TYPE_UNDEFINED = 0, LCBC_TYPE_SIMPLE = 1, LCBC_TYPE_REGISTER = 2, LCBC_TYPE_COMMAND = 3, LCBC_TYPE_EVENT = 4 } |
Enumerates the four defined command item types + one undefined type. More... | |
Functions | |
LCBC__EXP_PROTO const void * | LCBC__advance (const LCB_ci *ci, int nbytes) ATTR_UNUSED_OK |
Advances the pointer ci by the specified number of bytes. | |
LCBC__EXP_PROTO const LCB_ci * | LCBC__next (const LCB_ci *ci) ATTR_UNUSED_OK |
Advances the pointer ci to the next command item. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__mark_time_fill (LCB_ci_mark_time *ci, unsigned short int stall) ATTR_UNUSED_OK |
Constructs a mark time LCB command. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__event_fill (LCB_ci_event *ci, unsigned int latp_adr, unsigned int proto, unsigned int len32, unsigned short int stall) ATTR_UNUSED_OK |
Constructs event transmit command, without a response. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__cmd_xmit_fill (LCB_ci_cmd *ci, const LCB_ci_cmd_payload *payload, unsigned short int stall) ATTR_UNUSED_OK |
Constructs transmit command, without a response. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__lat_reset_fill (LCB_ci_lat_reset *ci, unsigned short int stall) ATTR_UNUSED_OK |
Constructs a LAT reset LCB command. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__cmdr_xmit_fill (LCB_ci_cmdr *ci, const LCB_ci_cmd_payload *payload, unsigned short int timeout) ATTR_UNUSED_OK |
Constructs transmit command, with a response. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__csr_access_fill (LCB_ci_csr *ci, unsigned int value, unsigned int field_select, unsigned short int stall) ATTR_UNUSED_OK |
Constructs a LCB CSR register access command. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__faults_access_fill (LCB_ci_faults *ci, unsigned int value, unsigned int field_select, unsigned short int stall) ATTR_UNUSED_OK |
Constructs a LCB FIFO FAULTS register access command. | |
LCBC__EXP_PROTO LCB_ci * | LCBC__rxstats_access_fill (LCB_ci_rxstats *ci, unsigned int value, unsigned int field_select, unsigned short int stall) ATTR_UNUSED_OK |
Constructs a LCB Receive Statistics/Status register access command. | |
LCB_ci * | LCBC_mark_time_fill (LCB_ci_mark_time *ci, unsigned short int stall) |
Constructs a mark time LCB command. | |
LCB_ci * | LCBC_event_fill (LCB_ci_event *ci, unsigned int latp_adr, unsigned int proto, unsigned int len32, unsigned short int stall) |
Constructs event transmit command. | |
LCB_ci * | LCBC_lat_reset_fill (LCB_ci_lat_reset *ci, unsigned short int stall) |
Constructs a LAT reset LCB command. | |
LCB_ci * | LCBC_csr_access_fill (LCB_ci_csr *ci, unsigned int value, unsigned int field_select, unsigned short int stall) |
Constructs a LCB CSR register access command. | |
LCB_ci * | LCBC_faults_access_fill (LCB_ci_faults *ci, unsigned int value, unsigned int field_select, unsigned short int stall) |
Constructs a LCB FIFO FAULTS register access command. | |
LCB_ci * | LCBC_rxstats_access_fill (LCB_ci_rxstats *ci, unsigned int value, unsigned int field_select, unsigned short int stall) |
Constructs a LCB RECEIVE STATISTICS/STATUS register access command. | |
unsigned int | LCBC_process (const LCB_ci *ci, const LCB_ci *end, LCBC_processor rtn, void *prm) |
Executes the user specified handler for each command item in the range ci to end. | |
void | LCBC_show (unsigned int options, const LCB_ci *beg, const LCB_ci *end) |
Dumps the result items to stdout. | |
unsigned int | LCBC_cmd_xmit (LCBD lcb, const LCB_ci_cmd_payload *payload, unsigned short int stall) |
Utility routine to compose and submit a command with no response command (department of redundancy department?). | |
unsigned int | LCBC_mark_time (LCBD lcb, unsigned short int stall) |
Utility routine to compose and execute an LCB mark time command. | |
unsigned int | LCBC_lat_reset (LCBD lcb, unsigned short int stall) |
Utility routine to compose and execute an LCB LAT reset command. | |
unsigned int | LCBC_cmdr_xmit (LCBD lcb, const LCB_ci_cmd_payload *ci_payload, unsigned short int timeout, LCB_ri_cmd_payload *ri_payload) |
Utility routine to compose and submit a command with response command (department of redundancy department?). | |
unsigned int | LCBC_csr_access (LCBD lcb, unsigned int value, unsigned int field_select, unsigned short int stall, unsigned int *old_val, unsigned int *cur_val) |
Utility routine to compose and execute an access command to LCB's CSR register. | |
unsigned int | LCBC_faults_access (LCBD lcb, unsigned int value, unsigned int field_select, unsigned short int stall, unsigned int *old_val, unsigned int *cur_val) |
Utility routine to compose and execute an access command to LCB's FIFO FAULTS register. | |
unsigned int | LCBC_rxstats_access (LCBD lcb, unsigned int value, unsigned int field_select, unsigned short int stall, unsigned int *old_val, unsigned int *cur_val) |
Utility routine to compose and execute an access command to LCB's RECEIVE STATISTICS/STATS register. |
JJRussell -- russell@slac.stanford.edu
CVS $Id
These map out the data structure of command items. See chapter 3 & 4 of Mike Huffer's "LAT Communications Board -- Design Specification" for more details.
|
Value: ( \ (LCBC_TYPE_COMMAND << (3 * LCB_OPCODE_CMD )) | \ (LCBC_TYPE_SIMPLE << (3 * LCB_OPCODE_MARK_TIME )) | \ (LCBC_TYPE_EVENT << (3 * LCB_OPCODE_EVENT )) | \ (LCBC_TYPE_SIMPLE << (3 * LCB_OPCODE_LAT_RESET )) | \ (LCBC_TYPE_COMMAND << (3 * LCB_OPCODE_CMDR )) | \ (LCBC_TYPE_REGISTER << (3 * LCB_OPCODE_CSR )) | \ (LCBC_TYPE_UNDEFINED << (3 * LCB_OPCODE_6 )) | \ (LCBC_TYPE_REGISTER << (3 * LCB_OPCODE_FAULTS )) | \ (LCBC_TYPE_UNDEFINED << (3 * LCB_OPCODE_8 )) | \ (LCBC_TYPE_REGISTER << (3 * LCB_OPCODE_RXSTATS )) \ ) The 32-bit integer functions as a map of the command type indexed by opcode. Each command type consumes 3 bits. Given that there are 16 potential opcodes, it takes 48 bits to define the map. This means the map cannot be contained in a 32 bit integer. Ah, but wait, only the first ten opcodes are actually defined. So we can cheat, and only define the first ten. Indexing by greater than 32 will produce a 0.
type = opcode <= 10 ? ((LCBC_MAP_TYPE_BY_OPCODE >> (3 * opcode)) & 0x3) : LCBC_TYPE_UNDEFINED; There are 16 opcodes, that map to 5 descriptor types 0 LCB_OPCODE_CMD = LCBC_TYPE_COMMAND 1 LCB_OPCODE_MARK_TIME = LCBC_TYPE_SIMPLE 2 LCB_OPCODE_EVENT = LCBC_TYPE_EVENT 3 LCB_OPCODE_LAT_RESET = LCBC_TYPE_SIMPLE 4 LCB_OPCODE_CMDW = LCBC_TYPE_COMMAND 5 LCB_OPCODE_CSR = LCBC_TYPE_REGISTER 6 LCB_OPCODE_6 = LCBC_TYPE_UNDEFINED 7 LCB_OPCODE_FAULTS = LCBC_TYPE_REGISTER 8 LCB_OPCODE_8 = LCBC_TYPE_UNDEFINED 9 LCB_OPCODE_RXSTATS = LCBC_TYPE_REGISTER A LCB_OPCODE_A = LCBC_TYPE_UNDEFINED B LCB_OPCODE_B = LCBC_TYPE_UNDEFINED C LCB_OPCODE_C = LCBC_TYPE_UNDEFINED D LCB_OPCODE_D = LCBC_TYPE_UNDEFINED E LCB_OPCODE_E = LCBC_TYPE_UNDEFINED F LCB_PPCODE_F = LCBC_TYPE_UNDEFINED |
|
Maps an opcode to a result item type.
|
|
Value: _opcode <= 10 \ ? (((unsigned long long int)_map >> (3 * (_opcode))) & 0x7) \ : LCBC_TYPE_UNDEFINED
|
|
Callback routine for LCBC_process.
|
|
Enumerates the four defined command item types + one undefined type.
|
|
Advances the pointer ci by the specified number of bytes.
|
|
Constructs transmit command, without a response.
|
|
Constructs transmit command, with a response.
|
|
Constructs a LCB CSR register access command.
|
|
Constructs event transmit command, without a response.
#define LATP_ADR 22 #define PROTO 2 #define STALL 10 fill (LCB_ci_event *ci, unsigned int *dst, int len32) { unsigned short *dst = ci->data; memcpy (dst, src, len32 * sizeof (int)); len32 += 1; // Add on the length of the LATP_pckt_hdr len32 = (len32 + 3) & ~03; // Round to a multiple of 4 integers return LCBC__event_fill (ci, 22, LATP_ADR, PROTO, len32, STALL); } |
|
Constructs a LCB FIFO FAULTS register access command.
|
|
Constructs a LAT reset LCB command.
|
|
Constructs a mark time LCB command.
|
|
Advances the pointer ci to the next command item.
|
|
Constructs a LCB Receive Statistics/Status register access command.
|
|
Utility routine to compose and submit a command with no response command (department of redundancy department?).
|
|
Utility routine to compose and submit a command with response command (department of redundancy department?).
|
|
Utility routine to compose and execute an access command to LCB's CSR register.
|
|
Constructs a LCB CSR register access command.
|
|
Constructs event transmit command.
#define LATP_ADR 22 #define PROTO 2 #define STALL 10 fill (LCB_ci_event *ci, unsigned int *dst, int len32) { unsigned short *dst = ci->data; memcpy (dst, src, len32 * sizeof (int)); return LCBC_event_fill (ci, 22, LATP_ADR, PROTO, len32, STALL); } |
|
Utility routine to compose and execute an access command to LCB's FIFO FAULTS register.
|
|
Constructs a LCB FIFO FAULTS register access command.
|
|
Utility routine to compose and execute an LCB LAT reset command.
|
|
Constructs a LAT reset LCB command.
|
|
Utility routine to compose and execute an LCB mark time command.
|
|
Constructs a mark time LCB command.
|
|
Executes the user specified handler for each command item in the range ci to end.
|
|
Utility routine to compose and execute an access command to LCB's RECEIVE STATISTICS/STATS register.
|
|
Constructs a LCB RECEIVE STATISTICS/STATUS register access command.
|
|
Dumps the result items to stdout.
|