Skip to content

Commit 76cbbff

Browse files
author
albezanc
committed
added docs
1 parent 3b677cf commit 76cbbff

File tree

8 files changed

+1957
-0
lines changed

8 files changed

+1957
-0
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Contributing guide
2+
This document serves as a checklist before contributing to this repository. It includes links to additional information if topics are unclear to you.
3+
4+
This guide mainly focuses on the proper use of Git.
5+
6+
### 1. Before opening an issue
7+
To report a bug/request please enter the issue in the right repository.
8+
9+
Please check the following boxes before posting an issue:
10+
- [ ] `Make sure you are using the latest commit (major releases are Tagged, but corrections are available as new commits).`
11+
- [ ] `Make sure your issue is a question/feedback/suggestion RELATED TO the software provided in this repository.` Otherwise, it should be discussed on the [ST Community forum](https://community.st.com/s/).
12+
- [ ] `Make sure your issue is not already reported/fixed on GitHub or discussed in a previous issue.` Please refer to the tab issue for the list of issues and pull-requests. Do not forget to browse to the **closed** issues.
13+
14+
### 2. Posting the issue
15+
When you have checked the previous boxes, you will find two templates (Bug Report or Other Issue) available in the **Issues** tab of the repository.
16+
17+
### 3. Pull Requests
18+
STMicroelectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
19+
20+
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual CLA (https://cla.st.com).
21+
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate CLA (https://cla.st.com) mentioning your GitHub account name.
22+
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account, you can check here (https://cla.st.com).
23+
24+
Please note that:
25+
* The Corporate CLA will always take precedence over the Individual CLA.
26+
* One CLA submission is sufficient for any project proposed by STMicroelectronics.
27+
28+
#### How to proceed
29+
30+
* We recommend to engage first a communication through an issue, in order to present your proposal and just to confirm that it corresponds to a STMicroelectronics domain or scope.
31+
* Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version.
32+
* Please submit one Pull Request for one new feature or proposal. This will facilitate the analysis and the final merge if accepted.
33+

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, STMicroelectronics
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# 1 - Introduction
2+
3+
Sensor driver for LIS2DH12 sensor written in C programming language. This repository contains the sensor driver files (.h and .c) to be included, or linked directly as a git submodule, in your project. The driver is MISRA compliant and the documentation can be generated using the [Doxygen](http://www.doxygen.org/) tool.
4+
5+
In order to `clone` the complete content of the repository folder, use the command:
6+
7+
```
8+
git clone https://github.com/STMicroelectronics/LIS2DH12/
9+
```
10+
11+
Some examples of driver usage can be found [here](https://github.com/STMicroelectronics/STMems_Standard_C_drivers).
12+
13+
------
14+
15+
16+
17+
# 2 - Integration details
18+
19+
The driver is platform-independent, you only need to define two functions for read and write transactions from the sensor hardware bus (ie. SPI or I²C). **A few devices integrate an extra bit in the communication protocol in order to enable multi read/write access, this bit must be managed in the read and write functions defined by the user.** Please refer to the read and write implementation in the [reference examples](https://github.com/STMicroelectronics/STMems_Standard_C_drivers/tree/master/LIS2DH12_STdC/examples).
20+
21+
22+
23+
### 2.a Source code integration
24+
25+
- Include in your project the driver files of the sensor (.h and .c)
26+
- Define in your code the read and write functions that use the I²C or SPI platform driver like the following:
27+
28+
```
29+
/** Please note that is MANDATORY: return 0 -> no Error.**/
30+
int32_t platform_write(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len)
31+
int32_t platform_read(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len)
32+
```
33+
34+
- Declare and initialize the structure of the device interface:
35+
36+
```
37+
xxxxxxx_ctx_t dev_ctx; /** xxxxxxx is the used part number **/
38+
dev_ctx.write_reg = platform_write;
39+
dev_ctx.read_reg = platform_read;
40+
```
41+
42+
- If needed by the platform read and write functions, initialize the handle parameter:
43+
44+
```
45+
dev_ctx.handle = &platform_handle;
46+
```
47+
48+
Some integration examples can be found [here](https://github.com/STMicroelectronics/STMems_Standard_C_drivers/tree/master/LIS2DH12_STdC/examples).
49+
50+
### 2.b Required properties
51+
52+
> - A standard C language compiler for the target MCU
53+
> - A C library for the target MCU and the desired interface (ie. SPI, I²C)
54+
55+
------
56+
57+
**More Information: [http://www.st.com](http://st.com/MEMS)**
58+
59+
**Copyright (C) 2021 STMicroelectronics**

Release_Notes.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7+
<title>Release Notes for LIS2DH12 Component</title>
8+
<style>
9+
code{white-space: pre-wrap;}
10+
span.smallcaps{font-variant: small-caps;}
11+
span.underline{text-decoration: underline;}
12+
div.column{display: inline-block; vertical-align: top; width: 50%;}
13+
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
14+
ul.task-list{list-style: none;}
15+
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
16+
</style>
17+
<link rel="stylesheet" href="_htmresc/mini-st_2020.css" />
18+
<!--[if lt IE 9]>
19+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
20+
<![endif]-->
21+
<link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
22+
</head>
23+
<body>
24+
<div class="row">
25+
<div class="col-sm-12 col-lg-4">
26+
<center>
27+
<h1 id="release-notes-for-lis2dh12-component-driver">Release Notes for LIS2DH12 Component Driver</h1>
28+
<p>Copyright © 2021 STMicroelectronics<br />
29+
</p>
30+
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo_2020.png" alt="ST logo" /></a>
31+
</center>
32+
<h1 id="license">License</h1>
33+
<p>This software component is licensed by ST under BSD 3-Clause license, the “License”. You may not use this component except in compliance with the License. You may obtain a copy of the License at:</p>
34+
<p><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause license</a></p>
35+
<h1 id="purpose">Purpose</h1>
36+
<p>This directory contains the LIS2DH12 component drivers.</p>
37+
</div>
38+
<section id="update-history" class="col-sm-12 col-lg-8">
39+
<h1>Update history</h1>
40+
<div class="collapse">
41+
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-June-2021</label>
42+
<div>
43+
<h2 id="main-changes">Main changes</h2>
44+
<h3 id="first-release">First release</h3>
45+
<ul>
46+
<li>First official release</li>
47+
</ul>
48+
<h2 id="section"></h2>
49+
</div>
50+
</div>
51+
</section>
52+
</div>
53+
<footer class="sticky">
54+
<div class="columns">
55+
<div class="column" style="width:95%;">
56+
<p>For complete documentation on LIS2DH12, visit: <a href="https://www.st.com/content/st_com/en/products/mems-and-sensors/accelerometers/lis2dh12.html">LIS2DH12</a></p>
57+
</div><div class="column" style="width:5%;">
58+
<p><abbr title="Based on template cx566953 version 2.0">Info</abbr></p>
59+
</div>
60+
</div>
61+
</footer>
62+
</body>
63+
</html>

Release_Notes.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
pagetitle: Release Notes for LIS2DH12 Component
3+
lang: en
4+
header-includes: <link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
5+
---
6+
7+
::: {.row}
8+
::: {.col-sm-12 .col-lg-4}
9+
10+
<center>
11+
# Release Notes for LIS2DH12 Component Driver
12+
Copyright &copy; 2021 STMicroelectronics\
13+
14+
[![ST logo](_htmresc/st_logo_2020.png)](https://www.st.com){.logo}
15+
</center>
16+
17+
# License
18+
19+
This software component is licensed by ST under BSD 3-Clause license, the "License".
20+
You may not use this component except in compliance with the License. You may obtain a copy of the License at:
21+
22+
[BSD 3-Clause license](https://opensource.org/licenses/BSD-3-Clause)
23+
24+
# Purpose
25+
26+
This directory contains the LIS2DH12 component drivers.
27+
:::
28+
29+
::: {.col-sm-12 .col-lg-8}
30+
# Update history
31+
32+
::: {.collapse}
33+
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
34+
<label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-June-2021</label>
35+
<div>
36+
37+
## Main changes
38+
39+
### First release
40+
41+
- First official release
42+
43+
##
44+
45+
</div>
46+
:::
47+
48+
:::
49+
:::
50+
51+
<footer class="sticky">
52+
::: {.columns}
53+
::: {.column width="95%"}
54+
For complete documentation on LIS2DH12,
55+
visit:
56+
[LIS2DH12](https://www.st.com/content/st_com/en/products/mems-and-sensors/accelerometers/lis2dh12.html)
57+
:::
58+
::: {.column width="5%"}
59+
<abbr title="Based on template cx566953 version 2.0">Info</abbr>
60+
:::
61+
:::
62+
</footer>

_htmresc/favicon.png

4.03 KB
Loading

0 commit comments

Comments
 (0)