Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
444378c7
Commit
444378c7
authored
Apr 19, 2016
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sm_io/modules/*: add new fmc_active_clk module
parent
56a80de8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1030 additions
and
0 deletions
+1030
-0
fmc_active_clk.mk
src/sm_io/modules/fmc_active_clk/fmc_active_clk.mk
+6
-0
sm_io_fmc_active_clk_codes.h
...sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_codes.h
+58
-0
sm_io_fmc_active_clk_core.c
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_core.c
+94
-0
sm_io_fmc_active_clk_core.h
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_core.h
+26
-0
sm_io_fmc_active_clk_defaults.c
...io/modules/fmc_active_clk/sm_io_fmc_active_clk_defaults.c
+89
-0
sm_io_fmc_active_clk_defaults.h
...io/modules/fmc_active_clk/sm_io_fmc_active_clk_defaults.h
+25
-0
sm_io_fmc_active_clk_exp.c
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_exp.c
+450
-0
sm_io_fmc_active_clk_exp.h
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_exp.h
+19
-0
sm_io_fmc_active_clk_exports.c
..._io/modules/fmc_active_clk/sm_io_fmc_active_clk_exports.c
+225
-0
sm_io_fmc_active_clk_exports.h
..._io/modules/fmc_active_clk/sm_io_fmc_active_clk_exports.h
+33
-0
modules.mk
src/sm_io/modules/modules.mk
+2
-0
sm_io_codes.c
src/sm_io/modules/sm_io_codes.c
+1
-0
sm_io_codes.h
src/sm_io/modules/sm_io_codes.h
+2
-0
No files found.
src/sm_io/modules/fmc_active_clk/fmc_active_clk.mk
0 → 100644
View file @
444378c7
sm_io_fmc_active_clk_DIR = $(SRC_DIR)/sm_io/modules/fmc_active_clk
sm_io_fmc_active_clk_OBJS = $(sm_io_fmc_active_clk_DIR)/sm_io_fmc_active_clk_core.o \
$(sm_io_fmc_active_clk_DIR)/sm_io_fmc_active_clk_exp.o \
$(sm_io_fmc_active_clk_DIR)/sm_io_fmc_active_clk_exports.o \
$(sm_io_fmc_active_clk_DIR)/sm_io_fmc_active_clk_defaults.o
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_codes.h
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#ifndef _SM_IO_FMC_ACTIVE_CLK_CODES_H_
#define _SM_IO_FMC_ACTIVE_CLK_CODES_H_
/* Messaging OPCODES */
#define FMC_ACTIVE_CLK_OPCODE_TYPE uint32_t
#define FMC_ACTIVE_CLK_OPCODE_SIZE (sizeof (FMC_ACTIVE_CLK_OPCODE_TYPE))
#define FMC_ACTIVE_CLK_OPCODE_SI571_OE 0
#define FMC_ACTIVE_CLK_NAME_SI571_OE "fmc_active_clk_si571_oe"
#define FMC_ACTIVE_CLK_OPCODE_PLL_FUNCTION 1
#define FMC_ACTIVE_CLK_NAME_PLL_FUNCTION "fmc_active_clk_pll_function"
#define FMC_ACTIVE_CLK_OPCODE_PLL_STATUS 2
#define FMC_ACTIVE_CLK_NAME_PLL_STATUS "fmc_active_clk_pll_status"
#define FMC_ACTIVE_CLK_OPCODE_CLK_SEL 3
#define FMC_ACTIVE_CLK_NAME_CLK_SEL "fmc_active_clk_clk_sel"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_CFG_DEFAULTS 4
#define FMC_ACTIVE_CLK_NAME_AD9510_CFG_DEFAULTS "fmc_active_clk_ad9510_cfg_defaults"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_A_DIV 5
#define FMC_ACTIVE_CLK_NAME_AD9510_PLL_A_DIV "fmc_active_clk_ad9510_pll_a_div"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_B_DIV 6
#define FMC_ACTIVE_CLK_NAME_AD9510_PLL_B_DIV "fmc_active_clk_ad9510_pll_b_div"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_PRESCALER 7
#define FMC_ACTIVE_CLK_NAME_AD9510_PLL_PRESCALER "fmc_active_clk_ad9510_pll_prescaler"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_R_DIV 8
#define FMC_ACTIVE_CLK_NAME_AD9510_R_DIV "fmc_active_clk_ad9510_r_div"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_PDOWN 9
#define FMC_ACTIVE_CLK_NAME_AD9510_PLL_PDOWN "fmc_active_clk_ad9510_pll_pdown"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_MUX_STATUS 10
#define FMC_ACTIVE_CLK_NAME_AD9510_MUX_STATUS "fmc_active_clk_ad9510_mux_status"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_CP_CURRENT 11
#define FMC_ACTIVE_CLK_NAME_AD9510_CP_CURRENT "fmc_active_clk_ad9510_cp_current"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_OUTPUTS 12
#define FMC_ACTIVE_CLK_NAME_AD9510_OUTPUTS "fmc_active_clk_ad9510_outputs"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_CLK_SEL 13
#define FMC_ACTIVE_CLK_NAME_AD9510_PLL_CLK_SEL "fmc_active_clk_ad9510_pll_clk_sel"
#define FMC_ACTIVE_CLK_OPCODE_SI571_SET_FREQ 14
#define FMC_ACTIVE_CLK_NAME_SI571_SET_FREQ "fmc_active_clk_si571_set_freq"
#define FMC_ACTIVE_CLK_OPCODE_SI571_GET_DEFAULTS 15
#define FMC_ACTIVE_CLK_NAME_SI571_GET_DEFAULTS "fmc_active_clk_si571_get_defaults"
#define FMC_ACTIVE_CLK_OPCODE_END 16
/* Messaging Reply OPCODES */
#define FMC_ACTIVE_CLK_REPLY_TYPE uint32_t
#define FMC_ACTIVE_CLK_REPLY_SIZE (sizeof (FMC_ACTIVE_CLK_REPLY_TYPE))
#define FMC_ACTIVE_CLK_OK 0
/* Operation was successful */
#define FMC_ACTIVE_CLK_ERR 1
/* Could not set/get value */
#define FMC_ACTIVE_CLK_UNINPL 2
/* Unimplemented function or operation */
#define FMC_ACTIVE_CLK_REPLY_END 3
/* End marker */
#endif
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_core.c
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#include "bpm_server.h"
/* Private headers */
#include "sm_io_fmc_active_clk_defaults.h"
#include "sm_io_fmc_active_clk_core.h"
#include "chips_addr.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
#undef ASSERT_TEST
#endif
#define ASSERT_TEST(test_boolean, err_str, err_goto_label,
/* err_core */
...) \
ASSERT_HAL_TEST(test_boolean, SM_IO, "[sm_io_fmc_active_clk_core]", \
err_str, err_goto_label,
/* err_core */
__VA_ARGS__)
#ifdef ASSERT_ALLOC
#undef ASSERT_ALLOC
#endif
#define ASSERT_ALLOC(ptr, err_goto_label,
/* err_core */
...) \
ASSERT_HAL_ALLOC(ptr, SM_IO, "[sm_io_fmc_active_clk_core]", \
smio_err_str(SMIO_ERR_ALLOC), \
err_goto_label,
/* err_core */
__VA_ARGS__)
#ifdef CHECK_ERR
#undef CHECK_ERR
#endif
#define CHECK_ERR(err, err_type) \
CHECK_HAL_ERR(err, SM_IO, "[sm_io_fmc_active_clk_core]", \
smio_err_str (err_type))
/* Creates a new instance of Device Information */
smio_fmc_active_clk_t
*
smio_fmc_active_clk_new
(
smio_t
*
parent
)
{
assert
(
parent
);
smio_fmc_active_clk_t
*
self
=
(
smio_fmc_active_clk_t
*
)
zmalloc
(
sizeof
*
self
);
ASSERT_ALLOC
(
self
,
err_self_alloc
);
uint32_t
inst_id
=
smio_get_inst_id
(
parent
);
DBE_DEBUG
(
DBG_SM_IO
|
DBG_LVL_TRACE
,
"[sm_io:fmc_active_clk_core] AD9510 initializing, "
"addr: 0x%08X, Inst ID: %u
\n
"
,
fmc_active_clk_ad9510_addr
,
inst_id
);
self
->
smch_ad9510
=
smch_ad9510_new
(
parent
,
FMC_ACTIVE_CLK_AD9510_SPI_OFFS
,
fmc_active_clk_ad9510_addr
,
0
);
ASSERT_ALLOC
(
self
->
smch_ad9510
,
err_smch_ad9510_alloc
);
DBE_DEBUG
(
DBG_SM_IO
|
DBG_LVL_TRACE
,
"[sm_io:fmc_active_clk_core] SI571 initializing, "
"addr: 0x%08X, Inst ID: %u
\n
"
,
fmc_active_clk_si571_addr
,
inst_id
);
self
->
smch_si571
=
smch_si57x_new
(
parent
,
FMC_ACTIVE_CLK_SI571_I2C_OFFS
,
fmc_active_clk_si571_addr
[
inst_id
],
0
);
ASSERT_ALLOC
(
self
->
smch_si571
,
err_smch_si571_alloc
);
return
self
;
err_smch_si571_alloc:
if
(
self
->
smch_ad9510
!=
NULL
)
{
smch_ad9510_destroy
(
&
self
->
smch_ad9510
);
}
err_smch_ad9510_alloc:
smch_24aa64_destroy
(
&
self
->
smch_24aa64
);
err_smch_24aa64_alloc:
if
(
self
->
smch_pca9547
!=
NULL
)
{
smch_pca9547_destroy
(
&
self
->
smch_pca9547
);
}
err_smch_pca9547_alloc:
err_num_fmc_active_clk_smios:
free
(
self
);
err_self_alloc:
return
NULL
;
}
/* Destroy an instance of the Device Information */
smio_err_e
smio_fmc_active_clk_destroy
(
smio_fmc_active_clk_t
**
self_p
)
{
assert
(
self_p
);
if
(
*
self_p
)
{
smio_fmc_active_clk_t
*
self
=
*
self_p
;
smch_si57x_destroy
(
&
self
->
smch_si571
);
smch_ad9510_destroy
(
&
self
->
smch_ad9510
);
free
(
self
);
*
self_p
=
NULL
;
}
return
SMIO_SUCCESS
;
}
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_core.h
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#ifndef _SM_IO_FMC_ACTIVE_CLK_CORE_H_
#define _SM_IO_FMC_ACTIVE_CLK_CORE_H_
#define SMIO_AD9510_HANDLER(smio_handler) ((smch_ad9510_t *) smio_handler->smch_ad9510)
#define SMIO_SI57X_HANDLER(smio_handler) ((smch_si57x_t *) smio_handler->smch_si571)
typedef
struct
{
smch_ad9510_t
*
smch_ad9510
;
/* AD9510 chip handler */
smch_si57x_t
*
smch_si571
;
/* SI571 chip handler */
}
smio_fmc_active_clk_t
;
/***************** Our methods *****************/
/* Creates a new instance of the smio realization */
smio_fmc_active_clk_t
*
smio_fmc_active_clk_new
(
smio_t
*
parent
);
/* Destroys the smio realization */
smio_err_e
smio_fmc_active_clk_destroy
(
smio_fmc_active_clk_t
**
self_p
);
#endif
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_defaults.c
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#include "bpm_server.h"
/* Private headers */
#include "sm_io_fmc_active_clk_defaults.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
#undef ASSERT_TEST
#endif
#define ASSERT_TEST(test_boolean, err_str, err_goto_label,
/* err_core */
...) \
ASSERT_HAL_TEST(test_boolean, SM_IO, "[sm_io:fmc_active_clk_defaults]", \
err_str, err_goto_label,
/* err_core */
__VA_ARGS__)
#ifdef ASSERT_ALLOC
#undef ASSERT_ALLOC
#endif
#define ASSERT_ALLOC(ptr, err_goto_label,
/* err_core */
...) \
ASSERT_HAL_ALLOC(ptr, SM_IO, "[sm_io:fmc_active_clk_defaults]", \
smio_err_str(SMIO_ERR_ALLOC), \
err_goto_label,
/* err_core */
__VA_ARGS__)
#ifdef CHECK_ERR
#undef CHECK_ERR
#endif
#define CHECK_ERR(err, err_type) \
CHECK_HAL_ERR(err, SM_IO, "[sm_io:fmc_active_clk_defaults]", \
smio_err_str (err_type))
#define SMIO_FMC_ACTIVE_CLK_LIBBPMCLIENT_LOG_MODE "a"
/* We use the actual libclient to send and configure our default values,
* maintaining internal consistency. So, in fact, we are sending ourselves
* a message containing the default values. Because of this approach, we
* only get to default our values when the functions are already exported
* to the broker, which happens on a late stage. This could cause a fast
* client to get an inconsistent state from our server */
/* TODO: Avoid exporting the functions before we have initialized
* our server with the default values */
smio_err_e
fmc_active_clk_config_defaults
(
char
*
broker_endp
,
char
*
service
,
const
char
*
log_file_name
)
{
(
void
)
log_file_name
;
DBE_DEBUG
(
DBG_SM_IO
|
DBG_LVL_INFO
,
"[sm_io:fmc_active_clk_defaults] Configuring SMIO "
"FMC_ACTIVE_CLK with default values ...
\n
"
);
bpm_client_err_e
client_err
=
BPM_CLIENT_SUCCESS
;
smio_err_e
err
=
SMIO_SUCCESS
;
bpm_client_t
*
config_client
=
bpm_client_new_log_mode
(
broker_endp
,
0
,
log_file_name
,
SMIO_FMC_ACTIVE_CLK_LIBBPMCLIENT_LOG_MODE
);
ASSERT_ALLOC
(
config_client
,
err_alloc_client
);
client_err
=
bpm_set_fmc_pll_function
(
config_client
,
service
,
FMC_ACTIVE_CLK_DFLT_PLL_FUNC
);
ASSERT_TEST
(
client_err
==
BPM_CLIENT_SUCCESS
,
"Could not set FMC PLL function"
,
err_param_set
,
SMIO_ERR_CONFIG_DFLT
);
client_err
=
bpm_set_fmc_clk_sel
(
config_client
,
service
,
FMC_ACTIVE_CLK_DFLT_CLK_SEL
);
ASSERT_TEST
(
client_err
==
BPM_CLIENT_SUCCESS
,
"Could not set FMC CLK SEL function"
,
err_param_set
,
SMIO_ERR_CONFIG_DFLT
);
client_err
=
bpm_ad9510_cfg_defaults
(
config_client
,
service
,
0
);
ASSERT_TEST
(
client_err
==
BPM_CLIENT_SUCCESS
||
client_err
==
BPM_CLIENT_ERR_AGAIN
,
"Could not configure AD9510"
,
err_param_set
,
SMIO_ERR_CONFIG_DFLT
);
client_err
=
bpm_set_si571_defaults
(
config_client
,
service
,
FMC_ACTIVE_CLK_DFLT_SI57X_FOUT_FACTORY
);
ASSERT_TEST
(
client_err
==
BPM_CLIENT_SUCCESS
,
"Could not get Si571 defaults"
,
err_param_set
,
SMIO_ERR_CONFIG_DFLT
);
client_err
=
bpm_set_si571_set_freq
(
config_client
,
service
,
FMC_ACTIVE_CLK_DFLT_SI57X_FOUT
);
ASSERT_TEST
(
client_err
==
BPM_CLIENT_SUCCESS
,
"Could not set Si571 frequency"
,
err_param_set
,
SMIO_ERR_CONFIG_DFLT
);
client_err
=
bpm_set_si571_oe
(
config_client
,
service
,
FMC_ACTIVE_CLK_DFLT_SI571_OE
);
ASSERT_TEST
(
client_err
==
BPM_CLIENT_SUCCESS
,
"Could not enable SI571 Output"
,
err_param_set
,
SMIO_ERR_CONFIG_DFLT
);
err_param_set:
bpm_client_destroy
(
&
config_client
);
err_alloc_client:
DBE_DEBUG
(
DBG_SM_IO
|
DBG_LVL_INFO
,
"[sm_io:fmc_active_clk_defaults] Exiting Config thread %s
\n
"
,
service
);
return
err
;
}
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_defaults.h
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#ifndef _FMC_ACTIVE_CLK_DEFAULTS_H_
#define _FMC_ACTIVE_CLK_DEFAULTS_H_
#include "sm_io_err.h"
#include "chips/si57x_regs.h"
#define FMC_ACTIVE_CLK_DFLT_PLL_FUNC 0x1
#define FMC_ACTIVE_CLK_DFLT_CLK_SEL 0x0
/* Clock from FMC front panel */
#define FMC_ACTIVE_CLK_DFLT_SI571_OE 0x1
#define FMC_ACTIVE_CLK_DFLT_SI57X_FOUT_FACTORY SI57X_FOUT_FACTORY_DFLT
#define FMC_ACTIVE_CLK_DFLT_SI57X_FOUT 113040445
/* 113.040445 MHz default */
smio_err_e
fmc_active_clk_config_defaults
(
char
*
broker_endp
,
char
*
service
,
const
char
*
log_file_name
);
#endif
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_exp.c
0 → 100644
View file @
444378c7
This diff is collapsed.
Click to expand it.
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_exp.h
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#ifndef _FMC_ACTIVE_CLK_H_
#define _FMC_ACTIVE_CLK_H_
/* Known modules IDs (from SDB records defined in FPGA) */
#define FMC_ACTIVE_CLK_SDB_DEVID 0x88c67d9c
#define FMC_ACTIVE_CLK_SDB_NAME "FMC_ACTIVE_CLK"
extern
const
smio_bootstrap_ops_t
fmc_active_clk_bootstrap_ops
;
#endif
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_exports.c
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#include "sm_io_exports_helper.h"
#include "sm_io_codes.h"
/* Description SMIO FMC_ACTIVE_CLK functions */
disp_op_t
fmc_active_clk_si571_oe_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_SI571_OE
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_SI571_OE
,
.
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
fmc_active_clk_pll_func_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_PLL_FUNCTION
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_PLL_FUNCTION
,
.
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
fmc_active_clk_pll_status_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_PLL_STATUS
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_PLL_STATUS
,
.
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
fmc_active_clk_clk_sel_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_CLK_SEL
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_CLK_SEL
,
.
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
fmc_active_clk_ad9510_cfg_defaults_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_CFG_DEFAULTS
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_CFG_DEFAULTS
,
.
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
fmc_active_clk_ad9510_pll_a_div_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_PLL_A_DIV
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_A_DIV
,
.
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
fmc_active_clk_ad9510_pll_b_div_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_PLL_B_DIV
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_B_DIV
,
.
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
fmc_active_clk_ad9510_pll_prescaler_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_PLL_PRESCALER
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_PRESCALER
,
.
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
fmc_active_clk_ad9510_r_div_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_R_DIV
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_R_DIV
,
.
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
fmc_active_clk_ad9510_pll_pdown_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_PLL_PDOWN
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_PDOWN
,
.
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
fmc_active_clk_ad9510_mux_status_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_MUX_STATUS
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_MUX_STATUS
,
.
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
fmc_active_clk_ad9510_cp_current_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_CP_CURRENT
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_CP_CURRENT
,
.
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
fmc_active_clk_ad9510_outputs_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_OUTPUTS
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_OUTPUTS
,
.
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
fmc_active_clk_ad9510_pll_clk_sel_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_AD9510_PLL_CLK_SEL
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_AD9510_PLL_CLK_SEL
,
.
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
fmc_active_clk_si571_set_freq_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_SI571_SET_FREQ
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_SI571_SET_FREQ
,
.
retval
=
DISP_ARG_END
,
.
retval_owner
=
DISP_OWNER_OTHER
,
.
args
=
{
DISP_ARG_ENCODE
(
DISP_ATYPE_UINT32
,
uint32_t
),
DISP_ARG_ENCODE
(
DISP_ATYPE_DOUBLE
,
double
),
DISP_ARG_END
}
};
disp_op_t
fmc_active_clk_si571_get_defaults_exp
=
{
.
name
=
FMC_ACTIVE_CLK_NAME_SI571_GET_DEFAULTS
,
.
opcode
=
FMC_ACTIVE_CLK_OPCODE_SI571_GET_DEFAULTS
,
.
retval
=
DISP_ARG_END
,
.
retval_owner
=
DISP_OWNER_OTHER
,
.
args
=
{
DISP_ARG_ENCODE
(
DISP_ATYPE_UINT32
,
uint32_t
),
DISP_ARG_ENCODE
(
DISP_ATYPE_DOUBLE
,
double
),
DISP_ARG_END
}
};
/* Exported function description */
const
disp_op_t
*
fmc_active_clk_exp_ops
[]
=
{
&
fmc_active_clk_si571_oe_exp
,
&
fmc_active_clk_pll_func_exp
,
&
fmc_active_clk_pll_status_exp
,
&
fmc_active_clk_clk_sel_exp
,
&
fmc_active_clk_ad9510_cfg_defaults_exp
,
&
fmc_active_clk_ad9510_pll_a_div_exp
,
&
fmc_active_clk_ad9510_pll_b_div_exp
,
&
fmc_active_clk_ad9510_pll_prescaler_exp
,
&
fmc_active_clk_ad9510_r_div_exp
,
&
fmc_active_clk_ad9510_pll_pdown_exp
,
&
fmc_active_clk_ad9510_mux_status_exp
,
&
fmc_active_clk_ad9510_cp_current_exp
,
&
fmc_active_clk_ad9510_outputs_exp
,
&
fmc_active_clk_ad9510_pll_clk_sel_exp
,
&
fmc_active_clk_si571_set_freq_exp
,
&
fmc_active_clk_si571_get_defaults_exp
,
NULL
};
src/sm_io/modules/fmc_active_clk/sm_io_fmc_active_clk_exports.h
0 → 100644
View file @
444378c7
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#ifndef _SM_IO_FMC_ACTIVE_CLK_EXPORTS_H_
#define _SM_IO_FMC_ACTIVE_CLK_EXPORTS_H_
#include "disptable.h"
extern
disp_op_t
fmc_active_clk_si571_oe_exp
;
extern
disp_op_t
fmc_active_clk_pll_func_exp
;
extern
disp_op_t
fmc_active_clk_pll_status_exp
;
extern
disp_op_t
fmc_active_clk_clk_sel_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_cfg_defaults_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_pll_a_div_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_pll_b_div_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_pll_prescaler_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_r_div_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_pll_pdown_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_mux_status_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_cp_current_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_outputs_exp
;
extern
disp_op_t
fmc_active_clk_ad9510_pll_clk_sel_exp
;
extern
disp_op_t
fmc_active_clk_si571_set_freq_exp
;
extern
disp_op_t
fmc_active_clk_si571_get_defaults_exp
;
extern
const
disp_op_t
*
fmc_active_clk_exp_ops
[];
#endif
src/sm_io/modules/modules.mk
View file @
444378c7
include $(SRC_DIR)/sm_io/modules/fmc130m_4ch/fmc130m_4ch.mk \
$(SRC_DIR)/sm_io/modules/fmc250m_4ch/fmc250m_4ch.mk \
$(SRC_DIR)/sm_io/modules/fmc_adc_common/fmc_adc_common.mk \
$(SRC_DIR)/sm_io/modules/fmc_active_clk/fmc_active_clk.mk \
$(SRC_DIR)/sm_io/modules/acq/acq.mk \
$(SRC_DIR)/sm_io/modules/dsp/dsp.mk \
$(SRC_DIR)/sm_io/modules/swap/swap.mk \
...
...
@@ -13,6 +14,7 @@ sm_io_modules_OBJS = $(sm_io_modules_DIR)/sm_io_codes.o \
$(sm_io_fmc130m_4ch_OBJS) \
$(sm_io_fmc250m_4ch_OBJS) \
$(sm_io_fmc_adc_common_OBJS) \
$(sm_io_fmc_active_clk_OBJS) \
$(sm_io_acq_OBJS) \
$(sm_io_dsp_OBJS) \
$(sm_io_swap_OBJS) \
...
...
src/sm_io/modules/sm_io_codes.c
View file @
444378c7
...
...
@@ -13,6 +13,7 @@ const disp_op_t **smio_exp_ops [] = {
fmc130m_4ch_exp_ops
,
fmc250m_4ch_exp_ops
,
fmc_adc_common_exp_ops
,
fmc_active_clk_exp_ops
,
swap_exp_ops
,
rffe_exp_ops
,
afc_diag_exp_ops
,
...
...
src/sm_io/modules/sm_io_codes.h
View file @
444378c7
...
...
@@ -25,6 +25,7 @@ typedef struct _smio_rffe_version_t smio_rffe_version_t;
#include "sm_io_fmc130m_4ch_codes.h"
#include "sm_io_fmc250m_4ch_codes.h"
#include "sm_io_fmc_adc_common_codes.h"
#include "sm_io_fmc_active_clk_codes.h"
#include "sm_io_acq_codes.h"
#include "sm_io_dsp_codes.h"
#include "sm_io_swap_codes.h"
...
...
@@ -35,6 +36,7 @@ typedef struct _smio_rffe_version_t smio_rffe_version_t;
#include "sm_io_fmc130m_4ch_exports.h"
#include "sm_io_fmc250m_4ch_exports.h"
#include "sm_io_fmc_adc_common_exports.h"
#include "sm_io_fmc_active_clk_exports.h"
#include "sm_io_acq_exports.h"
#include "sm_io_dsp_exports.h"
#include "sm_io_swap_exports.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment