/* CAMAC.h */ /*! @file CAMAC.h @brief CAMAC layer, designed for the DSP Technology 6001 & 6002 CAMAC Create Controller. I realize that this is not a 'CAMAC' layer but a crate controller layer, sorry. -Julian MANUAL: CAMAC_C_Source/docs/MTS_DSP_Technology_6001_6002_Manual.pdf */ /* History: 07/20/2022: Julian Zelazny Started CAMAC.h, added all the typedefs that outside software will need */ #ifndef _CAMAC_H #define _CAMAC_H #ifdef __cplusplus extern "C" { #endif #include #include /*============================================================================*/ /*! @enum CAMACFunction_t the 12 functions available to this Crate Controller, please look at the PDF for the bitmask these give back on the data bus */ typedef enum { /// bits 16-23 WRITE_HIGH, /// bits 8-15 WRITE_MID, /// bits 0-7 WRITE_LOW, ///sub address 0 - 15 A_ADDRESS, ///Function code 0 - 31 F_COMMAND, ///Station Number 1 - 23 N_STATION, ///INITIALIZE, CLEAR, INHIBIT signals ZCI_BITS, ///starts camac cycle CAMAC_CYCLE, ///Look-At-Me, X, Q LAM_X_Q, /// bits 16-23 READ_HIGH, /// bits 8-15 READ_MED, /// bits 0-7 READ_LOW, ///Read PDF, controller 'online', camac cycle finish STATUS }CAMACFunction_t; /*============================================================================*/ /*! @brief PLEASE CALL THIS BEFORE USING ANY CAMAC FUNCTIONS @return true if crate controller has done handshake, false if we could not. */ bool camacInit(void); /*! @brief read a register from the crate controller @param result location to store the results in, can be NULL. @param command the command to send to the crate controller @return true if the command is executed with no errors, false otherwise */ bool readCamacRegister(uint8_t* result, CAMACFunction_t command); /*! @brief write a command to the crate controller @param data the data we want to send over the 8-bit bus @param command the command to send to the crate controller */ void writeCamacRegister(uint8_t data, CAMACFunction_t command); /*============================================================================*/ #ifdef __cplusplus } #endif #endif //_CAMAC_H