Giter Club home page Giter Club logo

mcp342x's People

Contributors

stephendpmurphy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

makermaxinc

mcp342x's Issues

Bug in "If' statement at end of writeConfig API

The final IF statement does an assignment instead of a comparison..

mcp342x_return_code_t mcp342x_writeConfig(mcp342x_dev_t *dev) {
    mcp342x_return_code_t ret = MCP342x_RET_OK;

    if( dev == NULL ) {
        // The pointer to the mcp342x dev is NULL
        ret = MCP342x_RET_NULL_PTR;
    }

    if( (dev->registers.bits.config.bits.conv_mode >= MCP342x_CM__MAX__) ||
        (dev->registers.bits.config.bits.gain >= MCP342x_GAIN__MAX__) ||
        (dev->registers.bits.config.bits.sample_rate >= MCP342x_SR__MAX__) ) {
        // One of the config values provideed to use is not valid.
        ret = MCP342x_RET_INV_PARAM;
    }

    if( ret = MCP342x_RET_OK ) {
        // Write the config to our device
        ret = dev->intf.write((dev->intf.i2c_addr << 1), &dev->registers.bits.config.byte, 0x01);
    }

    return ret;
}

Create initial API

The current source is built around using STM HAL I2c calls. We want these to be abstracted away through function pointers, as well as adding the ability to instantiate multiple entities of the driver if a developer has several ADC chips.

Add settings struct to enable/disable ADC channels

The API currently allows a user to sample any channel they want. In the future, it would be nice to have an API to retrieve samples from all enabled config. Offloading the work to sample multiple channels from the app to the driver.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.