/****************************************************************************** * * Title : hostUtility.h * Version 0.0, 6 July 2000, * * Description: Host supporting routines and macros - checksum, * read/write to communication registers. *. Related files: hostUtility.c * Author: Lukas Tomasek, tomasekl@fzu.cz * ******************************************************************************/ #ifndef HOST_UTILITY_H /* multiple-inclusion protection */ #define HOST_UTILITY_H /****************************************************************************** * Header files * ******************************************************************************/ #include "hostDefinitions.h" #include "vmeAddressMap.h" #include "globalDefinitions.h" #include "commandListExecution.h" #ifdef LAB_WINDOWS_CVI #include #endif /* LAB_WINDOVS_CVI */ /****************************************************************************** * Definitions * ******************************************************************************/ /****************************************************************************** * Macros * ******************************************************************************/ #define SET_BIT(variable, bitNumber) ((variable)|=(1<<(bitNumber))) #define CLEAR_BIT(variable, bitNumber) ((variable)&=(~(1<<(bitNumber)))) #define READ_BIT(variable, bitNumber) (((variable)>>(bitNumber)) & 1) #define DEBUG_MODE_CFG_REG_ADDR 0x00404470 #define DEBUG_MODE_STAT_REG_ADDR 0x00404474 /****************************************************************************** * Global Function Declarations * ******************************************************************************/ UINT32 checkSum(UINT32 *sourceAddress, UINT32 wordCount); ERROR_ID setVmeCommandRegBit(UINT8 slotNumber, UINT32 *vmeCommandReg, unsigned int bitNumber); ERROR_ID clearVmeCommandRegBit(UINT8 slotNumber, UINT32 *vmeCommandReg, unsigned int bitNumber); ERROR_ID readRodStatusRegs(UINT8 slotNumber, UINT32 rodStatusRegs[NUMBER_OF_ROD_STAT_REGS]); ERROR_ID executePrimList(struct HOST *host, struct LIST_TABLE *newPrimList, unsigned int repetitions, int repeatBuildNotExec, int insideCmdList); ERROR_ID executePrimListFile(unsigned char slotNumber, char primListFile[PATHNAME_LENGTH], unsigned int repetitions, int repeatBuildNotExec, int insideCmdList); ERROR_ID executeCommandList(struct HOST *host, struct COMMAND_LIST *newCommandList, unsigned int repetitions, CMDLIST_ERROR_OPTION ifError); ERROR_ID executeCommandListFile(unsigned char slotNumber, char cListFile[PATHNAME_LENGTH], unsigned int repetitions, CMDLIST_ERROR_OPTION ifError); ERROR_ID executeTimCommandList(struct COMMAND_LIST *commandList); ERROR_ID stopCommunicationLoop(struct GLOBAL_VARIABLES *global); ERROR_ID resumeCommunicationLoop(struct GLOBAL_VARIABLES *global); ERROR_ID resetRod(struct HOST *host); ERROR_ID slaveOnOff(struct HOST *host, UINT8 slaveNumber, int on); ERROR_ID FEoccupancy(struct HOST *host); ERROR_ID dmaAccessSwitch(UINT8 slotNumber, int on, double timeoutInSeconds); /******************************************************************************/ #endif /* HOST_UTILITY_H */