Commit 303655eb authored by Lucas Russo's avatar Lucas Russo

sm_io/*/fmc250m_4ch/*: add RST ADCs and RST DIV ADCs functionality

parent 9d46d117
......@@ -106,7 +106,11 @@
#define FMC250M_4CH_NAME_SI571_SET_FREQ "fmc250m_4ch_si571_set_freq"
#define FMC250M_4CH_OPCODE_SI571_GET_DEFAULTS 44
#define FMC250M_4CH_NAME_SI571_GET_DEFAULTS "fmc250m_4ch_si571_get_defaults"
#define FMC250M_4CH_OPCODE_END 45
#define FMC250M_4CH_OPCODE_RST_ADCS 45
#define FMC250M_4CH_NAME_RST_ADCS "fmc250m_4ch_rst_adcs"
#define FMC250M_4CH_OPCODE_RST_DIV_ADCS 46
#define FMC250M_4CH_NAME_RST_DIV_ADCS "fmc250m_4ch_rst_div_adcs"
#define FMC250M_4CH_OPCODE_END 47
/* Messaging Reply OPCODES */
#define FMC250M_4CH_REPLY_TYPE uint32_t
......
......@@ -114,12 +114,6 @@ RW_PARAM_FUNC(fmc250m_4ch, clk_sel) {
NO_FMT_FUNC, SET_FIELD);
}
/***************************** ADC ISLA216P Control ***************************/
#if 0
#endif
/********************* ADC RAW Data registers (for simple debug) **************/
/* FIXME: Override DATA<channel_number>_VAL macros with the DATA_GLOBAL ones.
......@@ -611,6 +605,29 @@ FMC250M_4CH_SI571_FUNC_NAME_HEADER(get_defaults)
"Could not restart SI571 to its defaults");
}
/***************************** ADC ISLA216P Control ***************************/
#define BPM_FMC250M_4CH_RST_ADCS_MIN 0 /* Do nothing on RST_ADCS pin */
#define BPM_FMC250M_4CH_RST_ADCS_MAX 1 /* Pulse RST_ADCS pin */
RW_PARAM_FUNC(fmc250m_4ch, rst_adcs) {
SET_GET_PARAM(fmc250m_4ch, FMC_250M_CTRL_REGS_OFFS, WB_FMC_250M_4CH_CSR,
ADC_CTL, RST_ADCS, SINGLE_BIT_PARAM,
BPM_FMC250M_4CH_RST_ADCS_MIN, BPM_FMC250M_4CH_RST_ADCS_MAX, NO_CHK_FUNC,
NO_FMT_FUNC, SET_FIELD);
}
#define BPM_FMC250M_4CH_RST_DIV_ADCS_MIN 0 /* Do nothing on RST_DIV_ADCS pin */
#define BPM_FMC250M_4CH_RST_DIV_ADCS_MAX 1 /* Pulse RST_DIV_ADCS pin */
RW_PARAM_FUNC(fmc250m_4ch, rst_div_adcs) {
SET_GET_PARAM(fmc250m_4ch, FMC_250M_CTRL_REGS_OFFS, WB_FMC_250M_4CH_CSR,
ADC_CTL, RST_DIV_ADCS, SINGLE_BIT_PARAM,
BPM_FMC250M_4CH_RST_DIV_ADCS_MIN, BPM_FMC250M_4CH_RST_DIV_ADCS_MAX, NO_CHK_FUNC,
NO_FMT_FUNC, SET_FIELD);
}
/* Exported function pointers */
const disp_table_func_fp fmc250m_4ch_exp_fp [] = {
RW_PARAM_FUNC_NAME(fmc250m_4ch, leds),
......@@ -662,6 +679,8 @@ const disp_table_func_fp fmc250m_4ch_exp_fp [] = {
FMC250M_4CH_AD9510_FUNC_NAME(pll_clk_sel),
FMC250M_4CH_SI571_FUNC_NAME(set_freq),
FMC250M_4CH_SI571_FUNC_NAME(get_defaults),
RW_PARAM_FUNC_NAME(fmc250m_4ch, rst_adcs),
RW_PARAM_FUNC_NAME(fmc250m_4ch, rst_div_adcs),
NULL
};
......
......@@ -71,6 +71,30 @@ disp_op_t fmc250m_4ch_clk_sel_exp = {
}
};
disp_op_t fmc250m_4ch_rst_adcs_exp = {
.name = FMC250M_4CH_NAME_RST_ADCS,
.opcode = FMC250M_4CH_OPCODE_RST_ADCS,
.retval = DISP_ARG_ENCODE(DISP_ATYPE_UINT32, uint32_t),
.retval_owner = DISP_OWNER_OTHER,
.args = {
DISP_ARG_ENCODE(DISP_ATYPE_UINT32, uint32_t),
DISP_ARG_ENCODE(DISP_ATYPE_UINT32, uint32_t),
DISP_ARG_END
}
};
disp_op_t fmc250m_4ch_rst_div_adcs_exp = {
.name = FMC250M_4CH_NAME_RST_DIV_ADCS,
.opcode = FMC250M_4CH_OPCODE_RST_DIV_ADCS,
.retval = DISP_ARG_ENCODE(DISP_ATYPE_UINT32, uint32_t),
.retval_owner = DISP_OWNER_OTHER,
.args = {
DISP_ARG_ENCODE(DISP_ATYPE_UINT32, uint32_t),
DISP_ARG_ENCODE(DISP_ATYPE_UINT32, uint32_t),
DISP_ARG_END
}
};
#if 0
disp_op_t fmc250m_4ch_adc_rand_exp = {
.name = FMC250M_4CH_NAME_ADC_RAND,
......@@ -607,6 +631,8 @@ const disp_op_t *fmc250m_4ch_exp_ops [] = {
&fmc250m_4ch_ad9510_pll_clk_sel_exp,
&fmc250m_4ch_si571_set_freq_exp,
&fmc250m_4ch_si571_get_defaults_exp,
&fmc250m_4ch_rst_adcs_exp,
&fmc250m_4ch_rst_div_adcs_exp,
NULL
};
......@@ -59,6 +59,8 @@ extern disp_op_t fmc250m_4ch_ad9510_outputs_exp;
extern disp_op_t fmc250m_4ch_ad9510_pll_clk_sel_exp;
extern disp_op_t fmc250m_4ch_si571_set_freq_exp;
extern disp_op_t fmc250m_4ch_si571_get_defaults_exp;
extern disp_op_t fmc250m_4ch_rst_adcs_exp;
extern disp_op_t fmc250m_4ch_rst_div_adcs_exp;
extern const disp_op_t *fmc250m_4ch_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