Skip to content

Commit

Permalink
mbz interface compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
carrarin@FNAL.GOV authored and carrarin@FNAL.GOV on mu2ecalo@mu2edaq07.fnal.gov committed Jul 3, 2024
1 parent 434b17b commit 5be8987
Show file tree
Hide file tree
Showing 14 changed files with 190 additions and 1,602 deletions.
569 changes: 0 additions & 569 deletions otsdaq-mu2e-calorimeter/FEInterfaces/API_I2C.c

This file was deleted.

121 changes: 0 additions & 121 deletions otsdaq-mu2e-calorimeter/FEInterfaces/API_I2C.h

This file was deleted.

31 changes: 0 additions & 31 deletions otsdaq-mu2e-calorimeter/FEInterfaces/APP_config_define.h

This file was deleted.

10 changes: 10 additions & 0 deletions otsdaq-mu2e-calorimeter/FEInterfaces/MZB.C
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,13 @@ unsigned ees_chksum(void *ptr, int len) {
return sum;
}

MZB_OSCMDCODE_t mz_string_to_enum(const char* str){
for (int i = 0; i < sizeof(code_map) / sizeof(code_map[0]); i++) {
if (code_map[i].str == str) {
return code_map[i].code;
}
}

return SYNTAX_ERROR;

}
81 changes: 81 additions & 0 deletions otsdaq-mu2e-calorimeter/FEInterfaces/MZB.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,86 @@
} MZB_OSCMDCODE_t;


typedef struct {
MZB_OSCMDCODE_t code;
const char* str;
} MZB_OSCMDCODE_MAP_t;


MZB_OSCMDCODE_MAP_t code_map[] = {
{SYNTAX_ERROR, "SYNTAX_ERROR"},
{ADCONVERT, "ADCONVERT"},
{ADCFG, "ADCFG"},
{ADINIT, "ADINIT"},
{ADSTS, "ADSTS"},
{APPCONFIG, "APPCONFIG"},
{AUTOCALIBRATE, "AUTOCALIBRATE"},
{AUTOCONFIGURE, "AUTOCONFIGURE"},
{AUTOSTART, "AUTOSTART"},
{AUTOWDG, "AUTOWDG"},
{BUSYSRC, "BUSYSRC"},
{BUSYTMO, "BUSYTMO"},
{CALADCP1P2, "CALADCP1P2"},
{CALLPCP1P2, "CALLPCP1P2"},
{CALDACP1P2, "CALDACP1P2"},
{CALCARD, "CALCARD"},
{CALDATA, "CALDATA"},
{CALSOURCE, "CALSOURCE"},
{CALTEMP, "CALTEMP"},
{CARDSTS, "CARDSTS"},
{COMBPS, "COMBPS"},
{DACSET, "DACSET"},
{DACSTS, "DACSTS"},
{DEBUGMODE, "DEBUGMODE"},
{DELTAT_ms, "DELTAT_ms"},
{EMACENABLE, "EMACENABLE"},
{EMACINIT, "EMACINIT"},
{EMACSTS, "EMACSTS"},
{EMACWRITE, "EMACWRITE"},
{ERRORS, "ERRORS"},
{ERRSTS, "ERRSTS"},
{FRFLAG, "FRFLAG"},
{GAIN, "GAIN"},
{GPINPUT, "GPINPUT"},
{GPOUTPUT, "GPOUTPUT"},
{HELLO, "HELLO"},
{HELP, "HELP"},
{HVOO_AUTOSET, "HVOO_AUTOSET"},
{HVONOFF, "HVONOFF"},
{I2CRESET, "I2CRESET"},
{I2CSTS, "I2CSTS"},
{I2CENUMERATE, "I2CENUMERATE"},
{IP4ADR, "IP4ADR"},
{IRQ, "IRQ"},
{IRQENABLE, "IRQENABLE"},
{MSGLEVEL, "MSGLEVEL"},
{MPXREG, "MPXREG"},
{MZBDUMP, "MZBDUMP"},
{LOGIN, "LOGIN"},
{LOGOUT, "LOGOUT"},
{PROCESSES, "PROCESSES"},
{POST, "POST"},
{RESTART, "RESTART"},
{RESTORE, "RESTORE"},
{RIT, "RIT"},
{ROOT, "ROOT"},
{SBLACTIVATE, "SBLACTIVATE"},
{SEU, "SEU"},
{SHOW_TRANSIENT, "SHOW_TRANSIENT"},
{SKIPERROR, "SKIPERROR"},
{SILENT, "SILENT"},
{SLEWRATE, "SLEWRATE"},
{STATUS_REG, "STATUS_REG"},
{TEST, "TEST"},
{UPDATE, "UPDATE"},
{VERSION, "VERSION"},
{HWWDG, "HWWDG"},
{SWWDG, "SWWDG"},
{DIRACWDG, "DIRACWDG"},
{DIRACRST, "DIRACRST"},
{WATCHDOG, "WATCHDOG"},
{RESERVED, "RESERVED"}
};


#ifdef GNU_COMP
Expand Down Expand Up @@ -263,5 +343,6 @@

uint8_t* MZB_Encode_CMD_Command_raw(MZB_OSCMDCODE_t cmdCode, float* params);
unsigned ees_chksum(void *ptr, int len);
MZB_OSCMDCODE_t mz_string_to_enum(const char* str);

#endif

This file was deleted.

28 changes: 0 additions & 28 deletions otsdaq-mu2e-calorimeter/FEInterfaces/MZB_common_ees_checksum.c

This file was deleted.

Loading

0 comments on commit 5be8987

Please sign in to comment.