Giter Site home page Giter Site logo

max11615's Introduction

MAX11615 C Library

C library for the MAX11615EEE A/D multiplexer using STM32 HAL.

This library is made for the STM32 HAL (Hardware Abstraction Library) platform. The example code is for STM32CubeMX and Keil uVision 5 IDE.


Usage

/* USER CODE BEGIN Includes */
#include "max11615.h"          // include the library
/* USER CODE BEGIN 0 */
#define ADDRESS_MAX11615  0x66
MAX11615 adcDriver_1;
/* USER CODE END 0 */

int main(void)
{
    /* USER CODE BEGIN 2 */

    // initialize the adcDriver_1 with the I2C handle, the I2C address \
       and the settings for analog reference according to the datasheet
    // analog ref: (internal) + (reference not connected) \
                    + (internal reference always on)
    MAX11615_Init(&adcDriver_1, &hi2c1, ADDRESS_MAX11615, 4+2+1);

    uint16_t adc_value = 0;
    MAX11615_ADC_Read(&adcDriver_1, 0, &adc_value); 
    // read adc value from channel 0 and print to console
    printf("ADC Value CH0: %d\n", adc_value);

}

Restrictions

The library was developed and tested using a MAX11615 chip. You might however use it with the other chips from this family too.

  • MAX11612
  • MAX11613
  • MAX11614
  • MAX11615
  • MAX11616
  • MAX11617

Sources

MAX11612 Datasheet: maximintegrated.com

MAX11609EEE Breakout Board Arduino Library github.com/AllAboutEE


License

MIT License

Copyright (c) 2018 ETA Systems

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

max11615's People

Contributors

mnemocron avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

max11615's Issues

Bug in example code in readme

Hey, in your README.md you have the following snippet of example code:

    uint8_t adc_value = 0;
    MAX11615_ADC_Read(&adcDriver_1, 0, adc_value); 

However, the adc output return value is uint16_t* val as here:

uint8_t MAX11615_ADC_Read(MAX11615* chip, uint8_t channel, uint16_t* val){

Makes sense this would 16b, as the ADC itself is 12bit.

Thanks for the driver. Just a simple readme tweak may help others :)

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.