mrfioc2  2.3.0
Macros | Typedefs | Functions
mrfCommon.h File Reference
#include <epicsVersion.h>
#include <epicsTypes.h>
#include <epicsTime.h>
#include <epicsMath.h>
#include <epicsInterrupt.h>
#include <epicsStdlib.h>
#include <epicsThread.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbCommon.h>
#include <devSup.h>
#include <recGbl.h>
#include <menuYesNo.h>
#include <limits.h>
#include <shareLib.h>
Include dependency graph for mrfCommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MRF_NUM_EVENTS   256 /* Number of possible events */
 
#define MRF_EVENT_FIFO_SIZE   512 /* Size of EVR/EVG event FIFO */
 
#define MRF_MAX_DATA_BUFFER   2048 /* Maximum size of the distributed data buffer */
 
#define MRF_FRAC_SYNTH_REF   24.0 /* Fractional Synth reference frequency (MHz). */
 
#define MRF_DEF_CLOCK_SPEED   125.0 /* Default event clock speed is 125 MHz. */
 
#define MRF_SN_BYTES   6 /* Number of bytes in serial number */
 
#define MRF_SN_STRING_SIZE   18 /* Size of serial number string (including NULL) */
 
#define MRF_DESCRIPTION_SIZE   80 /* Size of description text string (inclucing NULL)*/
 
#define MRF_EVENT_NULL   0x00
 
#define MRF_EVENT_TS_SHIFT_0   0x70
 
#define MRF_EVENT_TS_SHIFT_1   0x71
 
#define MRF_EVENT_HEARTBEAT   0x7A
 
#define MRF_EVENT_RST_PRESCALERS   0x7B
 
#define MRF_EVENT_TS_COUNTER_INC   0x7C
 
#define MRF_EVENT_TS_COUNTER_RST   0x7D
 
#define MRF_EVENT_END_OF_SEQUENCE   0x7F
 
#define ER_PROVIDER_PRIORITY   50
 Priority given to EVR's timestamp/event provider. More...
 
#define MRF_BUS_COMPACT_PCI   0 /* 0 = Compact PCI (3U) */
 
#define MRF_BUS_PMC   1 /* 1 = PMC */
 
#define MRF_BUS_VME   2 /* 2 = VME 64x */
 
#define MRF_CARD_TYPE_EVR   1 /* 1 = Event Receiver */
 
#define MRF_CARD_TYPE_EVG   2 /* 2 = Event Generator */
 
#define MRF_SERIES_200   0x000000C8 /* Series 200 Code (in Hex) */
 
#define MRF_SERIES_220   0x000000DC /* Series 220 Code (in Hex) */
 
#define MRF_SERIES_230   0x000000E6 /* Series 230 Code (in Hex) */
 
#define EVENT_CLOCK_DEFAULT   0.00 /* Defaults to cntrl word value or 125.0 */
 
#define VERSION_INT(V, R, M, P)   ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
 
#define EPICS_VERSION_INT   VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL)
 
#define isfinite   finite
 
#define M_stdlib   (527 <<16) /*EPICS Standard library*/
 
#define S_stdlib_noConversion   (M_stdlib | 1) /* No digits to convert */
 
#define S_stdlib_extraneous   (M_stdlib | 2) /* Extraneous characters */
 
#define S_stdlib_underflow   (M_stdlib | 3) /* Too small to represent */
 
#define S_stdlib_overflow   (M_stdlib | 4) /* Too large to represent */
 
#define S_stdlib_badBase   (M_stdlib | 5) /* Number base not supported */
 

Typedefs

typedef long long epicsInt64
 
typedef unsigned long long epicsUInt64
 

Functions

epicsShareFunc int epicsParseUInt32 (const char *str, epicsUInt32 *to, int base, char **units)
 

Macro Definition Documentation

◆ EPICS_VERSION_INT

#define EPICS_VERSION_INT   VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL)

Definition at line 318 of file mrfCommon.h.

◆ ER_PROVIDER_PRIORITY

#define ER_PROVIDER_PRIORITY   50

Priority given to EVR's timestamp/event provider.

Definition at line 131 of file mrfCommon.h.

◆ EVENT_CLOCK_DEFAULT

#define EVENT_CLOCK_DEFAULT   0.00 /* Defaults to cntrl word value or 125.0 */

Definition at line 170 of file mrfCommon.h.

◆ isfinite

#define isfinite   finite

Definition at line 326 of file mrfCommon.h.

◆ M_stdlib

#define M_stdlib   (527 <<16) /*EPICS Standard library*/

Definition at line 373 of file mrfCommon.h.

◆ MRF_BUS_COMPACT_PCI

#define MRF_BUS_COMPACT_PCI   0 /* 0 = Compact PCI (3U) */

Definition at line 137 of file mrfCommon.h.

◆ MRF_BUS_PMC

#define MRF_BUS_PMC   1 /* 1 = PMC */

Definition at line 138 of file mrfCommon.h.

◆ MRF_BUS_VME

#define MRF_BUS_VME   2 /* 2 = VME 64x */

Definition at line 139 of file mrfCommon.h.

◆ MRF_CARD_TYPE_EVG

#define MRF_CARD_TYPE_EVG   2 /* 2 = Event Generator */

Definition at line 147 of file mrfCommon.h.

◆ MRF_CARD_TYPE_EVR

#define MRF_CARD_TYPE_EVR   1 /* 1 = Event Receiver */

Definition at line 146 of file mrfCommon.h.

