Skip to content

Commit

Permalink
Merge pull request #1 from xtrx-sdr/master
Browse files Browse the repository at this point in the history
merge changes from upstream
  • Loading branch information
stef authored Apr 5, 2019
2 parents ad38a83 + bfd5418 commit ce50a50
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions liblms7002m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions liblms7002m.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ce50a50

Please sign in to comment.