diff --git a/liblms7002m.c b/liblms7002m.c index 3b7f556..018a946 100644 --- a/liblms7002m.c +++ b/liblms7002m.c @@ -177,9 +177,11 @@ int lms7_ldo_enable(struct lms7_state* st, bool enable) uint32_t lod_regs[] = { MAKE_LMS7002_0x0092( 0, 0, 0, 0, e, e, 0, e, 0, 0, 0, e, 0, e, 0, e), MAKE_LMS7002_0x0093( 0, 0, 0, 0, 0, 0, 0, e, e, 0, e, e, 0, 0, 0, e), + MAKE_LMS7002_0x0095( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), + MAKE_LMS7002_0x0096( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), MAKE_LMS7002_0x00A6( 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1), - MAKE_LMS7002_0x00A1( 101, 140 ), - MAKE_LMS7002_0x00A4( 140, 101 ), + MAKE_LMS7002_0x00A1( 101, 101 ), + MAKE_LMS7002_0x00A4( 101, 101 ), }; return lms7_spi_post(st, REG_COUNT(lod_regs), lod_regs); } @@ -1293,6 +1295,8 @@ int lms7_rbb_set_lpfx_bandwidth(struct lms7_state* st, unsigned bw) int lms7_rbb_set_bandwidth(struct lms7_state* st, unsigned bw) { int res; + if (bw < 100000) + bw = 100000; int cfb_tia_rfe = (int)(1680000000U/bw - 10); int ccomp_tia_rfe = cfb_tia_rfe/100; @@ -1347,6 +1351,14 @@ int lms7_rbb_set_pga(struct lms7_state* st, unsigned gain) return lms7_spi_post(st, REG_COUNT(regs), regs); } +int lms7_rbb_set_ext(struct lms7_state* st) +{ + uint32_t regs[] = { + MAKE_LMS7002_0x0119(1, 20, 20, 1) + }; + return lms7_spi_post(st, REG_COUNT(regs), regs); +} + /************************************************************************ * AFE configuration diff --git a/liblms7002m.h b/liblms7002m.h index 00b6989..4bc07a9 100644 --- a/liblms7002m.h +++ b/liblms7002m.h @@ -163,6 +163,7 @@ int lms7_rbb_disable(struct lms7_state* st); int lms7_rbb_set_path(struct lms7_state* st, enum rbb_path path); int lms7_rbb_set_pga(struct lms7_state* st, unsigned gain); int lms7_rbb_set_bandwidth(struct lms7_state* st, unsigned bw); +int lms7_rbb_set_ext(struct lms7_state* st); // AFE functions int lms7_afe_ctrl(struct lms7_state* st, bool rxa, bool rxb, bool txa, bool txb);