#ifndef DRV_RCVR_UDP_H #define DRV_RCVR_UDP_H #ifdef __cplusplus extern "C" { #endif #include #define RCVR_MSG_VERS 1 #define RCVR_MSG_DATA_MAX 550 #define RCVR_TIMEOUT 1 int rcvrUdpInit(const void *name, unsigned instance, uint16_t *fw_vers, int pass, void *rcvr); typedef struct RcvrMsg_ { uint8_t vers; /* Message Version number */ uint8_t id; /* BPM ID number (unused?) */ uint8_t type; /* Message type */ uint8_t task; /* Task ID, used in bookkeeping */ uint16_t addr; /* Starting address of write/read (usually 0) */ uint16_t cnt; /* Word (16-bit) count */ uint8_t data[RCVR_MSG_DATA_MAX]; } RcvrMsg; /* Message types */ #define RCVR_MSG_BPM_READ 0x41 #define RCVR_MSG_BPM_WRITE 0x01 #define RCVR_MSG_PLL_READ 0x42 #define RCVR_MSG_PLL_WRITE 0x02 #define RCVR_MSG_FPGA_READ 0x63 #define RCVR_MSG_SYS_READ 0x64 #define RCVR_MSG_FOT_READ 0x65 #define RCVR_MSG_PLL_MON_READ 0x66 #define RCVR_MSG_HEADER_LENGTH 8 #define RCVR_REG_PLL_ENCODE(x) (x<<24) #define PLL_REG_DATA(x) (x & 0xFFFFFF) #ifdef __cplusplus } #endif #endif