/*============================================================================= Name: fcomLclsMgnt.c Abs: Header defining the layout of a MGNT FCOM blob for fast feedback correctors, when configured. Auth: 10-feb-2010, drogind Rev: -----------------------------------------------------------------------------*/ #include "copyright_SLAC.h" /* SLAC copyright comments */ /*----------------------------------------------------------------------------- Mod: =============================================================================*/ #ifndef FCOM_LCLS_MGNT_H #define FCOM_LCLS_MGNT_H #ifdef __cplusplus extern "C" { #endif /* Notes, Given (fcom_api.h) : */ /* typedef struct FcomBlob_ { FcomBlobHdr hdr; union { void *p_raw; float *p_flt; double *p_dbl; uint32_t *p_u32; int32_t *p_i32; int8_t *p_i08; } dref; ptr to data } FcomBlob, *FcomBlobRef; #define fc_dbl dref.p_dbl */ #define fc_mgnt_Bval fc_dbl /* double element of blob */ /* * Always use FcomMgntNumber -- if the data type is * ever changed then this change can be propagated * simply by redefining this typedef. */ typedef float FcomMgntNumber; /* Macros to access Mgnt B value; use as follows: * * FcomBlobRef blob_p; * * fcomGetBlob(id, &blob_p, 0); * * FcomMgntNumber mgnt = blob_p->fc_mgnt_Bval; * * ALWAYS access data using these macros * so that changes to the layout and/or data * type can be propagated by recompiling. */ /* Status values (other values not defined here must * be interpreted as 'all data invalid'). */ #define FC_STAT_MGNT_OK 0 /* Reference too small; B is INVALID/UNDEFINED. */ #define FC_STAT_MGNT_REFLO 1 /* * B couldn't be measured (hardware, network * or software error). All data are INVALID/UNDEFINED. */ #define FC_STAT_MGNT_INVAL 0xffff #ifdef __cplusplus } #endif #endif