◆ MRF_DEF_CLOCK_SPEED

#define MRF_DEF_CLOCK_SPEED   125.0 /* Default event clock speed is 125 MHz. */

Definition at line 100 of file mrfCommon.h.

◆ MRF_DESCRIPTION_SIZE

#define MRF_DESCRIPTION_SIZE   80 /* Size of description text string (inclucing NULL)*/

Definition at line 103 of file mrfCommon.h.

◆ MRF_EVENT_END_OF_SEQUENCE

#define MRF_EVENT_END_OF_SEQUENCE   0x7F

Definition at line 126 of file mrfCommon.h.

◆ MRF_EVENT_FIFO_SIZE

#define MRF_EVENT_FIFO_SIZE   512 /* Size of EVR/EVG event FIFO */

Definition at line 97 of file mrfCommon.h.

◆ MRF_EVENT_HEARTBEAT

#define MRF_EVENT_HEARTBEAT   0x7A

Definition at line 116 of file mrfCommon.h.

◆ MRF_EVENT_NULL

#define MRF_EVENT_NULL   0x00

Definition at line 109 of file mrfCommon.h.

◆ MRF_EVENT_RST_PRESCALERS

#define MRF_EVENT_RST_PRESCALERS   0x7B

Definition at line 118 of file mrfCommon.h.

◆ MRF_EVENT_TS_COUNTER_INC

#define MRF_EVENT_TS_COUNTER_INC   0x7C

Definition at line 120 of file mrfCommon.h.

◆ MRF_EVENT_TS_COUNTER_RST

#define MRF_EVENT_TS_COUNTER_RST   0x7D

Definition at line 124 of file mrfCommon.h.

◆ MRF_EVENT_TS_SHIFT_0

#define MRF_EVENT_TS_SHIFT_0   0x70

Definition at line 113 of file mrfCommon.h.

◆ MRF_EVENT_TS_SHIFT_1

#define MRF_EVENT_TS_SHIFT_1   0x71

Definition at line 114 of file mrfCommon.h.

◆ MRF_FRAC_SYNTH_REF

#define MRF_FRAC_SYNTH_REF   24.0 /* Fractional Synth reference frequency (MHz). */

Definition at line 99 of file mrfCommon.h.

◆ MRF_MAX_DATA_BUFFER

#define MRF_MAX_DATA_BUFFER   2048 /* Maximum size of the distributed data buffer */

Definition at line 98 of file mrfCommon.h.

◆ MRF_NUM_EVENTS

#define MRF_NUM_EVENTS   256 /* Number of possible events */

Definition at line 96 of file mrfCommon.h.

◆ MRF_SERIES_200

#define MRF_SERIES_200   0x000000C8 /* Series 200 Code (in Hex) */

Definition at line 154 of file mrfCommon.h.

◆ MRF_SERIES_220

#define MRF_SERIES_220   0x000000DC /* Series 220 Code (in Hex) */

Definition at line 155 of file mrfCommon.h.

◆ MRF_SERIES_230

#define MRF_SERIES_230   0x000000E6 /* Series 230 Code (in Hex) */

Definition at line 156 of file mrfCommon.h.

◆ MRF_SN_BYTES

#define MRF_SN_BYTES   6 /* Number of bytes in serial number */

Definition at line 101 of file mrfCommon.h.

◆ MRF_SN_STRING_SIZE

#define MRF_SN_STRING_SIZE   18 /* Size of serial number string (including NULL) */

Definition at line 102 of file mrfCommon.h.

◆ S_stdlib_badBase

#define S_stdlib_badBase   (M_stdlib | 5) /* Number base not supported */

Definition at line 379 of file mrfCommon.h.

◆ S_stdlib_extraneous

#define S_stdlib_extraneous   (M_stdlib | 2) /* Extraneous characters */

Definition at line 376 of file mrfCommon.h.

◆ S_stdlib_noConversion

#define S_stdlib_noConversion   (M_stdlib | 1) /* No digits to convert */

Definition at line 375 of file mrfCommon.h.

◆ S_stdlib_overflow

#define S_stdlib_overflow   (M_stdlib | 4) /* Too large to represent */

Definition at line 378 of file mrfCommon.h.

◆ S_stdlib_underflow

#define S_stdlib_underflow   (M_stdlib | 3) /* Too small to represent */

Definition at line 377 of file mrfCommon.h.

◆ VERSION_INT

#define VERSION_INT (   V,
  R,
  M,
 
)    ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))

Definition at line 317 of file mrfCommon.h.

Typedef Documentation

◆ epicsInt64

typedef long long epicsInt64

Definition at line 367 of file mrfCommon.h.

◆ epicsUInt64

typedef unsigned long long epicsUInt64

Definition at line 368 of file mrfCommon.h.

Function Documentation

◆ epicsParseUInt32()

epicsShareFunc int epicsParseUInt32 ( const char *  str,
epicsUInt32 *  to,
int  base,
char **  units 
)

Definition at line 113 of file mrfCommon.cpp.

114 {
115  unsigned long value;
116  int status = epicsParseULong(str, &value, base, units);
117 
118  if (status)
119  return status;
120 
121 #if (ULONG_MAX > 0xffffffffULL)
122  if (value > 0xffffffffUL && value <= ~0xffffffffUL)
123  return S_stdlib_overflow;
124 #endif
125 
126  *to = (epicsUInt32) value;
127  return 0;
128 }
#define S_stdlib_overflow
Definition: mrfCommon.h:378