Commit ecdf65ec authored by Lucas Russo's avatar Lucas Russo

sm_io/*/rffe,libbpmclient: add/refactores exported RFFE functions

As the RFFE hardware changed, we did not update
the bpm-sw communication with it. Many variables
have ceased to exist and other have been included.
parent a3633192
......@@ -765,93 +765,76 @@ bpm_client_err_e bpm_get_gain_d (bpm_client_t *self, char *service,
/********************** RFFE Functions ********************/
/* Switching functions */
/* These set of functions write (set) or read (get) the RFFE switching
* scheme. 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_rffe_sw (bpm_client_t *self, char *service,
uint32_t rffe_sw);
bpm_client_err_e bpm_get_rffe_sw (bpm_client_t *self, char *service,
uint32_t *rffe_sw);
/* Attenuator functions */
/* These set of functions write (set) or read (get) the RFFE attenuator
* values. 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_rffe_att1 (bpm_client_t *self, char *service,
double rffe_att1);
bpm_client_err_e bpm_get_rffe_att1 (bpm_client_t *self, char *service,
double *rffe_att1);
bpm_client_err_e bpm_set_rffe_att2 (bpm_client_t *self, char *service,
double rffe_att2);
bpm_client_err_e bpm_get_rffe_att2 (bpm_client_t *self, char *service,
double *rffe_att2);
bpm_client_err_e bpm_set_rffe_att (bpm_client_t *self, char *service,
double rffe_att);
bpm_client_err_e bpm_get_rffe_att (bpm_client_t *self, char *service,
double *rffe_att);
/* Temperature functions */
/* These set of functions read (get) the RFFE temperature
* values. 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_get_rffe_temp1 (bpm_client_t *self, char *service,
double *rffe_temp1);
bpm_client_err_e bpm_get_rffe_temp2 (bpm_client_t *self, char *service,
double *rffe_temp2);
bpm_client_err_e bpm_get_rffe_temp3 (bpm_client_t *self, char *service,
double *rffe_temp3);
bpm_client_err_e bpm_get_rffe_temp4 (bpm_client_t *self, char *service,
double *rffe_temp4);
bpm_client_err_e bpm_get_rffe_temp_ac (bpm_client_t *self, char *service,
double *rffe_temp_ac);
bpm_client_err_e bpm_get_rffe_temp_bd (bpm_client_t *self, char *service,
double *rffe_temp_bd);
/* Temperature control set point unctions */
/* These set of functions write (set) or read (get) the RFFE set point
* values. 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_rffe_set_point1 (bpm_client_t *self, char *service,
double rffe_set_point1);
bpm_client_err_e bpm_get_rffe_set_point1 (bpm_client_t *self, char *service,
double *rffe_set_point1);
bpm_client_err_e bpm_set_rffe_set_point2 (bpm_client_t *self, char *service,
double rffe_set_point2);
bpm_client_err_e bpm_get_rffe_set_point2 (bpm_client_t *self, char *service,
double *rffe_set_point2);
bpm_client_err_e bpm_set_rffe_set_point_ac (bpm_client_t *self, char *service,
double rffe_set_point_ac);
bpm_client_err_e bpm_get_rffe_set_point_ac (bpm_client_t *self, char *service,
double *rffe_set_point_ac);
bpm_client_err_e bpm_set_rffe_set_point_bd (bpm_client_t *self, char *service,
double rffe_set_point_bd);
bpm_client_err_e bpm_get_rffe_set_point_bd (bpm_client_t *self, char *service,
double *rffe_set_point_bd);
/* Temperature control enable functions */
/* These set of functions write (set) or read (get) the RFFE temperatue control
* scheme. 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_rffe_temp_control (bpm_client_t *self, char *service,
uint32_t rffe_temp_control);
uint8_t rffe_temp_control);
bpm_client_err_e bpm_get_rffe_temp_control (bpm_client_t *self, char *service,
uint32_t *rffe_temp_control);
uint8_t *rffe_temp_control);
/* RFFE output functions */
/* These set of functions write (set) or read (get) the RFFE output
* values. 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_rffe_output1 (bpm_client_t *self, char *service,
double rffe_output1);
bpm_client_err_e bpm_get_rffe_output1 (bpm_client_t *self, char *service,
double *rffe_output1);
bpm_client_err_e bpm_set_rffe_output2 (bpm_client_t *self, char *service,
double rffe_output2);
bpm_client_err_e bpm_get_rffe_output2 (bpm_client_t *self, char *service,
double *rffe_output2);
bpm_client_err_e bpm_set_rffe_heater_ac (bpm_client_t *self, char *service,
double rffe_heater_ac);
bpm_client_err_e bpm_get_rffe_heater_ac (bpm_client_t *self, char *service,
double *rffe_heater_ac);
bpm_client_err_e bpm_set_rffe_heater_bd (bpm_client_t *self, char *service,
double rffe_heater_bd);
bpm_client_err_e bpm_get_rffe_heater_bd (bpm_client_t *self, char *service,
double *rffe_heater_bd);
/* Reset functions */
/* These set of functions write (set) or read (get) the RFFE reset state
* scheme. 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_rffe_reset (bpm_client_t *self, char *service,
uint32_t rffe_reset);
uint8_t rffe_reset);
bpm_client_err_e bpm_get_rffe_reset (bpm_client_t *self, char *service,
uint32_t *rffe_reset);
uint8_t *rffe_reset);
/* Reprogramming functions */
/* These set of functions write (set) or read (get) the RFFE reprogramming
* scheme. 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_rffe_reprog (bpm_client_t *self, char *service,
uint32_t rffe_reprog);
uint8_t rffe_reprog);
bpm_client_err_e bpm_get_rffe_reprog (bpm_client_t *self, char *service,
uint32_t *rffe_reprog);
uint8_t *rffe_reprog);
/* Data functions */
/* These set of functions write (set) or read (get) the RFFE new firmware data
......@@ -870,14 +853,34 @@ bpm_client_err_e bpm_get_rffe_data (bpm_client_t *self, char *service,
bpm_client_err_e bpm_get_rffe_version (bpm_client_t *self, char *service,
struct _smio_rffe_version_t *rffe_version);
/* Switching level functions */
/* These set of functions write (set) read (get) the RFFE switching level.
/* PID functions */
/* These set of functions write (set) read (get) the PID parameters.
* 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_rffe_sw_lvl (bpm_client_t *self, char *service,
uint32_t rffe_sw_lvl);
bpm_client_err_e bpm_get_rffe_sw_lvl (bpm_client_t *self, char *service,
uint32_t *rffe_sw_lvl);
bpm_client_err_e bpm_set_rffe_pid_ac_kp (bpm_client_t *self, char *service,
double rffe_pid_ac_kp);
bpm_client_err_e bpm_get_rffe_pid_ac_kp (bpm_client_t *self, char *service,
double *rffe_pid_ac_kp);
bpm_client_err_e bpm_set_rffe_pid_ac_ti (bpm_client_t *self, char *service,
double rffe_pid_ac_ti);
bpm_client_err_e bpm_get_rffe_pid_ac_ti (bpm_client_t *self, char *service,
double *rffe_pid_ac_ti);
bpm_client_err_e bpm_set_rffe_pid_ac_td (bpm_client_t *self, char *service,
double rffe_pid_ac_td);
bpm_client_err_e bpm_get_rffe_pid_ac_td (bpm_client_t *self, char *service,
double *rffe_pid_ac_td);
bpm_client_err_e bpm_set_rffe_pid_bd_kp (bpm_client_t *self, char *service,
double rffe_pid_bd_kp);
bpm_client_err_e bpm_get_rffe_pid_bd_kp (bpm_client_t *self, char *service,
double *rffe_pid_bd_kp);
bpm_client_err_e bpm_set_rffe_pid_bd_ti (bpm_client_t *self, char *service,
double rffe_pid_bd_ti);
bpm_client_err_e bpm_get_rffe_pid_bd_ti (bpm_client_t *self, char *service,
double *rffe_pid_bd_ti);
bpm_client_err_e bpm_set_rffe_pid_bd_td (bpm_client_t *self, char *service,
double rffe_pid_bd_td);
bpm_client_err_e bpm_get_rffe_pid_bd_td (bpm_client_t *self, char *service,
double *rffe_pid_bd_td);
/********************** AFC Diagnostics Functions ********************/
/* AFC Card Slot functions */
......
......@@ -31,6 +31,10 @@ extern "C" {
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_WRITE(reg) (bpm_client_t *self, \
char *service, uint32_t reg)
#define PARAM_FUNC_CLIENT_WRITE_BYTE(reg) \
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_WRITE(reg) (bpm_client_t *self, \
char *service, uint8_t reg)
#define PARAM_FUNC_CLIENT_WRITE_DOUBLE(reg) \
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_WRITE(reg) (bpm_client_t *self, \
char *service, double reg)
......@@ -48,6 +52,10 @@ extern "C" {
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_READ(reg) (bpm_client_t *self, \
char *service, uint32_t *reg)
#define PARAM_FUNC_CLIENT_READ_BYTE(reg) \
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_READ(reg) (bpm_client_t *self, \
char *service, uint8_t *reg)
#define PARAM_FUNC_CLIENT_READ_DOUBLE(reg) \
bpm_client_err_e PARAM_FUNC_CLIENT_NAME_READ(reg) (bpm_client_t *self, \
char *service, double *reg)
......@@ -82,6 +90,8 @@ bpm_client_err_e param_client_write (bpm_client_t *self, char *service,
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_byte (bpm_client_t *self, char *service,
uint32_t operation, uint8_t param);
bpm_client_err_e param_client_write_double (bpm_client_t *self, char *service,
uint32_t operation, double param1);
bpm_client_err_e param_client_write_double2 (bpm_client_t *self, char *service,
......@@ -96,6 +106,8 @@ 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_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_byte (bpm_client_t *self, char *service,
uint32_t operation, uint8_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,
......
......@@ -1636,155 +1636,118 @@ PARAM_FUNC_CLIENT_READ2(gain_d, dir_gain, inv_gain)
/**************** RFFE SMIO Functions ****************/
/* RFFE get/set switching state */
PARAM_FUNC_CLIENT_WRITE(rffe_sw)
{
return param_client_write (self, service, RFFE_OPCODE_SET_GET_SW,
rffe_sw);
}
PARAM_FUNC_CLIENT_READ(rffe_sw)
{
return param_client_read (self, service, RFFE_OPCODE_SET_GET_SW,
rffe_sw);
}
/* RFFE get/set attenuator */
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_att1)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_ATT1,
rffe_att1);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_att1)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_ATT1,
rffe_att1);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_att2)
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_att)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_ATT2,
rffe_att2);
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_ATT,
rffe_att);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_att2)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_att)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_ATT2,
rffe_att2);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_ATT,
rffe_att);
}
/* RFFE get temperatures */
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_temp1)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_temp_ac)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_TEMP1,
rffe_temp1);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_TEMP_AC,
rffe_temp_ac);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_temp2)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_temp_bd)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_TEMP2,
rffe_temp2);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_temp3)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_TEMP3,
rffe_temp3);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_temp4)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_TEMP4,
rffe_temp4);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_TEMP_BD,
rffe_temp_bd);
}
/* RFFE get/set set points */
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_set_point1)
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_set_point_ac)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT1,
rffe_set_point1);
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT_AC,
rffe_set_point_ac);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_set_point1)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_set_point_ac)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT1,
rffe_set_point1);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT_AC,
rffe_set_point_ac);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_set_point2)
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_set_point_bd)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT2,
rffe_set_point2);
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT_BD,
rffe_set_point_bd);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_set_point2)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_set_point_bd)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT2,
rffe_set_point2);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_SET_POINT_BD,
rffe_set_point_bd);
}
/* RFFE get/set temperature control */
PARAM_FUNC_CLIENT_WRITE(rffe_temp_control)
PARAM_FUNC_CLIENT_WRITE_BYTE(rffe_temp_control)
{
return param_client_write (self, service, RFFE_OPCODE_SET_GET_TEMP_CONTROL,
return param_client_write_byte (self, service, RFFE_OPCODE_SET_GET_TEMP_CONTROL,
rffe_temp_control);
}
PARAM_FUNC_CLIENT_READ(rffe_temp_control)
PARAM_FUNC_CLIENT_READ_BYTE(rffe_temp_control)
{
return param_client_read (self, service, RFFE_OPCODE_SET_GET_TEMP_CONTROL,
return param_client_read_byte (self, service, RFFE_OPCODE_SET_GET_TEMP_CONTROL,
rffe_temp_control);
}
/* RFFE outputs */
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_output1)
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_heater_ac)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_OUTPUT1,
rffe_output1);
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_HEATER_AC,
rffe_heater_ac);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_output1)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_heater_ac)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_OUTPUT1,
rffe_output1);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_HEATER_AC,
rffe_heater_ac);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_output2)
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_heater_bd)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_OUTPUT2,
rffe_output2);
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_HEATER_BD,
rffe_heater_bd);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_output2)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_heater_bd)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_OUTPUT2,
rffe_output2);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_HEATER_BD,
rffe_heater_bd);
}
/* RFFE get/set reset */
PARAM_FUNC_CLIENT_WRITE(rffe_reset)
PARAM_FUNC_CLIENT_WRITE_BYTE(rffe_reset)
{
return param_client_write (self, service, RFFE_OPCODE_SET_GET_RESET,
return param_client_write_byte (self, service, RFFE_OPCODE_SET_GET_RESET,
rffe_reset);
}
PARAM_FUNC_CLIENT_READ(rffe_reset)
PARAM_FUNC_CLIENT_READ_BYTE(rffe_reset)
{
return param_client_read (self, service, RFFE_OPCODE_SET_GET_RESET,
return param_client_read_byte (self, service, RFFE_OPCODE_SET_GET_RESET,
rffe_reset);
}
/* RFFE get/set reprogram */
PARAM_FUNC_CLIENT_WRITE(rffe_reprog)
PARAM_FUNC_CLIENT_WRITE_BYTE(rffe_reprog)
{
return param_client_write (self, service, RFFE_OPCODE_SET_GET_REPROG,
return param_client_write_byte (self, service, RFFE_OPCODE_SET_GET_REPROG,
rffe_reprog);
}
PARAM_FUNC_CLIENT_READ(rffe_reprog)
PARAM_FUNC_CLIENT_READ_BYTE(rffe_reprog)
{
return param_client_read (self, service, RFFE_OPCODE_SET_GET_REPROG,
return param_client_read_byte (self, service, RFFE_OPCODE_SET_GET_REPROG,
rffe_reprog);
}
......@@ -1816,17 +1779,77 @@ bpm_client_err_e bpm_get_rffe_version (bpm_client_t *self, char *service,
rffe_version, sizeof (*rffe_version));
}
/* RFFE get/set switching level */
PARAM_FUNC_CLIENT_WRITE(rffe_sw_lvl)
/* RFFE PID parameters */
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_pid_ac_kp)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_PID_AC_KP,
rffe_pid_ac_kp);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_pid_ac_kp)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_PID_AC_KP,
rffe_pid_ac_kp);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_pid_ac_ti)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_PID_AC_TI,
rffe_pid_ac_ti);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_pid_ac_ti)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_PID_AC_TI,
rffe_pid_ac_ti);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_pid_ac_td)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_PID_AC_TD,
rffe_pid_ac_td);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_pid_ac_td)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_PID_AC_TD,
rffe_pid_ac_td);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_pid_bd_kp)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_PID_BD_KP,
rffe_pid_bd_kp);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_pid_bd_kp)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_PID_BD_KP,
rffe_pid_bd_kp);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_pid_bd_ti)
{
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_PID_BD_TI,
rffe_pid_bd_ti);
}
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_pid_bd_ti)
{
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_PID_BD_TI,
rffe_pid_bd_ti);
}
PARAM_FUNC_CLIENT_WRITE_DOUBLE(rffe_pid_bd_td)
{
return param_client_write (self, service, RFFE_OPCODE_SET_GET_SW_LVL,
rffe_sw_lvl);
return param_client_write_double (self, service, RFFE_OPCODE_SET_GET_PID_BD_TD,
rffe_pid_bd_td);
}
PARAM_FUNC_CLIENT_READ(rffe_sw_lvl)
PARAM_FUNC_CLIENT_READ_DOUBLE(rffe_pid_bd_td)
{
return param_client_read (self, service, RFFE_OPCODE_SET_GET_SW_LVL,
rffe_sw_lvl);
return param_client_read_double (self, service, RFFE_OPCODE_SET_GET_PID_BD_TD,
rffe_pid_bd_td);
}
/********************** AFC Diagnostics Functions ********************/
......
......@@ -147,6 +147,14 @@ bpm_client_err_e param_client_write (bpm_client_t *self, char *service,
sizeof (param), NULL, 0);
}
bpm_client_err_e param_client_write_byte (bpm_client_t *self, char *service,
uint32_t operation, uint8_t param)
{
uint32_t rw = WRITE_MODE;
return param_client_write_gen (self, service, operation, rw, &param,
sizeof (param), NULL, 0);
}
bpm_client_err_e param_client_write_double (bpm_client_t *self, char *service,
uint32_t operation, double param)
{
......@@ -258,6 +266,14 @@ bpm_client_err_e param_client_read (bpm_client_t *self, char *service,
sizeof (*param_out), NULL, 0, param_out, sizeof (*param_out));
}
bpm_client_err_e param_client_read_byte (bpm_client_t *self, char *service,
uint32_t operation, uint8_t *param_out)
{
uint32_t rw = READ_MODE;
return param_client_read_gen (self, service, operation, rw, param_out,
sizeof (*param_out), NULL, 0, param_out, sizeof (*param_out));
}
bpm_client_err_e param_client_read_double (bpm_client_t *self, char *service,
uint32_t operation, double *param_out)
{
......
......@@ -27,41 +27,43 @@ struct _smio_rffe_version_t {
#define RFFE_OPCODE_TYPE uint32_t
#define RFFE_OPCODE_SIZE (sizeof (RFFE_OPCODE_TYPE))
#define RFFE_OPCODE_SET_GET_SW 0
#define RFFE_NAME_SET_GET_SW "rffe_sw"
#define RFFE_OPCODE_SET_GET_ATT1 1
#define RFFE_NAME_SET_GET_ATT1 "rffe_att1"
#define RFFE_OPCODE_SET_GET_ATT2 2
#define RFFE_NAME_SET_GET_ATT2 "rffe_att2"
#define RFFE_OPCODE_SET_GET_TEMP1 3
#define RFFE_NAME_SET_GET_TEMP1 "rffe_temp1"
#define RFFE_OPCODE_SET_GET_TEMP2 4
#define RFFE_NAME_SET_GET_TEMP2 "rffe_temp2"
#define RFFE_OPCODE_SET_GET_TEMP3 5
#define RFFE_NAME_SET_GET_TEMP3 "rffe_temp3"
#define RFFE_OPCODE_SET_GET_TEMP4 6
#define RFFE_NAME_SET_GET_TEMP4 "rffe_temp4"
#define RFFE_OPCODE_SET_GET_SET_POINT1 7
#define RFFE_NAME_SET_GET_SET_POINT1 "rffe_set_point1"
#define RFFE_OPCODE_SET_GET_SET_POINT2 8
#define RFFE_NAME_SET_GET_SET_POINT2 "rffe_set_point2"
#define RFFE_OPCODE_SET_GET_TEMP_CONTROL 9
#define RFFE_OPCODE_SET_GET_ATT 0
#define RFFE_NAME_SET_GET_ATT "rffe_att"
#define RFFE_OPCODE_SET_GET_TEMP_AC 1
#define RFFE_NAME_SET_GET_TEMP_AC "rffe_temp_ac"
#define RFFE_OPCODE_SET_GET_TEMP_BD 2
#define RFFE_NAME_SET_GET_TEMP_BD "rffe_temp_bd"
#define RFFE_OPCODE_SET_GET_SET_POINT_AC 3
#define RFFE_NAME_SET_GET_SET_POINT_AC "rffe_set_point_ac"
#define RFFE_OPCODE_SET_GET_SET_POINT_BD 4
#define RFFE_NAME_SET_GET_SET_POINT_BD "rffe_set_point_bd"
#define RFFE_OPCODE_SET_GET_TEMP_CONTROL 5
#define RFFE_NAME_SET_GET_TEMP_CONTROL "rffe_temp_control"
#define RFFE_OPCODE_SET_GET_OUTPUT1 10
#define RFFE_NAME_SET_GET_OUTPUT1 "rffe_output1"
#define RFFE_OPCODE_SET_GET_OUTPUT2 11
#define RFFE_NAME_SET_GET_OUTPUT2 "rffe_output2"
#define RFFE_OPCODE_SET_GET_RESET 12
#define RFFE_OPCODE_SET_GET_HEATER_AC 6
#define RFFE_NAME_SET_GET_HEATER_AC "rffe_heater_ac"
#define RFFE_OPCODE_SET_GET_HEATER_BD 7
#define RFFE_NAME_SET_GET_HEATER_BD "rffe_heater_bd"
#define RFFE_OPCODE_SET_GET_RESET 8
#define RFFE_NAME_SET_GET_RESET "rffe_reset"
#define RFFE_OPCODE_SET_GET_REPROG 13
#define RFFE_OPCODE_SET_GET_REPROG 9
#define RFFE_NAME_SET_GET_REPROG "rffe_reprog"
#define RFFE_OPCODE_SET_GET_DATA 14
#define RFFE_OPCODE_SET_GET_DATA 10
#define RFFE_NAME_SET_GET_DATA "rffe_data"
#define RFFE_OPCODE_SET_GET_VERSION 15
#define RFFE_OPCODE_SET_GET_VERSION 11
#define RFFE_NAME_SET_GET_VERSION "rffe_version"
#define RFFE_OPCODE_SET_GET_SW_LVL 16
#define RFFE_NAME_SET_GET_SW_LVL "rffe_sw_lvl"
#define RFFE_OPCODE_END 17
#define RFFE_OPCODE_SET_GET_PID_AC_KP 12
#define RFFE_NAME_SET_GET_PID_AC_KP "rffe_pid_ac_kp"
#define RFFE_OPCODE_SET_GET_PID_AC_TI 13
#define RFFE_NAME_SET_GET_PID_AC_TI "rffe_pid_ac_ti"
#define RFFE_OPCODE_SET_GET_PID_AC_TD 14
#define RFFE_NAME_SET_GET_PID_AC_TD "rffe_pid_ac_td"
#define RFFE_OPCODE_SET_GET_PID_BD_KP 15
#define RFFE_NAME_SET_GET_PID_BD_KP "rffe_pid_bd_kp"
#define RFFE_OPCODE_SET_GET_PID_BD_TI 16
#define RFFE_NAME_SET_GET_PID_BD_TI "rffe_pid_bd_ti"
#define RFFE_OPCODE_SET_GET_PID_BD_TD 17
#define RFFE_NAME_SET_GET_PID_BD_TD "rffe_pid_bd_td"
#define RFFE_OPCODE_END 18
/* Messaging Reply OPCODES */
#define RFFE_REPLY_TYPE uint32_t
......
......@@ -54,16 +54,8 @@ smio_err_e rffe_config_defaults (char *broker_endp, char *service,
log_file_name, SMIO_RFFE_LIBBPMCLIENT_LOG_MODE);
ASSERT_ALLOC(config_client, err_alloc_client);
client_err = bpm_set_rffe_sw (config_client, service, RFFE_DFLT_SW);
ASSERT_TEST(client_err == BPM_CLIENT_SUCCESS, "Could not set RFFE switching value",
err_param_set, SMIO_ERR_CONFIG_DFLT);
client_err = bpm_set_rffe_att1 (config_client, service, RFFE_DFLT_ATT1);
ASSERT_TEST(client_err == BPM_CLIENT_SUCCESS, "Could not set RFFE attenuator 1 value",
err_param_set, SMIO_ERR_CONFIG_DFLT);
client_err = bpm_set_rffe_att2 (config_client, service, RFFE_DFLT_ATT2);
ASSERT_TEST(client_err == BPM_CLIENT_SUCCESS, "Could not set RFFE attenuator 2 value",
client_err = bpm_set_rffe_att (config_client, service, RFFE_DFLT_ATT);
ASSERT_TEST(client_err == BPM_CLIENT_SUCCESS, "Could not set RFFE attenuator value",
err_param_set, SMIO_ERR_CONFIG_DFLT);
err_param_set:
......
......@@ -8,9 +8,7 @@
#ifndef _RFFE_DEFAULTS_H_
#define _RFFE_DEFAULTS_H_
#define RFFE_DFLT_SW 0x1 /* No switching, direct position */
#define RFFE_DFLT_ATT1 31.5 /* 31.1 dB attenuation */
#define RFFE_DFLT_ATT2 31.5 /* 31.1 dB attenuation */
#define RFFE_DFLT_ATT 31.5 /* 31.1 dB attenuation */
smio_err_e rffe_config_defaults (char *broker_endp, char *service,
const char *log_file_name);
......
......@@ -102,148 +102,154 @@ err_get_rffe_handler:
return err;
}
RFFE_FUNC_NAME_HEADER(sw)
RFFE_FUNC_NAME_HEADER(att)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_SW,
"Could not set/get RFFE switching");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_ATT,
"Could not set/get RFFE attenuator");
}
RFFE_FUNC_NAME_HEADER(temp_ac)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP_AC,
"Could not set/get RFFE temperature AC");
}
RFFE_FUNC_NAME_HEADER(att1)
RFFE_FUNC_NAME_HEADER(temp_bd)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_ATT1,
"Could not set/get RFFE attenuator 1");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP_BD,
"Could not set/get RFFE temperature BD");
}
RFFE_FUNC_NAME_HEADER(att2)
RFFE_FUNC_NAME_HEADER(set_point_ac)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_ATT2,
"Could not set/get RFFE attenuator 2");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_SET_POINT_AC,
"Could not set/get RFFE set point AC");
}
RFFE_FUNC_NAME_HEADER(temp1)
RFFE_FUNC_NAME_HEADER(set_point_bd)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP1,
"Could not set/get RFFE temperature 1");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_SET_POINT_BD,
"Could not set/get RFFE set point BD");
}
RFFE_FUNC_NAME_HEADER(temp2)
RFFE_FUNC_NAME_HEADER(temp_control)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP2,
"Could not set/get RFFE temperature 2");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP_CONTROL,
"Could not set/get RFFE temperature control");
}
RFFE_FUNC_NAME_HEADER(temp3)
RFFE_FUNC_NAME_HEADER(heater_ac)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP3,
"Could not set/get RFFE temperature 3");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_HEATER_AC,
"Could not set/get RFFE heater AC");
}
RFFE_FUNC_NAME_HEADER(temp4)
RFFE_FUNC_NAME_HEADER(heater_bd)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP4,
"Could not set/get RFFE temperature 4");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_HEATER_BD,
"Could not set/get RFFE output BD");
}
RFFE_FUNC_NAME_HEADER(set_point1)
RFFE_FUNC_NAME_HEADER(reset)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_SET_POINT1,
"Could not set/get RFFE set point 1");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_RESET,
"Could not set/get RFFE reset");
}
RFFE_FUNC_NAME_HEADER(set_point2)
RFFE_FUNC_NAME_HEADER(reprog)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_SET_POINT2,
"Could not set/get RFFE set point 2");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_REPROG,
"Could not set/get RFFE reprogramming");
}
RFFE_FUNC_NAME_HEADER(temp_control)
RFFE_FUNC_NAME_HEADER(data)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_TEMP_CONTROL,
"Could not set/get RFFE temperature control");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_DATA,
"Could not set/get RFFE data");
}
RFFE_FUNC_NAME_HEADER(output1)
RFFE_FUNC_NAME_HEADER(version)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_OUTPUT1,
"Could not set/get RFFE output 1");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_VERSION,
"Could not set/get RFFE version");
}
RFFE_FUNC_NAME_HEADER(output2)
RFFE_FUNC_NAME_HEADER(pid_ac_kp)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_OUTPUT2,
"Could not set/get RFFE output 2");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_PID_AC_KP,
"Could not set/get RFFE AC PID KP parameter");
}
RFFE_FUNC_NAME_HEADER(reset)
RFFE_FUNC_NAME_HEADER(pid_ac_ti)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_RESET,
"Could not set/get RFFE reset");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_PID_AC_TI,
"Could not set/get RFFE AC PID TI parameter");
}
RFFE_FUNC_NAME_HEADER(reprog)
RFFE_FUNC_NAME_HEADER(pid_ac_td)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_REPROG,
"Could not set/get RFFE reprogramming");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_PID_AC_TD,
"Could not set/get RFFE AC PID TD parameter");
}
RFFE_FUNC_NAME_HEADER(data)
RFFE_FUNC_NAME_HEADER(pid_bd_kp)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_DATA,
"Could not set/get RFFE data");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_PID_BD_KP,
"Could not set/get RFFE BD PID KP parameter");
}
RFFE_FUNC_NAME_HEADER(version)
RFFE_FUNC_NAME_HEADER(pid_bd_ti)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_VERSION,
"Could not set/get RFFE version");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_PID_BD_TI,
"Could not set/get RFFE BD PID TI parameter");
}
RFFE_FUNC_NAME_HEADER(sw_lvl)
RFFE_FUNC_NAME_HEADER(pid_bd_td)
{
return _rffe_var_rw(owner, args, ret, smch_rffe_read_var,
smch_rffe_write_var, RFFE_OPCODE_SET_GET_SW_LVL,
"Could not set/get RFFE switching level");
smch_rffe_write_var, RFFE_OPCODE_SET_GET_PID_BD_TD,
"Could not set/get RFFE BD PID TD parameter");
}
/* Exported function pointers */
const disp_table_func_fp rffe_exp_fp [] = {
RFFE_FUNC_NAME(sw),
RFFE_FUNC_NAME(att1),
RFFE_FUNC_NAME(att2),
RFFE_FUNC_NAME(temp1),
RFFE_FUNC_NAME(temp2),
RFFE_FUNC_NAME(temp3),
RFFE_FUNC_NAME(temp4),
RFFE_FUNC_NAME(set_point1),
RFFE_FUNC_NAME(set_point2),
RFFE_FUNC_NAME(att),
RFFE_FUNC_NAME(temp_ac),
RFFE_FUNC_NAME(temp_bd),
RFFE_FUNC_NAME(set_point_ac),
RFFE_FUNC_NAME(set_point_bd),
RFFE_FUNC_NAME(temp_control),
RFFE_FUNC_NAME(output1),
RFFE_FUNC_NAME(output2),
RFFE_FUNC_NAME(heater_ac),
RFFE_FUNC_NAME(heater_bd),
RFFE_FUNC_NAME(reset),
RFFE_FUNC_NAME(reprog),
RFFE_FUNC_NAME(data),
RFFE_FUNC_NAME(version),
RFFE_FUNC_NAME(sw_lvl),
RFFE_FUNC_NAME(pid_ac_kp),
RFFE_FUNC_NAME(pid_ac_ti),
RFFE_FUNC_NAME(pid_ac_td),
RFFE_FUNC_NAME(pid_bd_kp),
RFFE_FUNC_NAME(pid_bd_ti),
RFFE_FUNC_NAME(pid_bd_td),
NULL
};
......
This diff is collapsed.
......@@ -10,23 +10,24 @@
#include "disptable.h"
extern disp_op_t rffe_set_get_sw_exp;
extern disp_op_t rffe_set_get_att1_exp;
extern disp_op_t rffe_set_get_att2_exp;
extern disp_op_t rffe_get_temp1_exp;
extern disp_op_t rffe_get_temp2_exp;
extern disp_op_t rffe_get_temp3_exp;
extern disp_op_t rffe_get_temp4_exp;
extern disp_op_t rffe_set_get_set_point1_exp;
extern disp_op_t rffe_set_get_set_point2_exp;
extern disp_op_t rffe_set_get_att_exp;
extern disp_op_t rffe_get_temp_ac_exp;
extern disp_op_t rffe_get_temp_bd_exp;
extern disp_op_t rffe_set_get_set_point_ac_exp;
extern disp_op_t rffe_set_get_set_point_bd_exp;
extern disp_op_t rffe_set_get_temp_control_exp;
extern disp_op_t rffe_set_get_output1_exp;
extern disp_op_t rffe_set_get_output2_exp;
extern disp_op_t rffe_set_get_heater_ac_exp;
extern disp_op_t rffe_set_get_heater_bd_exp;
extern disp_op_t rffe_set_get_reset_exp;
extern disp_op_t rffe_set_get_reprog_exp;
extern disp_op_t rffe_set_get_data_exp;
extern disp_op_t rffe_get_version_exp;
extern disp_op_t rffe_set_get_sw_lvl_exp;
extern disp_op_t rffe_set_get_pid_ac_kp_exp;
extern disp_op_t rffe_set_get_pid_ac_ti_exp;
extern disp_op_t rffe_set_get_pid_ac_td_exp;
extern disp_op_t rffe_set_get_pid_bd_kp_exp;
extern disp_op_t rffe_set_get_pid_bd_ti_exp;
extern disp_op_t rffe_set_get_pid_bd_td_exp;
extern const disp_op_t *rffe_exp_ops [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment