Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
lerwys committed Aug 22, 2017
2 parents 6499a6b + 548d362 commit 05857ea
Show file tree
Hide file tree
Showing 20 changed files with 326 additions and 84 deletions.
4 changes: 0 additions & 4 deletions core/boards/common/src/common/c/chips_addr_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@

#include "halcs_server.h"

/* FMC ACTIVE CLOCK chip addresses */
const uint32_t fmc_active_clk_si571_addr = 0x49;
const uint32_t fmc_active_clk_ad9510_addr = 0x01;

1 change: 1 addition & 0 deletions core/common/include/chips/si57x_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
#define SI57X_REG_START SI57X_REG_HS_N1

#define SI57X_NUM_DIV_REGS 6
#define SI57X_NUM_RFREQ_REGS 5

#endif

1 change: 1 addition & 0 deletions core/common/include/chips/sm_ch_si57x_defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define SMCH_SI57X_DFLT_HSDIV 0
#define SMCH_SI57X_DFLT_RFREQ 0ULL
#define SMCH_SI57X_DFLT_FREQUENCY SI57X_FOUT_FACTORY_DFLT
#define SMCH_SI57X_DFLT_FACTORY SI57X_FOUT_FACTORY_DFLT

#endif

3 changes: 0 additions & 3 deletions core/common/include/chips_addr_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
extern "C" {
#endif

extern const uint32_t fmc_active_clk_si571_addr;
extern const uint32_t fmc_active_clk_ad9510_addr;

#ifdef __cplusplus
}
#endif
Expand Down
30 changes: 30 additions & 0 deletions core/common/include/hal_stddef.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,36 @@

#define ARRAY_SIZE(ARRAY) (sizeof(ARRAY)/sizeof((ARRAY)[0]))

/*
* Divide positive or negative dividend by positive or negative divisor
* and round to closest integer. Result is undefined for negative
* divisors if he dividend variable type is unsigned and for negative
* dividends if the divisor variable type is unsigned.
*/
#define DIV_ROUND_CLOSEST(x, divisor)( \
{ \
typeof(x) __x = x; \
typeof(divisor) __d = divisor; \
(((typeof(x))-1) > 0 || \
((typeof(divisor))-1) > 0 || \
(((__x) > 0) == ((__d) > 0))) ? \
(((__x) + ((__d) / 2)) / (__d)) : \
(((__x) - ((__d) / 2)) / (__d)); \
} \
)
/*
* Same as above but for u64 dividends. divisor must be a 32-bit
* number.
*/
#define DIV_ROUND_CLOSEST_ULL(x, divisor)( \
{ \
typeof(divisor) __d = divisor; \
unsigned long long _tmp = (x) + (__d) / 2; \
do_div(_tmp, __d); \
_tmp; \
} \
)

/* Signal handler function pointer */
typedef void (*sig_handler_fp)(int sig, siginfo_t *siginfo, void *context);
/* Wait child handler function pointer */
Expand Down
22 changes: 17 additions & 5 deletions core/common/include/hw/wb_acq_core_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* File : wb_acq_core_regs.h
* Author : auto-generated by wbgen2 from acq_core.wb
* Created : Fri Mar 24 14:49:10 2017
* Created : Tue Aug 15 08:46:29 2017
* Standard : ANSI C
THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE acq_core.wb
DO NOT HAND-EDIT UNLESS IT'S ABSOLUTELY NECESSARY!
*/

/* This file has been modified! */
/* This file has been modified to include the ML605 fix! */

#ifndef __WBGEN2_REGDEFS_ACQ_CORE_WB
#define __WBGEN2_REGDEFS_ACQ_CORE_WB
Expand Down Expand Up @@ -192,10 +192,22 @@
#define ACQ_CORE_ACQ_CHAN_CTL_DTRIG_WHICH_R(reg) WBGEN2_GEN_READ(reg, 8, 5)

/* definitions for field: Reserved1 in reg: Acquisition channel control */
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED1_MASK WBGEN2_GEN_MASK(13, 19)
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED1_MASK WBGEN2_GEN_MASK(13, 3)
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED1_SHIFT 13
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED1_W(value) WBGEN2_GEN_WRITE(value, 13, 19)
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED1_R(reg) WBGEN2_GEN_READ(reg, 13, 19)
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED1_W(value) WBGEN2_GEN_WRITE(value, 13, 3)
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED1_R(reg) WBGEN2_GEN_READ(reg, 13, 3)

/* definitions for field: Number of acquisition channels in reg: Acquisition channel control */
#define ACQ_CORE_ACQ_CHAN_CTL_NUM_CHAN_MASK WBGEN2_GEN_MASK(16, 5)
#define ACQ_CORE_ACQ_CHAN_CTL_NUM_CHAN_SHIFT 16
#define ACQ_CORE_ACQ_CHAN_CTL_NUM_CHAN_W(value) WBGEN2_GEN_WRITE(value, 16, 5)
#define ACQ_CORE_ACQ_CHAN_CTL_NUM_CHAN_R(reg) WBGEN2_GEN_READ(reg, 16, 5)

/* definitions for field: Reserved2 in reg: Acquisition channel control */
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED2_MASK WBGEN2_GEN_MASK(21, 11)
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED2_SHIFT 21
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED2_W(value) WBGEN2_GEN_WRITE(value, 21, 11)
#define ACQ_CORE_ACQ_CHAN_CTL_RESERVED2_R(reg) WBGEN2_GEN_READ(reg, 21, 11)

/* definitions for register: Channel 0 Description */

Expand Down
4 changes: 4 additions & 0 deletions core/common/include/sm_ch_si57x.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ smch_err_e smch_si57x_get_defaults (smch_si57x_t *self, double fout);
smch_err_e smch_si57x_set_freq (smch_si57x_t *self, double *freq);
/* Get current frequency */
smch_err_e smch_si57x_get_freq (smch_si57x_t *self, double *freq);
/* Set startup frequency */
smch_err_e smch_si57x_set_fstartup (smch_si57x_t *self, double fstartup);
/* Get startup frequency */
double smch_si57x_get_fstartup (smch_si57x_t *self);

#ifdef __cplusplus
}
Expand Down
6 changes: 4 additions & 2 deletions core/sm_io/include/sm_io_fmc_active_clk_codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@
#define FMC_ACTIVE_CLK_OPCODE_RST_SWAP 17
#define FMC_ACTIVE_CLK_NAME_RST_SWAP "fmc_active_clk_rst_swap"
#define FMC_ACTIVE_CLK_OPCODE_AD9510_DATA 18
#define FMC_ACTIVE_CLK_NAME_AD9510_DATA "fmc130m_4ch_ad9510_data"
#define FMC_ACTIVE_CLK_OPCODE_END 19
#define FMC_ACTIVE_CLK_NAME_AD9510_DATA "fmc_active_clk_ad9510_data"
#define FMC_ACTIVE_CLK_OPCODE_SI571_FSTARTUP 19
#define FMC_ACTIVE_CLK_NAME_SI571_FSTARTUP "fmc_active_clk_si571_fstartup"
#define FMC_ACTIVE_CLK_OPCODE_END 20

/* Messaging Reply OPCODES */
#define FMC_ACTIVE_CLK_REPLY_TYPE uint32_t
Expand Down
Loading

0 comments on commit 05857ea

Please sign in to comment.