Skip to content

Commit bcd5899

Browse files
authored
Merge pull request #2 from Infineon/develop
v2.0.0 - refactor based on C core library
2 parents 8579497 + de4318d commit bcd5899

File tree

94 files changed

+2797
-8885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2797
-8885
lines changed

.github/workflows/build-check.yml

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,50 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ${{ matrix.os }}
12+
name: ${{ matrix.board.fqbn }}
13+
runs-on: ubuntu-latest
1314
strategy:
15+
fail-fast: false
1416
matrix:
15-
os: [ ubuntu-latest, windows-latest ]
16-
example: [examples/pulse-api-test/pulse-api-test.ino,
17-
examples/pulse-interrupt/pulse-interrupt.ino,
18-
examples/pulse-polling/pulse-polling.ino,
19-
examples/pulse-reset/pulse-reset.ino,
20-
examples/serial-alarm/serial-alarm.ino,
21-
examples/serial-api-test/serial-api-test.ino,
22-
examples/serial-calibrate/serial-calibrate.ino,
23-
examples/serial-device-id/serial-device-id.ino,
24-
examples/serial-calibrate/serial-calibrate.ino,
25-
examples/serial-diagnosis/serial-diagnosis.ino,
26-
examples/serial-oneshot/serial-oneshot.ino,
27-
examples/serial-periodic/serial-periodic.ino,
28-
examples/serial-reset/serial-reset.ino]
17+
board:
18+
- fqbn: "arduino:avr:uno"
19+
platform-name: arduino:avr
20+
- fqbn: "Infineon:arm:XMC1100_XMC2GO"
21+
platform-name: Infineon:arm
22+
- fqbn: "Infineon:arm:XMC1100_Boot_Kit"
23+
platform-name: Infineon:arm
24+
- fqbn: "esp32:esp32:featheresp32"
25+
platform-name: esp32:esp32
2926

27+
include:
28+
- board:
29+
platform-name: arduino:avr
30+
platforms: |
31+
# Install Arduino Avr Boards via Boards Manager
32+
- name: arduino:avr
33+
34+
- board:
35+
platform-name: Infineon:arm
36+
platforms: |
37+
# Install Arduino Avr Boards via Boards Manager
38+
- name: Infineon:arm
39+
source-url: https://github.com/Infineon/XMC-for-Arduino/releases/latest/download/package_infineon_index.json
40+
41+
- board:
42+
platform-name: esp32:esp32
43+
platforms: |
44+
# Install ESP32 platform via Boards Manager
45+
- name: esp32:esp32
46+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
3047
steps:
31-
- uses: actions/checkout@v2
32-
- name: Cache pip
33-
uses: actions/cache@v2
34-
with:
35-
path: ~/.cache/pip
36-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
37-
restore-keys: |
38-
${{ runner.os }}-pip-
39-
- name: Chache PlatformIO
40-
uses: actions/cache@v2
41-
with:
42-
path: ~/.platformio
43-
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
48+
- name: Checkout
49+
uses: actions/checkout@v2
50+
51+
- name: Build examples
52+
uses: arduino/compile-sketches@v1
53+
with:
54+
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
platforms: ${{ matrix.platforms }}
56+
fqbn: ${{ matrix.board.fqbn }}
4457

45-
- name: Set up Python
46-
uses: actions/setup-python@v2
47-
48-
- name: Install PlatformIO
49-
run: |
50-
python -m pip install --upgrade pip
51-
pip install --upgrade platformio
52-
pio platform install -f [email protected]
53-
pio platform install -f [email protected]
54-
- name: Run PlatformIO
55-
run: pio ci --lib="." --board=xmc1100_boot_kit --board=xmc1100_xmc2go --board=uno
56-
env:
57-
PLATFORMIO_CI_SRC: ${{ matrix.example }}
58+

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

