Skip to content

Commit

Permalink
Added missing lib #47
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Sep 21, 2024
1 parent b6f0e57 commit 35d38d2
Show file tree
Hide file tree
Showing 168 changed files with 125,247 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/SensorsLib/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.hpp linguist-language=C++


96 changes: 96 additions & 0 deletions lib/SensorsLib/.github/workflows/arduino_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build Arduino

on:
workflow_dispatch:
pull_request:
push:
paths:
- "src/**"
- "examples/**"
- ".github/workflows/arduino_ci.yml"

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
board: ["esp32:esp32:esp32s3"]
examples:
- examples/BAM423_Accelerometer/BAM423_Accelerometer.ino
- examples/BAM423_Orientation/BAM423_Orientation.ino
- examples/BAM423_Temperature/BAM423_Temperature.ino
- examples/BMA423_Feature/BMA423_Feature.ino
- examples/CM32181_LightSensor/CM32181_LightSensor.ino
- examples/CM32181_LightSensorInterrupt/CM32181_LightSensorInterrupt.ino
- examples/DRV2605_Basic/DRV2605_Basic.ino
- examples/LTR553ALS_Sensor/LTR553ALS_Sensor.ino
- examples/PCF85063_SimpleTime/PCF85063_SimpleTime.ino
- examples/PCF8563_AlarmByUnits/PCF8563_AlarmByUnits.ino
- examples/PCF8563_SimpleTime/PCF8563_SimpleTime.ino
- examples/PCF8563_TimeLib/PCF8563_TimeLib.ino
- examples/PCF8563_TimeSynchronization/PCF8563_TimeSynchronization.ino
- examples/QMC6310_CalibrateExample/QMC6310_CalibrateExample.ino
- examples/QMC6310_CompassExample/QMC6310_CompassExample.ino
- examples/QMC6310_GetDataExample/QMC6310_GetDataExample.ino
- examples/QMC6310_GetPolarExample/QMC6310_GetPolarExample.ino
- examples/QMI8658_BlockExample/QMI8658_BlockExample.ino
- examples/QMI8658_GetDataExample/QMI8658_GetDataExample.ino
- examples/QMI8658_InterruptBlockExample/QMI8658_InterruptBlockExample.ino
- examples/QMI8658_InterruptExample/QMI8658_InterruptExample.ino
- examples/QMI8658_LockingMechanismExample/QMI8658_LockingMechanismExample.ino
- examples/QMI8658_MadgwickAHRS/QMI8658_MadgwickAHRS.ino
- examples/QMI8658_PedometerExample/QMI8658_PedometerExample.ino
- examples/QMI8658_ReadFromFifoExample/QMI8658_ReadFromFifoExample.ino
- examples/QMI8658_WakeOnMotion/QMI8658_WakeOnMotion.ino
- examples/QMI8658_WakeOnMotionCallBackExample/QMI8658_WakeOnMotionCallBackExample.ino
- examples/TouchDrv_CHSC5816_GetPoint/TouchDrv_CHSC5816_GetPoint.ino
- examples/TouchDrv_CSTxxx_GetPoint/TouchDrv_CSTxxx_GetPoint.ino
- examples/TouchDrv_FT3267_LilyGo_T_RGB/TouchDrv_FT3267_LilyGo_T_RGB.ino
- examples/TouchDrv_FT6232_GetPoint/TouchDrv_FT6232_GetPoint.ino
- examples/TouchDrv_GT911_GetPoint/TouchDrv_GT911_GetPoint.ino
- examples/TouchDrv_GT911_LilyGo_T_RGB/TouchDrv_GT911_LilyGo_T_RGB.ino
- examples/XL9555_ExtensionIOInterrupt/XL9555_ExtensionIOInterrupt.ino
- examples/XL9555_ExtensionIORead/XL9555_ExtensionIORead.ino
- examples/XL9555_ExtensionIOWirte/XL9555_ExtensionIOWirte.ino
- examples/BHI260AP_6DoF/BHI260AP_6DoF.ino
- examples/BHI260AP_Orientation/BHI260AP_Orientation.ino
- examples/BHI260AP_DebugInfo/BHI260AP_DebugInfo.ino
- examples/BHI260AP_StepCounter/BHI260AP_StepCounter.ino
- examples/BHI260AP_aux_BMM150/BHI260AP_aux_BMM150.ino
- examples/BHI260AP_aux_BMM150_euler/BHI260AP_aux_BMM150_euler.ino
- examples/BHI260AP_aux_BMM150_quaternion/BHI260AP_aux_BMM150_quaternion.ino
- examples/BHI260AP_aux_BMM150_BME280/BHI260AP_aux_BMM150_BME280.ino
- examples/BMM150_GetDataExample/BMM150_GetDataExample.ino
- examples/TouchDrv_Interface_T_RGB/TouchDrv_Interface_T_RGB.ino
- examples/TouchDrv_CST9217_GetPoint/TouchDrv_CST9217_GetPoint.ino

env:
BOARD: ${{ matrix.board }}
EXAMPLES: ${{matrix.examples}}

steps:
- uses: actions/checkout@v3

- name: Install Arduino Ci
run: |
if [[ "$BOARD" =~ "esp32:esp32:" ]]; then
wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz -O arduino-cli.tar.gz ;
sudo tar xf arduino-cli.tar.gz -C /usr/local/bin arduino-cli ;
arduino-cli config init ;
arduino-cli config add board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json ;
arduino-cli core update-index ;
arduino-cli core install esp32:esp32 ;
fi
- name: Build examples
run: |
mkdir -p $HOME/Arduino/libraries ;
cd $HOME/Arduino/libraries ;
git clone https://github.com/ThingPulse/esp8266-oled-ssd1306 ;
git clone https://github.com/arduino-libraries/MadgwickAHRS ;
cd $GITHUB_WORKSPACE ;
if [[ "$BOARD" =~ "esp32:esp32:" ]]; then
arduino-cli compile -besp32:esp32:esp32s3 --library . $PWD/$EXAMPLES ;
fi ;
29 changes: 29 additions & 0 deletions lib/SensorsLib/.github/workflows/esp-idf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build esp-idf

on:
workflow_dispatch:
pull_request:
push:
paths:
- "src/**"
- "examples/ESP_IDF_TouchDrv_Example/**"
- ".github/workflows/esp-idf.yml"

jobs:
build:
strategy:
matrix:
idf_ver: ["latest"]
runs-on: ubuntu-latest

container: espressif/idf:${{ matrix.idf_ver }}
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Build esp-idf examples
shell: bash
run: |
. ${IDF_PATH}/export.sh
cd examples/ESP_IDF_TouchDrv_Example
idf.py build
93 changes: 93 additions & 0 deletions lib/SensorsLib/.github/workflows/pio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build PlatformIO

on:
workflow_dispatch:
pull_request:
push:
paths:
- "src/**"
- "examples/**"
- ".github/workflows/platformio.yml"
- "platformio.ini"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
example:
- examples/BAM423_Accelerometer
- examples/BAM423_Orientation
- examples/BAM423_Temperature
- examples/BHI260AP_6DoF
- examples/BHI260AP_aux_BMM150
- examples/BHI260AP_aux_BMM150_euler
- examples/BHI260AP_aux_BMM150_quaternion
- examples/BHI260AP_aux_BMM150_BME280
- examples/BHI260AP_DebugInfo
- examples/BHI260AP_Orientation
- examples/BHI260AP_StepCounter
- examples/BMA423_Feature
- examples/BMM150_GetDataExample
- examples/CM32181_LightSensor
- examples/CM32181_LightSensorInterrupt
- examples/DRV2605_Basic
- examples/LTR553ALS_Sensor
- examples/PCF85063_AlarmByUnits
- examples/PCF85063_SimpleTime
- examples/PCF8563_AlarmByUnits
- examples/PCF8563_SimpleTime
- examples/PCF8563_TimeLib
- examples/PCF8563_TimeSynchronization
- examples/QMC6310_CalibrateExample
- examples/QMC6310_CompassExample
- examples/QMC6310_GetDataExample
- examples/QMC6310_GetPolarExample
- examples/QMI8658_BlockExample
- examples/QMI8658_GetDataExample
- examples/QMI8658_InterruptBlockExample
- examples/QMI8658_InterruptExample
- examples/QMI8658_LockingMechanismExample
- examples/QMI8658_MadgwickAHRS
- examples/QMI8658_PedometerExample
- examples/QMI8658_ReadFromFifoExample
- examples/QMI8658_WakeOnMotion
- examples/QMI8658_WakeOnMotionCallBackExample
- examples/TouchDrv_CHSC5816_GetPoint
- examples/TouchDrv_CST9217_GetPoint
- examples/TouchDrv_CSTxxx_GetPoint
- examples/TouchDrv_FT3267_LilyGo_T_RGB
- examples/TouchDrv_FT6232_GetPoint
- examples/TouchDrv_GT911_GetPoint
- examples/TouchDrv_GT911_LilyGo_T_RGB
- examples/TouchDrv_Interface_T_RGB
- examples/XL9555_ExtensionIOInterrupt
- examples/XL9555_ExtensionIORead
- examples/XL9555_ExtensionIOWirte

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Install MadgwickAHRS library
# https://github.com/arduino-libraries/MadgwickAHRS
run: pio pkg install --library "arduino-libraries/Madgwick@^1.2.0" -g

- name: Install esp8266-oled-ssd1306 library
# https://github.com/ThingPulse/esp8266-oled-ssd1306
run: pio pkg install --library "thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays @ ^4.4.0" -g

- name: Run PlatformIO
run: pio ci --lib="." --board=esp32dev --board=esp32-c3-devkitm-1 --board=esp32-s3-devkitm-1 --board=nrf52840_dk_adafruit
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
11 changes: 11 additions & 0 deletions lib/SensorsLib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.pio
.vscode
test
.travis.yml
test
assets
*.bk
*.test
build
*.old
sdkconfig
10 changes: 10 additions & 0 deletions lib/SensorsLib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(src_dirs ./src
./src/touch
./src/platform)
set(include_dirs ./src
./src/REG
./src/touch
./src/platform)
idf_component_register(SRC_DIRS ${src_dirs}
INCLUDE_DIRS ${include_dirs}
REQUIRES esp_timer esp_driver_gpio driver)
16 changes: 16 additions & 0 deletions lib/SensorsLib/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
menu "SensorLib Configuration"

choice SensorLib_ESP_IDF_API
prompt "SensorLib library esp-idf api version"
default SENSORLIB_ESP_IDF_NEW_API
help
Define API version

config SENSORLIB_ESP_IDF_NEW_API
bool "Use esp-idf higher version (>= 5.0) API"
config SENSORLIB_ESP_IDF_OLD_API
bool "Use esp-idf lower version ( < 5.0) API , Compatible with lower versions of esp-idf"
endchoice


endmenu
21 changes: 21 additions & 0 deletions lib/SensorsLib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 lewis he

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.
78 changes: 78 additions & 0 deletions lib/SensorsLib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
```
_____ _ _ _
/ ___| | | (_)| |
\ `--. ___ _ __ ___ ___ _ __ | | _ | |__
`--. \ / _ \| '_ \ / __| / _ \ | '__|| | | || '_ \
/\__/ /| __/| | | |\__ \| (_) || | | |____| || |_) |
\____/ \___||_| |_||___/ \___/ |_| \_____/|_||_.__/
··· ···
> Commonly used I2C , SPI device multi-platform libraries
```

[![Build esp-idf](https://github.com/lewisxhe/SensorLib/actions/workflows/esp-idf.yml/badge.svg)](https://github.com/lewisxhe/SensorLib/actions/workflows/esp-idf.yml)
[![Arduino CI](https://github.com/lewisxhe/SensorLib/actions/workflows/arduino_ci.yml/badge.svg)](https://github.com/lewisxhe/SensorLib/actions/workflows/arduino_ci.yml)
[![PlatformIO CI](https://github.com/lewisxhe/SensorLib/actions/workflows/pio.yml/badge.svg)](https://github.com/lewisxhe/SensorLib/actions/workflows/pio.yml)
[![arduino-library-badge](https://www.ardu-badge.com/badge/SensorLib.svg?)](https://www.ardu-badge.com/SensorLib)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/lewisxhe/library/SensorLib.svg)](https://registry.platformio.org/libraries/lewisxhe/SensorLib)


[![LICENSE](https://img.shields.io/github/license/lewisxhe/SensorLib)](https://github.com/lewisxhe/SensorLib/blob/master/LICENSE)
[![ISSUES](https://img.shields.io/github/issues/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorsLib/issues)
[![FROK](https://img.shields.io/github/forks/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorsLib/graphs/contributors)
[![STAR](https://img.shields.io/github/stars/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorsLib/stargazers)
[![releases](https://img.shields.io/github/release/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorLib/releases)

![PCF8563](https://img.shields.io/badge/PCF8563-GREEN)
![PCF85063](https://img.shields.io/badge/PCF85063-GREEN)
![HYM8563](https://img.shields.io/badge/HYM8563-GREEN)
![QMI8658](https://img.shields.io/badge/QMI8658-blue)
![BMM150](https://img.shields.io/badge/BMM150-blue)
![QMC6310](https://img.shields.io/badge/QMC6310-blue)
![BMA423](https://img.shields.io/badge/BMA423-blue)
![BHI260AP](https://img.shields.io/badge/BHI260AP-blue)
![XL9555](https://img.shields.io/badge/XL9555-yellow)
![DRV2605](https://img.shields.io/badge/DRV2605-teal)
![CM32181](https://img.shields.io/badge/CM32181-brown)
![LTR553](https://img.shields.io/badge/LTR553-brown)
![FT5206](https://img.shields.io/badge/FT5206-red)
![FT6206](https://img.shields.io/badge/FT6206-red)
![FT6236](https://img.shields.io/badge/FT6236-red)
![FT3267](https://img.shields.io/badge/FT3267-red)
![CST816S](https://img.shields.io/badge/CST816S-red)
![CST816D](https://img.shields.io/badge/CST816D-red)
![CST816T](https://img.shields.io/badge/CST816T-red)
![CST820](https://img.shields.io/badge/CST820-red)
![CST226SE](https://img.shields.io/badge/CST226SE-red)
![CHSC5816](https://img.shields.io/badge/CHSC5816-red)
![GT911](https://img.shields.io/badge/GT911-red)
![CST9217](https://img.shields.io/badge/CST9217-red)
![CST9220](https://img.shields.io/badge/CST9220-red)

Support list:

| Sensor | Description | I2C | SPI |
| --------------- | ------------------------ | --- | --- |
| PCF8563/HYM8563 | Real-time clock | ✔️ ||
| PCF85063 | Real-time clock | ✔️ ||
| QMI8658 | IMU | ✔️ | ✔️ |
| BHI260AP | IMU | ✔️ | ✔️ |
| QMC6310 | Magnetic Sensor | ✔️ ||
| BMM150 | Magnetic Sensor | ✔️ ||
| XL9555 | I/O expander | ✔️ ||
| BMA423 | Accelerometer | ✔️ ||
| DRV2605 | Haptic Driver | ✔️ ||
| CM32181 | Ambient Light Sensor | ✔️ ||
| LTR553 | Light & Proximity Sensor | ✔️ ||
| FT3267 | Capacitive touch | ✔️ ||
| FT5206 | Capacitive touch | ✔️ ||
| FT6206 | Capacitive touch | ✔️ ||
| FT6236 | Capacitive touch | ✔️ ||
| CST820 | Capacitive touch | ✔️ ||
| CST816S/T/D | Capacitive touch | ✔️ ||
| CST226SE | Capacitive touch | ✔️ ||
| CHSC5816 | Capacitive touch | ✔️ ||
| GT911 | Capacitive touch | ✔️ ||
| CST9217 | Capacitive touch | ✔️ ||
| CST9220 | Capacitive touch | ✔️ ||

Loading

0 comments on commit 35d38d2

Please sign in to comment.