Skip to content

ADC: improve calibration by using a polynomial #74

@jnaulet

Description

@jnaulet

Calibration can be improved by using some kind of polynomial.
As not all architectures support floating point, it might take the form of a series of fractions, like:

struct adc_polynomial {
    unsigned long numerator;
    unsigned long denominator;
};

While calibrating the ADC, it might look like:

    static struct adc_polynomial poly[3] = {
        { 64, 73 }, { 2442, 10000 }, { 32, 37 }
    };

    (void)adc_set_polynomial(&ADCx, poly, (size_t)3);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions