Skip to content

Basic oversampling#351

Open
jamwaffles wants to merge 3 commits intomainfrom
basic-oversampling
Open

Basic oversampling#351
jamwaffles wants to merge 3 commits intomainfrom
basic-oversampling

Conversation

@jamwaffles
Copy link
Collaborator

Adds set_oversampling method to SubDevice as a stopgap solution to configure oversampling. The proper solution will look like some sort of ESI file parsing but that's a long way off. Example usage for EL3702:

const OVERSAMPLE_MUL: u8 = 8;

for mut subdevice in group.iter_mut(&maindevice) {
    if subdevice.name() == "EL3702" {
        log::info!("Found EL3702");

        // Configure oversampling for both input channels
        subdevice.set_oversampling(&[
            (0x1a00, OVERSAMPLE_MUL),
            (0x1a80, OVERSAMPLE_MUL),
        ]);

        subdevice.set_dc_sync(DcSync::Sync01 {
            sync1_period: Duration::from_micros(
                TICK_INTERVAL.as_micros() as u64 * OVERSAMPLE_MUL as u64,
            ),
        });
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant