Changeset 10924


Ignore:
Timestamp:
06/07/11 22:19:53 (13 years ago)
Author:
tbretz
Message:
Some small updates; added possibility for compilation under C and C++
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/HeadersFAD.h

    r10832 r10924  
    22#define FACT_HeadersFAD
    33
     4#ifdef __cplusplus
    45#include <ostream>
    56
     
    1314namespace FAD
    1415{
     16#endif
    1517    enum Enable
    1618    {
     
    3133    enum Commands
    3234    {
    33         kCmdWrite           = 0x0500,         // write to Config-RAM
    34         kCmdWriteRoi        = kCmdWrite|0x00, // Baseaddress ROI-Values
    35         kCmdWriteDac        = kCmdWrite|0x24, // Baseaddress DAC-Values
    36 
    37         kCmdWriteRate       = kCmdWrite|0x2c, // Continous trigger rate
    38         kCmdWriteRunNumber  = kCmdWrite|0x2d, //
     35        kCmdWrite             = 0x0500,         // write to Config-RAM
     36        kCmdWriteRoi          = kCmdWrite|0x00, // Baseaddress ROI-Values
     37        kCmdWriteDac          = kCmdWrite|0x24, // Baseaddress DAC-Values
     38
     39        kCmdWriteRate         = kCmdWrite|0x2c, // Continous trigger rate
     40        kCmdWriteRunNumberMSW = kCmdWrite|0x2d, // Run Number most  significant word
     41        kCmdWriteRunNumberLSW = kCmdWrite|0x2e, // Run Number least significant word
    3942
    4043        /*
     
    7174    enum
    7275    {
    73         kMaxRegAddr  = 0xff,    // Highest address in config-ram
    74         kMaxRegValue = 0xffff,
    75         kMaxDacAddr  = kNumDac-1,
    76         kMaxDacValue = 0xffff,
    77         kMaxRoiAddr  = kNumChannels-1,
    78         kMaxRoiValue = kMaxBins,
     76        kMaxRegAddr   = 0xff,    // Highest address in config-ram
     77        kMaxRegValue  = 0xffff,
     78        kMaxDacAddr   = kNumDac-1,
     79        kMaxDacValue  = 0xffff,
     80        kMaxRoiAddr   = kNumChannels-1,
     81        kMaxRoiValue  = kMaxBins,
     82        kMaxRunNumber = 0xffffffff,
    7983    };
    8084
     
    8993    struct EventHeader
    9094    {
     95#ifdef __cplusplus
    9196        enum Bits
    9297        {
     
    99104            kSpiSclk       = 1<< 5,
    100105        };
    101 
     106#endif
    102107        // Einmalig:     (new header changes entry in array --> send only if array changed)
    103108        // ----------------------------------
     
    173178        uint16_t fDac[kNumDac];
    174179        //
    175 
     180#ifdef __cplusplus
    176181        EventHeader() { init(*this); }
    177182
     
    260265        void clear() { reset(*this); }
    261266        void print(std::ostream &out) const;
     267#endif
    262268
    263269    } __attribute__((__packed__));
     
    271277        // uint16_t fData[];
    272278
     279#ifdef __cplusplus
    273280        ChannelHeader() { init(*this); }
    274281
     
    289296        uint16_t Chip() const    { return fId>>4; }
    290297        uint16_t Channel() const { return fId&0xf; }
    291 
     298#endif
    292299    } __attribute__((__packed__));
    293300
     
    386393*/
    387394    // --------------------------------------------------------------------
    388 
     395#ifdef __cplusplus
    389396    inline std::ostream &operator<<(std::ostream &out, const EventHeader &h)
    390397    {
     
    398405        return out;
    399406    }
     407#endif
     408
     409#ifdef __cplusplus
    400410};
    401 
    402 #endif
     411#endif
     412
     413#endif
Note: See TracChangeset for help on using the changeset viewer.