Giter Site home page Giter Site logo

chuyec / stmems_standard_c_drivers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stmicroelectronics/stmems_standard_c_drivers

0.0 2.0 0.0 232 KB

Platform-independent drivers source code for STMicroelectronics MEMS motion and environmental sensors, based on C standard.

C 100.00%

stmems_standard_c_drivers's Introduction

Index

        * Introduction
        * Integration details
        * Required properties
        * Copyright

Introduction

This repository contains platform-independent drivers and examples for STMicroelectronics MEMS sensors. The sensors drivers and examples are listed by product. Every product folder contains:

'driver' folder

This folder contains the driver files of Mems Sensor (.h and .c) to be included in your project. Driver documentation can be generated using Doxigen tool.

'examples' folder:

This folder contains examples showing how to integrate the Standard C driver in a project. They are written for STM32 Microcontroller using CubeMX API, but they can be used as a guideline for every platform.

Integration details

The driver is platform-independent, you only need to define the two functions for writing to and reading from Mems hardware bus (SPI or I2C).

Source code integration

  • Include in your project the driver files of Mems Sensor (.h and .c) located in the 'driver' folder of the desider product
  • Define in your code the read and write functions that use the I2C or SPI platform driver like the following:
    int32_t platform_write(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len)
    int32_t platform_read(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len)
  • Initialize the structure of device interface:
      dev_ctx.write_reg = platform_write;
      dev_ctx.read_reg = platform_read;
  • If needed by the platform read and write functions, initialize the handle parameter:
      dev_ctx.handle = &platform_handle;

Required properties

  • A standard C compiler for the desired target
  • A C library for the desired target and the desired interface (SPI, I2C)

More Information

http://st.com

Copyright

Copyright (C) 2018 STMicroelectronics

stmems_standard_c_drivers's People

Watchers

James Cloos avatar Denis Shreiber avatar

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.