Skip to content

Commit

Permalink
add API to enable external ADC input
Browse files Browse the repository at this point in the history
  • Loading branch information
sergforce committed Jan 25, 2019
1 parent 91b5107 commit bfd5418
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions liblms7002m.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,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 @@ -1349,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 bfd5418

Please sign in to comment.