Macros

From MidasWiki
(Redirected from Byte Swap Macros)
Jump to navigation Jump to search


Introduction

The following MACROS have been provided in the MIDAS package.

Byte Swap Macros

Thes macros are provided for big/little endian byte-swapping

  • WORD_SWAP
  • DWORD_SWAP
  • QWORD_SWAP

These macros are used by bk_swap();

CAMAC Macros

Midas provides Macros for CAMAC LAM manipulation which may be used in the Frontend user code or analyzer code. These Macros are used to interact with the LAM register. Usually the CAMAC Crate Controller has the feature that it is able to register one bit per slot and present this register to the user. It may even have the option to mask off this register to allow to set a "general" LAM register containing either "1" (At least one LAM from the masked LAM is set) or "0" ( no LAM set from the masked LAM register). The poll_event() routine uses this feature to return a variable which contains a bit-wise value of the current LAM register in the Crate Controller.

  • LAM_SOURCE
  • LAM_STATION
  • LAM_SOURCE_CRATE
  • LAM_SOURCE_STATION

Event Header Macros

  • TRIGGER_MASK
  • EVENT_ID
  • SERIAL_NUMBER
  • TIME_STAMP
  • DATA_SIZE

See MIDAS Event Header Macros.