LICENSE.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# License
2+
3+
```
4+
Important Notice:
5+
Changes, suggestions and commits in this repository may only be done following each
6+
license of the respective file and putting it under the same license (except
7+
stated otherwise by the license).
8+
All rights of the respective copyright holders shall be reserved.
9+
Brands and product names are trademarks of their respective owners.
10+
Referred and linked files/pages are out-of-scope of this repository and underly
11+
their respective licenses.
12+
```
13+
14+
This repository comprises several licenses dependent on the sources of the files.
15+
16+
Unless specified otherwise the sources on this projects are license under the MIT license:
17+
18+
```
19+
MIT License
20+
21+
Copyright (c) 2020-2021 Infineon Technologies AG
22+
23+
Permission is hereby granted, free of charge, to any person obtaining a copy
24+
of this software and associated documentation files (the "Software"), to deal
25+
in the Software without restriction, including without limitation the rights
26+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27+
copies of the Software, and to permit persons to whom the Software is
28+
furnished to do so, subject to the following conditions:
29+
30+
The above copyright notice and this permission notice shall be included in all
31+
copies or substantial portions of the Software.
32+
33+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
SOFTWARE.
40+
```
41+
42+
An exception to the previous are the sources obtained from the [sensor-xensiv-pasco2](https://github.com/Infineon/sensor-xensiv-pasco2) project:
43+
44+
* xensiv_pasco2_regs.h
45+
* xensiv_pasco2_ver.h
46+
* xensiv_pasco2.h
47+
* xensiv_pasco2.c
48+
49+
which are licensed under Apache 2.0:
50+
51+
```
52+
Copyright (c) 2021 Infineon Technologies AG
53+
SPDX-License-Identifier: Apache-2.0
54+
55+
Licensed under the Apache License, Version 2.0 (the "License");
56+
you may not use this file except in compliance with the License.
57+
You may obtain a copy of the License at
58+
59+
http://www.apache.org/licenses/LICENSE-2.0
60+
61+
Unless required by applicable law or agreed to in writing, software
62+
distributed under the License is distributed on an "AS IS" BASIS,
63+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64+
See the License for the specific language governing permissions and
65+
limitations under the License.
66+
```
67+

README.md

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,31 @@
22

33
![build-check](https://github.com/Infineon/arduino-pas-co2-sensor/actions/workflows/build-check.yml/badge.svg)
44

5-
Arduino library of Infineon's **Photoacoustic Spectroscopy (PAS) XENSIV™ CO2** miniaturized sensor.
5+
Arduino library of Infineon's [**Photoacoustic Spectroscopy (PAS) XENSIV™ CO2**](https://www.infineon.com/cms/en/product/sensor/co2-sensors/) miniaturized sensor.
66

7-
### Supported Sensor Boards
8-
<table>
9-
<tr>
10-
<td align="center"><img src="https://github.com/Infineon/pas-co2-sensor/wiki/img/pas-co2-s2go-front.jpg" width=200></td>
11-
<td align="center"><img src="https://github.com/Infineon/pas-co2-sensor/wiki/img/pas-co2-miniboard.jpg" width=200></td>
12-
</tr>
13-
<tr>
14-
<td style="text-align: center"><a href="https://github.com/Infineon/pas-co2-sensor/wiki/Hardware-Platforms#pas-co2-sensor-shield-2go">PAS CO2 Shield2Go</a></td>
15-
<td style="text-align: center"><a href="https://github.com/Infineon/pas-co2-sensor/wiki/Hardware-Platforms#pas-co2-miniboard">PAS CO2 Miniboard</a></td>
16-
</tr>
17-
</table>
7+
<img src="docs/img/pas-co2-module.png" width=200>
188

19-
### Supported Hardware Platforms
209

21-
The library should be supported by any Arduino platform based on the reference Arduino cores.
10+
### Getting started
2211

23-
Check in this [link](https://github.com/Infineon/pas-co2-sensor/wiki/Hardware-Platforms) the already verified (at least successfully built) platforms, and find out which boards are under CI build check [here](https://github.com/Infineon/arduino-pas-co2-sensor/blob/master/.github/workflows/build-check.yml).
12+
Find a getting started tutorial based on the PAS CO2 Shield2Go and the XMC 2Go eval board in this [link](https://arduino-pas-co2-sensor.readthedocs.io/en/latest/getting-started.html).
2413

25-
### Getting Started
14+
### Library installation
2615

27-
Find a getting started tutorial based on the PAS CO2 Shield2Go and the XMC 2Go eval board [here](https://github.com/Infineon/pas-co2-sensor/wiki/Ino-Getting-Started).
16+
Look for ```pas-co2-sensor``` in the Arduino library manager.
2817

29-
### More information
18+
Other installation alternatives [here](https://arduino-pas-co2-sensor.readthedocs.io/en/latest/lib-install.html).
3019

31-
The complete relevant Arduino documentation (and more) can be found in the base XFP library [Wiki](https://github.com/infineon/pas-co2-sensor/wiki/Home):
20+
### API reference
3221

33-
* <a href="https://github.com/Infineon/pas-co2-sensor/wiki/Ino-Library-Installation"> Arduino Lib Installation</a><br>
34-
* <a href="https://github.com/Infineon/pas-co2-sensor/wiki/Ino-Examples">Arduino Examples</a><br>
35-
* <a href="https://github.com/Infineon/pas-co2-sensor/wiki/Arduino-API">Arduino API</a><br>
36-
* <a href="https://github.com/Infineon/pas-co2-sensor/wiki/PlatformIO">PlatformIO</a><br>
22+
Discover all the API features and functions in the [API reference](https://arduino-pas-co2-sensor.readthedocs.io/en/latest/api-ref.html).
3723

38-
### Contributing
24+
### More information
3925

40-
This is a release repository for the Arduino framework. The code basis is maintained and developed in the PAS CO2 Sensor Cross-Framework-Platform (XFP) library [repository](https://github.com/infineon/pas-co2-sensor).
26+
More information can be found in the library [docs](https://arduino-pas-co2-sensor.readthedocs.io/en/latest/index.html).
4127

4228
### License
4329

44-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
30+
See the [LICENSE](LICENSE.md) file for more details.
4531

4632

docs/_templates/layout.html

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{% extends "!layout.html" %}
2+
{% block footer %} {{ super() }}
3+
4+
<style>
5+
/* Sidebar header (and topbar for mobile) */
6+
.wy-side-nav-search, .wy-nav-top {
7+
background: #5EA290;
8+
}
9+
/* Sidebar */
10+
.wy-nav-side {
11+
background: #5EA290;
12+
}
13+
14+
/* span.caption-text {
15+
color: white;
16+
} */
17+
18+
.wy-menu-vertical header, .wy-menu-vertical p.caption {
19+
color: white;
20+
height: 32px;
21+
display: inline-block;
22+
line-height: 32px;
23+
padding: 0 1.618em;
24+
margin: 12px 0 0 0;
25+
display: block;
26+
font-weight: bold;
27+
text-transform: uppercase;
28+
font-size: 85%;
29+
white-space: nowrap;
30+
}
31+
32+
/*
33+
.wy-side-nav-search>a, .wy-side-nav-search .wy-dropdown>a {
34+
color: #3a7ca8;
35+
font-size: 100%;
36+
font-weight: bold;
37+
display: inline-block;
38+
padding: 4px 6px;
39+
margin-bottom: .809em;
40+
}
41+
*/
42+
43+
.wy-menu-vertical header, .wy-menu-vertical p.caption {
44+
color: white;
45+
height: 32px;
46+
display: inline-block;
47+
line-height: 32px;
48+
padding: 0 1.618em;
49+
margin: 12px 0 0 0;
50+
display: block;
51+
font-weight: bold;
52+
text-transform: uppercase;
53+
font-size: 85%;
54+
white-space: nowrap;
55+
}
56+
57+
.rst-versions {
58+
position: fixed;
59+
bottom: 0;
60+
left: 0;
61+
width: 300px;
62+
color: #fcfcfc;
63+
background: #812161;
64+
font-family: "Lato","proxima-nova", "Helvetica Neue", Arial,sans-serif;
65+
z-index: 400;
66+
justify-content: stretch;
67+
}
68+
69+
</style>
70+
{% endblock %}

docs/api-ref.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.. _api-ref:
2+
3+
API Reference
4+
=============
5+
6+
The Arduino library API is implemented via the PASCO2SerialIno class.
7+
8+
PAS CO2 Serial Arduino API
9+
--------------------------
10+
11+
.. doxygenclass:: PASCO2SerialIno
12+
:members:
13+
14+
Types
15+
"""""
16+
17+
Return Error Codes
18+
^^^^^^^^^^^^^^^^^^
19+
20+
.. doxygentypedef:: Error_t
21+
22+
.. doxygendefine:: XENSIV_PASCO2_OK
23+
.. doxygendefine:: XENSIV_PASCO2_ERR_COMM
24+
.. doxygendefine:: XENSIV_PASCO2_ERR_WRITE_TOO_LARGE
25+
.. doxygendefine:: XENSIV_PASCO2_ERR_NOT_READY
26+
.. doxygendefine:: XENSIV_PASCO2_ICCERR
27+
.. doxygendefine:: XENSIV_PASCO2_ORVS
28+
.. doxygendefine:: XENSIV_PASCO2_ORTMP
29+
.. doxygendefine:: XENSIV_PASCO2_READ_NRDY
30+
31+
Dignosis
32+
^^^^^^^^
33+
34+
.. doxygentypedef:: Diag_t
35+
36+
.. doxygenunion:: xensiv_pasco2_status_t
37+
38+
Baseline Offset Compensation
39+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
41+
.. doxygentypedef:: ABOC_t
42+
43+
.. doxygenenum:: xensiv_pasco2_boc_cfg_t
44+
45+
XENSIV™ PAS CO2 C Reference API
46+
------------------------------
47+
48+
The Arduino library is wrapping the platform abstracted C library from `this project <https://github.com/Infineon/sensor-xensiv-pasco2>`_.
49+
Find out the complete C core library documentation `here <https://infineon.github.io/sensor-xensiv-pasco2/html/index.html>`_.

0 commit comments

Comments
 (0)