Commit 9760e41a authored by Lucas Russo's avatar Lucas Russo

Merge branch 'trig-rcv' into devel

parents d174d495 4ad50aa6
This diff is collapsed.
......@@ -97,6 +97,21 @@
#define WB_AFC_DIAG_CTRL_RAW_REGS (WB_AFC_DIAG_RAW_ADDR + \
WB_AFC_DIAG_CTRL_RAW_REGS_OFFS)
#define WB_TRIGGER_IFACE_RAW_ADDR 0x00390000
#define WB_TRIGGER_IFACE_RAW_CTRL_REGS (WB_TRIGGER_IFACE_RAW_ADDR + \
WB_TRIGGER_IFACE_RAW_REG_OFFS)
#define WB_TRIGGER_MUX1_RAW_ADDR 0x00400000
#define WB_TRIGGER_MUX1_RAW_CTRL_REGS (WB_TRIGGER_MUX1_RAW_ADDR + \
WB_TRIGGER_MUX_RAW_REG_OFFS)
#define WB_TRIGGER_MUX2_RAW_ADDR 0x00410000
#define WB_TRIGGER_MUX2_RAW_CTRL_REGS (WB_TRIGGER_MUX2_RAW_ADDR + \
WB_TRIGGER_MUX_RAW_REG_OFFS)
/* Large Memory RAW Addresses. It lives at address 0 */
#define LARGE_MEM_RAW_ADDR 0x00000000
......@@ -176,6 +191,18 @@
#define WB_AFC_DIAG_CTRL_REGS (BAR4_ADDR | WB_AFC_DIAG_CTRL_RAW_REGS)
#define WB_TRIGGER_IFACE_BASE_ADDR (BAR4_ADDR | WB_TRIGGER_IFACE_RAW_ADDR)
#define WB_TRIGGER_IFACE_CTRL_REGS (BAR4_ADDR | WB_TRIGGER_IFACE_RAW_CTRL_REGS)
#define WB_TRIGGER_MUX1_BASE_ADDR (BAR4_ADDR | WB_TRIGGER_MUX1_RAW_ADDR)
#define WB_TRIGGER_MUX1_CTRL_REGS (BAR4_ADDR | WB_TRIGGER_MUX1_RAW_CTRL_REGS)
#define WB_TRIGGER_MUX2_BASE_ADDR (BAR4_ADDR | WB_TRIGGER_MUX2_RAW_ADDR)
#define WB_TRIGGER_MUX2_CTRL_REGS (BAR4_ADDR | WB_TRIGGER_MUX2_RAW_CTRL_REGS)
/************************* AFCv3 Gateware Options *************************/
/********************* FMC130M_4CH SMIO Gateware Options ******************/
......
......@@ -97,6 +97,22 @@
#define WB_AFC_DIAG_CTRL_RAW_REGS (WB_AFC_DIAG_RAW_ADDR + \
WB_AFC_DIAG_CTRL_RAW_REGS_OFFS)
#define WB_TRIGGER_IFACE_RAW_ADDR 0x00390000
#define WB_TRIGGER_IFACE_RAW_CTRL_REGS (WB_TRIGGER_IFACE_RAW_ADDR + \
WB_TRIGGER_IFACE_RAW_REG_OFFS)
#define WB_TRIGGER_MUX1_RAW_ADDR 0x00400000
#define WB_TRIGGER_MUX1_RAW_CTRL_REGS (WB_TRIGGER_MUX1_RAW_ADDR + \
WB_TRIGGER_MUX_RAW_REG_OFFS)
#define WB_TRIGGER_MUX2_RAW_ADDR 0x00410000
#define WB_TRIGGER_MUX2_RAW_CTRL_REGS (WB_TRIGGER_MUX2_RAW_ADDR + \
WB_TRIGGER_MUX_RAW_REG_OFFS)
/* Large Memory RAW Addresses. It lives at address 0 */
#define LARGE_MEM_RAW_ADDR 0x00000000
......@@ -176,6 +192,18 @@
#define WB_AFC_DIAG_CTRL_REGS (BAR4_ADDR | WB_AFC_DIAG_CTRL_RAW_REGS)
#define WB_TRIGGER_IFACE_BASE_ADDR (BAR4_ADDR | WB_TRIGGER_IFACE_RAW_ADDR)
#define WB_TRIGGER_IFACE_CTRL_REGS (BAR4_ADDR | WB_TRIGGER_IFACE_RAW_CTRL_REGS)
#define WB_TRIGGER_MUX1_BASE_ADDR (BAR4_ADDR | WB_TRIGGER_MUX1_RAW_ADDR)
#define WB_TRIGGER_MUX1_CTRL_REGS (BAR4_ADDR | WB_TRIGGER_MUX1_RAW_CTRL_REGS)
#define WB_TRIGGER_MUX2_BASE_ADDR (BAR4_ADDR | WB_TRIGGER_MUX2_RAW_ADDR)
#define WB_TRIGGER_MUX2_CTRL_REGS (BAR4_ADDR | WB_TRIGGER_MUX2_RAW_CTRL_REGS)
/************************* AFCv3 Gateware Options *************************/
/********************* FMC130M_4CH SMIO Gateware Options ******************/
......
This diff is collapsed.
This diff is collapsed.
......@@ -37,6 +37,12 @@ extern "C" {
/* ACQ Components */
#define WB_ACQ_CORE_CTRL_RAW_REGS_OFFS 0x0000
/* Trigger Interface Components */
#define WB_TRIGGER_IFACE_RAW_REG_OFFS 0x0000
/* Trigger Mux Components */
#define WB_TRIGGER_MUX_RAW_REG_OFFS 0x0000
/* Large Memory RAW Addresses. It lives at address 0 */
#define LARGE_MEM_RAW_ADDR 0x00000000
......
......@@ -227,6 +227,59 @@ typedef int (*rw_param_format_fp) (uint32_t *param);
max, chk_funcp, fmt_funcp, clr_field, smio_thsafe_client_read_32, \
smio_thsafe_client_write_32)
/* zmq message in SET_GET_PARAM_CHANNEL macro is:
* frame 0: operation code
* frame 1: rw R /W 1 = read mode, 0 = write mode
* frame 2: channel (0 to num_channels -1)
* frame 3: value to be written (rw = 0) or dummy value (rw = 1)
* */
#define SET_GET_PARAM_CHANNEL_GEN(module, base_addr, prefix, reg, field, \
chan_offset, chan_num, single_bit, min, max, chk_funcp, fmt_funcp, clr_field, \
read_32_fp, write_32_fp) \
do { \
assert (owner); \
assert (args); \
DBE_DEBUG (DBG_SM_IO | DBG_LVL_TRACE, "[sm_io:rw_param:"#module"] " \
"Calling SET_GET_PARAM_"#reg"\n"); \
SMIO_OWNER_TYPE *self = SMIO_EXP_OWNER(owner); \
uint32_t rw = *(uint32_t *) EXP_MSG_ZMQ_FIRST_ARG(args); \
uint32_t chan = *(uint32_t *) EXP_MSG_ZMQ_NEXT_ARG(args); \
uint32_t value = *(uint32_t *) EXP_MSG_ZMQ_NEXT_ARG(args); \
DBE_DEBUG (DBG_SM_IO | DBG_LVL_TRACE, "[sm_io:rw_param:"#module"] " \
"SET_GET_PARAM_CHANNEL_"#reg": rw = %u, chan = %u\n", rw, chan); \
RW_REPLY_TYPE set_param_return; \
\
if (chan > chan_num-1) { \
return -RW_INV; \
} \
if (rw) { \
set_param_return = GET_PARAM_GEN(self, module, \
(base_addr + (chan*chan_offset)), \
prefix, reg, field, single_bit, value, fmt_funcp, read_32_fp); \
if (set_param_return != RW_OK) { \
return -set_param_return; \
} \
else { \
*(uint32_t *) ret = value; \
return sizeof(value); \
} \
} \
else { \
set_param_return = SET_PARAM_GEN(self, module, \
(base_addr + (chan*chan_offset)), \
prefix, reg, field, single_bit, value, min, max, chk_funcp, \
clr_field, read_32_fp, write_32_fp); \
return -set_param_return; \
} \
} while (0)
#define SET_GET_PARAM_CHANNEL(module, base_addr, prefix, reg, field, chan_offset, \
chan_num, single_bit, min, max, chk_funcp, fmt_funcp, clr_field) \
SET_GET_PARAM_CHANNEL_GEN(module, base_addr, prefix, reg, field, \
chan_offset, chan_num, single_bit, min, max, chk_funcp, \
fmt_funcp, clr_field, smio_thsafe_client_read_32, \
smio_thsafe_client_write_32)
uint32_t check_param_limits (uint32_t value, uint32_t min, uint32_t max);
#endif
......
......@@ -884,6 +884,8 @@ static devio_err_e _spawn_be_platform_smios (void *pipe, zhashx_t *hints, uint32
/* AFCv3 spefific */
#if defined (__BOARD_AFCV3__)
uint32_t afc_diag_id = 0x51954750;
uint32_t trigger_iface_id = 0xbcbb78d2;
uint32_t trigger_mux_id = 0x84b6a5ac;
DBE_DEBUG (DBG_DEV_IO | DBG_LVL_INFO, "[ebpm] Spawning AFCv3 specific SMIOs ...\n");
......@@ -928,6 +930,21 @@ static devio_err_e _spawn_be_platform_smios (void *pipe, zhashx_t *hints, uint32
if (err != DEVIO_SUCCESS) {
DBE_DEBUG (DBG_DEV_IO | DBG_LVL_FATAL, "[ebpm] devio_register_sm error!\n");
}
err = devio_register_sm (pipe, trigger_iface_id, WB_TRIGGER_IFACE_BASE_ADDR, 0);
if (err != DEVIO_SUCCESS) {
DBE_DEBUG (DBG_DEV_IO | DBG_LVL_FATAL, "[ebpm] devio_register_sm error!\n");
}
err = devio_register_sm (pipe, trigger_mux_id, WB_TRIGGER_MUX1_BASE_ADDR, 0);
if (err != DEVIO_SUCCESS) {
DBE_DEBUG (DBG_DEV_IO | DBG_LVL_FATAL, "[ebpm] devio_register_sm error!\n");
}
err = devio_register_sm (pipe, trigger_mux_id, WB_TRIGGER_MUX2_BASE_ADDR, 1);
if (err != DEVIO_SUCCESS) {
DBE_DEBUG (DBG_DEV_IO | DBG_LVL_FATAL, "[ebpm] devio_register_sm error!\n");
}
#endif
#else
#error "BE FPGA Board not supported!"
......
......@@ -104,7 +104,9 @@ OBJS_EXTERNAL = ../../sm_io/modules/sm_io_codes.o \
../../sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_exports.o \
../../sm_io/modules/swap/sm_io_swap_exports.o \
../../sm_io/modules/rffe/sm_io_rffe_exports.o \
../../sm_io/modules/afc_diag/sm_io_afc_diag_exports.o
../../sm_io/modules/afc_diag/sm_io_afc_diag_exports.o \
../../sm_io/modules/trigger_iface/sm_io_trigger_iface_exports.o \
../../sm_io/modules/trigger_mux/sm_io_trigger_mux_exports.o
# Project boards
boards_INCLUDE_DIRS = -I../../../include/boards/$(BOARD)
......@@ -123,6 +125,8 @@ INCLUDE_DIRS = -I. -Iinclude \
-I../../sm_io/modules/dsp \
-I../../sm_io/modules/rffe \
-I../../sm_io/modules/afc_diag \
-I../../sm_io/modules/trigger_iface \
-I../../sm_io/modules/trigger_mux \
-I${PREFIX}/include
# Merge all flags. We expect tghese variables to be appended to the possible
......@@ -156,6 +160,8 @@ $(LIBNAME)_SMIO_CODES = ../../sm_io/modules/fmc130m_4ch/sm_io_fmc130m_4ch_codes.
../../sm_io/modules/swap/sm_io_swap_codes.h \
../../sm_io/modules/rffe/sm_io_rffe_codes.h \
../../sm_io/modules/afc_diag/sm_io_afc_diag_codes.h \
../../sm_io/modules/trigger_iface/sm_io_trigger_iface_codes.h \
../../sm_io/modules/trigger_mux/sm_io_trigger_mux_codes.h \
../../sm_io/modules/sm_io_codes.h
$(LIBNAME)_SMIO_EXPORTS = ../../sm_io/modules/fmc130m_4ch/sm_io_fmc130m_4ch_exports.h \
......@@ -166,7 +172,9 @@ $(LIBNAME)_SMIO_EXPORTS = ../../sm_io/modules/fmc130m_4ch/sm_io_fmc130m_4ch_expo
../../sm_io/modules/dsp/sm_io_dsp_exports.h \
../../sm_io/modules/swap/sm_io_swap_exports.h \
../../sm_io/modules/rffe/sm_io_rffe_exports.h \
../../sm_io/modules/afc_diag/sm_io_afc_diag_exports.h
../../sm_io/modules/afc_diag/sm_io_afc_diag_exports.h \
../../sm_io/modules/trigger_iface/sm_io_trigger_iface_exports.h \
../../sm_io/modules/trigger_mux/sm_io_trigger_mux_exports.h
# Copy specific acq_chan.h defintions according to the BOARD MACRO
$(LIBNAME)_ACQ_HEADERS_BASENAME = acq_chan
......
......@@ -912,6 +912,115 @@ bpm_client_err_e bpm_get_afc_diag_build_user_name (bpm_client_t *self, char *ser
bpm_client_err_e bpm_get_afc_diag_build_user_email (bpm_client_t *self, char *service,
struct _smio_afc_diag_revision_data_t *revision_data);
/****************************** Trigger Functions ****************************/
/* Trigger Direction functions */
/* These set of functions write (set) or read (get) the trigger direction of
* a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_dir (bpm_client_t *self, char *service,
uint32_t chan, uint32_t dir);
bpm_client_err_e bpm_get_trigger_dir (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *dir);
/* Trigger Direction Polarity functions */
/* These set of functions write (set) or read (get) the trigger direction
* polarity of a specified channel "chan". When set to 0, the output
* direction signal is kept the same as the FPGA internal. When set to
* 1, the output direction signal is reversed.
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_dir_pol (bpm_client_t *self, char *service,
uint32_t chan, uint32_t dir_pol);
bpm_client_err_e bpm_get_trigger_dir_pol (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *dir_pol);
/* Trigger Receive/Transmit Counter Reset functions */
/* These set of functions write (set) or read (get) the reset of the
* receiver or transmitter trigger counters of a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_rcv_count_rst (bpm_client_t *self, char *service,
uint32_t chan, uint32_t rcv_count_rst);
bpm_client_err_e bpm_get_trigger_rcv_count_rst (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *rcv_count_rst);
bpm_client_err_e bpm_set_trigger_transm_count_rst (bpm_client_t *self, char *service,
uint32_t chan, uint32_t transm_count_rst);
bpm_client_err_e bpm_get_trigger_transm_count_rst (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *transm_count_rst);
/* Trigger Receive/Transmit Debounce/Extension length functions */
/* These set of functions write (set) or read (get) the debounce (for receiver) and
* pulse extension (for transmitter) for the triggers of a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_rcv_len (bpm_client_t *self, char *service,
uint32_t chan, uint32_t rcv_len);
bpm_client_err_e bpm_get_trigger_rcv_len (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *rcv_len);
bpm_client_err_e bpm_set_trigger_transm_len (bpm_client_t *self, char *service,
uint32_t chan, uint32_t transm_len);
bpm_client_err_e bpm_get_trigger_transm_len (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *transm_len);
/* Trigger Receive/Transmit Trigger Counter functions */
/* These set of functions write (set) or read (get) the trigger counters
* of a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_count_rcv (bpm_client_t *self, char *service,
uint32_t chan, uint32_t count_rcv);
bpm_client_err_e bpm_get_trigger_count_rcv (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *count_rcv);
bpm_client_err_e bpm_set_trigger_count_transm (bpm_client_t *self, char *service,
uint32_t chan, uint32_t count_transm);
bpm_client_err_e bpm_get_trigger_count_transm (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *count_transm);
/**************************** Trigger Mux Functions ***************************/
/* Trigger Receive Source functions */
/* These set of functions write (set) or read (get) the trigger source for the
* receiver of a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_rcv_src (bpm_client_t *self, char *service,
uint32_t chan, uint32_t rcv_src);
bpm_client_err_e bpm_get_trigger_rcv_src (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *rcv_src);
/* Trigger Receive Selection functions */
/* These set of functions write (set) or read (get) the trigger selection for the
* receiver of a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_rcv_in_sel (bpm_client_t *self, char *service,
uint32_t chan, uint32_t rcv_in_sel);
bpm_client_err_e bpm_get_trigger_rcv_in_sel (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *rcv_in_sel);
/* Trigger Transmit Source functions */
/* These set of functions write (set) or read (get) the trigger source for the
* transmitter of a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_transm_src (bpm_client_t *self, char *service,
uint32_t chan, uint32_t transm_src);
bpm_client_err_e bpm_get_trigger_transm_src (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *transm_src);
/* Trigger Transmit Selection functions */
/* These set of functions write (set) or read (get) the trigger selection for the
* transmitter of a specified channel "chan".
* All of the functions returns BPM_CLIENT_SUCCESS if the parameter was
* correctly set or error (see bpm_client_err.h for all possible errors)*/
bpm_client_err_e bpm_set_trigger_transm_out_sel (bpm_client_t *self, char *service,
uint32_t chan, uint32_t transm_out_sel);
bpm_client_err_e bpm_get_trigger_transm_out_sel (bpm_client_t *self, char *service,
uint32_t chan, uint32_t *transm_out_sel);
/****************************** Helper Functions ****************************/
/* Helper Function */
/* This function execute the given function *func in a disp_op_t
......
......@@ -56,33 +56,50 @@ extern "C" {
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_READ(reg) (bpm_client_t *self, \
char *service, uint32_t *param1, uint32_t *param2)
#define PARAM_FUNC_CLIENT_WRITE_READ(reg, param1, param_out) \
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_READ(reg) (bpm_client_t *self, \
char *service, uint32_t param1, uint32_t *param_out)
#define PARAM_FUNC_CLIENT_READ_GEN(param) \
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_READ(param) (bpm_client_t *self, \
char *service, void *param, size_t size)
/* Low-level protocol functions */
bpm_client_err_e param_client_send_gen_rw (bpm_client_t *self, char *service,
uint32_t operation, uint32_t rw, void *param, size_t size);
uint32_t operation, uint32_t rw, void *param1, size_t size1,
void *param2, size_t size2);
bpm_client_err_e param_client_recv_rw (bpm_client_t *self, char *service,
zmsg_t **report);
/* Write functions */
bpm_client_err_e param_client_write_gen (bpm_client_t *self, char *service,
uint32_t operation, uint32_t rw, void *param1, size_t size1,
void *param2, size_t size2);
bpm_client_err_e param_client_write_raw (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param1, uint32_t param2);
bpm_client_err_e param_client_write (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param);
uint32_t operation, uint32_t param1);
bpm_client_err_e param_client_write2 (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param1, uint32_t param2);
bpm_client_err_e param_client_write_double (bpm_client_t *self, char *service,
uint32_t operation, double param);
bpm_client_err_e param_client_write_gen (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param1, void *param2, size_t size);
uint32_t operation, double param1);
bpm_client_err_e param_client_write_double2 (bpm_client_t *self, char *service,
uint32_t operation, double param1, double param2);
/* Read functions */
bpm_client_err_e param_client_read_gen (bpm_client_t *self, char *service,
uint32_t operation, uint32_t rw, void *param1, size_t size1,
void *param2, size_t size2, void *param_out, size_t size_out);
bpm_client_err_e param_client_read (bpm_client_t *self, char *service,
uint32_t operation, uint32_t *param_out);
bpm_client_err_e param_client_read_gen (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param1, void *param_out, size_t size);
bpm_client_err_e param_client_write_read (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param1, uint32_t *param_out);
bpm_client_err_e param_client_read_double (bpm_client_t *self, char *service,
uint32_t operation, double *param_out);
bpm_client_err_e param_client_write_read_double (bpm_client_t *self, char *service,
uint32_t operation, double param1, double *param_out);
/* Utility functions */
zmsg_t *param_client_recv_timeout (bpm_client_t *self);
......
......@@ -1794,7 +1794,7 @@ bpm_client_err_e bpm_set_rffe_data (bpm_client_t *self, char *service,
{
uint32_t rw = WRITE_MODE;
return param_client_write_gen (self, service, RFFE_OPCODE_SET_GET_DATA,
rw, rffe_data_block, sizeof (*rffe_data_block));
rw, rffe_data_block, sizeof (*rffe_data_block), NULL, 0);
}
bpm_client_err_e bpm_get_rffe_data (bpm_client_t *self, char *service,
......@@ -1802,7 +1802,8 @@ bpm_client_err_e bpm_get_rffe_data (bpm_client_t *self, char *service,
{
uint32_t rw = READ_MODE;
return param_client_read_gen (self, service, RFFE_OPCODE_SET_GET_DATA,
rw, rffe_data_block, sizeof (*rffe_data_block));
rw, rffe_data_block, sizeof (*rffe_data_block), NULL, 0,
rffe_data_block, sizeof (*rffe_data_block));
}
/* RFFE get version */
......@@ -1811,7 +1812,8 @@ bpm_client_err_e bpm_get_rffe_version (bpm_client_t *self, char *service,
{
uint32_t rw = READ_MODE;
return param_client_read_gen (self, service, RFFE_OPCODE_SET_GET_VERSION,
rw, rffe_version, sizeof (*rffe_version));
rw, rffe_version, sizeof (*rffe_version), NULL, 0,
rffe_version, sizeof (*rffe_version));
}
/* RFFE get/set switching level */
......@@ -1861,7 +1863,8 @@ bpm_client_err_e bpm_get_afc_diag_build_revision (bpm_client_t *self, char *serv
{
uint32_t rw = READ_MODE;
return param_client_read_gen (self, service, AFC_DIAG_OPCODE_GET_BUILD_REVISION,
rw, revision_data, sizeof (*revision_data));
rw, revision_data, sizeof (*revision_data), NULL, 0,
revision_data, sizeof (*revision_data));
}
/* Build Date */
......@@ -1870,7 +1873,8 @@ bpm_client_err_e bpm_get_afc_diag_build_date (bpm_client_t *self, char *service,
{
uint32_t rw = READ_MODE;
return param_client_read_gen (self, service, AFC_DIAG_OPCODE_GET_BUILD_DATE,
rw, revision_data, sizeof (*revision_data));
rw, revision_data, sizeof (*revision_data), NULL, 0,
revision_data, sizeof (*revision_data));
}
/* Build User Name */
......@@ -1879,7 +1883,8 @@ bpm_client_err_e bpm_get_afc_diag_build_user_name (bpm_client_t *self, char *ser
{
uint32_t rw = READ_MODE;
return param_client_read_gen (self, service, AFC_DIAG_OPCODE_GET_BUILD_USER_NAME,
rw, revision_data, sizeof (*revision_data));
rw, revision_data, sizeof (*revision_data), NULL, 0,
revision_data, sizeof (*revision_data));
}
/* Build User Email */
......@@ -1888,7 +1893,168 @@ bpm_client_err_e bpm_get_afc_diag_build_user_email (bpm_client_t *self, char *se
{
uint32_t rw = READ_MODE;
return param_client_read_gen (self, service, AFC_DIAG_OPCODE_GET_BUILD_USER_EMAIL,
rw, revision_data, sizeof (*revision_data));
rw, revision_data, sizeof (*revision_data), NULL, 0,
revision_data, sizeof (*revision_data));
}
/********************** Trigger Interface Functions ********************/
/* Trigger direction */
PARAM_FUNC_CLIENT_WRITE2(trigger_dir, chan, dir)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_DIR,
chan, dir);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_dir, chan, dir)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_DIR,
chan, dir);
}
/* Trigger direction */
PARAM_FUNC_CLIENT_WRITE2(trigger_dir_pol, chan, dir_pol)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_DIR_POL,
chan, dir_pol);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_dir_pol, chan, dir_pol)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_DIR_POL,
chan, dir_pol);
}
/* Trigger receive counter reset */
PARAM_FUNC_CLIENT_WRITE2(trigger_rcv_count_rst, chan, rcv_count_rst)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_RCV_COUNT_RST,
chan, rcv_count_rst);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_rcv_count_rst, chan, rcv_count_rst)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_RCV_COUNT_RST,
chan, rcv_count_rst);
}
/* Trigger transmit counter reset */
PARAM_FUNC_CLIENT_WRITE2(trigger_transm_count_rst, chan, transm_count_rst)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_TRANSM_COUNT_RST,
chan, transm_count_rst);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_transm_count_rst, chan, transm_count_rst)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_TRANSM_COUNT_RST,
chan, transm_count_rst);
}
/* Trigger receive length debounce */
PARAM_FUNC_CLIENT_WRITE2(trigger_rcv_len, chan, rcv_len)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_RCV_LEN,
chan, rcv_len);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_rcv_len, chan, rcv_len)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_RCV_LEN,
chan, rcv_len);
}
/* Trigger transmit length debounce */
PARAM_FUNC_CLIENT_WRITE2(trigger_transm_len, chan, transm_len)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_TRANSM_LEN,
chan, transm_len);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_transm_len, chan, transm_len)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_TRANSM_LEN,
chan, transm_len);
}
/* Trigger count_receive */
PARAM_FUNC_CLIENT_WRITE2(trigger_count_rcv, chan, count_rcv)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_COUNT_RCV,
chan, count_rcv);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_count_rcv, chan, count_rcv)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_COUNT_RCV,
chan, count_rcv);
}
/* Trigger count transmit */
PARAM_FUNC_CLIENT_WRITE2(trigger_count_transm, chan, count_transm)
{
return param_client_write2 (self, service, TRIGGER_IFACE_OPCODE_COUNT_TRANSM,
chan, count_transm);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_count_transm, chan, count_transm)
{
return param_client_write_read (self, service, TRIGGER_IFACE_OPCODE_COUNT_TRANSM,
chan, count_transm);
}
/********************** Trigger Mux Functions ********************/
/* Trigger receive source */
PARAM_FUNC_CLIENT_WRITE2(trigger_rcv_src, chan, rcv_src)
{
return param_client_write2 (self, service, TRIGGER_MUX_OPCODE_RCV_SRC,
chan, rcv_src);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_rcv_src, chan, rcv_src)
{
return param_client_write_read (self, service, TRIGGER_MUX_OPCODE_RCV_SRC,
chan, rcv_src);
}
/* Trigger receive in selection */
PARAM_FUNC_CLIENT_WRITE2(trigger_rcv_in_sel, chan, rcv_in_sel)
{
return param_client_write2 (self, service, TRIGGER_MUX_OPCODE_RCV_IN_SEL,
chan, rcv_in_sel);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_rcv_in_sel, chan, rcv_in_sel)
{
return param_client_write_read (self, service, TRIGGER_MUX_OPCODE_RCV_IN_SEL,
chan, rcv_in_sel);
}
/* Trigger transmit source */
PARAM_FUNC_CLIENT_WRITE2(trigger_transm_src, chan, transm_src)
{
return param_client_write2 (self, service, TRIGGER_MUX_OPCODE_TRANSM_SRC,
chan, transm_src);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_transm_src, chan, transm_src)
{
return param_client_write_read (self, service, TRIGGER_MUX_OPCODE_TRANSM_SRC,
chan, transm_src);
}
/* Trigger transmit selection */
PARAM_FUNC_CLIENT_WRITE2(trigger_transm_out_sel, chan, transm_out_sel)
{
return param_client_write2 (self, service, TRIGGER_MUX_OPCODE_TRANSM_OUT_SEL,
chan, transm_out_sel);
}
PARAM_FUNC_CLIENT_WRITE_READ(trigger_transm_out_sel, chan, transm_out_sel)
{
return param_client_write_read (self, service, TRIGGER_MUX_OPCODE_TRANSM_OUT_SEL,
chan, transm_out_sel);
}
/**************** Helper Function ****************/
......
......@@ -35,12 +35,13 @@
bpm_client_err_str (err_type))
bpm_client_err_e param_client_send_gen_rw (bpm_client_t *self, char *service,
uint32_t operation, uint32_t rw, void *param, size_t size)
uint32_t operation, uint32_t rw, void *param1, size_t size1,
void *param2, size_t size2)
{
bpm_client_err_e err = BPM_CLIENT_SUCCESS;
ASSERT_TEST(param != NULL, "param_client_send_gen_rw (): parameter cannot be NULL",
err_param_null, BPM_CLIENT_ERR_INV_PARAM);
ASSERT_TEST(param1 != NULL, "param_client_send_gen_rw (): parameter cannot be NULL",
err_param1_null, BPM_CLIENT_ERR_INV_PARAM);
mlm_client_t *client = bpm_get_mlm_client (self);
ASSERT_TEST(client != NULL, "Could not get BPM client handler", err_get_handler,
......@@ -50,7 +51,10 @@ bpm_client_err_e param_client_send_gen_rw (bpm_client_t *self, char *service,
ASSERT_ALLOC(request, err_send_msg_alloc, BPM_CLIENT_ERR_ALLOC);
zmsg_addmem (request, &operation, sizeof (operation));
zmsg_addmem (request, &rw, sizeof (rw));
zmsg_addmem (request, param, size);
zmsg_addmem (request, param1, size1);
if (param2 != NULL) {
zmsg_addmem (request, param2, size2);
}
/* Get poller and timeout from client */
uint32_t timeout = bpm_client_get_timeout (self);
......@@ -61,7 +65,7 @@ bpm_client_err_e param_client_send_gen_rw (bpm_client_t *self, char *service,
err_send_msg_alloc:
err_get_handler:
err_param_null:
err_param1_null:
return err;
}
......@@ -87,7 +91,8 @@ err_get_handler:
}
bpm_client_err_e param_client_write_gen (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param1, void *param2, size_t size)
uint32_t operation, uint32_t rw, void *param1, size_t size1,
void *param2, size_t size2)
{
assert (self);
assert (service);
......@@ -95,8 +100,8 @@ bpm_client_err_e param_client_write_gen (bpm_client_t *self, char *service,
bpm_client_err_e err = BPM_CLIENT_SUCCESS;
zmsg_t *report;
err = param_client_send_gen_rw (self, service, operation, param1, param2,
size);
err = param_client_send_gen_rw (self, service, operation, rw, param1,
size1, param2, size2);
ASSERT_TEST(err == BPM_CLIENT_SUCCESS, "Could not send message", err_send_msg);
err = param_client_recv_rw (self, service, &report);
ASSERT_TEST(err == BPM_CLIENT_SUCCESS, "Could not receive message", err_recv_msg);
......@@ -131,7 +136,7 @@ bpm_client_err_e param_client_write_raw (bpm_client_t *self, char *service,
uint32_t operation, uint32_t param1, uint32_t param2)
{
return param_client_write_gen (self, service, operation