Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lms_lpf_enable issue. #5

Closed
LazyDodo opened this issue Jun 27, 2013 · 1 comment
Closed

lms_lpf_enable issue. #5

LazyDodo opened this issue Jun 27, 2013 · 1 comment
Labels
Issue: Bug It's a bug and it oughta be fixed

Comments

@LazyDodo
Copy link
Contributor

lms_lpf_enable doesn't change the enable bit unless you're changing bandwidth, when calling it after lms_lpf_disable you have to specify something other than 28Mhz for the call to work.

proposed fix

// When enabling an LPF, we must select both the module and the filter bandwidth
void lms_lpf_enable( struct bladerf *dev, lms_module_t mod, lms_bw_t bw )
{
    uint8_t reg = (mod == RX) ? 0x54 : 0x34 ;
    uint8_t data ;
    // Check to see which bandwidth we have selected
    lms_spi_read( dev, reg, &data ) ;
    data |= (1<<1) ;
    if( (lms_bw_t)(data&0x3c>>2) != bw )
    {
        data &= ~0x3c ;
        data |= (bw<<2) ;
    }
    lms_spi_write( dev, reg, data ) ;
    // Check to see if we are bypassed
    lms_spi_read( dev, reg+1, &data ) ;
    if( data&(1<<6) )
    {
        data &= ~(1<<6) ;
        lms_spi_write( dev, reg+1, data ) ;
    }
    return ;
}
bpadalino added a commit that referenced this issue Jul 6, 2013
Fixed lms_lpf_enable() to always enable the LPF.
Fixed lms_lpf_disable() to not disturb DCO_DACCAL_LPF.
@bpadalino
Copy link
Contributor

Forgot to close out this issue. Whoops!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Bug It's a bug and it oughta be fixed
Projects
None yet
Development

No branches or pull requests

2 participants