Commit f2f7ea21 authored by Lucas Russo's avatar Lucas Russo

libclient/bpm_client.*: add FMC130M_4CH AD9510 "get" functions

parent 02bc74db
......@@ -454,6 +454,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_pll_a_div)
ad9510_pll_a_div);
}
PARAM_FUNC_CLIENT_READ(ad9510_pll_a_div)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_PLL_A_DIV,
ad9510_pll_a_div);
}
/* AD9510 PLL B divider */
PARAM_FUNC_CLIENT_WRITE(ad9510_pll_b_div)
{
......@@ -461,6 +467,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_pll_b_div)
ad9510_pll_b_div);
}
PARAM_FUNC_CLIENT_READ(ad9510_pll_b_div)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_PLL_B_DIV,
ad9510_pll_b_div);
}
/* AD9510 PLL Prescaler */
PARAM_FUNC_CLIENT_WRITE(ad9510_pll_prescaler)
{
......@@ -468,6 +480,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_pll_prescaler)
ad9510_pll_prescaler);
}
PARAM_FUNC_CLIENT_READ(ad9510_pll_prescaler)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_PLL_PRESCALER,
ad9510_pll_prescaler);
}
/* AD9510 R divider */
PARAM_FUNC_CLIENT_WRITE(ad9510_r_div)
{
......@@ -475,6 +493,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_r_div)
ad9510_r_div);
}
PARAM_FUNC_CLIENT_READ(ad9510_r_div)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_R_DIV,
ad9510_r_div);
}
/* AD9510 PLL Power Down */
PARAM_FUNC_CLIENT_WRITE(ad9510_pll_pdown)
{
......@@ -482,6 +506,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_pll_pdown)
ad9510_pll_pdown);
}
PARAM_FUNC_CLIENT_READ(ad9510_pll_pdown)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_PLL_PDOWN,
ad9510_pll_pdown);
}
/* AD9510 Mux Status */
PARAM_FUNC_CLIENT_WRITE(ad9510_mux_status)
{
......@@ -489,6 +519,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_mux_status)
ad9510_mux_status);
}
PARAM_FUNC_CLIENT_READ(ad9510_mux_status)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_MUX_STATUS,
ad9510_mux_status);
}
/* AD9510 CP current */
PARAM_FUNC_CLIENT_WRITE(ad9510_cp_current)
{
......@@ -496,6 +532,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_cp_current)
ad9510_cp_current);
}
PARAM_FUNC_CLIENT_READ(ad9510_cp_current)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_CP_CURRENT,
ad9510_cp_current);
}
/* AD9510 Outputs */
PARAM_FUNC_CLIENT_WRITE(ad9510_outputs)
{
......@@ -503,6 +545,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_outputs)
ad9510_outputs);
}
PARAM_FUNC_CLIENT_READ(ad9510_outputs)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_OUTPUTS,
ad9510_outputs);
}
/* AD9510 PLL CLK Selection */
PARAM_FUNC_CLIENT_WRITE(ad9510_pll_clk_sel)
{
......@@ -510,6 +558,12 @@ PARAM_FUNC_CLIENT_WRITE(ad9510_pll_clk_sel)
ad9510_pll_clk_sel);
}
PARAM_FUNC_CLIENT_READ(ad9510_pll_clk_sel)
{
return param_client_read (self, service, FMC130M_4CH_OPCODE_AD9510_PLL_CLK_SEL,
ad9510_pll_clk_sel);
}
/* SI571 Set frequency */
PARAM_FUNC_CLIENT_WRITE_DOUBLE(si571_set_freq)
{
......@@ -798,7 +852,7 @@ err_null_report:
}
bpm_client_err_e bpm_get_curve (bpm_client_t *self, char *service,
acq_trans_t *acq_trans, int timeout)
acq_trans_t *acq_trans, int timeout, bool new_acq)
{
assert (self);
assert (service);
......@@ -806,14 +860,17 @@ bpm_client_err_e bpm_get_curve (bpm_client_t *self, char *service,
assert (acq_trans->block.data);
/* Client requisition: data acquire */
bpm_client_err_e err = _bpm_data_acquire (self, service, &acq_trans->req);
ASSERT_TEST(err == BPM_CLIENT_SUCCESS, "Could not request acqusition\n",
err_bpm_data_acquire);
/* Client requisition: wait data acquire indefinetly */
err = _bpm_wait_data_acquire_timed (self, service, timeout);
ASSERT_TEST(err == BPM_CLIENT_SUCCESS, "Request acquisition timed out\n",
err_bpm_wait_data_acquire);
bpm_client_err_e err = BPM_CLIENT_SUCCESS;
if (new_acq) {
err = _bpm_data_acquire (self, service, &acq_trans->req);
ASSERT_TEST(err == BPM_CLIENT_SUCCESS, "Could not request acqusition\n",
err_bpm_data_acquire);
/* Client requisition: wait data acquire indefinetly */
err = _bpm_wait_data_acquire_timed (self, service, timeout);
ASSERT_TEST(err == BPM_CLIENT_SUCCESS, "Request acquisition timed out\n",
err_bpm_wait_data_acquire);
}
/* FIXME: When the last block is full 'block_n_valid exceeds by one */
uint32_t block_n_valid = acq_trans->req.num_samples /
......
......@@ -236,22 +236,48 @@ bpm_client_err_e bpm_get_trig_val (bpm_client_t *self, char *service,
* if server could not complete the request */
bpm_client_err_e bpm_set_ad9510_pll_a_div (bpm_client_t *self, char *service,
uint32_t ad9510_pll_a_div);
bpm_client_err_e bpm_get_ad9510_pll_a_div (bpm_client_t *self, char *service,
uint32_t *ad9510_pll_a_div);
bpm_client_err_e bpm_set_ad9510_pll_b_div (bpm_client_t *self, char *service,
uint32_t ad9510_pll_b_div);
bpm_client_err_e bpm_get_ad9510_pll_b_div (bpm_client_t *self, char *service,
uint32_t *ad9510_pll_b_div);
bpm_client_err_e bpm_set_ad9510_pll_prescaler (bpm_client_t *self, char *service,
uint32_t ad9510_pll_prescaler);
bpm_client_err_e bpm_get_ad9510_pll_prescaler (bpm_client_t *self, char *service,
uint32_t *ad9510_pll_prescaler);
bpm_client_err_e bpm_set_ad9510_r_div (bpm_client_t *self, char *service,
uint32_t ad9510_r_div);
bpm_client_err_e bpm_get_ad9510_r_div (bpm_client_t *self, char *service,
uint32_t *ad9510_r_div);
bpm_client_err_e bpm_set_ad9510_pll_pdown (bpm_client_t *self, char *service,
uint32_t ad9510_pll_pdown);
bpm_client_err_e bpm_get_ad9510_pll_pdown (bpm_client_t *self, char *service,
uint32_t *ad9510_pll_pdown);
bpm_client_err_e bpm_set_ad9510_mux_status (bpm_client_t *self, char *service,
uint32_t ad9510_mux_status);
bpm_client_err_e bpm_get_ad9510_mux_status (bpm_client_t *self, char *service,
uint32_t *ad9510_mux_status);
bpm_client_err_e bpm_set_ad9510_cp_current (bpm_client_t *self, char *service,
uint32_t ad9510_cp_current);
bpm_client_err_e bpm_get_ad9510_cp_current (bpm_client_t *self, char *service,
uint32_t *ad9510_cp_current);
bpm_client_err_e bpm_set_ad9510_outputs (bpm_client_t *self, char *service,
uint32_t ad9510_outputs);
bpm_client_err_e bpm_get_ad9510_outputs (bpm_client_t *self, char *service,
uint32_t *ad9510_outputs);
bpm_client_err_e bpm_set_ad9510_pll_clk_sel (bpm_client_t *self, char *service,
uint32_t ad9510_pll_clk_sel);
bpm_client_err_e bpm_get_ad9510_pll_clk_sel (bpm_client_t *self, char *service,
uint32_t *ad9510_pll_clk_sel);
/* FMC SI571 Control.
* Returns BPM_CLIENT_SUCCESS if ok and BPM_CLIIENT_ERR_SERVER if
......@@ -335,7 +361,7 @@ bpm_client_err_e bpm_get_data_block (bpm_client_t *self, char *service,
* otherwise. The data read is returned in acq_trans->block.data along with
* the number of bytes effectivly read in acq_trans->block.bytes_read */
bpm_client_err_e bpm_get_curve (bpm_client_t *self, char *service,
acq_trans_t *acq_trans, int timeout);
acq_trans_t *acq_trans, int timeout, bool new_acq);
/********************** DSP Functions ********************/
......
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