diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 4a15daa5c..f218d9a01 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -7,7 +7,7 @@
- [ ] Only relevant files were touched
- [ ] Only one feature/fix was added per PR and the code change compiles without warnings
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
- - [ ] The code change is tested and works with Tasmota core ESP32 V.2.0.1.1
+ - [ ] The code change is tested and works with Tasmota core ESP32 V.2.0.2.1
- [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla).
_NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_
diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml
index fe3f995d1..8cb8a140e 100644
--- a/.github/workflows/Tasmota_build_devel.yml
+++ b/.github/workflows/Tasmota_build_devel.yml
@@ -1,4 +1,4 @@
-name: Build_firmware_development_cache
+name: Build_development
on:
workflow_dispatch: # Manually start a workflow
@@ -8,1319 +8,80 @@ on:
- '.github/**' # Ignore changes towards the .github directory
- '**.md' # Do no build if *.md files changes
+# Ensures that only one deploy task per branch/environment will run at a time.
+concurrency:
+ group: environment-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
-
- tasmota:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-minimal:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-minimal
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-lite:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-lite
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-knx:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-knx
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-sensors:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-sensors
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-display:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-display
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-ir:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-ir
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-zbbridge:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-zbbridge
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-zigbee:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-zigbee
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-AF:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-AF
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-BG:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-BG
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-BR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-BR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-CN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-CN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-CZ:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-CZ
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-DE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-DE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-ES:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-ES
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-FR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-FR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-FY:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-FY
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-GR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-GR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-HE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-HE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-HU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-HU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-IT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-IT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-KO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-KO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-NL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-NL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-PL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-PL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-PT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-PT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-RO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-RO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-RU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-RU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-SE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-SE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-SK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-SK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-TR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-TR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-TW:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-TW
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-UK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-UK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-VN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-VN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32solo1:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32solo1
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-webcam:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-webcam
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-odroidgo:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-odroidgo
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-core2:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-core2
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-bluetooth:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-bluetooth
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-display:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-display
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-lvgl:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-lvgl
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-ir:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-ir
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
- tasmota32c3:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32c3
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
- tasmota32-AF:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-AF
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-BG:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-BG
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-BR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-BR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-CN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-CN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-CZ:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-CZ
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-DE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-DE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-ES:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-ES
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-FR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-FR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-FY:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-FY
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-GR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-GR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-HE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-HE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-HU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-HU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-IT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-IT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-KO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-KO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-NL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-NL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-PL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-PL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-PT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-PT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-RO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-RO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-RU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-RU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-SE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-SE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-SK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-SK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-TR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-TR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-TW:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-TW
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-UK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-UK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-VN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-VN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
+ base-images:
+ runs-on: ubuntu-latest
+ if: github.repository == 'arendst/Tasmota'
+ continue-on-error: true
+ strategy:
+ matrix:
+ variant:
+ - tasmota
+ - tasmota-minimal
+ - tasmota-display
+ - tasmota-ir
+ - tasmota-knx
+ - tasmota-lite
+ - tasmota-sensors
+ - tasmota-zbbridge
+ - tasmota-zigbee
+ - tasmota32
+ - tasmota32-webcam
+ - tasmota32-bluetooth
+ - tasmota32-core2
+ - tasmota32-display
+ - tasmota32-ir
+ - tasmota32-lvgl
+ - tasmota32-odroidgo
+ - tasmota32c3
+ - tasmota32solo1
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: development
+ - name: Set up Python
+ uses: actions/setup-python@v1
+ - name: Install dependencies
+ run: |
+ pip install -U platformio
+ - name: Run PlatformIO
+ run: platformio run -e ${{ matrix.variant }}
+ - uses: actions/upload-artifact@v2
+ with:
+ name: firmware
+ path: ./build_output
+
+ language-images:
+ runs-on: ubuntu-latest
+ if: github.repository == 'arendst/Tasmota'
+ continue-on-error: true
+ strategy:
+ matrix:
+ variant: [ tasmota, tasmota32 ]
+ language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: development
+ - name: Set up Python
+ uses: actions/setup-python@v1
+ - name: Install dependencies
+ run: |
+ pip install -U platformio
+ - name: Run PlatformIO
+ run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
+ - uses: actions/upload-artifact@v2
+ with:
+ name: firmware
+ path: ./build_output
Upload:
- needs: [tasmota-VN, tasmota32-VN, tasmota32-TW, tasmota32-TR]
+ needs: [base-images, language-images]
runs-on: ubuntu-latest
continue-on-error: true
steps:
@@ -1339,7 +100,7 @@ jobs:
[ ! -f ./mv_firmware/map/* ] || mv ./mv_firmware/map/* ./firmware/map/
[ ! -f ./mv_firmware/firmware/tasmota.* ] || mv ./mv_firmware/firmware/tasmota.* ./firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-sensors.* ] || mv ./mv_firmware/firmware/tasmota-sensors.* ./firmware/tasmota/
- [ ! -f ./mv_firmware/firmware/tasmota-minimal.* ] || mv ./mv_firmware/firmware/tasmota-minimal.* ./firmware/tasmota/
+ [ ! -f ./mv_firmware/firmware/tasmota-minimal.bin.gz ] || mv ./mv_firmware/firmware/tasmota-minimal.bin.gz ./firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-lite.* ] || mv ./mv_firmware/firmware/tasmota-lite.* ./firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-ir*.* ] || mv ./mv_firmware/firmware/tasmota-ir*.* ./firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-display.* ] || mv ./mv_firmware/firmware/tasmota-display.* ./firmware/tasmota/
diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml
index 4639fde5e..a5e1c3881 100644
--- a/.github/workflows/Tasmota_build_master.yml
+++ b/.github/workflows/Tasmota_build_master.yml
@@ -5,1320 +5,82 @@ on:
branches: master
paths-ignore:
- '.github/**' # Ignore changes towards the .github directory
+ - '**.md' # Do no build if *.md files changes
+
+# Ensures that only one deploy task per branch/environment will run at a time.
+concurrency:
+ group: environment-${{ github.ref }}
+ cancel-in-progress: true
jobs:
-
- tasmota:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-minimal:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-minimal
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-lite:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-lite
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-knx:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-knx
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-sensors:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-sensors
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-display:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-display
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-ir:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-ir
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-zbbridge:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-zbbridge
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-zigbee:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-zigbee
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-AF:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-AF
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-BG:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-BG
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-BR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-BR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-CN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-CN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-CZ:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-CZ
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-DE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-DE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-ES:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-ES
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-FR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-FR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-FY:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-FY
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-GR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-GR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-HE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-HE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-HU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-HU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-IT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-IT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-KO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-KO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-NL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-NL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-PL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-PL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-PT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-PT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-RO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-RO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-RU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-RU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-SE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-SE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-SK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-SK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-TR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-TR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-TW:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-TW
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-UK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-UK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota-VN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota-VN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32solo1:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32solo1
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-webcam:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-webcam
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-odroidgo:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-odroidgo
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-core2:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-core2
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-bluetooth:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-bluetooth
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-display:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-display
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-lvgl:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-lvgl
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-ir:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-ir
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
- tasmota32c3:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32c3
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
- tasmota32-AF:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-AF
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-BG:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-BG
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-BR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-BR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-CN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-CN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-CZ:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-CZ
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-DE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-DE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-ES:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-ES
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-FR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-FR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-FY:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-FY
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-GR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-GR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-HE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-HE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-HU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-HU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-IT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-IT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-KO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-KO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-NL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-NL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-PL:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-PL
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-PT:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-PT
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-RO:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-RO
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-RU:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-RU
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-SE:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-SE
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-SK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-SK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-TR:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-TR
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-TW:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-TW
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-UK:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-UK
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
-
- tasmota32-VN:
- runs-on: ubuntu-latest
- continue-on-error: true
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v1
- - name: Install dependencies
- run: |
- pip install -U platformio
- - name: Run PlatformIO
- run: |
- platformio run -e tasmota32-VN
- - uses: actions/upload-artifact@v2
- with:
- name: firmware
- path: ./build_output
-
+ base-images:
+ runs-on: ubuntu-latest
+ if: github.repository == 'arendst/Tasmota'
+ continue-on-error: true
+ strategy:
+ matrix:
+ variant:
+ - tasmota
+ - tasmota-minimal
+ - tasmota-display
+ - tasmota-ir
+ - tasmota-knx
+ - tasmota-lite
+ - tasmota-sensors
+ - tasmota-zbbridge
+ - tasmota-zigbee
+ - tasmota32
+ - tasmota32-webcam
+ - tasmota32-bluetooth
+ - tasmota32-core2
+ - tasmota32-display
+ - tasmota32-ir
+ - tasmota32-lvgl
+ - tasmota32-odroidgo
+ - tasmota32c3
+ - tasmota32solo1
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: master
+ - name: Set up Python
+ uses: actions/setup-python@v1
+ - name: Install dependencies
+ run: |
+ pip install -U platformio
+ - name: Run PlatformIO
+ run: platformio run -e ${{ matrix.variant }}
+ - uses: actions/upload-artifact@v2
+ with:
+ name: firmware
+ path: ./build_output
+
+ language-images:
+ runs-on: ubuntu-latest
+ if: github.repository == 'arendst/Tasmota'
+ continue-on-error: true
+ strategy:
+ matrix:
+ variant: [ tasmota, tasmota32 ]
+ language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: master
+ - name: Set up Python
+ uses: actions/setup-python@v1
+ - name: Install dependencies
+ run: |
+ pip install -U platformio
+ - name: Run PlatformIO
+ run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
+ - uses: actions/upload-artifact@v2
+ with:
+ name: firmware
+ path: ./build_output
Upload:
- needs: [tasmota-VN, tasmota32-VN, tasmota32-TW, tasmota32-TR]
+ needs: [base-images, language-images]
runs-on: ubuntu-latest
continue-on-error: true
steps:
@@ -1346,7 +108,7 @@ jobs:
[ ! -f ./mv_firmware/map/* ] || mv ./mv_firmware/map/* ./release-firmware/map/
[ ! -f ./mv_firmware/firmware/tasmota.* ] || mv ./mv_firmware/firmware/tasmota.* ./release-firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-sensors.* ] || mv ./mv_firmware/firmware/tasmota-sensors.* ./release-firmware/tasmota/
- [ ! -f ./mv_firmware/firmware/tasmota-minimal.* ] || mv ./mv_firmware/firmware/tasmota-minimal.* ./release-firmware/tasmota/
+ [ ! -f ./mv_firmware/firmware/tasmota-minimal.bin.gz ] || mv ./mv_firmware/firmware/tasmota-minimal.bin.gz ./release-firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-lite.* ] || mv ./mv_firmware/firmware/tasmota-lite.* ./release-firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-ir*.* ] || mv ./mv_firmware/firmware/tasmota-ir*.* ./release-firmware/tasmota/
[ ! -f ./mv_firmware/firmware/tasmota-display.* ] || mv ./mv_firmware/firmware/tasmota-display.* ./release-firmware/tasmota/
diff --git a/.github/workflows/build_all_the_things.yml b/.github/workflows/build_all_the_things.yml
index 2ffca53b7..cb41ae85e 100644
--- a/.github/workflows/build_all_the_things.yml
+++ b/.github/workflows/build_all_the_things.yml
@@ -18,6 +18,7 @@ on:
jobs:
base-images:
runs-on: ubuntu-latest
+ if: github.repository == 'arendst/Tasmota'
strategy:
matrix:
variant:
@@ -59,6 +60,7 @@ jobs:
language-images:
runs-on: ubuntu-latest
+ if: github.repository == 'arendst/Tasmota'
strategy:
matrix:
variant: [ tasmota ]
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile
index 909bcf681..29d75d19d 100644
--- a/.gitpod.Dockerfile
+++ b/.gitpod.Dockerfile
@@ -2,4 +2,4 @@ FROM gitpod/workspace-full
USER gitpod
-RUN pip3 install -U platformio && brew install uncrustify
+RUN pip3 install -U platformio
diff --git a/BUILDS.md b/BUILDS.md
index 975e34d24..77d7d4128 100644
--- a/BUILDS.md
+++ b/BUILDS.md
@@ -76,6 +76,7 @@ Note: `minimal` variant is not listed as it shouldn't be used outside of the [up
| USE_MCP39F501 | x | x / - | x | x | - | - |
| USE_SDM72 | - | - / x | - | x | - | - |
| USE_SDM120 | - | - / x | - | x | - | - |
+| USE_SDM230 | - | - / x | - | - | - | - |
| USE_SDM630 | - | - / x | - | x | - | - |
| USE_DDS2382 | - | - / x | - | x | - | - |
| USE_DDSU666 | - | - / x | - | x | - | - |
@@ -100,7 +101,7 @@ Note: `minimal` variant is not listed as it shouldn't be used outside of the [up
| USE_SHT | - | - / x | - | x | - | - |
| USE_HTU | - | - / x | - | x | - | - |
| USE_BMP | - | - / x | - | x | - | - |
-| USE_BME680 | - | - / x | - | x | - | - |
+| USE_BME68X | - | - / x | - | x | - | - |
| USE_BH1750 | - | - / x | - | x | - | - |
| USE_VEML6070 | - | - / x | - | x | - | - |
| USE_ADS1115 | - | - / x | - | x | - | - |
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e5d9a8633..d245af292 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,105 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
-## [10.1.0.1]
+## [2022.01.3]
+### Added
+- Command ``WebTime ,`` to show part of date and/or time in web gui based on "2017-03-07T11:08:02-07:00"
+- ESP32 disable serial console when 3 (ESP32) or 2 (Other models) serial interfaces are requested (#14487)
+- Support for BME688 with latest Bosch-Sensor-API library (#14513)
+- Command ``SetOption44 1..100`` to set base tolerance percentage for matching incoming IR messages (default 25, max 100) (#14555)
+- Command ``Json {}`` to enable input of any command as JSON tokens (#14568)
+- Rule variable %color% (#14572)
+- Command ``SspmDisplay 1`` to display Sonoff SPM energy data in GUI for relays powered on only
+- Command ``SspmEnergyTotal`` to (p)reset Sonoff SPM total energy without today's energy
+- Command ``SspmHistory`` to retrieve Sonoff SPM daily energy up to last six month (as defined by ARM firmware)
+- Command ``SspmIAmHere`` to (faintly) blink Sonoff SPM-4Relay module error light of requested relay
+- Command ``SspmLog [x]`` to retrieve Sonoff SPM relay power state change and cause logging
+- Command ``SspmScan`` to rescan Sonoff SPM modbus
+- Support for MQ analog sensor for air quality by Francesco Adriani (#14581)
+- Command ``SetOption134 1`` to disable PWM auto-phasing for lights by default (new behavior) (#14590)
+
+### Changed
+- BME68x-Sensor-API library from v3.5.9 to v4.4.7
+- ESP32 core library from v2.0.2 to v2.0.2.1 (#14553)
+
+### Fixed
+- OneWire-Stickbreaker (DS18x20) library support for ESP32S2 (#14338)
+
+## [2022.01.2] 20220116
+### Added
+- Tasmota favicon to webbrowser tab (#14322)
+- Commands for ESP32 ethernet configuration ``EthIpAddress``, ``EthGateway``, ``EthSubnetmask``, ``EthDnsServer1`` and ``EthDnsServer2`` (#14385)
+- Support for Eastron SDM230 modBus energy meter (#13443)
+
+### Changed
+- IRremoteESP8266 library from v2.8.0 to v2.8.1
+
+## [2022.01.1] 20220107
+### Added
+- Experimental ADE7953 (Shelly EM) reset on restart (#14261)
+- Command ``SspmMap 2,1,..`` to map Sonoff SPM scanned module to physical module (#14281)
+- Solax X1 modbus RTS support and offline status (#14305)
+- DDP schemes for light and WS2812 (#14017)
+- ESP32 single binary firmware (#14239)
+- ESP32 support for USE_PWM_DIMMER as GPIO ``Option E1``
+- Support for Linkind dimmer as GPIO ``Option A6`` (#14004)
+
+### Changed
+- PubSubClient library from v2.8.12 to v2.8.13
+- TasmotaSerial library from v3.3.0 to v3.4.0
+- TasmotaModbus library from v1.2.0 to v3.4.0
+- From Semantic Versioning (SemVer) to Calendar Versioning (CalVer)
+- ESP32 Set stack size with ``#define SET_ESP32_STACK_SIZE``, added ``StackLowMark`` metrics
+- ESP32 Berry stores compiled bytecode into IRAM, freeing space in heap (#14307)
+
+### Fixed
+- Intermittent exceptions and heap corruption due to PubSubClient library buffer overflow (#13700)
+- Scripter memory corruption (#14268)
+- Edit file for SD card (#14229)
+- Solax X1 negative temperature support (#14278)
+- Modbus serial config regression from v10.1.0.3
+
+## [10.1.0.3] 20211231
+### Added
+- Command ``SSerialConfig `` to change Serial Bridge configuration
+
+### Fixed
+- DHT support negative temperatures on different hardware (#14173)
+- ESP32 Provide proper OTA_URL for tasmota32solo1 (#14202)
+- Hardware serial parity and stop bits support (#14212)
+
+### Changed
+- LVGL update from 8.0.2 to 8.1.0
+
+## [10.1.0.2] 20211225
+### Changed
+- TasmotaSerial library from v3.3.0 to v3.4.0 - reverted (#14153)
+- Force initial serial configuration even if no serial GPIO's are enabled (#14153)
+- Revert change to fix extra flashwrite before QuickPowerDetection (#14153)
+- Increase SerialBridge receive buffer from 130 to 256 characters - reverted (#14153)
+- ESP8266Audio library from v1.9.2 to v1.9.5 (#14172)
+- ESP8266SAM library from v1.0 to v1.0.1 (#14172)
+
+### Fixed
+- Serial broken after #14153 - reverted
+
+## [10.1.0.1] 20211223
+### Added
+- PWM Dimmer two button support (#13993)
+- Device Group Send full status item (#14045)
+- Support for MAX7219 Dot Matrix displays (#14091)
+- ESP32 support for TuyaMcu
+- ESP32 Berry features
+
+### Changed
+- Mitsubishi HVAC temperature resolution (#13936)
+- Remove restriction of topic must differ from mqttclient (#14019)
+
+### Fixed
+- EZOO2 sensor message format (#14000)
+- ESP32 Webcam exception during flashwrites
+- ESP32 LedPwmMode exception (#14073)
+- ESP32 Compile error when I2S_Audio is enabled (#14095)
## [Released]
@@ -893,6 +991,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Triple-mode TLS via configuration in a single firmware (TLS AWS IoT, Letsencrypt and No-TLS)
+- Berry C mapping moved to a separate ``berry_mapping`` library
### Fixed
- ESP32 PWM range
diff --git a/FIRMWARE.md b/FIRMWARE.md
index 610cc6fba..7373dd131 100644
--- a/FIRMWARE.md
+++ b/FIRMWARE.md
@@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/C
## Development
-[](https://github.com/arendst/Tasmota)
+[](https://github.com/arendst/Tasmota)
[](http://ota.tasmota.com/tasmota/)
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
diff --git a/README.md b/README.md
index b41539308..abdc78f58 100644
--- a/README.md
+++ b/README.md
@@ -23,11 +23,10 @@ Easy initial installation of Tasmota can be performed using the [Tasmota WebInst
## Development
-[](https://github.com/arendst/Tasmota)
+[](https://github.com/arendst/Tasmota)
[](http://ota.tasmota.com/tasmota/)
-[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
-[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
-[](https://github.com/arendst/Tasmota/actions?query=workflow%3ABuild_firmware)
+[](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
+[](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml)
See [CHANGELOG.md](CHANGELOG.md) for detailed change information.
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index e7b2dcdb3..2135624e8 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -100,13 +100,67 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
[Complete list](BUILDS.md) of available feature and sensors.
-## Changelog v10.1.0.1
+## Changelog v2022.01.3
### Added
+- Command ``Json {}`` to enable input of any command as JSON tokens [#14568](https://github.com/arendst/Tasmota/issues/14568)
+- Command ``SetOption44 1..100`` to set base tolerance percentage for matching incoming IR messages (default 25, max 100) [#14555](https://github.com/arendst/Tasmota/issues/14555)
+- Command ``SetOption134 1`` to disable PWM auto-phasing for lights by default (new behavior) [#14590](https://github.com/arendst/Tasmota/issues/14590)
+- Command ``SSerialConfig `` to change Serial Bridge configuration
+- Command ``SspmDisplay 1`` to display Sonoff SPM energy data in GUI for relays powered on only
+- Command ``SspmEnergyTotal`` to (p)reset Sonoff SPM total energy without today's energy
+- Command ``SspmHistory`` to retrieve Sonoff SPM daily energy up to last six month (as defined by ARM firmware)
+- Command ``SspmIAmHere`` to (faintly) blink Sonoff SPM-4Relay module error light of requested relay
+- Command ``SspmLog [x]`` to retrieve Sonoff SPM relay power state change and cause logging
+- Command ``SspmMap 2,1,..`` to map Sonoff SPM scanned module to physical module [#14281](https://github.com/arendst/Tasmota/issues/14281)
+- Command ``SspmScan`` to rescan Sonoff SPM modbus
+- Command ``WebTime ,`` to show part of date and/or time in web gui based on "2017-03-07T11:08:02-07:00"
+- Commands for ESP32 ethernet configuration ``EthIpAddress``, ``EthGateway``, ``EthSubnetmask``, ``EthDnsServer1`` and ``EthDnsServer2`` [#14385](https://github.com/arendst/Tasmota/issues/14385)
+- Support for Eastron SDM230 modBus energy meter [#13443](https://github.com/arendst/Tasmota/issues/13443)
+- PWM Dimmer two button support [#13993](https://github.com/arendst/Tasmota/issues/13993)
+- Support for Linkind dimmer as GPIO ``Option A6`` [#14004](https://github.com/arendst/Tasmota/issues/14004)
+- DDP schemes for light and WS2812 [#14017](https://github.com/arendst/Tasmota/issues/14017)
+- Device Group Send full status item [#14045](https://github.com/arendst/Tasmota/issues/14045)
+- Support for MAX7219 Dot Matrix displays [#14091](https://github.com/arendst/Tasmota/issues/14091)
+- Experimental ADE7953 (Shelly EM) reset on restart [#14261](https://github.com/arendst/Tasmota/issues/14261)
+- Solax X1 negative temperature support [#14278](https://github.com/arendst/Tasmota/issues/14278)
+- Solax X1 modbus RTS support and offline status [#14305](https://github.com/arendst/Tasmota/issues/14305)
+- Tasmota favicon to webbrowser tab [#14322](https://github.com/arendst/Tasmota/issues/14322)
+- Support for BME688 with latest Bosch-Sensor-API library [#14513](https://github.com/arendst/Tasmota/issues/14513)
+- Rule variable %color% [#14572](https://github.com/arendst/Tasmota/issues/14572)
+- Support for MQ analog sensor for air quality by Francesco Adriani [#14581](https://github.com/arendst/Tasmota/issues/14581)
+- ESP32 single binary firmware [#14239](https://github.com/arendst/Tasmota/issues/14239)
+- ESP32 disable serial console when 3 (ESP32) or 2 (Other models) serial interfaces are requested [#14487](https://github.com/arendst/Tasmota/issues/14487)
+- ESP32 support for TuyaMcu
+- ESP32 Berry features
+- ESP32 support for USE_PWM_DIMMER as GPIO ``Option E1``
### Breaking Changed
### Changed
+- ESP32 core library from v2.0.2 to v2.0.2.1
+- PubSubClient library from v2.8.12 to v2.8.13
+- TasmotaSerial library from v3.3.0 to v3.4.0
+- TasmotaModbus library from v1.2.0 to v3.4.0
+- ESP8266Audio library from v1.9.2 to v1.9.5
+- ESP8266SAM library from v1.0 to v1.0.1
+- BME68x-Sensor-API library from v3.5.9 to v4.4.7
+- From Semantic Versioning (SemVer) to Calendar Versioning (CalVer)
+- Mitsubishi HVAC temperature resolution [#13936](https://github.com/arendst/Tasmota/issues/13936)
+- Remove restriction of topic must differ from mqttclient [#14019](https://github.com/arendst/Tasmota/issues/14019)
+- ESP32 Set stack size with ``#define SET_ESP32_STACK_SIZE``, added ``StackLowMark`` metrics
+- ESP32 Berry stores compiled bytecode into IRAM, freeing space in heap [#14307](https://github.com/arendst/Tasmota/issues/14307)
### Fixed
+- Intermittent exceptions and heap corruption due to PubSubClient library buffer overflow [#13700](https://github.com/arendst/Tasmota/issues/13700)
+- EZOO2 sensor message format [#14000](https://github.com/arendst/Tasmota/issues/14000)
+- DHT support negative temperatures on different hardware [#14173](https://github.com/arendst/Tasmota/issues/14173)
+- Hardware serial parity and stop bits support [#14212](https://github.com/arendst/Tasmota/issues/14212)
+- Edit file for SD card [#14229](https://github.com/arendst/Tasmota/issues/14229)
+- Scripter memory corruption [#14268](https://github.com/arendst/Tasmota/issues/14268)
+- ESP32 Webcam exception during flashwrites
+- ESP32 LedPwmMode exception [#14073](https://github.com/arendst/Tasmota/issues/14073)
+- ESP32 Compile error when I2S_Audio is enabled [#14095](https://github.com/arendst/Tasmota/issues/14095)
+- ESP32 Provide proper OTA_URL for tasmota32solo1 [#14202](https://github.com/arendst/Tasmota/issues/14202)
+- ESP32 OneWire-Stickbreaker (DS18x20) library support for ESP32C3 and ESP32S2 [#14338](https://github.com/arendst/Tasmota/issues/14338)
### Removed
diff --git a/boards/esp32-cam.json b/boards/esp32-cam.json
index fc3fc4f1f..4691051e4 100644
--- a/boards/esp32-cam.json
+++ b/boards/esp32-cam.json
@@ -4,7 +4,7 @@
"ldscript": "esp32_out.ld"
},
"core": "esp32",
- "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw",
+ "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
@@ -25,7 +25,7 @@
"arduino",
"espidf"
],
- "name": "AI Thinker ESP32-CAM, 4M Flash 4MB PSRAM, Tasmota 1856k Code/OTA, 320k SPIFFS",
+ "name": "AI Thinker ESP32-CAM, 4M Flash 4MB PSRAM, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32-m5core2.json b/boards/esp32-m5core2.json
index 0170649fa..137f023a9 100644
--- a/boards/esp32-m5core2.json
+++ b/boards/esp32-m5core2.json
@@ -4,7 +4,7 @@
"ldscript": "esp32_out.ld"
},
"core": "esp32",
- "extra_flags": "-DARDUINO_M5STACK_Core2 -DBOARD_HAS_PSRAM",
+ "extra_flags": "-DARDUINO_M5STACK_Core2 -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
@@ -25,7 +25,7 @@
"arduino",
"espidf"
],
- "name": "M5Stack Core2 16M Flash, 4MB PSRAM, Tasmota 2944k Code/OTA, 10M SPIFFS",
+ "name": "M5Stack Core2 16M Flash, 4MB PSRAM, Tasmota 2944k Code/OTA, 10M FS",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32-odroid.json b/boards/esp32-odroid.json
index 10bb8bf4d..119af3d9e 100644
--- a/boards/esp32-odroid.json
+++ b/boards/esp32-odroid.json
@@ -4,7 +4,7 @@
"ldscript": "esp32_out.ld"
},
"core": "esp32",
- "extra_flags": "-DARDUINO_ODROID_ESP32 -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw",
+ "extra_flags": "-DARDUINO_ODROID_ESP32 -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
@@ -25,7 +25,7 @@
"arduino",
"espidf"
],
- "name": "ESP32 ODROID-GO 16M Flash, 4MB PSRAM, Tasmota 2944k Code/OTA, 10M SPIFFS",
+ "name": "ESP32 ODROID-GO 16M Flash, 4MB PSRAM, Tasmota 2944k Code/OTA, 10M FS",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32_16M.json b/boards/esp32_16M.json
index 69abb9a09..9667b46ff 100644
--- a/boards/esp32_16M.json
+++ b/boards/esp32_16M.json
@@ -4,7 +4,7 @@
"ldscript": "esp32_out.ld"
},
"core": "esp32",
- "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DESP32_16M",
+ "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
@@ -25,7 +25,7 @@
"arduino",
"espidf"
],
- "name": "Espressif Generic ESP32 16M Flash, Tasmota 2944k Code/OTA, 10M SPIFFS",
+ "name": "Espressif Generic ESP32 16M Flash, Tasmota 2944k Code/OTA, 10M FS",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32_4M.json b/boards/esp32_4M.json
index f43be6848..ee7effe39 100644
--- a/boards/esp32_4M.json
+++ b/boards/esp32_4M.json
@@ -4,7 +4,7 @@
"ldscript": "esp32_out.ld"
},
"core": "esp32",
- "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DESP32_4M",
+ "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
@@ -25,7 +25,7 @@
"arduino",
"espidf"
],
- "name": "Espressif Generic ESP32 4M Flash, Tasmota 1856k Code/OTA, 320k SPIFFS",
+ "name": "Espressif Generic ESP32 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32_8M.json b/boards/esp32_8M.json
index adcd0caaa..b5dcfd676 100644
--- a/boards/esp32_8M.json
+++ b/boards/esp32_8M.json
@@ -4,7 +4,7 @@
"ldscript": "esp32_out.ld"
},
"core": "esp32",
- "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DESP32_8M",
+ "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_8M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
@@ -25,7 +25,7 @@
"arduino",
"espidf"
],
- "name": "Espressif Generic ESP32 8M Flash, Tasmota 2944k Code/OTA, 2112k SPIFFS",
+ "name": "Espressif Generic ESP32 8M Flash, Tasmota 2944k Code/OTA, 2112k FS",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32_solo1_4M.json b/boards/esp32_solo1_4M.json
index 64759d331..e5b86ade8 100644
--- a/boards/esp32_solo1_4M.json
+++ b/boards/esp32_solo1_4M.json
@@ -4,7 +4,7 @@
"ldscript": "esp32_out.ld"
},
"core": "esp32",
- "extra_flags": "-DARDUINO_ESP32_DEV -DESP32_4M",
+ "extra_flags": "-DARDUINO_ESP32_DEV -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DCORE32SOLO1",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
@@ -25,7 +25,7 @@
"arduino",
"espidf"
],
- "name": "Espressif Generic ESP32 4M Flash, Tasmota 1856k Code/OTA, 320k SPIFFS",
+ "name": "Espressif Generic ESP32 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32c3.json b/boards/esp32c3.json
index cedcf1500..762172fc3 100644
--- a/boards/esp32c3.json
+++ b/boards/esp32c3.json
@@ -4,6 +4,7 @@
"ldscript": "esp32c3_out.ld"
},
"core": "esp32",
+ "extra_flags": "-DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DESP32C3",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
@@ -21,7 +22,7 @@
"arduino",
"espidf"
],
- "name": "Espressif Generic ESP32-C3 4M Flash, Tasmota 1856k Code/OTA, 320k SPIFFS",
+ "name": "Espressif Generic ESP32-C3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp32s2.json b/boards/esp32s2.json
index e18a2339c..e0736aa29 100644
--- a/boards/esp32s2.json
+++ b/boards/esp32s2.json
@@ -4,7 +4,7 @@
"ldscript": "esp32s2_out.ld"
},
"core": "esp32",
- "extra_flags": "-DBOARD_HAS_PSRAM",
+ "extra_flags": "-DBOARD_HAS_PSRAM -DESP32_4M -DESP32S2",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
@@ -22,7 +22,7 @@
"espidf",
"arduino"
],
- "name": "Espressif Generic ESP32-S2 4M Flash, Tasmota 1856k Code/OTA, 320k SPIFFS",
+ "name": "Espressif Generic ESP32-S2 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
diff --git a/boards/esp8266_1M.json b/boards/esp8266_1M.json
index bc5b1f49b..7cd01ec90 100644
--- a/boards/esp8266_1M.json
+++ b/boards/esp8266_1M.json
@@ -19,7 +19,7 @@
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
],
- "name": "Espressif Generic ESP8266 Tasmota 1M sketch NO SPIFFS",
+ "name": "Espressif Generic ESP8266 Tasmota 1M sketch NO FS",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 995326,
diff --git a/boards/esp8266_2M1M.json b/boards/esp8266_2M1M.json
index e3a675373..afe54a343 100644
--- a/boards/esp8266_2M1M.json
+++ b/boards/esp8266_2M1M.json
@@ -19,7 +19,7 @@
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
],
- "name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M SPIFFS",
+ "name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M FS",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 995326,
diff --git a/boards/esp8266_2M256.json b/boards/esp8266_2M256.json
index 734f62537..335b84ade 100644
--- a/boards/esp8266_2M256.json
+++ b/boards/esp8266_2M256.json
@@ -19,7 +19,7 @@
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
],
- "name": "Espressif Generic ESP8266 Tasmota 1M sketch 772k OTA 256k SPIFFS",
+ "name": "Espressif Generic ESP8266 Tasmota 1M sketch 772k OTA 256k FS",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 995326,
diff --git a/boards/esp8266_4M2M.json b/boards/esp8266_4M2M.json
index 873c84f24..7b0e0c364 100644
--- a/boards/esp8266_4M2M.json
+++ b/boards/esp8266_4M2M.json
@@ -19,7 +19,7 @@
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
],
- "name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M OTA 2M SPIFFS",
+ "name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M OTA 2M FS",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 995326,
diff --git a/boards/esp8266_4M3M.json b/boards/esp8266_4M3M.json
index c845d6e96..fec296cf0 100644
--- a/boards/esp8266_4M3M.json
+++ b/boards/esp8266_4M3M.json
@@ -19,7 +19,7 @@
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
],
- "name": "Espressif Generic ESP8266 Tasmota 1M sketch 3M SPIFFS",
+ "name": "Espressif Generic ESP8266 Tasmota 1M sketch 3M FS",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 995326,
diff --git a/boards/esp8266_zbbridge.json b/boards/esp8266_zbbridge.json
index 975c1bc8c..dbc229004 100644
--- a/boards/esp8266_zbbridge.json
+++ b/boards/esp8266_zbbridge.json
@@ -4,7 +4,7 @@
"ldscript": "eagle.flash.2m256.ld"
},
"core": "esp8266",
- "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01",
+ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_2M -DESP8266_2M256",
"f_cpu": "160000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
@@ -19,7 +19,7 @@
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
],
- "name": "Sonoff ZbBridge Tasmota 1M sketch 772k OTA 256k SPIFFS",
+ "name": "Sonoff ZbBridge Tasmota 1M sketch 772k OTA 256k FS",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 995326,
diff --git a/lib/default/DHT-sensor-library/.gitignore b/lib/default/DHT-sensor-library/.gitignore
new file mode 100644
index 000000000..542d266a9
--- /dev/null
+++ b/lib/default/DHT-sensor-library/.gitignore
@@ -0,0 +1,8 @@
+# osx
+.DS_Store
+
+# doxygen
+Doxyfile*
+doxygen_sqlite3.db
+html
+*.tmp
diff --git a/lib/default/DHT-sensor-library/CONTRIBUTING.md b/lib/default/DHT-sensor-library/CONTRIBUTING.md
new file mode 100644
index 000000000..3227bf9cc
--- /dev/null
+++ b/lib/default/DHT-sensor-library/CONTRIBUTING.md
@@ -0,0 +1,13 @@
+# Contribution Guidlines
+
+This library is the culmination of the expertise of many members of the open source community who have dedicated their time and hard work. The best way to ask for help or propose a new idea is to [create a new issue](https://github.com/adafruit/DHT-sensor-library/issues/new) while creating a Pull Request with your code changes allows you to share your own innovations with the rest of the community.
+
+The following are some guidelines to observe when creating issues or PRs:
+
+- Be friendly; it is important that we can all enjoy a safe space as we are all working on the same project and it is okay for people to have different ideas
+
+- [Use code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code); it helps us help you when we can read your code! On that note also refrain from pasting more than 30 lines of code in a post, instead [create a gist](https://gist.github.com/) if you need to share large snippets
+
+- Use reasonable titles; refrain from using overly long or capitalized titles as they are usually annoying and do little to encourage others to help :smile:
+
+- Be detailed; refrain from mentioning code problems without sharing your source code and always give information regarding your board and version of the library
diff --git a/lib/default/DHT-sensor-library/DHT.cpp b/lib/default/DHT-sensor-library/DHT.cpp
new file mode 100644
index 000000000..b36461224
--- /dev/null
+++ b/lib/default/DHT-sensor-library/DHT.cpp
@@ -0,0 +1,388 @@
+/*!
+ * @file DHT.cpp
+ *
+ * @mainpage DHT series of low cost temperature/humidity sensors.
+ *
+ * @section intro_sec Introduction
+ *
+ * This is a library for DHT series of low cost temperature/humidity sensors.
+ *
+ * You must have Adafruit Unified Sensor Library library installed to use this
+ * class.
+ *
+ * Adafruit invests time and resources providing this open source code,
+ * please support Adafruit andopen-source hardware by purchasing products
+ * from Adafruit!
+ *
+ * @section author Author
+ *
+ * Written by Adafruit Industries.
+ *
+ * @section license License
+ *
+ * MIT license, all text above must be included in any redistribution
+ */
+
+#include "DHT.h"
+
+#define MIN_INTERVAL 2000 /**< min interval value */
+#define TIMEOUT \
+ UINT32_MAX /**< Used programmatically for timeout. \
+ Not a timeout duration. Type: uint32_t. */
+
+/*!
+ * @brief Instantiates a new DHT class
+ * @param pin
+ * pin number that sensor is connected
+ * @param type
+ * type of sensor
+ * @param count
+ * number of sensors
+ */
+DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) {
+ (void)count; // Workaround to avoid compiler warning.
+ _pin = pin;
+ _type = type;
+#ifdef __AVR
+ _bit = digitalPinToBitMask(pin);
+ _port = digitalPinToPort(pin);
+#endif
+ _maxcycles =
+ microsecondsToClockCycles(1000); // 1 millisecond timeout for
+ // reading pulses from DHT sensor.
+ // Note that count is now ignored as the DHT reading algorithm adjusts itself
+ // based on the speed of the processor.
+}
+
+/*!
+ * @brief Setup sensor pins and set pull timings
+ * @param usec
+ * Optionally pass pull-up time (in microseconds) before DHT reading
+ *starts. Default is 55 (see function declaration in DHT.h).
+ */
+void DHT::begin(uint8_t usec) {
+ // set up the pins!
+ pinMode(_pin, INPUT_PULLUP);
+ // Using this value makes sure that millis() - lastreadtime will be
+ // >= MIN_INTERVAL right away. Note that this assignment wraps around,
+ // but so will the subtraction.
+ _lastreadtime = millis() - MIN_INTERVAL;
+ DEBUG_PRINT("DHT max clock cycles: ");
+ DEBUG_PRINTLN(_maxcycles, DEC);
+ pullTime = usec;
+}
+
+/*!
+ * @brief Read temperature
+ * @param S
+ * Scale. Boolean value:
+ * - true = Fahrenheit
+ * - false = Celcius
+ * @param force
+ * true if in force mode
+ * @return Temperature value in selected scale
+ */
+float DHT::readTemperature(bool S, bool force) {
+ float f = NAN;
+
+ if (read(force)) {
+ switch (_type) {
+ case DHT11:
+ f = data[2];
+ if (data[3] & 0x80) {
+ f = -1 - f;
+ }
+ f += (data[3] & 0x0f) * 0.1;
+ if (S) {
+ f = convertCtoF(f);
+ }
+ break;
+ case DHT12:
+ f = data[2];
+ f += (data[3] & 0x0f) * 0.1;
+ if (data[2] & 0x80) {
+ f *= -1;
+ }
+ if (S) {
+ f = convertCtoF(f);
+ }
+ break;
+ case DHT22:
+ case DHT21:
+ f = ((word)(data[2] & 0x7F)) << 8 | data[3];
+ f *= 0.1;
+ if (data[2] & 0x80) {
+ f *= -1;
+ }
+ if (S) {
+ f = convertCtoF(f);
+ }
+ break;
+ }
+ }
+ return f;
+}
+
+/*!
+ * @brief Converts Celcius to Fahrenheit
+ * @param c
+ * value in Celcius
+ * @return float value in Fahrenheit
+ */
+float DHT::convertCtoF(float c) { return c * 1.8 + 32; }
+
+/*!
+ * @brief Converts Fahrenheit to Celcius
+ * @param f
+ * value in Fahrenheit
+ * @return float value in Celcius
+ */
+float DHT::convertFtoC(float f) { return (f - 32) * 0.55555; }
+
+/*!
+ * @brief Read Humidity
+ * @param force
+ * force read mode
+ * @return float value - humidity in percent
+ */
+float DHT::readHumidity(bool force) {
+ float f = NAN;
+ if (read(force)) {
+ switch (_type) {
+ case DHT11:
+ case DHT12:
+ f = data[0] + data[1] * 0.1;
+ break;
+ case DHT22:
+ case DHT21:
+ f = ((word)data[0]) << 8 | data[1];
+ f *= 0.1;
+ break;
+ }
+ }
+ return f;
+}
+
+/*!
+ * @brief Compute Heat Index
+ * Simplified version that reads temp and humidity from sensor
+ * @param isFahrenheit
+ * true if fahrenheit, false if celcius
+ *(default true)
+ * @return float heat index
+ */
+float DHT::computeHeatIndex(bool isFahrenheit) {
+ float hi = computeHeatIndex(readTemperature(isFahrenheit), readHumidity(),
+ isFahrenheit);
+ return hi;
+}
+
+/*!
+ * @brief Compute Heat Index
+ * Using both Rothfusz and Steadman's equations
+ * (http://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml)
+ * @param temperature
+ * temperature in selected scale
+ * @param percentHumidity
+ * humidity in percent
+ * @param isFahrenheit
+ * true if fahrenheit, false if celcius
+ * @return float heat index
+ */
+float DHT::computeHeatIndex(float temperature, float percentHumidity,
+ bool isFahrenheit) {
+ float hi;
+
+ if (!isFahrenheit)
+ temperature = convertCtoF(temperature);
+
+ hi = 0.5 * (temperature + 61.0 + ((temperature - 68.0) * 1.2) +
+ (percentHumidity * 0.094));
+
+ if (hi > 79) {
+ hi = -42.379 + 2.04901523 * temperature + 10.14333127 * percentHumidity +
+ -0.22475541 * temperature * percentHumidity +
+ -0.00683783 * pow(temperature, 2) +
+ -0.05481717 * pow(percentHumidity, 2) +
+ 0.00122874 * pow(temperature, 2) * percentHumidity +
+ 0.00085282 * temperature * pow(percentHumidity, 2) +
+ -0.00000199 * pow(temperature, 2) * pow(percentHumidity, 2);
+
+ if ((percentHumidity < 13) && (temperature >= 80.0) &&
+ (temperature <= 112.0))
+ hi -= ((13.0 - percentHumidity) * 0.25) *
+ sqrt((17.0 - abs(temperature - 95.0)) * 0.05882);
+
+ else if ((percentHumidity > 85.0) && (temperature >= 80.0) &&
+ (temperature <= 87.0))
+ hi += ((percentHumidity - 85.0) * 0.1) * ((87.0 - temperature) * 0.2);
+ }
+
+ return isFahrenheit ? hi : convertFtoC(hi);
+}
+
+/*!
+ * @brief Read value from sensor or return last one from less than two
+ *seconds.
+ * @param force
+ * true if using force mode
+ * @return float value
+ */
+bool DHT::read(bool force) {
+ // Check if sensor was read less than two seconds ago and return early
+ // to use last reading.
+ uint32_t currenttime = millis();
+ if (!force && ((currenttime - _lastreadtime) < MIN_INTERVAL)) {
+ return _lastresult; // return last correct measurement
+ }
+ _lastreadtime = currenttime;
+
+ // Reset 40 bits of received data to zero.
+ data[0] = data[1] = data[2] = data[3] = data[4] = 0;
+
+#if defined(ESP8266)
+ yield(); // Handle WiFi / reset software watchdog
+#endif
+
+ // Send start signal. See DHT datasheet for full signal diagram:
+ // http://www.adafruit.com/datasheets/Digital%20humidity%20and%20temperature%20sensor%20AM2302.pdf
+
+ // Go into high impedence state to let pull-up raise data line level and
+ // start the reading process.
+ pinMode(_pin, INPUT_PULLUP);
+ delay(1);
+
+ // First set data line low for a period according to sensor type
+ pinMode(_pin, OUTPUT);
+ digitalWrite(_pin, LOW);
+ switch (_type) {
+ case DHT22:
+ case DHT21:
+ delayMicroseconds(1100); // data sheet says "at least 1ms"
+ break;
+ case DHT11:
+ default:
+ delay(20); // data sheet says at least 18ms, 20ms just to be safe
+ break;
+ }
+
+ uint32_t cycles[80];
+ {
+ // End the start signal by setting data line high for 40 microseconds.
+ pinMode(_pin, INPUT_PULLUP);
+
+ // Delay a moment to let sensor pull data line low.
+ delayMicroseconds(pullTime);
+
+ // Now start reading the data line to get the value from the DHT sensor.
+
+ // Turn off interrupts temporarily because the next sections
+ // are timing critical and we don't want any interruptions.
+ InterruptLock lock;
+
+ // First expect a low signal for ~80 microseconds followed by a high signal
+ // for ~80 microseconds again.
+ if (expectPulse(LOW) == TIMEOUT) {
+ DEBUG_PRINTLN(F("DHT timeout waiting for start signal low pulse."));
+ _lastresult = false;
+ return _lastresult;
+ }
+ if (expectPulse(HIGH) == TIMEOUT) {
+ DEBUG_PRINTLN(F("DHT timeout waiting for start signal high pulse."));
+ _lastresult = false;
+ return _lastresult;
+ }
+
+ // Now read the 40 bits sent by the sensor. Each bit is sent as a 50
+ // microsecond low pulse followed by a variable length high pulse. If the
+ // high pulse is ~28 microseconds then it's a 0 and if it's ~70 microseconds
+ // then it's a 1. We measure the cycle count of the initial 50us low pulse
+ // and use that to compare to the cycle count of the high pulse to determine
+ // if the bit is a 0 (high state cycle count < low state cycle count), or a
+ // 1 (high state cycle count > low state cycle count). Note that for speed
+ // all the pulses are read into a array and then examined in a later step.
+ for (int i = 0; i < 80; i += 2) {
+ cycles[i] = expectPulse(LOW);
+ cycles[i + 1] = expectPulse(HIGH);
+ }
+ } // Timing critical code is now complete.
+
+ // Inspect pulses and determine which ones are 0 (high state cycle count < low
+ // state cycle count), or 1 (high state cycle count > low state cycle count).
+ for (int i = 0; i < 40; ++i) {
+ uint32_t lowCycles = cycles[2 * i];
+ uint32_t highCycles = cycles[2 * i + 1];
+ if ((lowCycles == TIMEOUT) || (highCycles == TIMEOUT)) {
+ DEBUG_PRINTLN(F("DHT timeout waiting for pulse."));
+ _lastresult = false;
+ return _lastresult;
+ }
+ data[i / 8] <<= 1;
+ // Now compare the low and high cycle times to see if the bit is a 0 or 1.
+ if (highCycles > lowCycles) {
+ // High cycles are greater than 50us low cycle count, must be a 1.
+ data[i / 8] |= 1;
+ }
+ // Else high cycles are less than (or equal to, a weird case) the 50us low
+ // cycle count so this must be a zero. Nothing needs to be changed in the
+ // stored data.
+ }
+
+ DEBUG_PRINTLN(F("Received from DHT:"));
+ DEBUG_PRINT(data[0], HEX);
+ DEBUG_PRINT(F(", "));
+ DEBUG_PRINT(data[1], HEX);
+ DEBUG_PRINT(F(", "));
+ DEBUG_PRINT(data[2], HEX);
+ DEBUG_PRINT(F(", "));
+ DEBUG_PRINT(data[3], HEX);
+ DEBUG_PRINT(F(", "));
+ DEBUG_PRINT(data[4], HEX);
+ DEBUG_PRINT(F(" =? "));
+ DEBUG_PRINTLN((data[0] + data[1] + data[2] + data[3]) & 0xFF, HEX);
+
+ // Check we read 40 bits and that the checksum matches.
+ if (data[4] == ((data[0] + data[1] + data[2] + data[3]) & 0xFF)) {
+ _lastresult = true;
+ return _lastresult;
+ } else {
+ DEBUG_PRINTLN(F("DHT checksum failure!"));
+ _lastresult = false;
+ return _lastresult;
+ }
+}
+
+// Expect the signal line to be at the specified level for a period of time and
+// return a count of loop cycles spent at that level (this cycle count can be
+// used to compare the relative time of two pulses). If more than a millisecond
+// ellapses without the level changing then the call fails with a 0 response.
+// This is adapted from Arduino's pulseInLong function (which is only available
+// in the very latest IDE versions):
+// https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/wiring_pulse.c
+uint32_t DHT::expectPulse(bool level) {
+#if (F_CPU > 16000000L)
+ uint32_t count = 0;
+#else
+ uint16_t count = 0; // To work fast enough on slower AVR boards
+#endif
+// On AVR platforms use direct GPIO port access as it's much faster and better
+// for catching pulses that are 10's of microseconds in length:
+#ifdef __AVR
+ uint8_t portState = level ? _bit : 0;
+ while ((*portInputRegister(_port) & _bit) == portState) {
+ if (count++ >= _maxcycles) {
+ return TIMEOUT; // Exceeded timeout, fail.
+ }
+ }
+// Otherwise fall back to using digitalRead (this seems to be necessary on
+// ESP8266 right now, perhaps bugs in direct port access functions?).
+#else
+ while (digitalRead(_pin) == level) {
+ if (count++ >= _maxcycles) {
+ return TIMEOUT; // Exceeded timeout, fail.
+ }
+ }
+#endif
+
+ return count;
+}
diff --git a/lib/default/DHT-sensor-library/DHT.h b/lib/default/DHT-sensor-library/DHT.h
new file mode 100644
index 000000000..95570e1cf
--- /dev/null
+++ b/lib/default/DHT-sensor-library/DHT.h
@@ -0,0 +1,109 @@
+/*!
+ * @file DHT.h
+ *
+ * This is a library for DHT series of low cost temperature/humidity sensors.
+ *
+ * You must have Adafruit Unified Sensor Library library installed to use this
+ * class.
+ *
+ * Adafruit invests time and resources providing this open source code,
+ * please support Adafruit andopen-source hardware by purchasing products
+ * from Adafruit!
+ *
+ * Written by Adafruit Industries.
+ *
+ * MIT license, all text above must be included in any redistribution
+ */
+
+#ifndef DHT_H
+#define DHT_H
+
+#include "Arduino.h"
+
+/* Uncomment to enable printing out nice debug messages. */
+//#define DHT_DEBUG
+
+#define DEBUG_PRINTER \
+ Serial /**< Define where debug output will be printed. \
+ */
+
+/* Setup debug printing macros. */
+#ifdef DHT_DEBUG
+#define DEBUG_PRINT(...) \
+ { DEBUG_PRINTER.print(__VA_ARGS__); }
+#define DEBUG_PRINTLN(...) \
+ { DEBUG_PRINTER.println(__VA_ARGS__); }
+#else
+#define DEBUG_PRINT(...) \
+ {} /**< Debug Print Placeholder if Debug is disabled */
+#define DEBUG_PRINTLN(...) \
+ {} /**< Debug Print Line Placeholder if Debug is disabled */
+#endif
+
+/* Define types of sensors. */
+static const uint8_t DHT11{11}; /**< DHT TYPE 11 */
+static const uint8_t DHT12{12}; /**< DHY TYPE 12 */
+static const uint8_t DHT21{21}; /**< DHT TYPE 21 */
+static const uint8_t DHT22{22}; /**< DHT TYPE 22 */
+static const uint8_t AM2301{21}; /**< AM2301 */
+
+#if defined(TARGET_NAME) && (TARGET_NAME == ARDUINO_NANO33BLE)
+#ifndef microsecondsToClockCycles
+/*!
+ * As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have
+ * microsecondsToClockCycles defined.
+ */
+#define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L))
+#endif
+#endif
+
+/*!
+ * @brief Class that stores state and functions for DHT
+ */
+class DHT {
+public:
+ DHT(uint8_t pin, uint8_t type, uint8_t count = 6);
+ void begin(uint8_t usec = 55);
+ float readTemperature(bool S = false, bool force = false);
+ float convertCtoF(float);
+ float convertFtoC(float);
+ float computeHeatIndex(bool isFahrenheit = true);
+ float computeHeatIndex(float temperature, float percentHumidity,
+ bool isFahrenheit = true);
+ float readHumidity(bool force = false);
+ bool read(bool force = false);
+
+private:
+ uint8_t data[5];
+ uint8_t _pin, _type;
+#ifdef __AVR
+ // Use direct GPIO access on an 8-bit AVR so keep track of the port and
+ // bitmask for the digital pin connected to the DHT. Other platforms will use
+ // digitalRead.
+ uint8_t _bit, _port;
+#endif
+ uint32_t _lastreadtime, _maxcycles;
+ bool _lastresult;
+ uint8_t pullTime; // Time (in usec) to pull up data line before reading
+
+ uint32_t expectPulse(bool level);
+};
+
+/*!
+ * @brief Class that defines Interrupt Lock Avaiability
+ */
+class InterruptLock {
+public:
+ InterruptLock() {
+#if !defined(ARDUINO_ARCH_NRF52)
+ noInterrupts();
+#endif
+ }
+ ~InterruptLock() {
+#if !defined(ARDUINO_ARCH_NRF52)
+ interrupts();
+#endif
+ }
+};
+
+#endif
diff --git a/lib/default/DHT-sensor-library/README.md b/lib/default/DHT-sensor-library/README.md
new file mode 100644
index 000000000..ba871876d
--- /dev/null
+++ b/lib/default/DHT-sensor-library/README.md
@@ -0,0 +1,58 @@
+# DHT sensor library [](https://github.com/adafruit/DHT-sensor-library/actions)
+
+## Description
+
+An Arduino library for the DHT series of low-cost temperature/humidity sensors.
+
+You can find DHT tutorials [here](https://learn.adafruit.com/dht).
+
+# Dependencies
+ * [Adafruit Unified Sensor Driver](https://github.com/adafruit/Adafruit_Sensor)
+
+# Contributing
+
+Contributions are welcome! Not only you’ll encourage the development of the library, but you’ll also learn how to best use the library and probably some C++ too
+
+Please read our [Code of Conduct](https://github.com/adafruit/DHT-sensor-library/blob/master/CODE_OF_CONDUCT.md>)
+before contributing to help this project stay welcoming.
+
+## Documentation and doxygen
+Documentation is produced by doxygen. Contributions should include documentation for any new code added.
+
+Some examples of how to use doxygen can be found in these guide pages:
+
+https://learn.adafruit.com/the-well-automated-arduino-library/doxygen
+
+https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips
+
+Written by Adafruit Industries based on work by:
+
+ * T. DiCola
+ * P. Y. Dragon
+ * L. Fried
+ * J. Hoffmann
+ * M. Kooijman
+ * J. M. Dana
+ * S. Conaway
+ * S. IJskes
+ * T. Forbes
+ * B. C
+ * T. J Myers
+ * L. Sørup
+ * per1234
+ * O. Duffy
+ * matthiasdanner
+ * J. Lim
+ * G. Ambrozio
+ * chelmi
+ * adams13x13
+ * Spacefish
+ * I. Scheller
+ * C. Miller
+ * 7eggert
+
+
+MIT license, check license.txt for more information
+All text above must be included in any redistribution
+
+To install, use the Arduino Library Manager and search for "DHT sensor library" and install the library.
diff --git a/lib/default/DHT-sensor-library/code-of-conduct.md b/lib/default/DHT-sensor-library/code-of-conduct.md
new file mode 100644
index 000000000..8ee6e4498
--- /dev/null
+++ b/lib/default/DHT-sensor-library/code-of-conduct.md
@@ -0,0 +1,127 @@
+# Adafruit Community Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and leaders pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level or type of
+experience, education, socio-economic status, nationality, personal appearance,
+race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+We are committed to providing a friendly, safe and welcoming environment for
+all.
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Be kind and courteous to others
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Collaborating with other community members
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and sexual attention or advances
+* The use of inappropriate images, including in a community member's avatar
+* The use of inappropriate language, including in a community member's nickname
+* Any spamming, flaming, baiting or other attention-stealing behavior
+* Excessive or unwelcome helping; answering outside the scope of the question
+ asked
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate
+
+The goal of the standards and moderation guidelines outlined here is to build
+and maintain a respectful community. We ask that you don’t just aim to be
+"technically unimpeachable", but rather try to be your best self.
+
+We value many things beyond technical expertise, including collaboration and
+supporting others within our community. Providing a positive experience for
+other community members can have a much more significant impact than simply
+providing the correct answer.
+
+## Our Responsibilities
+
+Project leaders are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project leaders have the right and responsibility to remove, edit, or
+reject messages, comments, commits, code, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any community member for other behaviors that they deem
+inappropriate, threatening, offensive, or harmful.
+
+## Moderation
+
+Instances of behaviors that violate the Adafruit Community Code of Conduct
+may be reported by any member of the community. Community members are
+encouraged to report these situations, including situations they witness
+involving other community members.
+
+You may report in the following ways:
+
+In any situation, you may send an email to .
+
+On the Adafruit Discord, you may send an open message from any channel
+to all Community Helpers by tagging @community helpers. You may also send an
+open message from any channel, or a direct message to @kattni#1507,
+@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
+@Andon#8175.
+
+Email and direct message reports will be kept confidential.
+
+In situations on Discord where the issue is particularly egregious, possibly
+illegal, requires immediate action, or violates the Discord terms of service,
+you should also report the message directly to Discord.
+
+These are the steps for upholding our community’s standards of conduct.
+
+1. Any member of the community may report any situation that violates the
+Adafruit Community Code of Conduct. All reports will be reviewed and
+investigated.
+2. If the behavior is an egregious violation, the community member who
+committed the violation may be banned immediately, without warning.
+3. Otherwise, moderators will first respond to such behavior with a warning.
+4. Moderators follow a soft "three strikes" policy - the community member may
+be given another chance, if they are receptive to the warning and change their
+behavior.
+5. If the community member is unreceptive or unreasonable when warned by a
+moderator, or the warning goes unheeded, they may be banned for a first or
+second offense. Repeated offenses will result in the community member being
+banned.
+
+## Scope
+
+This Code of Conduct and the enforcement policies listed above apply to all
+Adafruit Community venues. This includes but is not limited to any community
+spaces (both public and private), the entire Adafruit Discord server, and
+Adafruit GitHub repositories. Examples of Adafruit Community spaces include
+but are not limited to meet-ups, audio chats on the Adafruit Discord, or
+interaction at a conference.
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. As a community
+member, you are representing our community, and are expected to behave
+accordingly.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 1.4, available at
+,
+and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
+
+For other projects adopting the Adafruit Community Code of
+Conduct, please contact the maintainers of those projects for enforcement.
+If you wish to use this code of conduct for your own project, consider
+explicitly mentioning your moderation policy or making a copy with your
+own moderation policy so as to avoid confusion.
diff --git a/lib/default/DHT-sensor-library/examples/DHT_Unified_Sensor/DHT_Unified_Sensor.ino b/lib/default/DHT-sensor-library/examples/DHT_Unified_Sensor/DHT_Unified_Sensor.ino
new file mode 100644
index 000000000..0f70347ba
--- /dev/null
+++ b/lib/default/DHT-sensor-library/examples/DHT_Unified_Sensor/DHT_Unified_Sensor.ino
@@ -0,0 +1,85 @@
+// DHT Temperature & Humidity Sensor
+// Unified Sensor Library Example
+// Written by Tony DiCola for Adafruit Industries
+// Released under an MIT license.
+
+// REQUIRES the following Arduino libraries:
+// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
+// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor
+
+#include
+#include
+#include
+
+#define DHTPIN 2 // Digital pin connected to the DHT sensor
+// Feather HUZZAH ESP8266 note: use pins 3, 4, 5, 12, 13 or 14 --
+// Pin 15 can work but DHT must be disconnected during program upload.
+
+// Uncomment the type of sensor in use:
+//#define DHTTYPE DHT11 // DHT 11
+#define DHTTYPE DHT22 // DHT 22 (AM2302)
+//#define DHTTYPE DHT21 // DHT 21 (AM2301)
+
+// See guide for details on sensor wiring and usage:
+// https://learn.adafruit.com/dht/overview
+
+DHT_Unified dht(DHTPIN, DHTTYPE);
+
+uint32_t delayMS;
+
+void setup() {
+ Serial.begin(9600);
+ // Initialize device.
+ dht.begin();
+ Serial.println(F("DHTxx Unified Sensor Example"));
+ // Print temperature sensor details.
+ sensor_t sensor;
+ dht.temperature().getSensor(&sensor);
+ Serial.println(F("------------------------------------"));
+ Serial.println(F("Temperature Sensor"));
+ Serial.print (F("Sensor Type: ")); Serial.println(sensor.name);
+ Serial.print (F("Driver Ver: ")); Serial.println(sensor.version);
+ Serial.print (F("Unique ID: ")); Serial.println(sensor.sensor_id);
+ Serial.print (F("Max Value: ")); Serial.print(sensor.max_value); Serial.println(F("°C"));
+ Serial.print (F("Min Value: ")); Serial.print(sensor.min_value); Serial.println(F("°C"));
+ Serial.print (F("Resolution: ")); Serial.print(sensor.resolution); Serial.println(F("°C"));
+ Serial.println(F("------------------------------------"));
+ // Print humidity sensor details.
+ dht.humidity().getSensor(&sensor);
+ Serial.println(F("Humidity Sensor"));
+ Serial.print (F("Sensor Type: ")); Serial.println(sensor.name);
+ Serial.print (F("Driver Ver: ")); Serial.println(sensor.version);
+ Serial.print (F("Unique ID: ")); Serial.println(sensor.sensor_id);
+ Serial.print (F("Max Value: ")); Serial.print(sensor.max_value); Serial.println(F("%"));
+ Serial.print (F("Min Value: ")); Serial.print(sensor.min_value); Serial.println(F("%"));
+ Serial.print (F("Resolution: ")); Serial.print(sensor.resolution); Serial.println(F("%"));
+ Serial.println(F("------------------------------------"));
+ // Set delay between sensor readings based on sensor details.
+ delayMS = sensor.min_delay / 1000;
+}
+
+void loop() {
+ // Delay between measurements.
+ delay(delayMS);
+ // Get temperature event and print its value.
+ sensors_event_t event;
+ dht.temperature().getEvent(&event);
+ if (isnan(event.temperature)) {
+ Serial.println(F("Error reading temperature!"));
+ }
+ else {
+ Serial.print(F("Temperature: "));
+ Serial.print(event.temperature);
+ Serial.println(F("°C"));
+ }
+ // Get humidity event and print its value.
+ dht.humidity().getEvent(&event);
+ if (isnan(event.relative_humidity)) {
+ Serial.println(F("Error reading humidity!"));
+ }
+ else {
+ Serial.print(F("Humidity: "));
+ Serial.print(event.relative_humidity);
+ Serial.println(F("%"));
+ }
+}
diff --git a/lib/default/DHT-sensor-library/examples/DHTtester/DHTtester.ino b/lib/default/DHT-sensor-library/examples/DHTtester/DHTtester.ino
new file mode 100644
index 000000000..d13507bfe
--- /dev/null
+++ b/lib/default/DHT-sensor-library/examples/DHTtester/DHTtester.ino
@@ -0,0 +1,74 @@
+// Example testing sketch for various DHT humidity/temperature sensors
+// Written by ladyada, public domain
+
+// REQUIRES the following Arduino libraries:
+// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
+// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor
+
+#include "DHT.h"
+
+#define DHTPIN 2 // Digital pin connected to the DHT sensor
+// Feather HUZZAH ESP8266 note: use pins 3, 4, 5, 12, 13 or 14 --
+// Pin 15 can work but DHT must be disconnected during program upload.
+
+// Uncomment whatever type you're using!
+//#define DHTTYPE DHT11 // DHT 11
+#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
+//#define DHTTYPE DHT21 // DHT 21 (AM2301)
+
+// Connect pin 1 (on the left) of the sensor to +5V
+// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
+// to 3.3V instead of 5V!
+// Connect pin 2 of the sensor to whatever your DHTPIN is
+// Connect pin 3 (on the right) of the sensor to GROUND (if your sensor has 3 pins)
+// Connect pin 4 (on the right) of the sensor to GROUND and leave the pin 3 EMPTY (if your sensor has 4 pins)
+// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
+
+// Initialize DHT sensor.
+// Note that older versions of this library took an optional third parameter to
+// tweak the timings for faster processors. This parameter is no longer needed
+// as the current DHT reading algorithm adjusts itself to work on faster procs.
+DHT dht(DHTPIN, DHTTYPE);
+
+void setup() {
+ Serial.begin(9600);
+ Serial.println(F("DHTxx test!"));
+
+ dht.begin();
+}
+
+void loop() {
+ // Wait a few seconds between measurements.
+ delay(2000);
+
+ // Reading temperature or humidity takes about 250 milliseconds!
+ // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
+ float h = dht.readHumidity();
+ // Read temperature as Celsius (the default)
+ float t = dht.readTemperature();
+ // Read temperature as Fahrenheit (isFahrenheit = true)
+ float f = dht.readTemperature(true);
+
+ // Check if any reads failed and exit early (to try again).
+ if (isnan(h) || isnan(t) || isnan(f)) {
+ Serial.println(F("Failed to read from DHT sensor!"));
+ return;
+ }
+
+ // Compute heat index in Fahrenheit (the default)
+ float hif = dht.computeHeatIndex(f, h);
+ // Compute heat index in Celsius (isFahreheit = false)
+ float hic = dht.computeHeatIndex(t, h, false);
+
+ Serial.print(F("Humidity: "));
+ Serial.print(h);
+ Serial.print(F("% Temperature: "));
+ Serial.print(t);
+ Serial.print(F("°C "));
+ Serial.print(f);
+ Serial.print(F("°F Heat index: "));
+ Serial.print(hic);
+ Serial.print(F("°C "));
+ Serial.print(hif);
+ Serial.println(F("°F"));
+}
diff --git a/lib/default/DHT-sensor-library/keywords.txt b/lib/default/DHT-sensor-library/keywords.txt
new file mode 100644
index 000000000..3b0280fc4
--- /dev/null
+++ b/lib/default/DHT-sensor-library/keywords.txt
@@ -0,0 +1,22 @@
+###########################################
+# Syntax Coloring Map For DHT-sensor-library
+###########################################
+
+###########################################
+# Datatypes (KEYWORD1)
+###########################################
+
+DHT KEYWORD1
+
+###########################################
+# Methods and Functions (KEYWORD2)
+###########################################
+
+begin KEYWORD2
+readTemperature KEYWORD2
+convertCtoF KEYWORD2
+convertFtoC KEYWORD2
+computeHeatIndex KEYWORD2
+readHumidity KEYWORD2
+read KEYWORD2
+
diff --git a/lib/default/DHT-sensor-library/library.properties b/lib/default/DHT-sensor-library/library.properties
new file mode 100644
index 000000000..5c24c5aa9
--- /dev/null
+++ b/lib/default/DHT-sensor-library/library.properties
@@ -0,0 +1,10 @@
+name=DHT sensor library
+version=1.4.3
+author=Adafruit
+maintainer=Adafruit
+sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors
+paragraph=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors
+category=Sensors
+url=https://github.com/adafruit/DHT-sensor-library
+architectures=*
+depends=Adafruit Unified Sensor
diff --git a/lib/default/DHT-sensor-library/license.txt b/lib/default/DHT-sensor-library/license.txt
new file mode 100644
index 000000000..f06f843e4
--- /dev/null
+++ b/lib/default/DHT-sensor-library/license.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2020 Adafruit Industries
+
+
+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.
diff --git a/lib/default/TasmotaLList/library.json b/lib/default/TasmotaLList/library.json
index d49f03f71..d5c06d45c 100644
--- a/lib/default/TasmotaLList/library.json
+++ b/lib/default/TasmotaLList/library.json
@@ -4,8 +4,8 @@
"description": "Simple yet powerful linked-list",
"license": "MIT",
"homepage": "https://github.com/arendst/Tasmota",
- "frameworks": "*",
- "platforms": "*",
+ "frameworks": "arduino",
+ "platforms": "espressif32, espressif8266",
"authors":
{
"name": "Stephan Hadinger",
diff --git a/lib/default/TasmotaSerial-3.3.0/README.md b/lib/default/TasmotaSerial-3.4.0/README.md
similarity index 100%
rename from lib/default/TasmotaSerial-3.3.0/README.md
rename to lib/default/TasmotaSerial-3.4.0/README.md
diff --git a/lib/default/TasmotaSerial-3.3.0/examples/swsertest/swsertest.ino b/lib/default/TasmotaSerial-3.4.0/examples/swsertest/swsertest.ino
similarity index 100%
rename from lib/default/TasmotaSerial-3.3.0/examples/swsertest/swsertest.ino
rename to lib/default/TasmotaSerial-3.4.0/examples/swsertest/swsertest.ino
diff --git a/lib/default/TasmotaSerial-3.3.0/keywords.txt b/lib/default/TasmotaSerial-3.4.0/keywords.txt
similarity index 100%
rename from lib/default/TasmotaSerial-3.3.0/keywords.txt
rename to lib/default/TasmotaSerial-3.4.0/keywords.txt
diff --git a/lib/default/TasmotaSerial-3.3.0/library.json b/lib/default/TasmotaSerial-3.4.0/library.json
similarity index 94%
rename from lib/default/TasmotaSerial-3.3.0/library.json
rename to lib/default/TasmotaSerial-3.4.0/library.json
index f6d1aaaeb..e9e2294fb 100644
--- a/lib/default/TasmotaSerial-3.3.0/library.json
+++ b/lib/default/TasmotaSerial-3.4.0/library.json
@@ -1,6 +1,6 @@
{
"name": "TasmotaSerial",
- "version": "3.3.0",
+ "version": "3.4.0",
"keywords": [
"serial", "io", "TasmotaSerial"
],
diff --git a/lib/default/TasmotaSerial-3.3.0/library.properties b/lib/default/TasmotaSerial-3.4.0/library.properties
similarity index 94%
rename from lib/default/TasmotaSerial-3.3.0/library.properties
rename to lib/default/TasmotaSerial-3.4.0/library.properties
index 6b43764a6..d254a7355 100644
--- a/lib/default/TasmotaSerial-3.3.0/library.properties
+++ b/lib/default/TasmotaSerial-3.4.0/library.properties
@@ -1,5 +1,5 @@
name=TasmotaSerial
-version=3.3.0
+version=3.4.0
author=Theo Arends
maintainer=Theo Arends
sentence=Implementation of software serial with hardware serial fallback for ESP8266 and ESP32.
diff --git a/lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp b/lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp
similarity index 91%
rename from lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp
rename to lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp
index 07754719e..150d740b0 100644
--- a/lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp
+++ b/lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp
@@ -40,13 +40,7 @@ TasmotaSerial *tms_obj_list[16];
#include "driver/uart.h"
-#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
-static int tasmota_serial_index = 2; // Allow UART2 and UART1 only
-#elif CONFIG_IDF_TARGET_ESP32S2 // ESP32-S2
-static int tasmota_serial_index = 1; // Allow UART1 only
-#elif CONFIG_IDF_TARGET_ESP32C3 // ESP32-C3
-static int tasmota_serial_index = 1; // Allow UART1 only
-#endif
+static int tasmota_serial_index = SOC_UART_NUM -1; // Available UART
#endif // ESP32
@@ -90,7 +84,8 @@ TasmotaSerial::TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fal
}
#endif // ESP8266
#ifdef ESP32
- if (transmit_pin > 33) { return; } // GPIO34 - GPIO39 are Input only
+ if ((receive_pin >= 0) && !GPIO_IS_VALID_GPIO(receive_pin)) { return; }
+ if ((transmit_pin >= 0) && !GPIO_IS_VALID_OUTPUT_GPIO(transmit_pin)) { return; }
m_hardserial = true;
#endif // ESP32
m_valid = true;
@@ -111,7 +106,7 @@ TasmotaSerial::~TasmotaSerial(void) {
#ifdef ESP32
TSerial->end();
- tasmota_serial_index++;
+ tasmota_serial_index++; // This only works if no more uarts are requested otherwise will need a global used_uart log
#endif // ESP32
}
@@ -121,21 +116,6 @@ bool TasmotaSerial::isValidGPIOpin(int pin) {
bool TasmotaSerial::begin(uint32_t speed, uint32_t config) {
if (!m_valid) { return false; }
- if (config > 2) {
- // Legacy support where software serial fakes two stop bits if either stop bits is 2 or parity is not None
- m_stop_bits = ((config &0x30) >> 5) +1;
- if ((1 == m_stop_bits) && (config &0x03)) {
- m_stop_bits++;
- }
- } else {
- m_stop_bits = ((config -1) &1) +1;
-#ifdef ESP8266
- config = (2 == m_stop_bits) ? (uint32_t)SERIAL_8N2 : (uint32_t)SERIAL_8N1;
-#endif // ESP8266
-#ifdef ESP32
- config = (2 == m_stop_bits) ? SERIAL_8N2 : SERIAL_8N1;
-#endif // ESP32
- }
if (m_hardserial) {
#ifdef ESP8266
@@ -149,10 +129,17 @@ bool TasmotaSerial::begin(uint32_t speed, uint32_t config) {
}
#endif // ESP8266
#ifdef ESP32
- if (tasmota_serial_index > 0) { // We only support UART1 and UART2 and keep UART0 for debugging
+ if (tasmota_serial_index >= 0) { // We prefer UART1 and UART2 and keep UART0 for debugging
m_uart = tasmota_serial_index;
tasmota_serial_index--;
- TSerial = new HardwareSerial(m_uart);
+ if (0 == m_uart) {
+ Serial.flush();
+ Serial.end();
+ delay(10); // Allow time to cleanup queues - if not used hangs ESP32
+ TSerial = &Serial;
+ } else {
+ TSerial = new HardwareSerial(m_uart);
+ }
if (serial_buffer_size > 256) { // RX Buffer can't be resized when Serial is already running (HardwareSerial.cpp)
TSerial->setRxBufferSize(serial_buffer_size);
}
@@ -181,6 +168,18 @@ bool TasmotaSerial::begin(uint32_t speed, uint32_t config) {
// Serial.printf("TSR: Using UART%d\n", m_uart);
#endif // ESP32
} else {
+ // Software serial fakes two stop bits if either stop bits is 2 or parity is not None
+ // #define UART_NB_STOP_BIT_0 0B00000000
+ // #define UART_NB_STOP_BIT_1 0B00010000
+ // #define UART_NB_STOP_BIT_15 0B00100000
+ // #define UART_NB_STOP_BIT_2 0B00110000
+ m_stop_bits = ((config &0x30) >> 5) +1;
+ // #define UART_PARITY_NONE 0B00000000
+ // #define UART_PARITY_EVEN 0B00000010
+ // #define UART_PARITY_ODD 0B00000011
+ if ((1 == m_stop_bits) && (config &0x03)) {
+ m_stop_bits++;
+ }
// Use getCycleCount() loop to get as exact timing as possible
m_bit_time = ESP.getCpuFreqMHz() * 1000000 / speed;
m_bit_start_time = m_bit_time + m_bit_time/3 - (ESP.getCpuFreqMHz() > 120 ? 700 : 500); // pre-compute first wait
@@ -195,7 +194,7 @@ bool TasmotaSerial::hardwareSerial(void) {
return m_hardserial;
#endif // ESP8266
#ifdef ESP32
- return false; // On ESP32 do not mess with Serial0 buffers
+ return (0 == m_uart); // We prefer UART1 and UART2 and keep UART0 for debugging
#endif // ESP32
}
diff --git a/lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.h b/lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.h
similarity index 100%
rename from lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.h
rename to lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.h
diff --git a/lib/default/pubsubclient-2.8.12/.gitignore b/lib/default/pubsubclient-2.8.13/.gitignore
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/.gitignore
rename to lib/default/pubsubclient-2.8.13/.gitignore
diff --git a/lib/default/pubsubclient-2.8.12/.travis.yml b/lib/default/pubsubclient-2.8.13/.travis.yml
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/.travis.yml
rename to lib/default/pubsubclient-2.8.13/.travis.yml
diff --git a/lib/default/pubsubclient-2.8.12/CHANGES.txt b/lib/default/pubsubclient-2.8.13/CHANGES.txt
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/CHANGES.txt
rename to lib/default/pubsubclient-2.8.13/CHANGES.txt
diff --git a/lib/default/pubsubclient-2.8.12/LICENSE.txt b/lib/default/pubsubclient-2.8.13/LICENSE.txt
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/LICENSE.txt
rename to lib/default/pubsubclient-2.8.13/LICENSE.txt
diff --git a/lib/default/pubsubclient-2.8.12/README.md b/lib/default/pubsubclient-2.8.13/README.md
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/README.md
rename to lib/default/pubsubclient-2.8.13/README.md
diff --git a/lib/default/pubsubclient-2.8.12/examples/mqtt_auth/mqtt_auth.ino b/lib/default/pubsubclient-2.8.13/examples/mqtt_auth/mqtt_auth.ino
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/examples/mqtt_auth/mqtt_auth.ino
rename to lib/default/pubsubclient-2.8.13/examples/mqtt_auth/mqtt_auth.ino
diff --git a/lib/default/pubsubclient-2.8.12/examples/mqtt_basic/mqtt_basic.ino b/lib/default/pubsubclient-2.8.13/examples/mqtt_basic/mqtt_basic.ino
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/examples/mqtt_basic/mqtt_basic.ino
rename to lib/default/pubsubclient-2.8.13/examples/mqtt_basic/mqtt_basic.ino
diff --git a/lib/default/pubsubclient-2.8.12/examples/mqtt_esp8266/mqtt_esp8266.ino b/lib/default/pubsubclient-2.8.13/examples/mqtt_esp8266/mqtt_esp8266.ino
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/examples/mqtt_esp8266/mqtt_esp8266.ino
rename to lib/default/pubsubclient-2.8.13/examples/mqtt_esp8266/mqtt_esp8266.ino
diff --git a/lib/default/pubsubclient-2.8.12/examples/mqtt_large_message/mqtt_large_message.ino b/lib/default/pubsubclient-2.8.13/examples/mqtt_large_message/mqtt_large_message.ino
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/examples/mqtt_large_message/mqtt_large_message.ino
rename to lib/default/pubsubclient-2.8.13/examples/mqtt_large_message/mqtt_large_message.ino
diff --git a/lib/default/pubsubclient-2.8.12/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino b/lib/default/pubsubclient-2.8.13/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino
rename to lib/default/pubsubclient-2.8.13/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino
diff --git a/lib/default/pubsubclient-2.8.12/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino b/lib/default/pubsubclient-2.8.13/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino
rename to lib/default/pubsubclient-2.8.13/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino
diff --git a/lib/default/pubsubclient-2.8.12/examples/mqtt_stream/mqtt_stream.ino b/lib/default/pubsubclient-2.8.13/examples/mqtt_stream/mqtt_stream.ino
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/examples/mqtt_stream/mqtt_stream.ino
rename to lib/default/pubsubclient-2.8.13/examples/mqtt_stream/mqtt_stream.ino
diff --git a/lib/default/pubsubclient-2.8.12/keywords.txt b/lib/default/pubsubclient-2.8.13/keywords.txt
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/keywords.txt
rename to lib/default/pubsubclient-2.8.13/keywords.txt
diff --git a/lib/default/pubsubclient-2.8.12/library.json b/lib/default/pubsubclient-2.8.13/library.json
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/library.json
rename to lib/default/pubsubclient-2.8.13/library.json
diff --git a/lib/default/pubsubclient-2.8.12/library.properties b/lib/default/pubsubclient-2.8.13/library.properties
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/library.properties
rename to lib/default/pubsubclient-2.8.13/library.properties
diff --git a/lib/default/pubsubclient-2.8.12/src/PubSubClient.cpp b/lib/default/pubsubclient-2.8.13/src/PubSubClient.cpp
similarity index 98%
rename from lib/default/pubsubclient-2.8.12/src/PubSubClient.cpp
rename to lib/default/pubsubclient-2.8.13/src/PubSubClient.cpp
index acd0fab9b..c51879af0 100644
--- a/lib/default/pubsubclient-2.8.12/src/PubSubClient.cpp
+++ b/lib/default/pubsubclient-2.8.13/src/PubSubClient.cpp
@@ -439,6 +439,17 @@ boolean PubSubClient::loop() {
if (type == MQTTPUBLISH) {
if (callback) {
uint16_t tl = (this->buffer[llen+1]<<8)+this->buffer[llen+2]; /* topic length in bytes */
+
+// Start Tasmota patch
+// Observed heap corruption in some cases since v10.0.0
+// Also see https://github.com/knolleary/pubsubclient/pull/843
+ if (llen+3+tl>this->bufferSize) {
+ _state = MQTT_DISCONNECTED;
+ _client->stop();
+ return false;
+ }
+// End Tasmota patch
+
memmove(this->buffer+llen+2,this->buffer+llen+3,tl); /* move topic inside buffer 1 byte to front */
this->buffer[llen+2+tl] = 0; /* end the topic as a 'C' string with \x00 */
char *topic = (char*) this->buffer+llen+2;
diff --git a/lib/default/pubsubclient-2.8.12/src/PubSubClient.h b/lib/default/pubsubclient-2.8.13/src/PubSubClient.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/src/PubSubClient.h
rename to lib/default/pubsubclient-2.8.13/src/PubSubClient.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/.gitignore b/lib/default/pubsubclient-2.8.13/tests/.gitignore
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/.gitignore
rename to lib/default/pubsubclient-2.8.13/tests/.gitignore
diff --git a/lib/default/pubsubclient-2.8.12/tests/Makefile b/lib/default/pubsubclient-2.8.13/tests/Makefile
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/Makefile
rename to lib/default/pubsubclient-2.8.13/tests/Makefile
diff --git a/lib/default/pubsubclient-2.8.12/tests/README.md b/lib/default/pubsubclient-2.8.13/tests/README.md
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/README.md
rename to lib/default/pubsubclient-2.8.13/tests/README.md
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/connect_spec.cpp b/lib/default/pubsubclient-2.8.13/tests/src/connect_spec.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/connect_spec.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/connect_spec.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/keepalive_spec.cpp b/lib/default/pubsubclient-2.8.13/tests/src/keepalive_spec.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/keepalive_spec.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/keepalive_spec.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/Arduino.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/Arduino.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/Arduino.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/Arduino.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/BDDTest.cpp b/lib/default/pubsubclient-2.8.13/tests/src/lib/BDDTest.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/BDDTest.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/BDDTest.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/BDDTest.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/BDDTest.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/BDDTest.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/BDDTest.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/Buffer.cpp b/lib/default/pubsubclient-2.8.13/tests/src/lib/Buffer.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/Buffer.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/Buffer.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/Buffer.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/Buffer.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/Buffer.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/Buffer.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/Client.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/Client.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/Client.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/Client.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/IPAddress.cpp b/lib/default/pubsubclient-2.8.13/tests/src/lib/IPAddress.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/IPAddress.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/IPAddress.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/IPAddress.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/IPAddress.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/IPAddress.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/IPAddress.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/Print.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/Print.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/Print.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/Print.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/ShimClient.cpp b/lib/default/pubsubclient-2.8.13/tests/src/lib/ShimClient.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/ShimClient.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/ShimClient.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/ShimClient.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/ShimClient.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/ShimClient.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/ShimClient.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/Stream.cpp b/lib/default/pubsubclient-2.8.13/tests/src/lib/Stream.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/Stream.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/Stream.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/Stream.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/Stream.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/Stream.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/Stream.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/lib/trace.h b/lib/default/pubsubclient-2.8.13/tests/src/lib/trace.h
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/lib/trace.h
rename to lib/default/pubsubclient-2.8.13/tests/src/lib/trace.h
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/publish_spec.cpp b/lib/default/pubsubclient-2.8.13/tests/src/publish_spec.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/publish_spec.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/publish_spec.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/receive_spec.cpp b/lib/default/pubsubclient-2.8.13/tests/src/receive_spec.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/receive_spec.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/receive_spec.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/src/subscribe_spec.cpp b/lib/default/pubsubclient-2.8.13/tests/src/subscribe_spec.cpp
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/src/subscribe_spec.cpp
rename to lib/default/pubsubclient-2.8.13/tests/src/subscribe_spec.cpp
diff --git a/lib/default/pubsubclient-2.8.12/tests/testcases/__init__.py b/lib/default/pubsubclient-2.8.13/tests/testcases/__init__.py
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/testcases/__init__.py
rename to lib/default/pubsubclient-2.8.13/tests/testcases/__init__.py
diff --git a/lib/default/pubsubclient-2.8.12/tests/testcases/mqtt_basic.py b/lib/default/pubsubclient-2.8.13/tests/testcases/mqtt_basic.py
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/testcases/mqtt_basic.py
rename to lib/default/pubsubclient-2.8.13/tests/testcases/mqtt_basic.py
diff --git a/lib/default/pubsubclient-2.8.12/tests/testcases/mqtt_publish_in_callback.py b/lib/default/pubsubclient-2.8.13/tests/testcases/mqtt_publish_in_callback.py
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/testcases/mqtt_publish_in_callback.py
rename to lib/default/pubsubclient-2.8.13/tests/testcases/mqtt_publish_in_callback.py
diff --git a/lib/default/pubsubclient-2.8.12/tests/testcases/settings.py b/lib/default/pubsubclient-2.8.13/tests/testcases/settings.py
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/testcases/settings.py
rename to lib/default/pubsubclient-2.8.13/tests/testcases/settings.py
diff --git a/lib/default/pubsubclient-2.8.12/tests/testsuite.py b/lib/default/pubsubclient-2.8.13/tests/testsuite.py
similarity index 100%
rename from lib/default/pubsubclient-2.8.12/tests/testsuite.py
rename to lib/default/pubsubclient-2.8.13/tests/testsuite.py
diff --git a/lib/lib_audio/ESP8266Audio/.github/workflows/pr-or-master-push.yml b/lib/lib_audio/ESP8266Audio/.github/workflows/pr-or-master-push.yml
index 88d6fca71..fcbd0952e 100644
--- a/lib/lib_audio/ESP8266Audio/.github/workflows/pr-or-master-push.yml
+++ b/lib/lib_audio/ESP8266Audio/.github/workflows/pr-or-master-push.yml
@@ -86,3 +86,27 @@ jobs:
valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./wav
valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./midi
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: arduino/arduino-lint-action@v1
+ with:
+ library-manager: 'update'
+
+# Validate orthography
+ code-spell:
+ name: Check spelling
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ - name: Run codespell
+ uses: codespell-project/actions-codespell@master
+ with:
+ skip: ./src/libmad,./src/libhelix-aac,./src/libopus
+ ignore_words_list: ESP8266,esp8266,esp,dout,DOUT,ser,ans,inout,numer,hist
diff --git a/lib/lib_audio/ESP8266Audio/README.md b/lib/lib_audio/ESP8266Audio/README.md
index f243db52a..0b3ab8d5a 100644
--- a/lib/lib_audio/ESP8266Audio/README.md
+++ b/lib/lib_audio/ESP8266Audio/README.md
@@ -31,7 +31,9 @@ JohannesMTC has built a similar project especially for model trains: https://git
A neat MQTT-driven ESP8266 light-and-sound device (alarm? toy? who can say!) was built by @CosmicMac, available at https://github.com/CosmicMac/ESParkle
-A very interesting "linear clock" with a stepper motor, NTP time keeping, and configurable recorded chimes with schematics, 3D printer plans, and source code, is now available http://home.kpn.nl/bderogee1980/projects/linear_clock/linear_clock.html
+A very interesting "linear clock" with a stepper motor, NTP time keeping, and configurable recorded chimes with schematics, 3D printer plans, and source code, is now available https://janderogee.com/projects/linear_clock/linear_clock.htm
+
+Source and instructions for a gorgeous wooden MP3-playing clock, FM radio and a walkie-talkie using the ESP8266 and AVR microcontrollers is available https://github.com/zduka/mp3-player
## Prerequisites
First, make sure you are running the 2.6.3/later or GIT head version of the Arduino libraries for ESP8266, or the latest ESP32 SDK from Espressif.
@@ -100,7 +102,7 @@ AudioFileSourcePROGMEM: Reads a file from a PROGMEM array. Under UNIX you can
AudioFileSourceHTTPStream: Simple implementation of a streaming HTTP reader for ShoutCast-type MP3 streaming. Not yet resilient, and at 44.1khz 128bit stutters due to CPU limitations, but it works more or less.
## AudioFileSourceBuffer - Double buffering, useful for HTTP streams
-AudioFileSourceBuffer is an input source that simpy adds an additional RAM buffer of the output of any other AudioFileSource. This is particularly useful for web streaming where you need to have 1-2 packets in memory to ensure hiccup-free playback.
+AudioFileSourceBuffer is an input source that simply adds an additional RAM buffer of the output of any other AudioFileSource. This is particularly useful for web streaming where you need to have 1-2 packets in memory to ensure hiccup-free playback.
Create your standard input file source, create the buffer with the original source as its input, and pass this buffer object to the generator.
```cpp
@@ -158,7 +160,15 @@ AudioOutputSPIFFSWAV: Writes a binary WAV format with headers to a SPIFFS files
AudioOutputNull: Just dumps samples to /dev/null. Used for speed testing as it doesn't artificially limit the AudioGenerator output speed since there are no buffers to fill/drain.
## I2S DACs
-I've used both the Adafruit [I2S +3W amp DAC](https://www.adafruit.com/product/3006) and a generic PCM5102 based DAC with success. The biggest problems I've seen from users involve pinouts from the ESP8266 for GPIO and hooking up all necessary pins on the DAC board.
+I've used both the Adafruit [I2S +3W amp DAC](https://www.adafruit.com/product/3006) and a generic PCM5102 based DAC with success. The biggest problems I've seen from users involve pinouts from the ESP8266 for GPIO and hooking up all necessary pins on the DAC board. The essential pins are:
+
+I2S pin | Common label* | ESP8266 pin
+--------|---------------|-------------
+LRC | D4 | GPIO2
+BCLK | D8 | GPIO15
+DIN | RX | GPIO3
+
+\* The "common label" column applies to common NodeMCU and D1 Mini development boards. Unfortunately some manufacturers use different mappings so the labels listed here might not apply to your particular model.
### Adafruit I2S DAC
This is quite simple and only needs the GND, VIN, LRC, BCLK< and DIN pins to be wired. Be sure to use +5V on the VIN to get the loudest sound. See the [Adafruit example page](https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp) for more info.
diff --git a/lib/lib_audio/ESP8266Audio/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino b/lib/lib_audio/ESP8266Audio/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino
index 3c127883b..50b0ade33 100644
--- a/lib/lib_audio/ESP8266Audio/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino
+++ b/lib/lib_audio/ESP8266Audio/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino
@@ -8,7 +8,7 @@
// Espressif Audio Development Framework at:
// https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/audio-samples.html
//
-// On ESP8266 you might need to reencode FLAC files with max '-2' compression level
+// On ESP8266 you might need to re-encode FLAC files with max '-2' compression level
// (i.e. 1152 maximum block size) or you will run out of memory. FLAC files will be
// slightly bigger but you don't loose audio quality with reencoding (lossles codec).
diff --git a/lib/lib_audio/ESP8266Audio/examples/PlayMIDIFromSPIFFS/PlayMIDIFromSPIFFS.ino b/lib/lib_audio/ESP8266Audio/examples/PlayMIDIFromSPIFFS/PlayMIDIFromSPIFFS.ino
index dcfa8f983..da9f685c3 100644
--- a/lib/lib_audio/ESP8266Audio/examples/PlayMIDIFromSPIFFS/PlayMIDIFromSPIFFS.ino
+++ b/lib/lib_audio/ESP8266Audio/examples/PlayMIDIFromSPIFFS/PlayMIDIFromSPIFFS.ino
@@ -25,6 +25,7 @@ void setup()
WiFi.mode(WIFI_OFF);
Serial.begin(115200);
+ SPIFFS.begin();
Serial.println("Starting up...\n");
audioLogger = &Serial;
diff --git a/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino b/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino
index fe0cc896d..9af90e0dc 100644
--- a/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino
+++ b/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino
@@ -44,7 +44,7 @@ void setup() {
// param : float (current time [sec] of the song)
// return : float (the amplitude of sound which varies from -1.f to +1.f)
//
- // sound function can be registerd only one or the same number with channels
+ // sound function can be registered only one or the same number with channels
// if the channels > 1 && the number of function == 1,
// same function are used to generate the sound in every channel
//
diff --git a/lib/lib_audio/ESP8266Audio/examples/StreamMP3FromHTTPToSPDIF/StreamMP3FromHTTPToSPDIF.ino b/lib/lib_audio/ESP8266Audio/examples/StreamMP3FromHTTPToSPDIF/StreamMP3FromHTTPToSPDIF.ino
new file mode 100644
index 000000000..ef5429083
--- /dev/null
+++ b/lib/lib_audio/ESP8266Audio/examples/StreamMP3FromHTTPToSPDIF/StreamMP3FromHTTPToSPDIF.ino
@@ -0,0 +1,142 @@
+#include
+
+#ifdef ESP32
+ #include
+#else
+ #include
+#endif
+#include "AudioFileSourceICYStream.h"
+#include "AudioFileSourceBuffer.h"
+#include "AudioGeneratorMP3.h"
+//#include "AudioOutputI2SNoDAC.h"
+#include "AudioOutputSPDIF.h"
+
+//
+// Stream MP3 from HTTP to SPDIF
+//
+
+// To run, set your ESP8266 build to 160MHz, update the SSID info, and upload.
+
+// Note:
+// If using ESP8266 NodeMCU connect LED to RX pin and GND pin
+
+// Enter your WiFi setup here:
+#ifndef STASSID
+#define STASSID "your-ssid"
+#define STAPSK "your-password"
+#endif
+
+const char* ssid = STASSID;
+const char* password = STAPSK;
+
+// Examples URLs
+//const char *URL="http://kvbstreams.dyndns.org:8000/wkvi-am";
+
+// Italian Rock Radio
+const char *URL="http://streamingv2.shoutcast.com/radiofreccia";
+
+// Stream URL of Logitech Media Server, aka LMS, Version: 8.2.0 (August 2021)
+// const char *URL="http://192.168.1.121:9000/stream.mp3";
+
+AudioGeneratorMP3 *mp3;
+AudioFileSourceICYStream *file;
+AudioFileSourceBuffer *buff;
+
+// Output device is SPDIF
+AudioOutputSPDIF *out;
+
+
+// Called when a metadata event occurs (i.e. an ID3 tag, an ICY block, etc.
+void MDCallback(void *cbData, const char *type, bool isUnicode, const char *string)
+{
+ const char *ptr = reinterpret_cast(cbData);
+ (void) isUnicode; // Punt this ball for now
+ // Note that the type and string may be in PROGMEM, so copy them to RAM for printf
+ char s1[32], s2[64];
+ strncpy_P(s1, type, sizeof(s1));
+ s1[sizeof(s1)-1]=0;
+ strncpy_P(s2, string, sizeof(s2));
+ s2[sizeof(s2)-1]=0;
+ Serial.printf("METADATA(%s) '%s' = '%s'\n", ptr, s1, s2);
+ Serial.flush();
+}
+
+// Called when there's a warning or error (like a buffer underflow or decode hiccup)
+void StatusCallback(void *cbData, int code, const char *string)
+{
+ const char *ptr = reinterpret_cast(cbData);
+ // Note that the string may be in PROGMEM, so copy it to RAM for printf
+ char s1[64];
+ strncpy_P(s1, string, sizeof(s1));
+ s1[sizeof(s1)-1]=0;
+ Serial.printf("STATUS(%s) '%d' = '%s'\n", ptr, code, s1);
+ Serial.flush();
+}
+
+
+void setup()
+{
+ Serial.begin(115200);
+ delay(1000);
+ Serial.println("Connecting to WiFi");
+
+ WiFi.disconnect();
+ WiFi.softAPdisconnect(true);
+ WiFi.mode(WIFI_STA);
+
+ WiFi.begin(ssid, password);
+
+ // Try forever
+ while (WiFi.status() != WL_CONNECTED) {
+ Serial.println("...Connecting to WiFi");
+ delay(1000);
+ }
+ Serial.println("Connected");
+
+ audioLogger = &Serial;
+ file = new AudioFileSourceICYStream(URL);
+
+ // Commented out for performance issues with high rate MP3 stream
+ //file->RegisterMetadataCB(MDCallback, (void*)"ICY");
+
+ buff = new AudioFileSourceBuffer(file, 4096); // Doubled form default 2048
+
+ // Commented out for performance issues with high rate MP3 stream
+ //buff->RegisterStatusCB(StatusCallback, (void*)"buffer");
+
+ // Set SPDIF output
+ out = new AudioOutputSPDIF();
+ mp3 = new AudioGeneratorMP3();
+
+ // Commented out for performance issues with high rate MP3 stream
+ //mp3->RegisterStatusCB(StatusCallback, (void*)"mp3");
+
+ mp3->begin(buff, out);
+}
+
+
+void loop()
+{
+ // Commented out
+ //static int lastms = 0;
+
+ if (mp3->isRunning()) {
+ /* Commented out
+ if (millis()-lastms > 1000) {
+ lastms = millis();
+ Serial.printf("Running for %d ms...\n", lastms);
+ Serial.flush();
+ }
+ */
+ if (!mp3->loop()) {
+ mp3->stop();
+ }
+ } else {
+ Serial.printf("MP3 done\n");
+
+ // Restart ESP when streaming is done or errored
+ delay(10000);
+
+ ESP.restart();
+ }
+}
diff --git a/lib/lib_audio/ESP8266Audio/library.json b/lib/lib_audio/ESP8266Audio/library.json
index 139291880..ddbb6d634 100644
--- a/lib/lib_audio/ESP8266Audio/library.json
+++ b/lib/lib_audio/ESP8266Audio/library.json
@@ -14,7 +14,7 @@
"type": "git",
"url": "https://github.com/earlephilhower/ESP8266Audio"
},
- "version": "1.9.2",
+ "version": "1.9.5",
"homepage": "https://github.com/earlephilhower/ESP8266Audio",
"frameworks": "Arduino",
"examples": [
diff --git a/lib/lib_audio/ESP8266Audio/library.properties b/lib/lib_audio/ESP8266Audio/library.properties
index 111915c1c..85a99c0e3 100644
--- a/lib/lib_audio/ESP8266Audio/library.properties
+++ b/lib/lib_audio/ESP8266Audio/library.properties
@@ -1,5 +1,5 @@
name=ESP8266Audio
-version=1.9.2
+version=1.9.5
author=Earle F. Philhower, III
maintainer=Earle F. Philhower, III
sentence=Audio file and I2S sound playing routines for ESP8266, ESP32, and Raspberry Pi Pico RP2040
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.cpp
index 9e86eff21..885defa4e 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.cpp
@@ -1,6 +1,6 @@
/*
AudioFileSourceFunction
- Audio ouptut generator which can generate WAV file data from function
+ Audio output generator which can generate WAV file data from function
Copyright (C) 2021 Hideaki Tai
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.h
index 6c41229ae..94b88d6fb 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.h
+++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.h
@@ -1,6 +1,6 @@
/*
AudioFileSourceFunction
- Audio ouptut generator which can generate WAV file data from function
+ Audio output generator which can generate WAV file data from function
Copyright (C) 2021 Hideaki Tai
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp
index 63c84f328..25e641705 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp
@@ -20,7 +20,9 @@
#if defined(ESP32) || defined(ESP8266)
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+#endif
#include "AudioFileSourceICYStream.h"
#include
@@ -47,6 +49,7 @@ bool AudioFileSourceICYStream::open(const char *url)
http.addHeader("Icy-MetaData", "1");
http.collectHeaders( hdr, 4 );
http.setReuse(true);
+ http.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS);
int code = http.GET();
if (code != HTTP_CODE_OK) {
http.end();
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceLittleFS.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceLittleFS.h
index 27d94bb8b..b57b89fa3 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceLittleFS.h
+++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceLittleFS.h
@@ -21,8 +21,6 @@
#ifndef _AUDIOFILESOURCESPIFFS_H
#define _AUDIOFILESOURCESPIFFS_H
-#ifndef ESP32 // No LittleFS there, yet
-
#include
#include
@@ -39,5 +37,3 @@ class AudioFileSourceLittleFS : public AudioFileSourceFS
#endif
-#endif
-
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp
index 2c9eb3b96..475afa4d0 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp
@@ -105,7 +105,7 @@ uint32_t AudioFileSourceSPIRAMBuffer::read(void *data, uint32_t len)
}
// Read up to the entire buffer from RAM
- uint32_t toReadFromBuffer = std::min(len, writePtr - readPtr);
+ uint32_t toReadFromBuffer = std::min(len, (uint32_t)(writePtr - readPtr));
uint8_t *ptr = reinterpret_cast(data);
if (toReadFromBuffer > 0) {
#ifdef FAKERAM
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMIDI.cpp b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMIDI.cpp
index e3be2b2d0..5f1c5f3a3 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMIDI.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMIDI.cpp
@@ -1,6 +1,6 @@
/*
AudioGeneratorMIDI
- Audio output generator that plays MIDI files using a SF2 SoundFont
+ Audio output generator that plays MIDI files using an SF2 SoundFont
Copyright (C) 2017 Earle F. Philhower, III
@@ -172,7 +172,7 @@ unsigned int AudioGeneratorMIDI::buffer_int32 (int offset) {
unsigned long AudioGeneratorMIDI::get_varlen (int *ptr) {
/* Get a 1-4 byte variable-length value and adjust the pointer past it.
- These are a succession of 7-bit values with a MSB bit of zero marking the end */
+ These are a succession of 7-bit values with an MSB bit of zero marking the end */
unsigned long val;
int i, byte;
@@ -331,7 +331,7 @@ note_off:
}
-// Open file, parse headers, get ready tio process MIDI
+// Open file, parse headers, get ready to process MIDI
void AudioGeneratorMIDI::PrepareMIDI(AudioFileSource *src)
{
MakeStreamFromAFS(src, &afsMIDI);
@@ -364,7 +364,7 @@ void AudioGeneratorMIDI::PrepareMIDI(AudioFileSource *src)
int AudioGeneratorMIDI::PlayMIDI()
{
/* Continue processing all tracks, in an order based on the simulated time.
- This is not unlike multiway merging used for tape sorting algoritms in the 50's! */
+ This is not unlike multiway merging used for tape sorting algorithms in the 50's! */
do { /* while there are still track notes to process */
static struct track_status *trk;
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.cpp b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.cpp
index f42154f85..b47b28396 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.cpp
@@ -124,7 +124,7 @@ bool AudioGeneratorMOD::begin(AudioFileSource *source, AudioOutput *out)
UpdateAmiga();
for (int i = 0; i < CHANNELS; i++) {
- FatBuffer.channels[i] = reinterpret_cast(malloc(fatBufferSize));
+ FatBuffer.channels[i] = reinterpret_cast(calloc(fatBufferSize, 1));
if (!FatBuffer.channels[i]) {
stop();
return false;
@@ -565,7 +565,7 @@ bool AudioGeneratorMOD::ProcessRow()
Mixer.channelFrequency[channel] = Player.amiga / Player.lastAmigaPeriod[channel];
if (note != NONOTE)
- Mixer.channelSampleOffset[channel] = sampleOffset << DIVIDER;
+ Mixer.channelSampleOffset[channel] = sampleOffset << FIXED_DIVIDER;
if (sampleNumber)
Mixer.channelSampleNumber[channel] = Player.lastSampleNumber[channel];
@@ -757,12 +757,12 @@ void AudioGeneratorMOD::GetSample(int16_t sample[2])
if (!Mixer.channelVolume[channel]) continue;
samplePointer = Mixer.sampleBegin[Mixer.channelSampleNumber[channel]] +
- (Mixer.channelSampleOffset[channel] >> DIVIDER);
+ (Mixer.channelSampleOffset[channel] >> FIXED_DIVIDER);
if (Mixer.sampleLoopLength[Mixer.channelSampleNumber[channel]]) {
if (samplePointer >= Mixer.sampleLoopEnd[Mixer.channelSampleNumber[channel]]) {
- Mixer.channelSampleOffset[channel] -= Mixer.sampleLoopLength[Mixer.channelSampleNumber[channel]] << DIVIDER;
+ Mixer.channelSampleOffset[channel] -= Mixer.sampleLoopLength[Mixer.channelSampleNumber[channel]] << FIXED_DIVIDER;
samplePointer -= Mixer.sampleLoopLength[Mixer.channelSampleNumber[channel]];
}
@@ -801,7 +801,7 @@ void AudioGeneratorMOD::GetSample(int16_t sample[2])
out = current;
// Integer linear interpolation
- out += (next - current) * (Mixer.channelSampleOffset[channel] & ((1 << DIVIDER) - 1)) >> DIVIDER;
+ out += (next - current) * (Mixer.channelSampleOffset[channel] & ((1 << FIXED_DIVIDER) - 1)) >> FIXED_DIVIDER;
// Upscale to BITDEPTH
out <<= BITDEPTH - 8;
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.h b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.h
index 87fac18e9..060037750 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.h
+++ b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMOD.h
@@ -56,14 +56,14 @@ class AudioGeneratorMOD : public AudioGenerator
enum {BITDEPTH = 15};
int sampleRate;
int fatBufferSize; //(6*1024) // File system buffers per-CHANNEL (i.e. total mem required is 4 * FATBUFFERSIZE)
- enum {DIVIDER = 10}; // Fixed-point mantissa used for integer arithmetic
+ enum {FIXED_DIVIDER = 10}; // Fixed-point mantissa used for integer arithmetic
int stereoSeparation; //STEREOSEPARATION = 32; // 0 (max) to 64 (mono)
bool usePAL;
// Hz = 7093789 / (amigaPeriod * 2) for PAL
// Hz = 7159091 / (amigaPeriod * 2) for NTSC
int AMIGA;
- void UpdateAmiga() { AMIGA = ((usePAL?7159091:7093789) / 2 / sampleRate << DIVIDER); }
+ void UpdateAmiga() { AMIGA = ((usePAL?7159091:7093789) / 2 / sampleRate << FIXED_DIVIDER); }
enum {ROWS = 64, SAMPLES = 31, CHANNELS = 4, NONOTE = 0xFFFF, NONOTE8 = 0xff };
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp
index 5e524894d..0eb3c0da7 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp
@@ -1,7 +1,7 @@
/*
AudioOutputI2S
Base class for I2S interface port
-
+
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
@@ -21,12 +21,10 @@
#include
#ifdef ESP32
#include "driver/i2s.h"
-#elif defined(ARDUINO_ARCH_RP2040) || defined(ESP8266)
- #ifdef ARDUINO_ESP8266_MAJOR //this define was added in ESP8266 Arduino Core version v3.0.1
- #include "core_esp8266_i2s.h" //for Arduino core >= 3.0.1
- #else
- #include "i2s.h" //for Arduino core <= 3.0.0
- #endif
+#elif defined(ARDUINO_ARCH_RP2040) || ARDUINO_ESP8266_MAJOR >= 3
+ #include
+#elif ARDUINO_ESP8266_MAJOR < 3
+ #include
#endif
#include "AudioOutputI2S.h"
@@ -44,6 +42,7 @@ AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int
//set defaults
mono = false;
+ lsb_justified = false;
bps = 16;
channels = 2;
hertz = 44100;
@@ -150,6 +149,12 @@ bool AudioOutputI2S::SetOutputModeMono(bool mono)
return true;
}
+bool AudioOutputI2S::SetLsbJustified(bool lsbJustified)
+{
+ this->lsb_justified = lsbJustified;
+ return true;
+}
+
bool AudioOutputI2S::begin(bool txDAC)
{
#ifdef ESP32
@@ -170,17 +175,41 @@ bool AudioOutputI2S::begin(bool txDAC)
i2s_mode_t mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX);
if (output_mode == INTERNAL_DAC)
{
+#if CONFIG_IDF_TARGET_ESP32
mode = (i2s_mode_t)(mode | I2S_MODE_DAC_BUILT_IN);
+#else
+ return false;
+#endif
}
else if (output_mode == INTERNAL_PDM)
{
+#if CONFIG_IDF_TARGET_ESP32
mode = (i2s_mode_t)(mode | I2S_MODE_PDM);
+#else
+ return false;
+#endif
}
- i2s_comm_format_t comm_fmt = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB);
+ i2s_comm_format_t comm_fmt;
if (output_mode == INTERNAL_DAC)
{
- comm_fmt = (i2s_comm_format_t)I2S_COMM_FORMAT_I2S_MSB;
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
+ comm_fmt = (i2s_comm_format_t) I2S_COMM_FORMAT_STAND_MSB;
+#else
+ comm_fmt = (i2s_comm_format_t) I2S_COMM_FORMAT_I2S_MSB;
+#endif
+ }
+ else if (lsb_justified)
+ {
+ comm_fmt = (i2s_comm_format_t) (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_LSB);
+ }
+ else
+ {
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
+ comm_fmt = (i2s_comm_format_t) (I2S_COMM_FORMAT_STAND_I2S);
+#else
+ comm_fmt = (i2s_comm_format_t) (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB);
+#endif
}
i2s_config_t i2s_config_dac = {
@@ -191,7 +220,7 @@ bool AudioOutputI2S::begin(bool txDAC)
.communication_format = comm_fmt,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // lowest interrupt priority
.dma_buf_count = dma_buf_count,
- .dma_buf_len = 64,
+ .dma_buf_len = 128,
.use_apll = use_apll // Use audio PLL
};
audioLogger->printf("+%d %p\n", portNo, &i2s_config_dac);
@@ -201,8 +230,12 @@ bool AudioOutputI2S::begin(bool txDAC)
}
if (output_mode == INTERNAL_DAC || output_mode == INTERNAL_PDM)
{
+#if CONFIG_IDF_TARGET_ESP32
i2s_set_pin((i2s_port_t)portNo, NULL);
i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
+#else
+ return false;
+#endif
}
else
{
@@ -273,11 +306,12 @@ bool AudioOutputI2S::ConsumeSample(int16_t sample[2])
{
s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
}
-// Deprecated. Use i2s_write
+//"i2s_write_bytes" has been removed in the ESP32 Arduino 2.0.0, use "i2s_write" instead.
// return i2s_write_bytes((i2s_port_t)portNo, (const char *)&s32, sizeof(uint32_t), 0);
- size_t bytes_written;
- i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0);
- return bytes_written;
+
+ size_t i2s_bytes_written;
+ i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &i2s_bytes_written, 0);
+ return i2s_bytes_written;
#elif defined(ESP8266)
uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true
@@ -290,7 +324,7 @@ void AudioOutputI2S::flush()
{
#ifdef ESP32
// makes sure that all stored DMA samples are consumed / played
- int buffersize = 64 * this->dma_buf_count;
+ int buffersize = 128 * this->dma_buf_count;
int16_t samples[2] = {0x0, 0x0};
for (int i = 0; i < buffersize; i++)
{
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h
index 90370dc27..b3f621d28 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h
+++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h
@@ -44,6 +44,7 @@ class AudioOutputI2S : public AudioOutput
bool begin(bool txDAC);
bool SetOutputModeMono(bool mono); // Force mono output no matter the input
+ bool SetLsbJustified(bool lsbJustified); // Allow supporting non-I2S chips, e.g. PT8211
protected:
bool SetPinout();
@@ -51,6 +52,7 @@ class AudioOutputI2S : public AudioOutput
uint8_t portNo;
int output_mode;
bool mono;
+ int lsb_justified;
bool i2sOn;
int dma_buf_count;
int use_apll;
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp
index 116d9ac74..976d73c77 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp
@@ -1,7 +1,7 @@
/*
AudioOutputI2SNoDAC
Audio player using SW delta-sigma to generate "analog" on I2S data
-
+
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
@@ -21,12 +21,10 @@
#include
#ifdef ESP32
#include "driver/i2s.h"
-#elif defined(ARDUINO_ARCH_RP2040) || defined(ESP8266)
- #ifdef ARDUINO_ESP8266_MAJOR //this define was added in ESP8266 Arduino Core version v3.0.1
- #include "core_esp8266_i2s.h" //for Arduino core >= 3.0.1
- #else
- #include "i2s.h" //for Arduino core <= 3.0.0
- #endif
+#elif defined(ARDUINO_ARCH_RP2040) || ARDUINO_ESP8266_MAJOR >= 3
+ #include
+#elif ARDUINO_ESP8266_MAJOR < 3
+ #include
#endif
#include "AudioOutputI2SNoDAC.h"
@@ -70,7 +68,7 @@ void AudioOutputI2SNoDAC::DeltaSigma(int16_t sample[2], uint32_t dsBuff[8])
for (int j = 0; j < oversample32; j++) {
uint32_t bits = 0; // The bits we convert the sample into, MSB to go on the wire first
-
+
for (int i = 32; i > 0; i--) {
bits = bits << 1;
if (cumErr < 0) {
@@ -99,12 +97,14 @@ bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2])
// Either send complete pulse stream or nothing
#ifdef ESP32
-// Deprecated. Use i2s_write
+//"i2s_write_bytes" has been removed in the ESP32 Arduino 2.0.0, use "i2s_write" instead.
// if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0))
- size_t bytes_written;
- i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0);
- if (!bytes_written)
+
+ size_t i2s_bytes_written;
+ i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &i2s_bytes_written, 0);
+ if (!i2s_bytes_written){
return false;
+ }
#elif defined(ESP8266)
if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn
// At this point we've sent in first of possibly 8 32-bits, need to send
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp
index 53483d4ac..6e1cf1978 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp
@@ -3,7 +3,7 @@
S/PDIF output via I2S
- Needs transciever from CMOS level to either optical or coaxial interface
+ Needs transceiver from CMOS level to either optical or coaxial interface
See: https://www.epanorama.net/documents/audio/spdif.html
Original idea and sources:
@@ -94,7 +94,11 @@ AudioOutputSPDIF::AudioOutputSPDIF(int dout_pin, int port, int dma_buf_count)
.sample_rate = 88200, // 2 x sampling_rate
.bits_per_sample = I2S_BITS_PER_SAMPLE_32BIT, // 32bit words
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, // Right than left
- .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
+ .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_STAND_I2S),
+#else
+ .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
+#endif
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // lowest interrupt priority
.dma_buf_count = dma_buf_count,
.dma_buf_len = DMA_BUF_SIZE_DEFAULT, // bigger buffers, reduces interrupts
@@ -265,7 +269,7 @@ bool AudioOutputSPDIF::ConsumeSample(int16_t sample[2])
#if defined(ESP32)
// Assume DMA buffers are multiples of 16 bytes. Either we write all bytes or none.
- uint32_t bytes_written;
+ size_t bytes_written;
esp_err_t ret = i2s_write((i2s_port_t)portNo, (const char*)&buf, 8 * channels, &bytes_written, 0);
// If we didn't write all bytes, return false early and do not increment frame_num
if ((ret != ESP_OK) || (bytes_written != (8 * channels))) return false;
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h
index 5da160b3d..7cb194dbc 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h
+++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h
@@ -3,7 +3,7 @@
S/PDIF output via I2S
- Needs transciever from CMOS level to either optical or coaxial interface
+ Needs transceiver from CMOS level to either optical or coaxial interface
See: https://www.epanorama.net/documents/audio/spdif.html
Original idea and sources:
diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputSTDIO.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputSTDIO.cpp
index 33bbd34f8..f9032bb12 100644
--- a/lib/lib_audio/ESP8266Audio/src/AudioOutputSTDIO.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputSTDIO.cpp
@@ -54,6 +54,11 @@ bool AudioOutputSTDIO::begin()
bool AudioOutputSTDIO::ConsumeSample(int16_t sample[2])
{
+ static int avail = 100;
+ if (!(--avail)) {
+ avail = 100;
+ return false;
+ }
for (int i=0; i.
*/
-#ifdef ESP32
+#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#include "AudioOutputULP.h"
#include
diff --git a/lib/lib_audio/ESP8266Audio/src/driver/SinglePinI2SDriver.cpp b/lib/lib_audio/ESP8266Audio/src/driver/SinglePinI2SDriver.cpp
index 3d08efaf0..c2d2280c0 100644
--- a/lib/lib_audio/ESP8266Audio/src/driver/SinglePinI2SDriver.cpp
+++ b/lib/lib_audio/ESP8266Audio/src/driver/SinglePinI2SDriver.cpp
@@ -3,7 +3,7 @@
ESP8266Audio I2S Minimal driver
Most of this code is taken and reworked from ESP8266 Arduino core,
- which itsef is reworked from Espessif's I2S examples.
+ which itself is reworked from Espessif's I2S examples.
Original code is licensed under LGPL 2.1 or above
Reasons for rewrite:
@@ -196,7 +196,7 @@ void SinglePinI2SDriver::setDividers(uint8_t div1, uint8_t div2)
// Ensure dividers fit in bit fields
div1 &= I2SBDM;
div2 &= I2SCDM;
- // trans master(active low), recv master(active_low), !bits mod(==16 bits/chanel), clear clock dividers
+ // trans master(active low), recv master(active_low), !bits mod(==16 bits/channel), clear clock dividers
I2SC &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
// I2SRF = Send/recv right channel first
// I2SMR = MSB recv/xmit first
@@ -249,7 +249,7 @@ void SinglePinI2SDriver::startI2S()
I2SFC |= I2SDE; // Enable DMA
// I2STXCMM, I2SRXCMM=0 => Dual channel mode, RX/TX CHAN_MOD=0
I2SCC &= ~((I2STXCMM << I2STXCM) | (I2SRXCMM << I2SRXCM));
- // Set dividers to something resonable
+ // Set dividers to something reasonable
currentRate = 0;
setRate(44100);
// Start I2S peripheral
@@ -280,4 +280,4 @@ int SinglePinI2SDriver::getUnderflowCount()
// Global instance
SinglePinI2SDriver I2SDriver;
-#endif // defined(ESP8266)
\ No newline at end of file
+#endif // defined(ESP8266)
diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/config.h b/lib/lib_audio/ESP8266Audio/src/libflac/config.h
index cf6c07dfe..b0aebe44d 100644
--- a/lib/lib_audio/ESP8266Audio/src/libflac/config.h
+++ b/lib/lib_audio/ESP8266Audio/src/libflac/config.h
@@ -3,7 +3,9 @@
#ifdef DEBUG
#undef NDEBUG
#else
- #define NDEBUG
+ #ifndef NDEBUG
+ #define NDEBUG
+ #endif
#endif
/* config.h. Generated from config.h.in by configure. */
diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c b/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c
index ec172fe8d..20ae399f5 100644
--- a/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c
+++ b/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c
@@ -2199,14 +2199,14 @@ FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder)
* Three kinds of things can go wrong when reading the frame header:
* 1) We may have sync'ed incorrectly and not landed on a frame header.
* If we don't find a sync code, it can end up looking like we read
- * a valid but unparseable header, until getting to the frame header
+ * a valid but unparsable header, until getting to the frame header
* CRC. Even then we could get a false positive on the CRC.
- * 2) We may have sync'ed correctly but on an unparseable frame (from a
+ * 2) We may have sync'ed correctly but on an unparsable frame (from a
* future encoder).
- * 3) We may be on a damaged frame which appears valid but unparseable.
+ * 3) We may be on a damaged frame which appears valid but unparsable.
*
* For all these reasons, we try and read a complete frame header as
- * long as it seems valid, even if unparseable, up until the frame
+ * long as it seems valid, even if unparsable, up until the frame
* header CRC.
*/
@@ -2839,7 +2839,7 @@ FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data)
* FLAC__STREAM_DECODER_UNPARSEABLE_STREAM and increment its
* unparseable_frame_count. But there is a remote possibility
* that it is properly synced at such a "future-codec frame",
- * so to make sure, we wait to see many "unparseable" errors in
+ * so to make sure, we wait to see many "unparsable" errors in
* a row before bailing out.
*/
if(decoder->private_->is_seeking && decoder->private_->unparseable_frame_count > 20) {
@@ -3146,7 +3146,7 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s
return false;
}
/* Now we need to get a frame. First we need to reset our
- * unparseable_frame_count; if we get too many unparseable
+ * unparseable_frame_count; if we get too many unparsable
* frames in a row, the read callback will return
* FLAC__STREAM_DECODER_READ_STATUS_ABORT, causing
* FLAC__stream_decoder_process_single() to return false.
diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h
index 595a8fc97..0c17f0c44 100644
--- a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h
+++ b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h
@@ -558,7 +558,7 @@ static __inline int CLZ(int x)
typedef union _U64 {
Word64 w64;
struct {
-#ifdef __XTENSA__
+#if defined(__XTENSA__) || defined (__riscv)
unsigned int lo32;
signed int hi32;
#else
diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/RPSL.txt b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/RPSL.txt
index d040a4520..94b44586d 100644
--- a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/RPSL.txt
+++ b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/RPSL.txt
@@ -201,7 +201,7 @@ and 3, above.
4.2 Compatible Source Licenses. Software modules that have been independently
developed without any use of Covered Code and which contain no portion of the
Covered Code, Modifications or other Derivative Works, but are used or combined
-in any way wtih the Covered Code or any Derivative Work to form a larger
+in any way with the Covered Code or any Derivative Work to form a larger
Derivative Work, are exempt from the conditions described in Section 4.1 but
only to the extent that: the software module, including any software that is
linked to, integrated with, or part of the same applications as, the software
diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h
index b9e46c529..5ad0f30b8 100644
--- a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h
+++ b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h
@@ -40,7 +40,7 @@
*
* assembly.h - assembly language functions and prototypes for supported platforms
*
- * - inline rountines with access to 64-bit multiply results
+ * - inline routines with access to 64-bit multiply results
* - x86 (_WIN32) and ARM (ARM_ADS, _WIN32_WCE) versions included
* - some inline functions are mix of asm and C for speed
* - some functions are in native asm files, so only the prototype is given here
@@ -241,7 +241,7 @@ static __inline int MULSHIFT32(int x, int y)
static __inline int FASTABS(int x)
{
- int t=0; /*Really is not necessary to initialiaze only to avoid warning*/
+ int t=0; /*Really is not necessary to initialize only to avoid warning*/
__asm {
eor t, x, x, asr #31
diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/scalfact.c b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/scalfact.c
index 4937e4530..d274b3615 100644
--- a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/scalfact.c
+++ b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/scalfact.c
@@ -74,7 +74,7 @@ static const char SFLenTab[16][2] = {
* Return: none
*
* Notes: set order of short blocks to s[band][window] instead of s[window][band]
- * so that we index through consectutive memory locations when unpacking
+ * so that we index through consecutive memory locations when unpacking
* (make sure dequantizer follows same convention)
* Illegal Intensity Position = 7 (always) for MPEG1 scale factors
**************************************************************************************/
diff --git a/lib/lib_audio/ESP8266Audio/src/libogg/README.md b/lib/lib_audio/ESP8266Audio/src/libogg/README.md
index 63545e288..c3be01460 100644
--- a/lib/lib_audio/ESP8266Audio/src/libogg/README.md
+++ b/lib/lib_audio/ESP8266Audio/src/libogg/README.md
@@ -7,7 +7,7 @@
Ogg project codecs use the Ogg bitstream format to arrange the raw,
compressed bitstream into a more robust, useful form. For example,
the Ogg bitstream makes seeking, time stamping and error recovery
-possible, as well as mixing several sepearate, concurrent media
+possible, as well as mixing several separate, concurrent media
streams into a single physical bitstream.
## What's here ##
@@ -18,7 +18,7 @@ use with Ogg bitstreams.
Directory:
-- `src` The source for libogg, a BSD-license inplementation of the public domain Ogg bitstream format
+- `src` The source for libogg, a BSD-license implementation of the public domain Ogg bitstream format
- `include` Library API headers
diff --git a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/README.ESP8266 b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/README.ESP8266
index e88104dfc..1009f36f6 100644
--- a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/README.ESP8266
+++ b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/README.ESP8266
@@ -28,7 +28,7 @@ Even with the caching, it was found that SPIFFS, while having great
functionality, was horrbly slow. So I wrote a new "faster" ROM filesystem
called, surprisingly, FastROMFilesystem.
https://github.com/earlephilhower/ESP8266FastROMFS
-If you are getting choppy playback, try this new filesytem or using a SD
+If you are getting choppy playback, try this new filesystem or using a SD
card (not tested by myself, but it'd be hard top be slower than SPIFFS).
Simply going from SPIFFS to FastROMFilesystem took my testing of
FURELISE.MID and 1MGM.SF2 from 0.5x realtime to 2.5x (i.e. from unusable
diff --git a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h
index e786d1662..45d7b97a5 100644
--- a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h
+++ b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h
@@ -104,7 +104,7 @@ TSFDEF tsf* tsf_load(struct tsf_stream* stream);
// Free the memory related to this tsf instance
TSFDEF void tsf_close(tsf* f);
-// Stop all playing notes immediatly and reset all channel parameters
+// Stop all playing notes immediately and reset all channel parameters
TSFDEF void tsf_reset(tsf* f);
// Returns the preset index from a bank and preset number, or -1 if it does not exist in the loaded SoundFont
@@ -202,7 +202,7 @@ TSFDEF void tsf_channel_set_tuning(tsf* f, int channel, float tuning);
TSFDEF void tsf_channel_note_on(tsf* f, int channel, int key, float vel);
TSFDEF void tsf_channel_note_off(tsf* f, int channel, int key);
TSFDEF void tsf_channel_note_off_all(tsf* f, int channel); //end with sustain and release
-TSFDEF void tsf_channel_sounds_off_all(tsf* f, int channel); //end immediatly
+TSFDEF void tsf_channel_sounds_off_all(tsf* f, int channel); //end immediately
// Apply a MIDI control change to the channel (not all controllers are supported!)
TSFDEF void tsf_channel_midi_control(tsf* f, int channel, int controller, int control_value);
diff --git a/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.h b/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.h
index 7a6457240..11cc07a16 100644
--- a/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.h
+++ b/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.h
@@ -729,7 +729,7 @@ struct OpusServerInfo{
/**The software used by the origin server (Server).
This is NULL
if there was no Server
header.*/
char *server;
- /**The media type of the entity sent to the recepient (Content-Type).
+ /**The media type of the entity sent to the recipient (Content-Type).
This is NULL
if there was no Content-Type
header.*/
char *content_type;
@@ -1436,7 +1436,7 @@ void op_free(OggOpusFile *_of);
Some of these functions may be used successfully on the partially open
streams returned by op_test_callbacks() or one of the associated
convenience functions.
- Their documention will indicate so explicitly.*/
+ Their documentation will indicate so explicitly.*/
/*@{*/
/**Returns whether or not the stream being read is seekable.
diff --git a/lib/lib_audio/ESP8266Audio/tests/common.sh b/lib/lib_audio/ESP8266Audio/tests/common.sh
index cabad512f..25c05cd66 100755
--- a/lib/lib_audio/ESP8266Audio/tests/common.sh
+++ b/lib/lib_audio/ESP8266Audio/tests/common.sh
@@ -58,7 +58,7 @@ function build_sketches()
local sketchdirname=$(basename $sketchdir)
local sketchname=$(basename $sketch)
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
- echo "Skipping $sketch, beacause it is not the main sketch file";
+ echo "Skipping $sketch, because it is not the main sketch file";
continue
fi;
if [[ -f "$sketchdir/.test.skip" ]]; then
diff --git a/lib/lib_audio/ESP8266Audio/tests/host/Makefile b/lib/lib_audio/ESP8266Audio/tests/host/Makefile
index 25156dbcd..15eee60e6 100644
--- a/lib/lib_audio/ESP8266Audio/tests/host/Makefile
+++ b/lib/lib_audio/ESP8266Audio/tests/host/Makefile
@@ -83,7 +83,7 @@ CPPOPTS=-g -Wunused-parameter -Wall -std=c++11 -m32 -Wstack-usage=300 -include A
.phony: all
-all: mp3 aac wav midi opus flac
+all: mp3 aac wav midi opus flac mod
mp3: FORCE
rm -f *.o
@@ -106,6 +106,12 @@ flac: FORCE
rm -f *.o
echo valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all ./flac
+mod: FORCE
+ rm -f *.o
+ g++ $(CPPOPTS) -o mod mod.cpp Serial.cpp ../../src/AudioFileSourcePROGMEM.cpp ../../src/AudioOutputSTDIO.cpp ../../src/AudioGeneratorMOD.cpp ../../src/AudioLogger.cpp -I ../../src/ -I.
+ rm -f *.o
+ echo valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all ./mod
+
wav: FORCE
rm -f *.o
g++ $(CPPOPTS) -o wav wav.cpp Serial.cpp ../../src/AudioFileSourceSTDIO.cpp ../../src/AudioOutputSTDIO.cpp ../../src/AudioGeneratorWAV.cpp ../../src/AudioLogger.cpp -I ../../src/ -I.
@@ -128,6 +134,6 @@ opus: FORCE
echo valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all ./opus
clean:
- rm -f mp3 aac wav midi opus flac *.o
+ rm -f mp3 aac wav midi opus flac mod *.o
FORCE:
diff --git a/lib/lib_audio/ESP8266Audio/tests/host/mod.cpp b/lib/lib_audio/ESP8266Audio/tests/host/mod.cpp
new file mode 100644
index 000000000..18da2ce35
--- /dev/null
+++ b/lib/lib_audio/ESP8266Audio/tests/host/mod.cpp
@@ -0,0 +1,26 @@
+#include
+#include "AudioFileSourcePROGMEM.h"
+#include "AudioOutputSTDIO.h"
+#include "AudioGeneratorMOD.h"
+
+#include "../../examples/PlayMODFromPROGMEMToDAC/enigma.h"
+
+int main(int argc, char **argv)
+{
+ (void) argc;
+ (void) argv;
+
+ AudioFileSourcePROGMEM *file = new AudioFileSourcePROGMEM(enigma_mod, sizeof(enigma_mod));
+ AudioOutputSTDIO *out = new AudioOutputSTDIO();
+ out->SetFilename("mod.wav");
+ AudioGeneratorMOD *mod = new AudioGeneratorMOD();
+
+ mod->begin(file, out);
+ // The MOD plays forever, so only run for ~30 seconds worth
+ for (int i=0; i<10000; i++) mod->loop();
+ mod->stop();
+
+ delete out;
+ delete mod;
+ delete file;
+}
diff --git a/lib/lib_audio/ESP8266AudioAttention.md b/lib/lib_audio/ESP8266AudioAttention.md
deleted file mode 100644
index 7077d8211..000000000
--- a/lib/lib_audio/ESP8266AudioAttention.md
+++ /dev/null
@@ -1,82 +0,0 @@
-The current library needs two fixes solving the deprecated ``i2s_write_bytes`` function.
-
-In file AudioOutputI2S.cpp:
-
-bool AudioOutputI2S::ConsumeSample(int16_t sample[2])
-{
-
- //return if we haven't called ::begin yet
- if (!i2sOn)
- return false;
-
- int16_t ms[2];
-
- ms[0] = sample[0];
- ms[1] = sample[1];
- MakeSampleStereo16( ms );
-
- if (this->mono) {
- // Average the two samples and overwrite
- int32_t ttl = ms[LEFTCHANNEL] + ms[RIGHTCHANNEL];
- ms[LEFTCHANNEL] = ms[RIGHTCHANNEL] = (ttl>>1) & 0xffff;
- }
- #ifdef ESP32
- uint32_t s32;
- if (output_mode == INTERNAL_DAC)
- {
- int16_t l = Amplify(ms[LEFTCHANNEL]) + 0x8000;
- int16_t r = Amplify(ms[RIGHTCHANNEL]) + 0x8000;
- s32 = (r << 16) | (l & 0xffff);
- }
- else
- {
- s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
- }
-// Deprecated. Use i2s_write
-// return i2s_write_bytes((i2s_port_t)portNo, (const char *)&s32, sizeof(uint32_t), 0);
- size_t bytes_written;
- i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0);
- return bytes_written;
- #elif defined(ESP8266)
- uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
- return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true
- #elif defined(ARDUINO_ARCH_RP2040)
- return !!I2S.write((void*)ms, 4);
- #endif
-}
-
-In file AudioOutputI2SNoDac.cpp:
-
-bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2])
-{
- int16_t ms[2];
- ms[0] = sample[0];
- ms[1] = sample[1];
- MakeSampleStereo16( ms );
-
- // Make delta-sigma filled buffer
- uint32_t dsBuff[8];
- DeltaSigma(ms, dsBuff);
-
- // Either send complete pulse stream or nothing
-#ifdef ESP32
-// Deprecated. Use i2s_write
-// if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0))
- size_t bytes_written;
- i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0);
- if (!bytes_written)
- return false;
-#elif defined(ESP8266)
- if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn
- // At this point we've sent in first of possibly 8 32-bits, need to send
- // remaining ones even if they block.
- for (int i = 32; i < oversample; i+=32)
- i2s_write_sample( dsBuff[i / 32]);
-#elif defined(ARDUINO_ARCH_RP2040)
- int16_t *p = (int16_t *) dsBuff;
- for (int i = 0; i < oversample / 16; i++) {
- I2S.write(*(p++));
- }
-#endif
- return true;
-}
diff --git a/lib/lib_audio/ESP8266SAM/README.md b/lib/lib_audio/ESP8266SAM/README.md
index 6fb215564..694086db2 100644
--- a/lib/lib_audio/ESP8266SAM/README.md
+++ b/lib/lib_audio/ESP8266SAM/README.md
@@ -23,6 +23,10 @@ Output is fixed at 22050Hz due to some hardcoded delays to help match C64 intern
The voice is formant generated and can be modified by setting things such as speed, pitch, mouth and throat configuration, and even sending in phonetic codes instead of English text. See @s-macke's repository for more information.
+## Cool uses of SAM
+Jan Derogee has used ESP8266SAM to build a complete VIC-20 compatible speech synthesis cartridge that works with BASIC applications. It also has a great background on early speech synthesis and a neat construction and demo video. Check it out at https://janderogee.com/projects/SerialSpeechSynthesisSAM/SerialSpeechSynthesisSAM.htm
+
+
## License
While the ESP8266 wrapper is my own, the SAM software is a reverse-engineered version of a software published more than 34 years ago by "Don't ask Software".
diff --git a/lib/lib_audio/ESP8266SAM/examples/SpeakNoDac/SpeakNoDac.ino b/lib/lib_audio/ESP8266SAM/examples/SpeakNoDac/SpeakNoDac.ino
new file mode 100644
index 000000000..6951fe855
--- /dev/null
+++ b/lib/lib_audio/ESP8266SAM/examples/SpeakNoDac/SpeakNoDac.ino
@@ -0,0 +1,20 @@
+#include
+#include
+#include "AudioOutputI2SNoDAC.h"
+
+AudioOutputI2SNoDAC *out = NULL;
+
+void setup()
+{
+ out = new AudioOutputI2SNoDAC();
+ out->begin();
+}
+
+void loop()
+{
+ ESP8266SAM *sam = new ESP8266SAM;
+ sam->Say(out, "Can you hear me now?");
+ delay(500);
+ sam->Say(out, "I can't hear you!");
+ delete sam;
+}
diff --git a/lib/lib_audio/ESP8266SAM/examples/remoteSAM/remoteSAM.ino b/lib/lib_audio/ESP8266SAM/examples/remoteSAM/remoteSAM.ino
new file mode 100644
index 000000000..d6a82991e
--- /dev/null
+++ b/lib/lib_audio/ESP8266SAM/examples/remoteSAM/remoteSAM.ino
@@ -0,0 +1,129 @@
+// In a webbrowser go to http://sam.local/say/{message} to make it speak
+// ex: http://sam.local/say/hello world
+
+#include
+
+#if !defined(ESP8266)
+#error This example is only for the ESP8266
+#endif
+
+#include
+#include "AudioOutputI2SNoDAC.h"
+
+#include
+#include
+#include //Library for SSDP (Show ESP in Network on Windows)
+#include //Library for WebServer
+#include
+#include
+
+AudioOutputI2SNoDAC *out = NULL;
+
+ESP8266WebServer server(80); //Web Server on port 80
+WiFiManager wifiManager;
+const char* NAME = "SAM";
+
+void setup()
+{
+ Serial.begin(115200);
+ out = new AudioOutputI2SNoDAC();
+ out->begin();
+
+ wifiManager.autoConnect(NAME);
+
+ MDNS.begin(NAME);
+ MDNS.addService("http", "tcp", 80);
+ NBNS.begin(NAME);
+
+ server.on(UriBraces("/say/{}"), []() {
+ String message_encoded = server.pathArg(0);
+ String message_decoded = urldecode(message_encoded);
+ const char* message = message_decoded.c_str();
+
+ Serial.println(message_encoded);
+ Serial.println(message_decoded);
+ Serial.println(message);
+
+ ESP8266SAM *sam = new ESP8266SAM;
+ sam->Say(out, message);
+ delete sam;
+ server.send(200, "text/plain", "OK");
+ });
+
+ server.on("/description.xml", HTTP_GET, []() {
+ SSDP.schema(server.client());
+ });
+ server.begin();
+ ssdp();
+}
+
+void ssdp() {
+ //Simple Service Discovery Protocol : Display ESP in Windows Network Tab
+ SSDP.setSchemaURL("description.xml");
+ SSDP.setHTTPPort(80);
+ SSDP.setName(NAME);
+ SSDP.setDeviceType("upnp: rootdevice");
+ SSDP.setSerialNumber("000000000001");
+ SSDP.setURL("/say/connected");
+ SSDP.setModelName("ESP8266SAM");
+ SSDP.setModelNumber("0000000000001");
+ SSDP.setModelURL("https://github.com/earlephilhower/ESP8266SAM");
+ SSDP.setManufacturer("earlephilhower");
+ SSDP.setManufacturerURL("https://github.com/earlephilhower/");
+ SSDP.begin();
+}
+
+void loop() {
+ server.handleClient();
+}
+
+char* string2char(String command) {
+ if (command.length() != 0) {
+ char *p = const_cast(command.c_str());
+ return p;
+ } else {
+ return "";
+ }
+}
+
+unsigned char h2int(char c) {
+ if (c >= '0' && c <= '9') {
+ return ((unsigned char)c - '0');
+ }
+ if (c >= 'a' && c <= 'f') {
+ return ((unsigned char)c - 'a' + 10);
+ }
+ if (c >= 'A' && c <= 'F') {
+ return ((unsigned char)c - 'A' + 10);
+ }
+ return (0);
+}
+
+String urldecode(String str)
+{
+
+ String encodedString = "";
+ char c;
+ char code0;
+ char code1;
+ for (int i = 0; i < str.length(); i++) {
+ c = str.charAt(i);
+ if (c == '+') {
+ encodedString += ' ';
+ } else if (c == '%') {
+ i++;
+ code0 = str.charAt(i);
+ i++;
+ code1 = str.charAt(i);
+ c = (h2int(code0) << 4) | h2int(code1);
+ encodedString += c;
+ } else {
+
+ encodedString += c;
+ }
+
+ yield();
+ }
+
+ return encodedString;
+}
diff --git a/lib/lib_audio/ESP8266SAM/library.json b/lib/lib_audio/ESP8266SAM/library.json
index af66aee97..d03ac694c 100644
--- a/lib/lib_audio/ESP8266SAM/library.json
+++ b/lib/lib_audio/ESP8266SAM/library.json
@@ -1,7 +1,7 @@
{
"name": "ESP8266SAM",
- "description": "Speech synthesizer SAM ported to ESP8266/ESP32",
- "keywords": "ESP8266, ESP32, Speecn Synthesis, SAM",
+ "description": "Speech synthesizer SAM ported to ESP8266/ESP32/RP2040",
+ "keywords": "ESP8266, ESP32, RP2040, Speecn Synthesis, SAM",
"authors": [
{
"name": "Earle F. Philhower, III",
@@ -14,10 +14,9 @@
"type": "git",
"url": "https://github.com/earlephilhower/ESP8266SAM"
},
- "version": "1.0",
+ "version": "1.0.1",
"homepage": "https://github.com/earlephilhower/ESP8266SAM",
"frameworks": "Arduino",
- "platforms": ["espressif8266", "espressif32"],
"examples": [
"examples/*/*.ino"
]
diff --git a/lib/lib_audio/ESP8266SAM/library.properties b/lib/lib_audio/ESP8266SAM/library.properties
index ed295ef12..f4624783c 100644
--- a/lib/lib_audio/ESP8266SAM/library.properties
+++ b/lib/lib_audio/ESP8266SAM/library.properties
@@ -1,9 +1,9 @@
name=ESP8266SAM
-version=1.0
+version=1.0.1
author=Earle F. Philhower, III
maintainer=Earle F. Philhower, III
-sentence=Speech synthesis on the ESP8266 and ESP32
-paragraph=Speech synthesis program SAM ported to ESP8266/ESP32 and ESP8266Audio
+sentence=Speech synthesis on the ESP8266, ESP32, and RP2040
+paragraph=Speech synthesis program SAM ported to ESP8266/ESP32/RP2040 and ESP8266Audio
category=Signal Input/Output
url=https://github.com/earlephilhower/ESP8266SAM
-architectures=esp8266,esp32
+architectures=esp8266,esp32,rp2040
diff --git a/lib/lib_audio/ESP8266SAM/src/ESP8266SAM.h b/lib/lib_audio/ESP8266SAM/src/ESP8266SAM.h
index d947c72f0..526f41b91 100644
--- a/lib/lib_audio/ESP8266SAM/src/ESP8266SAM.h
+++ b/lib/lib_audio/ESP8266SAM/src/ESP8266SAM.h
@@ -1,7 +1,7 @@
/*
ESP8266SAM
Port of SAM to the ESP8266
-
+
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ public:
speed = 0;
output = NULL;
};
-
+
~ESP8266SAM()
{
}
@@ -70,3 +70,4 @@ private:
};
#endif
+
diff --git a/lib/lib_audio/ESP8266SAM/src/ReciterTabs.h b/lib/lib_audio/ESP8266SAM/src/ReciterTabs.h
index c89636e4d..3f152cc6a 100644
--- a/lib/lib_audio/ESP8266SAM/src/ReciterTabs.h
+++ b/lib/lib_audio/ESP8266SAM/src/ReciterTabs.h
@@ -2,8 +2,8 @@
#define RECITERTABS_H
#include
-#include "samdebug.h"
-#if sam_debug
+#include "esp8266sam_debug.h"
+#if DEBUG_ESP8266SAM_LIB
#define PROGMEM
#endif
diff --git a/lib/lib_audio/ESP8266SAM/src/RenderTabs.h b/lib/lib_audio/ESP8266SAM/src/RenderTabs.h
index a98e93bc7..c492fb9c5 100644
--- a/lib/lib_audio/ESP8266SAM/src/RenderTabs.h
+++ b/lib/lib_audio/ESP8266SAM/src/RenderTabs.h
@@ -2,8 +2,8 @@
#define RENDERTABS_H
#include
-#include "samdebug.h"
-#if sam_debug
+#include "esp8266sam_debug.h"
+#if DEBUG_ESP8266SAM_LIB
#define PROGMEM
#endif
@@ -196,7 +196,7 @@ const unsigned char ampl3data[] PROGMEM =
//tab42240
-const signed char sinus[256] PROGMEM = {0,3,6,9,12,16,19,22,25,28,31,34,37,40,43,46,49,51,54,57,60,63,65,68,71,73,76,78,81,83,85,88,90,92,94,96,98,100,102,104,106,107,109,111,112,113,115,116,117,118,120,121,122,122,123,124,125,125,126,126,126,127,127,127,127,127,127,127,126,126,126,125,125,124,123,122,122,121,120,118,117,116,115,113,112,111,109,107,106,104,102,100,98,96,94,92,90,88,85,83,81,78,76,73,71,68,65,63,60,57,54,51,49,46,43,40,37,34,31,28,25,22,19,16,12,9,6,3,0,-3,-6,-9,-12,-16,-19,-22,-25,-28,-31,-34,-37,-40,-43,-46,-49,-51,-54,-57,-60,-63,-65,-68,-71,-73,-76,-78,-81,-83,-85,-88,-90,-92,-94,-96,-98,-100,-102,-104,-106,-107,-109,-111,-112,-113,-115,-116,-117,-118,-120,-121,-122,-122,-123,-124,-125,-125,-126,-126,-126,-127,-127,-127,-127,-127,-127,-127,-126,-126,-126,-125,-125,-124,-123,-122,-122,-121,-120,-118,-117,-116,-115,-113,-112,-111,-109,-107,-106,-104,-102,-100,-98,-96,-94,-92,-90,-88,-85,-83,-81,-78,-76,-73,-71,-68,-65,-63,-60,-57,-54,-51,-49,-46,-43,-40,-37,-34,-31,-28,-25,-22,-19,-16,-12,-9,-6,-3};
+const signed char sinus[256] PROGMEM = {0,3,6,9,12,16,19,22,25,28,31,34,37,40,43,46,49,51,54,57,60,63,65,68,71,73,76,78,81,83,85,88,90,92,94,96,98,100,102,104,106,107,109,111,112,113,115,116,117,118,120,121,122,122,123,124,125,125,126,126,126,127,127,127,127,127,127,127,126,126,126,125,125,124,123,122,122,121,120,118,117,116,115,113,112,111,109,107,106,104,102,100,98,96,94,92,90,88,85,83,81,78,76,73,71,68,65,63,60,57,54,51,49,46,43,40,37,34,31,28,25,22,19,16,12,9,6,3,0,-3,-6,-9,-12,-16,-19,-22,-25,-28,-31,-34,-37,-40,-43,-46,-49,-51,-54,-57,-60,-63,-65,-68,-71,-73,-76,-78,-81,-83,-85,-88,-90,-92,-94,-96,-98,-100,-102,-104,-106,-107,-109,-111,-112,-113,-115,-116,-117,-118,-120,-121,-122,-122,-123,-124,-125,-125,-126,-126,-126,-127,-127,-127,-127,-127,-127,-127,-126,-126,-126,-125,-125,-124,-123,-122,-122,-121,-120,-118,-117,-116,-115,-113,-112,-111,-109,-107,-106,-104,-102,-100,-98,-96,-94,-92,-90,-88,-85,-83,-81,-78,-76,-73,-71,-68,-65,-63,-60,-57,-54,-51,-49,-46,-43,-40,-37,-34,-31,-28,-25,-22,-19,-16,-12,-9,-6,-3};
//tab42496
const unsigned char rectangle[] PROGMEM =
diff --git a/lib/lib_audio/ESP8266SAM/src/SamTabs.h b/lib/lib_audio/ESP8266SAM/src/SamTabs.h
index 4574746e7..933f95b0e 100644
--- a/lib/lib_audio/ESP8266SAM/src/SamTabs.h
+++ b/lib/lib_audio/ESP8266SAM/src/SamTabs.h
@@ -2,8 +2,8 @@
#define SAMTABS_H
#include
-#include "samdebug.h"
-#if sam_debug
+#include "esp8266sam_debug.h"
+#if DEBUG_ESP8266SAM_LIB
#define PROGMEM
#endif
diff --git a/lib/lib_audio/ESP8266SAM/src/samdebug.c b/lib/lib_audio/ESP8266SAM/src/esp8266sam_debug.c
similarity index 100%
rename from lib/lib_audio/ESP8266SAM/src/samdebug.c
rename to lib/lib_audio/ESP8266SAM/src/esp8266sam_debug.c
diff --git a/lib/lib_audio/ESP8266SAM/src/samdebug.h b/lib/lib_audio/ESP8266SAM/src/esp8266sam_debug.h
similarity index 79%
rename from lib/lib_audio/ESP8266SAM/src/samdebug.h
rename to lib/lib_audio/ESP8266SAM/src/esp8266sam_debug.h
index 5f862a0e6..de2a2f840 100644
--- a/lib/lib_audio/ESP8266SAM/src/samdebug.h
+++ b/lib/lib_audio/ESP8266SAM/src/esp8266sam_debug.h
@@ -1,5 +1,5 @@
-#ifndef DEBUG_H
-#define DEBUG_H
+#ifndef ESP8266SAM_DEBUG_H
+#define ESP8266SAM_DEBUG_H
void PrintPhonemes(unsigned char *phonemeindex, unsigned char *phonemeLength, unsigned char *stress);
void PrintOutput(
@@ -14,6 +14,6 @@ void PrintOutput(
void PrintRule(int offset);
-#define sam_debug 0
+#define DEBUG_ESP8266SAM_LIB 0
#endif
diff --git a/lib/lib_audio/ESP8266SAM/src/reciter.c b/lib/lib_audio/ESP8266SAM/src/reciter.c
index 3845609c3..f949ca579 100644
--- a/lib/lib_audio/ESP8266SAM/src/reciter.c
+++ b/lib/lib_audio/ESP8266SAM/src/reciter.c
@@ -2,7 +2,7 @@
#include
#include "reciter.h"
#include "ReciterTabs.h"
-#include "samdebug.h"
+#include "esp8266sam_debug.h"
#include "SamData.h"
unsigned char A, X, Y;
@@ -527,7 +527,7 @@ pos37455:
Y = mem64;
mem61 = mem60;
- if (sam_debug)
+ if (DEBUG_ESP8266SAM_LIB)
PrintRule(mem62);
pos37461:
diff --git a/lib/lib_audio/ESP8266SAM/src/render.c b/lib/lib_audio/ESP8266SAM/src/render.c
index f73c848a4..4cbabb190 100644
--- a/lib/lib_audio/ESP8266SAM/src/render.c
+++ b/lib/lib_audio/ESP8266SAM/src/render.c
@@ -5,8 +5,7 @@
#include "render.h"
#include "RenderTabs.h"
-#include "samdebug.h"
-//extern int debug;
+#include "esp8266sam_debug.h"
#include
#include "SamData.h"
@@ -445,7 +444,7 @@ do
mem44++;
} while(mem44 != 0);
yield();
-if (sam_debug)
+if (DEBUG_ESP8266SAM_LIB)
{
PrintOutput(sampledConsonantFlag, frequency1, frequency2, frequency3, amplitude1, amplitude2, amplitude3, pitches);
}
@@ -786,7 +785,7 @@ if (sam_debug)
X = A;
mem38 = A - (A>>2); // 3/4*A ???
yield();
-if (sam_debug)
+if (DEBUG_ESP8266SAM_LIB)
{
PrintOutput(sampledConsonantFlag, frequency1, frequency2, frequency3, amplitude1, amplitude2, amplitude3, pitches);
}
diff --git a/lib/lib_audio/ESP8266SAM/src/sam.c b/lib/lib_audio/ESP8266SAM/src/sam.c
index 5dba52fda..c20d8dd2a 100644
--- a/lib/lib_audio/ESP8266SAM/src/sam.c
+++ b/lib/lib_audio/ESP8266SAM/src/sam.c
@@ -2,7 +2,7 @@
#include // strlen()
//#include
#include // define NULL
-#include "samdebug.h"
+#include "esp8266sam_debug.h"
#include "sam.h"
#include "render.h"
#include "SamTabs.h"
@@ -15,8 +15,6 @@ static unsigned char mouth = 128;
static unsigned char throat = 128;
int singmode = 0;
-//extern int debug;
-
unsigned char mem39;
unsigned char mem44;
unsigned char mem47;
@@ -146,7 +144,7 @@ int SAMMain( void (*cb)(void *, unsigned char), void *cbd )
phonemeindex[255] = 32; //to prevent buffer overflow
if (!Parser1()) return 0;
- if (sam_debug)
+ if (DEBUG_ESP8266SAM_LIB)
PrintPhonemes(phonemeindex, phonemeLength, stress);
Parser2();
CopyStress();
@@ -168,7 +166,7 @@ int SAMMain( void (*cb)(void *, unsigned char), void *cbd )
InsertBreath();
//mem[40158] = 255;
- if (sam_debug)
+ if (DEBUG_ESP8266SAM_LIB)
{
PrintPhonemes(phonemeindex, phonemeLength, stress);
}
@@ -645,7 +643,7 @@ void Code41240()
//void Code41397()
void Parser2()
{
- if (sam_debug) printf("Parser2\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("Parser2\n");
unsigned char pos = 0; //mem66;
unsigned char mem58 = 0;
@@ -659,7 +657,7 @@ void Parser2()
A = phonemeindex[pos];
// DEBUG: Print phoneme and index
- if (sam_debug && A != 255) printf("%d: %c%c\n", X, signInputTable1[A], signInputTable2[A]);
+ if (DEBUG_ESP8266SAM_LIB && A != 255) printf("%d: %c%c\n", X, signInputTable1[A], signInputTable2[A]);
// Is phoneme pause?
if (A == 0)
@@ -695,8 +693,8 @@ void Parser2()
//pos41443:
// Insert at WX or YX following, copying the stress
- if (sam_debug) if (A==20) printf("RULE: insert WX following diphtong NOT ending in IY sound\n");
- if (sam_debug) if (A==21) printf("RULE: insert YX following diphtong ending in IY sound\n");
+ if (DEBUG_ESP8266SAM_LIB) if (A==20) printf("RULE: insert WX following diphtong NOT ending in IY sound\n");
+ if (DEBUG_ESP8266SAM_LIB) if (A==21) printf("RULE: insert YX following diphtong ending in IY sound\n");
Insert(pos+1, A, mem59, mem58);
X = pos;
// Jump to ???
@@ -716,7 +714,7 @@ pos41457:
if (A != 78) goto pos41487; // 'UL'
A = 24; // 'L' //change 'UL' to 'AX L'
- if (sam_debug) printf("RULE: UL -> AX L\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: UL -> AX L\n");
pos41466:
// Get current phoneme stress
@@ -740,7 +738,7 @@ pos41487:
if (A != 79) goto pos41495; // 'UM'
// Jump up to branch - replaces current phoneme with AX and continues
A = 27; // 'M' //change 'UM' to 'AX M'
- if (sam_debug) printf("RULE: UM -> AX M\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: UM -> AX M\n");
goto pos41466;
pos41495:
@@ -754,7 +752,7 @@ pos41495:
// Jump up to branch - replaces current phoneme with AX and continues
A = 28; // 'N' //change UN to 'AX N'
- if (sam_debug) printf("RULE: UN -> AX N\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: UN -> AX N\n");
goto pos41466;
pos41503:
@@ -802,7 +800,7 @@ pos41503:
if (A != 0)
{
// Insert a glottal stop and move forward
- if (sam_debug) printf("RULE: Insert glottal stop between two stressed vowels with space between them\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: Insert glottal stop between two stressed vowels with space between them\n");
// 31 = 'Q'
Insert(X, 31, mem59, 0);
pos++;
@@ -831,7 +829,7 @@ pos41503:
if (A == 69) // 'T'
{
// Change T to CH
- if (sam_debug) printf("RULE: T R -> CH R\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: T R -> CH R\n");
phonemeindex[pos-1] = 42;
goto pos41779;
}
@@ -846,7 +844,7 @@ pos41503:
{
// Change D to J
phonemeindex[pos-1] = 44;
- if (sam_debug) printf("RULE: D R -> J R\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: D R -> J R\n");
goto pos41788;
}
@@ -857,7 +855,7 @@ pos41503:
// If vowel flag is set change R to RX
A = flags[A] & 128;
- if (sam_debug) printf("RULE: R -> RX\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: R -> RX\n");
if (A != 0) phonemeindex[pos] = 18; // 'RX'
// continue to next phoneme
@@ -876,7 +874,7 @@ pos41611:
// If prior phoneme does not have VOWEL flag set, move to next phoneme
if ((flags[phonemeindex[pos-1]] & 128) == 0) {pos++; continue;}
// Prior phoneme has VOWEL flag set, so change L to LX and move to next phoneme
- if (sam_debug) printf("RULE: L -> LX\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: L -> LX\n");
phonemeindex[X] = 19; // 'LX'
pos++;
continue;
@@ -895,7 +893,7 @@ pos41611:
// If prior phoneme is not G, move to next phoneme
if (phonemeindex[pos-1] != 60) {pos++; continue;}
// Replace S with Z and move on
- if (sam_debug) printf("RULE: G S -> G Z\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: G S -> G Z\n");
phonemeindex[pos] = 38; // 'Z'
pos++;
continue;
@@ -916,7 +914,7 @@ pos41611:
{
// VOWELS AND DIPHTONGS ENDING WITH IY SOUND flag set?
A = flags[Y] & 32;
- if (sam_debug) if (A==0) printf("RULE: K -> KX \n");
+ if (DEBUG_ESP8266SAM_LIB) if (A==0) printf("RULE: K -> KX \n");
// Replace with KX
if (A == 0) phonemeindex[pos] = 75; // 'KX'
}
@@ -943,7 +941,7 @@ pos41611:
// If diphtong ending with YX, move continue processing next phoneme
if ((flags[index] & 32) != 0) {pos++; continue;}
// replace G with GX and continue processing next phoneme
- if (sam_debug) printf("RULE: G -> GX \n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: G -> GX \n");
phonemeindex[pos] = 63; // 'GX'
pos++;
continue;
@@ -968,7 +966,7 @@ pos41611:
goto pos41812;
}
// Replace with softer version
- if (sam_debug) printf("RULE: S* %c%c -> S* %c%c\n", signInputTable1[Y], signInputTable2[Y],signInputTable1[Y-12], signInputTable2[Y-12]);
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: S* %c%c -> S* %c%c\n", signInputTable1[Y], signInputTable2[Y],signInputTable1[Y-12], signInputTable2[Y-12]);
phonemeindex[pos] = Y-12;
pos++;
continue;
@@ -991,7 +989,7 @@ pos41749:
A = flags2[Y] & 4;
// If not set, continue processing next phoneme
if (A == 0) {pos++; continue;}
- if (sam_debug) printf("RULE: UW -> UX\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: UW -> UX\n");
phonemeindex[X] = 16;
pos++;
continue;
@@ -1005,7 +1003,7 @@ pos41779:
if (A == 42) // 'CH'
{
// pos41783:
- if (sam_debug) printf("CH -> CH CH+1\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("CH -> CH CH+1\n");
Insert(X+1, A+1, mem59, stress[X]);
pos++;
continue;
@@ -1020,7 +1018,7 @@ pos41788:
if (A == 44) // 'J'
{
- if (sam_debug) printf("J -> J J+1\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("J -> J J+1\n");
Insert(X+1, A+1, mem59, stress[X]);
pos++;
continue;
@@ -1060,7 +1058,7 @@ pos41812:
if (stress[X] != 0) {pos++; continue;}
//pos41856:
// Set phonemes to DX
- if (sam_debug) printf("RULE: Soften T or D following vowel or ER and preceding a pause -> DX\n");
+ if (DEBUG_ESP8266SAM_LIB) printf("RULE: Soften T or D following vowel or ER and preceding a pause -> DX\n");
phonemeindex[pos] = 30; // 'DX'
} else
{
@@ -1070,7 +1068,7 @@ pos41812:
else
// Is next phoneme a vowel or ER?
A = flags[A] & 128;
- if (sam_debug) if (A != 0) printf("RULE: Soften T or D following vowel or ER and preceding a pause -> DX\n");
+ if (DEBUG_ESP8266SAM_LIB) if (A != 0) printf("RULE: Soften T or D following vowel or ER and preceding a pause -> DX\n");
if (A != 0) phonemeindex[pos] = 30; // 'DX'
}
@@ -1160,14 +1158,14 @@ pos48644:
// change phoneme length to (length * 1.5) + 1
A = (A >> 1) + A + 1;
-if (sam_debug) printf("RULE: Lengthen or between and by 1.5\n");
-if (sam_debug) printf("PRE\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("RULE: Lengthen or between and by 1.5\n");
+if (DEBUG_ESP8266SAM_LIB) printf("PRE\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
phonemeLength[X] = A;
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
}
// keep moving forward
@@ -1221,15 +1219,15 @@ if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonem
// RULE: RX | LX
-if (sam_debug) printf("RULE: - decrease length by 1\n");
-if (sam_debug) printf("PRE\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", loopIndex, signInputTable1[phonemeindex[loopIndex]], signInputTable2[phonemeindex[loopIndex]], phonemeLength[loopIndex]);
+if (DEBUG_ESP8266SAM_LIB) printf("RULE: - decrease length by 1\n");
+if (DEBUG_ESP8266SAM_LIB) printf("PRE\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", loopIndex, signInputTable1[phonemeindex[loopIndex]], signInputTable2[phonemeindex[loopIndex]], phonemeLength[loopIndex]);
// decrease length of vowel by 1 frame
phonemeLength[loopIndex]--;
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", loopIndex, signInputTable1[phonemeindex[loopIndex]], signInputTable2[phonemeindex[loopIndex]], phonemeLength[loopIndex]);
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", loopIndex, signInputTable1[phonemeindex[loopIndex]], signInputTable2[phonemeindex[loopIndex]], phonemeLength[loopIndex]);
}
// move ahead
@@ -1267,16 +1265,16 @@ if (sam_debug) printf("phoneme %d (%c%c) length %d\n", loopIndex, signInputTable
// move back
X--;
-if (sam_debug) printf("RULE: - decrease vowel by 1/8th\n");
-if (sam_debug) printf("PRE\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("RULE: - decrease vowel by 1/8th\n");
+if (DEBUG_ESP8266SAM_LIB) printf("PRE\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
// decrease length by 1/8th
mem56 = phonemeLength[X] >> 3;
phonemeLength[X] -= mem56;
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
// move ahead
loopIndex++;
@@ -1286,16 +1284,16 @@ if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonem
// RULE:
//
-if (sam_debug) printf("RULE: - increase vowel by 1/2 + 1\n");
-if (sam_debug) printf("PRE\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
+if (DEBUG_ESP8266SAM_LIB) printf("RULE: - increase vowel by 1/2 + 1\n");
+if (DEBUG_ESP8266SAM_LIB) printf("PRE\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
// decrease length
A = phonemeLength[X-1];
phonemeLength[X-1] = (A >> 2) + A + 1; // 5/4*A + 1
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
// move ahead
loopIndex++;
@@ -1335,10 +1333,10 @@ if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phon
// B*, D*, G*, GX, P*, T*, K*, KX
{
-if (sam_debug) printf("RULE: - set nasal = 5, consonant = 6\n");
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
+if (DEBUG_ESP8266SAM_LIB) printf("RULE: - set nasal = 5, consonant = 6\n");
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
// set stop consonant length to 6
phonemeLength[X] = 6;
@@ -1346,9 +1344,9 @@ if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phon
// set nasal length to 5
phonemeLength[X-1] = 5;
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
}
// move to next phoneme
@@ -1388,10 +1386,10 @@ if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phon
}
// RULE: {optional silence}
-if (sam_debug) printf("RULE: {optional silence} - shorten both to 1/2 + 1\n");
-if (sam_debug) printf("PRE\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
+if (DEBUG_ESP8266SAM_LIB) printf("RULE: {optional silence} - shorten both to 1/2 + 1\n");
+if (DEBUG_ESP8266SAM_LIB) printf("PRE\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X-1, signInputTable1[phonemeindex[X-1]], signInputTable2[phonemeindex[X-1]], phonemeLength[X-1]);
// X gets overwritten, so hold prior X value for debug statement
int debugX = X;
// shorten the prior phoneme length to (length/2 + 1)
@@ -1401,9 +1399,9 @@ int debugX = X;
// also shorten this phoneme length to (length/2 +1)
phonemeLength[loopIndex] = (phonemeLength[loopIndex] >> 1) + 1;
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", debugX, signInputTable1[phonemeindex[debugX]], signInputTable2[phonemeindex[debugX]], phonemeLength[debugX]);
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", debugX-1, signInputTable1[phonemeindex[debugX-1]], signInputTable2[phonemeindex[debugX-1]], phonemeLength[debugX-1]);
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", debugX, signInputTable1[phonemeindex[debugX]], signInputTable2[phonemeindex[debugX]], phonemeLength[debugX]);
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", debugX-1, signInputTable1[phonemeindex[debugX-1]], signInputTable2[phonemeindex[debugX-1]], phonemeLength[debugX-1]);
// move ahead
@@ -1429,15 +1427,15 @@ if (sam_debug) printf("phoneme %d (%c%c) length %d\n", debugX-1, signInputTable1
if((flags[index] & 2) != 0)
// Rule:
-if (sam_debug) printf("RULE: - decrease by 2\n");
-if (sam_debug) printf("PRE\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("RULE: - decrease by 2\n");
+if (DEBUG_ESP8266SAM_LIB) printf("PRE\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
// decrease the phoneme length by 2 frames (20 ms)
phonemeLength[X] -= 2;
-if (sam_debug) printf("POST\n");
-if (sam_debug) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
+if (DEBUG_ESP8266SAM_LIB) printf("POST\n");
+if (DEBUG_ESP8266SAM_LIB) printf("phoneme %d (%c%c) length %d\n", X, signInputTable1[phonemeindex[X]], signInputTable2[phonemeindex[X]], phonemeLength[X]);
}
// move to next phoneme
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README.md b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README.md
index 90fd8d4c8..f392c5529 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README.md
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README.md
@@ -10,8 +10,8 @@
This library enables you to **send _and_ receive** infra-red signals on an [ESP8266](https://github.com/esp8266/Arduino) or an
[ESP32](https://github.com/espressif/arduino-esp32) using the [Arduino framework](https://www.arduino.cc/) using common 940nm IR LEDs and common IR receiver modules. e.g. TSOP{17,22,24,36,38,44,48}* demodulators etc.
-## v2.8.0 Now Available
-Version 2.8.0 of the library is now [available](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes.
+## v2.8.1 Now Available
+Version 2.8.1 of the library is now [available](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes.
#### Upgrading from pre-v2.0
Usage of the library has been slightly changed in v2.0. You will need to change your usage to work with v2.0 and beyond. You can read more about the changes required on our [Upgrade to v2.0](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Upgrading-to-v2.0) page.
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_de.md b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_de.md
index 4dbd835c4..884628149 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_de.md
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_de.md
@@ -11,8 +11,8 @@
Diese Programmbibliothek ermöglicht das **Senden _und_ Empfangen** von Infrarotsignalen mit [ESP8266](https://github.com/esp8266/Arduino)- und
[ESP32](https://github.com/espressif/arduino-esp32)-Mikrocontrollern mithilfe des [Arduino-Frameworks](https://www.arduino.cc/) und handelsüblichen 940nm Infrarot-LEDs undIR-Empfängermodulen, wie zum Beispiel TSOP{17,22,24,36,38,44,48}*-Demodulatoren.
-## v2.8.0 jetzt verfügbar
-Version 2.8.0 der Bibliothek ist nun [verfügbar](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Die [Versionshinweise](ReleaseNotes.md) enthalten alle wichtigen Neuerungen.
+## v2.8.1 jetzt verfügbar
+Version 2.8.1 der Bibliothek ist nun [verfügbar](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Die [Versionshinweise](ReleaseNotes.md) enthalten alle wichtigen Neuerungen.
#### Hinweis für Nutzer von Versionen vor v2.0
Die Benutzung der Bibliothek hat sich mit Version 2.0 leicht geändert. Einige Anpassungen im aufrufenden Code werden nötig sein, um mit Version ab 2.0 korrekt zu funktionieren. Mehr zu den Anpassungen finden sich auf unserer [Upgrade to v2.0](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Upgrading-to-v2.0)-Seite.
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_fr.md b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_fr.md
index d7033c093..3f1a93048 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_fr.md
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/README_fr.md
@@ -10,8 +10,8 @@
Cette librairie vous permetra de **recevoir et d'envoyer des signaux** infrarouge sur le protocole [ESP8266](https://github.com/esp8266/Arduino) ou sur le protocole
[ESP32](https://github.com/espressif/arduino-esp32) en utilisant le [Arduino framework](https://www.arduino.cc/) qui utilise la norme 940nm IR LEDs et le module basique de reception d'onde IR. Exemple : TSOP{17,22,24,36,38,44,48}* modules etc.
-## v2.8.0 disponible
-Version 2.8.0 de la libraire est maintenant [disponible](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Vous pouvez voir le [Release Notes](ReleaseNotes.md) pour tous les changements importants.
+## v2.8.1 disponible
+Version 2.8.1 de la libraire est maintenant [disponible](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Vous pouvez voir le [Release Notes](ReleaseNotes.md) pour tous les changements importants.
#### mise à jour depuis pre-v2.0
L'utilisation de la librairie à un peu changer depuis la version in v2.0. Si vous voulez l'utiliser vous devrez changer votre utilisation aussi. Vous pouvez vous renseigner sur les précondition d'utilisation ici : [Upgrade to v2.0](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Upgrading-to-v2.0) page.
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/ReleaseNotes.md b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/ReleaseNotes.md
index 0f41b562d..9c8d7df98 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/ReleaseNotes.md
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/ReleaseNotes.md
@@ -1,5 +1,29 @@
# Release Notes
+## _v2.8.1 (20220101)_
+
+**[Bug Fixes]**
+- Arduino ESP32 Core v2.0.2+ crashes due to our timer hack. (#1715 #1713)
+- SONY: Fix old Sony CD-Player Remote (12 Bit) (#1714)
+
+**[Features]**
+- Add tool to convert protocol & code to raw timing info. (#1708 #1707 #1703)
+- Add basic support for COOLIX48 protocol. (#1697 #1694)
+- MITSUBISHI_AC: Added support for i-SAVE mode. (#1666)
+- TOSHIBA_AC: Add Filter setting support. aka. Pure. (#1693 #1692)
+- Airton: Add detailed A/C support. (#1688 #1670)
+
+**[Misc]**
+- Add a structured library version number. (#1717)
+- Workflows Split UnitTests (#1712)
+- Reduce time for workflow/Build (#1709)
+- Fix some compiler & linter warnings (#1699 #1700)
+- Fujitsu: Update supported A/C models (#1690 #1689 #1702 #1701)
+- Remove extra `const` qualifier for char pointer (#1704)
+- TCL: Update supported devices. (#1698)
+- ESP32-C3: Work around for some C3 specific compiler issues. (#1696 #1695)
+
+
## _v2.8.0 (20211119)_
**[Bug Fixes]**
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/SupportedProtocols.md b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/SupportedProtocols.md
index cf960a0eb..0b6fb06c1 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/SupportedProtocols.md
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/SupportedProtocols.md
@@ -1,11 +1,11 @@
+ Last generated: Fri 31 Dec 2021 21:49:00 +0000 --->
# IR Protocols supported by this library
| Protocol | Brand | Model | A/C Model | Detailed A/C Support |
| --- | --- | --- | --- | --- |
-| [Airton](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Airton.cpp) | **Airton** | RD1A1 remote
SMVH09B-2A2A3NH ref. 409730 A/C | | - |
+| [Airton](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Airton.cpp) | **[Airton](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Airton.h)** | RD1A1 remote
SMVH09B-2A2A3NH ref. 409730 A/C | | Yes |
| [Airwell](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Airwell.cpp) | **[Airwell](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Airwell.h)** | DLS 21 DCI R410 AW A/C
RC04 remote
RC08W remote | | Yes |
| [Aiwa](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Aiwa.cpp) | **Aiwa** | RC-T501 RCU | | - |
| [Amcor](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Amcor.cpp) | **[Amcor](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Amcor.h)** | ADR-853H A/C
TAC-444 remote
TAC-495 remote | | Yes |
@@ -15,6 +15,7 @@
| [Carrier](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Carrier.cpp) | **[Carrier/Surrey](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Carrier.h)** | 42QG5A55970 remote
53NGK009/012 Inverter
619EGX0090E0 A/C
619EGX0120E0 A/C
619EGX0180E0 A/C
619EGX0220E0 A/C | | Yes |
| [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Airwell](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | RC08B remote | | Yes |
| [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Beko](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | BINR 070/071 split-type A/C
RG57K7(B)/BGEF Remote | | Yes |
+| [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Bosch](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | B1ZAI2441W/B1ZAO2441W A/C
RG36B4/BGE remote | | Yes |
| [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Kastron](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | RG57A7/BGEF Inverter remote | | Yes |
| [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Kaysun](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | Casual CF A/C | | Yes |
| [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Midea](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | MS12FU-10HRDN1-QRD0GW(B) A/C
MSABAU-07HRFN1-QRD0GW A/C (circa 2016)
RG52D/BGE Remote | | Yes |
@@ -35,7 +36,7 @@
| [EliteScreens](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_EliteScreens.cpp) | **Elite Screens** | CineTension2 / CineTension3 series
Home2 / Home3 series
Spectrum series
VMAX Plus4 series
VMAX2 / VMAX2 Plus series
ZSP-IR-B / ZSP-IR-W remote | | - |
| [EliteScreens](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_EliteScreens.cpp) | **Lumene Screens** | Embassy | | - |
| [Epson](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Epson.cpp) | **Epson** | EN-TW9100W Projector
EX3220 Projector
EX5220 Projector
EX5230 Projector
EX6220 Projector
EX7220 Projector
VS230 Projector
VS330 Projector | | - |
-| [Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.cpp) | **[Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.h)** | AGTV14LAC A/C (ARRAH2E)
AR-DB1 remote (ARDB1)
AR-DL10 remote (ARDB1)
AR-RAC1E remote (ARRAH2E)
AR-RAE1E remote (ARRAH2E)
AR-RAH1U remote (ARREB1E)
AR-RAH2E remote (ARRAH2E)
AR-REB1E remote (ARREB1E)
AR-REW4E remote (ARREW4E)
AR-RY4 remote (ARRY4)
AST9RSGCW A/C (ARDB1)
ASTB09LBC A/C (ARRY4)
ASU12RLF A/C (ARREB1E)
ASU30C1 A/C (ARDB1)
ASYG09KETA-B A/C (ARREW4E)
ASYG30LFCA A/C (ARRAH2E)
ASYG7LMCA A/C (ARREB1E) | ARDB1
ARJW2
ARRAH2E
ARREB1E
ARREW4E
ARRY4 | Yes |
+| [Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.cpp) | **[Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.h)** | AGTV14LAC A/C (ARRAH2E)
AR-DB1 remote (ARDB1)
AR-DL10 remote (ARDB1)
AR-RAC1E remote (ARRAH2E)
AR-RAE1E remote (ARRAH2E)
AR-RAH1U remote (ARREB1E)
AR-RAH2E remote (ARRAH2E)
AR-REB1E remote (ARREB1E)
AR-REB4E remote (ARREB1E)
AR-REW1E remote (ARREW4E)
AR-REW4E remote (ARREW4E)
AR-RY4 remote (ARRY4)
AST9RSGCW A/C (ARDB1)
ASTB09LBC A/C (ARRY4)
ASTG09K A/C (ARREW4E)
ASTG18K A/C (ARREW4E)
ASU12RLF A/C (ARREB1E)
ASU30C1 A/C (ARDB1)
ASYG09KETA-B A/C (ARREW4E)
ASYG30LFCA A/C (ARRAH2E)
ASYG7LMCA A/C (ARREB1E) | ARDB1
ARJW2
ARRAH2E
ARREB1E
ARREW4E
ARRY4 | Yes |
| [Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.cpp) | **[Fujitsu General](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.h)** | AOHG09LLC A/C (ARRAH2E)
AR-JW2 remote (ARJW2)
AR-RCE1E remote (ARRAH2E)
ASHG09LLCA A/C (ARRAH2E) | ARDB1
ARJW2
ARRAH2E
ARREB1E
ARREW4E
ARRY4 | Yes |
| [GICable](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_GICable.cpp) | **G.I. Cable** | XRC-200 remote | | - |
| [GlobalCache](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_GlobalCache.cpp) | **Global Cache** | Control Tower IR DB | | - |
@@ -79,7 +80,7 @@
| [Mirage](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mirage.cpp) | **[Mirage](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mirage.h)** | VLU series A/C | KKG29AC1
KKG9AC1 | Yes |
| [Mirage](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mirage.cpp) | **[Tronitechnik](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mirage.h)** | KKG29A-C1 remote
Reykir 9000 A/C | KKG29AC1
KKG9AC1 | Yes |
| [Mitsubishi](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.cpp) | **[Mitsubishi](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.h)** | HC3000 Projector (MITSUBISHI2)
KM14A 0179213 remote
MS-GK24VA A/C
TV (MITSUBISHI) | | Yes |
-| [Mitsubishi](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.cpp) | **[Mitsubishi Electric](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.h)** | 001CP T7WE10714 remote (MITSUBISHI136)
KPOA remote (MITSUBISHI112)
MLZ-RX5017AS A/C (MITSUBISHI_AC)
MSH-A24WV A/C (MITSUBISHI112)
MSZ-GV2519 A/C (MITSUBISHI_AC)
MSZ-SF25VE3 A/C (MITSUBISHI_AC)
MSZ-ZW4017S A/C (MITSUBISHI_AC)
MUH-A24WV A/C (MITSUBISHI112)
PEAD-RP71JAA Ducted A/C (MITSUBISHI136)
RH151/M21ED6426 remote (MITSUBISHI_AC)
SG153/M21EDF426 remote (MITSUBISHI_AC)
SG15D remote (MITSUBISHI_AC) | | Yes |
+| [Mitsubishi](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.cpp) | **[Mitsubishi Electric](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.h)** | 001CP T7WE10714 remote (MITSUBISHI136)
KPOA remote (MITSUBISHI112)
MLZ-RX5017AS A/C (MITSUBISHI_AC)
MSH-A24WV A/C (MITSUBISHI112)
MSZ-FHnnVE A/C (MITSUBISHI_AC)
MSZ-GV2519 A/C (MITSUBISHI_AC)
MSZ-SF25VE3 A/C (MITSUBISHI_AC)
MSZ-ZW4017S A/C (MITSUBISHI_AC)
MUH-A24WV A/C (MITSUBISHI112)
PEAD-RP71JAA Ducted A/C (MITSUBISHI136)
RH151/M21ED6426 remote (MITSUBISHI_AC)
SG153/M21EDF426 remote (MITSUBISHI_AC)
SG15D remote (MITSUBISHI_AC) | | Yes |
| [MitsubishiHeavy](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_MitsubishiHeavy.cpp) | **[Mitsubishi Heavy Industries](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_MitsubishiHeavy.h)** | RKX502A001C remote (88 bit)
RLA502A700B remote (152 bit)
SRKxxZJ-S A/C (88 bit)
SRKxxZM-S A/C (152 bit)
SRKxxZMXA-S A/C (152 bit) | | Yes |
| [Multibrackets](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Multibrackets.cpp) | **Multibrackets** | Motorized Swing mount large - 4500 | | - |
| [NEC](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_NEC.cpp) | **[Aloka](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_NEC.h)** | SleepyLights LED Lamp | | - |
@@ -107,6 +108,7 @@
| [Symphony](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Symphony.cpp) | **SilverCrest** | SSVS 85 A1 Fan | | - |
| [Symphony](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Symphony.cpp) | **Symphony** | Air Cooler 3Di | | - |
| [Symphony](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Symphony.cpp) | **Westinghouse** | 78095 Remote
Ceiling fan | | - |
+| [Tcl](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.cpp) | **[Daewoo](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.h)** | DSB-F0934ELH-V A/C
GYKQ-52E remote | GZ055BE1
TAC09CHSD | Yes |
| [Tcl](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.cpp) | **[Leberg](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.h)** | LBS-TOR07 A/C (TAC09CHSD) | GZ055BE1
TAC09CHSD | Yes |
| [Tcl](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.cpp) | **[TCL](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.h)** | TAC-09CHSD/XA31I A/C (TAC09CHSD) | GZ055BE1
TAC09CHSD | Yes |
| [Tcl](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.cpp) | **[Teknopoint](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.h)** | Allegro SSA-09H A/C (GZ055BE1)
GZ-055B-E1 remote (GZ055BE1) | GZ055BE1
TAC09CHSD | Yes |
@@ -114,7 +116,7 @@
| [Teco](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Teco.cpp) | **[Alaska](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Teco.h)** | SAC9010QC A/C
SAC9010QC remote | | Yes |
| [Teknopoint](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Teknopoint.cpp) | **Teknopoint** | Allegro SSA-09H A/C
GZ-055B-E1 remote | | - |
| [Toshiba](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.cpp) | **[Carrier](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.h)** | 42NQV025M2 / 38NYV025M2 A/C
42NQV035M2 / 38NYV035M2 A/C
42NQV050M2 / 38NYV050M2 A/C
42NQV060M2 / 38NYV060M2 A/C | | Yes |
-| [Toshiba](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.cpp) | **[Toshiba](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.h)** | Akita EVO II
RAS 18SKP-ES
RAS-2558V A/C
RAS-B13N3KV2
RAS-B13N3KVP-E
WC-L03SE
WH-TA04NE
WH-UB03NJ remote | | Yes |
+| [Toshiba](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.cpp) | **[Toshiba](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.h)** | Akita EVO II
RAS 18SKP-ES
RAS-2558V A/C
RAS-25SKVP2-ND A/C
RAS-B13N3KV2
RAS-B13N3KVP-E
WC-L03SE
WH-TA01JE remote
WH-TA04NE
WH-UB03NJ remote | | Yes |
| [Transcold](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Transcold.cpp) | **[Transcold](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Transcold.h)** | M1-F-NO-6 A/C | | Yes |
| [Trotec](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Trotec.cpp) | **[Duux](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Trotec.h)** | Blizzard Smart 10K / DXMA04 A/C (TROTEC) | | Yes |
| [Trotec](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Trotec.cpp) | **[Trotec](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Trotec.h)** | PAC 3200 A/C (TROTEC)
PAC 3550 Pro A/C (TROTEC_3550) | | Yes |
@@ -149,6 +151,7 @@
- CARRIER_AC40
- CARRIER_AC64
- COOLIX
+- COOLIX48
- CORONA_AC
- DAIKIN
- DAIKIN128
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino
index 180c4214c..c2e427166 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino
@@ -1249,7 +1249,7 @@ void handleInfo(void) {
"Built: " __DATE__
" " __TIME__ "
"
"Period Offset: ") + String(offset) + F("us
"
- "IR Lib Version: " _IRREMOTEESP8266_VERSION_ "
"
+ "IR Lib Version: " _IRREMOTEESP8266_VERSION_STR "
"
#if defined(ESP8266)
"ESP8266 Core Version: ") + ESP.getCoreVersion() + F("
"
"Free Sketch Space: ") + String(maxSketchSpace() >> 10) + F("k
"
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV2/IRrecvDumpV2.ino b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV2/IRrecvDumpV2.ino
index ae7e21dab..70dbdba42 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV2/IRrecvDumpV2.ino
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV2/IRrecvDumpV2.ino
@@ -154,7 +154,7 @@ void loop() {
if (results.overflow)
Serial.printf(D_WARN_BUFFERFULL "\n", kCaptureBufferSize);
// Display the library version the message was captured with.
- Serial.println(D_STR_LIBRARY " : v" _IRREMOTEESP8266_VERSION_ "\n");
+ Serial.println(D_STR_LIBRARY " : v" _IRREMOTEESP8266_VERSION_STR "\n");
// Display the tolerance percentage if it has been change from the default.
if (kTolerancePercentage != kTolerance)
Serial.printf(D_STR_TOLERANCE " : %d%%\n", kTolerancePercentage);
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV3/IRrecvDumpV3.ino b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV3/IRrecvDumpV3.ino
index fc2037368..0948ae5e9 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV3/IRrecvDumpV3.ino
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/examples/IRrecvDumpV3/IRrecvDumpV3.ino
@@ -163,7 +163,7 @@ void loop() {
if (results.overflow)
Serial.printf(D_WARN_BUFFERFULL "\n", kCaptureBufferSize);
// Display the library version the message was captured with.
- Serial.println(D_STR_LIBRARY " : v" _IRREMOTEESP8266_VERSION_ "\n");
+ Serial.println(D_STR_LIBRARY " : v" _IRREMOTEESP8266_VERSION_STR "\n");
// Display the tolerance percentage if it has been change from the default.
if (kTolerancePercentage != kTolerance)
Serial.printf(D_STR_TOLERANCE " : %d%%\n", kTolerancePercentage);
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/keywords.txt b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/keywords.txt
index 592b5d99b..8e0379173 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/keywords.txt
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/keywords.txt
@@ -20,6 +20,8 @@
# Datatypes & Classes (KEYWORD1)
#######################################
+CoronaSection KEYWORD1
+IRAirtonAc KEYWORD1
IRAirwellAc KEYWORD1
IRAmcorAc KEYWORD1
IRArgoAC KEYWORD1
@@ -147,6 +149,7 @@ addTempFloatToString KEYWORD2
addTempToString KEYWORD2
addToggleToString KEYWORD2
adjustRepeat KEYWORD2
+airton KEYWORD2
airwell KEYWORD2
amcor KEYWORD2
argo KEYWORD2
@@ -174,6 +177,7 @@ checkSum KEYWORD2
checkZjsSig KEYWORD2
checkZmsSig KEYWORD2
checksum KEYWORD2
+cleanState KEYWORD2
clearOnTimerFlag KEYWORD2
clearPowerSpecial KEYWORD2
clearSensorTemp KEYWORD2
@@ -211,6 +215,7 @@ decodeCOOLIX KEYWORD2
decodeCarrierAC KEYWORD2
decodeCarrierAC40 KEYWORD2
decodeCarrierAC64 KEYWORD2
+decodeCoolix48 KEYWORD2
decodeCoronaAc KEYWORD2
decodeDISH KEYWORD2
decodeDaikin KEYWORD2
@@ -339,6 +344,7 @@ fujitsu KEYWORD2
get10CHeat KEYWORD2
get3D KEYWORD2
get8CHeat KEYWORD2
+getAbsenseDetect KEYWORD2
getBeep KEYWORD2
getBit KEYWORD2
getBoost KEYWORD2
@@ -356,9 +362,11 @@ getCorrectedRawLength KEYWORD2
getCurrTime KEYWORD2
getCurrentDay KEYWORD2
getCurrentTime KEYWORD2
+getDirectIndirect KEYWORD2
getDisplay KEYWORD2
getDisplayTempSource KEYWORD2
getDryGrade KEYWORD2
+getEcocool KEYWORD2
getEcono KEYWORD2
getEconoToggle KEYWORD2
getEnableSensorTemp KEYWORD2
@@ -377,6 +385,8 @@ getHold KEYWORD2
getHumid KEYWORD2
getHumidity KEYWORD2
getIFeel KEYWORD2
+getISave10C KEYWORD2
+getISee KEYWORD2
getId KEYWORD2
getInternalStateLength KEYWORD2
getIon KEYWORD2
@@ -388,6 +398,7 @@ getLock KEYWORD2
getMax KEYWORD2
getMode KEYWORD2
getMold KEYWORD2
+getNaturalFlow KEYWORD2
getNight KEYWORD2
getOffSleepTimer KEYWORD2
getOffTime KEYWORD2
@@ -423,7 +434,9 @@ getSleepTimerEnabled KEYWORD2
getSpecial KEYWORD2
getSpeed KEYWORD2
getStartClock KEYWORD2
+getState KEYWORD2
getStateLength KEYWORD2
+getStatePrev KEYWORD2
getStopClock KEYWORD2
getSupercool KEYWORD2
getSwing KEYWORD2
@@ -474,6 +487,7 @@ haier KEYWORD2
haier176 KEYWORD2
haierYrwo2 KEYWORD2
handleSpecialState KEYWORD2
+handleToggles KEYWORD2
hasACState KEYWORD2
hasInvertedStates KEYWORD2
hasStateChanged KEYWORD2
@@ -571,6 +585,7 @@ sendCOOLIX KEYWORD2
sendCarrierAC KEYWORD2
sendCarrierAC40 KEYWORD2
sendCarrierAC64 KEYWORD2
+sendCoolix48 KEYWORD2
sendCoronaAc KEYWORD2
sendDISH KEYWORD2
sendDaikin KEYWORD2
@@ -679,6 +694,7 @@ serialPrintUint64 KEYWORD2
set10CHeat KEYWORD2
set3D KEYWORD2
set8CHeat KEYWORD2
+setAbsenseDetect KEYWORD2
setAuto KEYWORD2
setBeep KEYWORD2
setBit KEYWORD2
@@ -696,9 +712,11 @@ setCommand KEYWORD2
setCurrTime KEYWORD2
setCurrentDay KEYWORD2
setCurrentTime KEYWORD2
+setDirectIndirect KEYWORD2
setDisplay KEYWORD2
setDisplayTempSource KEYWORD2
setDryGrade KEYWORD2
+setEcocool KEYWORD2
setEcono KEYWORD2
setEconoToggle KEYWORD2
setEnableSensorTemp KEYWORD2
@@ -717,6 +735,8 @@ setHold KEYWORD2
setHumid KEYWORD2
setHumidity KEYWORD2
setIFeel KEYWORD2
+setISave10C KEYWORD2
+setISee KEYWORD2
setId KEYWORD2
setInvertedStates KEYWORD2
setIon KEYWORD2
@@ -729,6 +749,7 @@ setMax KEYWORD2
setMode KEYWORD2
setModel KEYWORD2
setMold KEYWORD2
+setNaturalFlow KEYWORD2
setNight KEYWORD2
setOffTime KEYWORD2
setOffTimeEnabled KEYWORD2
@@ -819,6 +840,7 @@ technibel KEYWORD2
teco KEYWORD2
ticksHigh KEYWORD2
ticksLow KEYWORD2
+toCommon KEYWORD2
toString KEYWORD2
toggleArrisRelease KEYWORD2
toggleRC5 KEYWORD2
@@ -896,6 +918,7 @@ CARRIER_AC40 LITERAL1
CARRIER_AC64 LITERAL1
CARRIER_AC_BITS LITERAL1
COOLIX LITERAL1
+COOLIX48 LITERAL1
COOLIX_BITS LITERAL1
CORONA_AC LITERAL1
DAIKIN LITERAL1
@@ -930,6 +953,7 @@ DECODE_CARRIER_AC LITERAL1
DECODE_CARRIER_AC40 LITERAL1
DECODE_CARRIER_AC64 LITERAL1
DECODE_COOLIX LITERAL1
+DECODE_COOLIX48 LITERAL1
DECODE_CORONA_AC LITERAL1
DECODE_DAIKIN LITERAL1
DECODE_DAIKIN128 LITERAL1
@@ -1284,6 +1308,7 @@ SEND_CARRIER_AC LITERAL1
SEND_CARRIER_AC40 LITERAL1
SEND_CARRIER_AC64 LITERAL1
SEND_COOLIX LITERAL1
+SEND_COOLIX48 LITERAL1
SEND_CORONA_AC LITERAL1
SEND_DAIKIN LITERAL1
SEND_DAIKIN128 LITERAL1
@@ -1443,13 +1468,27 @@ k8CHeatStr LITERAL1
kA705Str LITERAL1
kA903Str LITERAL1
kA907Str LITERAL1
+kAbsenseDetectStr LITERAL1
kAirFlowStr LITERAL1
+kAirtonAuto LITERAL1
kAirtonBitMark LITERAL1
kAirtonBits LITERAL1
+kAirtonCool LITERAL1
kAirtonDefaultRepeat LITERAL1
+kAirtonDry LITERAL1
+kAirtonFan LITERAL1
+kAirtonFanAuto LITERAL1
+kAirtonFanHigh LITERAL1
+kAirtonFanLow LITERAL1
+kAirtonFanMax LITERAL1
+kAirtonFanMed LITERAL1
+kAirtonFanMin LITERAL1
kAirtonFreq LITERAL1
kAirtonHdrMark LITERAL1
kAirtonHdrSpace LITERAL1
+kAirtonHeat LITERAL1
+kAirtonMaxTemp LITERAL1
+kAirtonMinTemp LITERAL1
kAirtonOneSpace LITERAL1
kAirtonZeroSpace LITERAL1
kAirwellAuto LITERAL1
@@ -1645,6 +1684,8 @@ kCommandStr LITERAL1
kCool LITERAL1
kCoolStr LITERAL1
kCoolingStr LITERAL1
+kCoolix48Bits LITERAL1
+kCoolix48ExtraTolerance LITERAL1
kCoolixAuto LITERAL1
kCoolixBitMark LITERAL1
kCoolixBitMarkTicks LITERAL1
@@ -1997,6 +2038,8 @@ kDenonZeroSpaceTicks LITERAL1
kDg11j104Str LITERAL1
kDg11j13aStr LITERAL1
kDg11j191Str LITERAL1
+kDirectIndirectModeStr LITERAL1
+kDirectStr LITERAL1
kDishBitMark LITERAL1
kDishBitMarkTicks LITERAL1
kDishBits LITERAL1
@@ -2478,6 +2521,7 @@ kHourStr LITERAL1
kHoursStr LITERAL1
kHumidStr LITERAL1
kIFeelStr LITERAL1
+kISeeStr LITERAL1
kIdStr LITERAL1
kIdleState LITERAL1
kInaxBitMark LITERAL1
@@ -2489,6 +2533,7 @@ kInaxMinRepeat LITERAL1
kInaxOneSpace LITERAL1
kInaxTick LITERAL1
kInaxZeroSpace LITERAL1
+kIndirectStr LITERAL1
kInsideStr LITERAL1
kIonStr LITERAL1
kJkeStr LITERAL1
@@ -2894,6 +2939,8 @@ kMitsubishiACStateLength LITERAL1
kMitsubishiAcAuto LITERAL1
kMitsubishiAcBitMark LITERAL1
kMitsubishiAcCool LITERAL1
+kMitsubishiAcDirect LITERAL1
+kMitsubishiAcDirectOff LITERAL1
kMitsubishiAcDry LITERAL1
kMitsubishiAcExtraTolerance LITERAL1
kMitsubishiAcFan LITERAL1
@@ -2905,6 +2952,7 @@ kMitsubishiAcFanSilent LITERAL1
kMitsubishiAcHdrMark LITERAL1
kMitsubishiAcHdrSpace LITERAL1
kMitsubishiAcHeat LITERAL1
+kMitsubishiAcIndirect LITERAL1
kMitsubishiAcMaxTemp LITERAL1
kMitsubishiAcMinTemp LITERAL1
kMitsubishiAcNoTimer LITERAL1
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.json b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.json
index 99160ec37..e1777f1c4 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.json
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.json
@@ -1,6 +1,6 @@
{
"name": "IRremoteESP8266",
- "version": "2.8.0",
+ "version": "2.8.1",
"keywords": "infrared, ir, remote, esp8266, esp32",
"description": "Send and receive infrared signals with multiple protocols (ESP8266/ESP32)",
"repository":
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.properties b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.properties
index e7580dd2d..5ee1f5229 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.properties
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/library.properties
@@ -1,5 +1,5 @@
name=IRremoteESP8266
-version=2.8.0
+version=2.8.1
author=David Conran, Sebastien Warin, Mark Szabo, Ken Shirriff
maintainer=David Conran, Mark Szabo, Sebastien Warin, Roi Dayan, Massimiliano Pinto, Christian Nilsson
sentence=Send and receive infrared signals with multiple protocols (ESP8266/ESP32)
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.cpp
index 557e5593e..f9d9647d3 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.cpp
@@ -16,6 +16,7 @@
#include "IRremoteESP8266.h"
#include "IRtext.h"
#include "IRutils.h"
+#include "ir_Airton.h"
#include "ir_Airwell.h"
#include "ir_Amcor.h"
#include "ir_Argo.h"
@@ -56,7 +57,7 @@
#ifndef STRCASECMP
#if defined(ESP8266)
#define STRCASECMP(LHS, RHS) \
- strcasecmp_P(LHS, reinterpret_cast(RHS))
+ strcasecmp_P(LHS, reinterpret_cast(RHS))
#else // ESP8266
#define STRCASECMP(LHS, RHS) strcasecmp(LHS, RHS)
#endif // ESP8266
@@ -152,9 +153,12 @@ stdAc::state_t IRac::getStatePrev(void) { return _prev; }
/// @return true if the protocol is supported by this class, otherwise false.
bool IRac::isProtocolSupported(const decode_type_t protocol) {
switch (protocol) {
+#if SEND_AIRTON
+ case decode_type_t::AIRTON:
+#endif // SEND_AIRTON
#if SEND_AIRWELL
case decode_type_t::AIRWELL:
-#endif
+#endif // SEND_AIRWELL
#if SEND_AMCOR
case decode_type_t::AMCOR:
#endif
@@ -326,6 +330,44 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
}
}
+#if SEND_AIRTON
+/// Send an Airton 56-bit A/C message with the supplied settings.
+/// @param[in, out] ac A Ptr to an IRAirtonAc object to use.
+/// @param[in] on The power setting.
+/// @param[in] mode The operation mode setting.
+/// @param[in] degrees The temperature setting in degrees.
+/// @param[in] fan The speed setting for the fan.
+/// @param[in] swingv The vertical swing setting.
+/// @param[in] turbo Run the device in turbo/powerful mode.
+/// @param[in] light Turn on the LED/Display mode.
+/// @param[in] econo Run the device in economical mode.
+/// @param[in] filter Turn on the (ion/pollen/health/etc) filter mode.
+/// @param[in] sleep Nr. of minutes for sleep mode.
+/// @note -1 is Off, >= 0 is on.
+void IRac::airton(IRAirtonAc *ac,
+ const bool on, const stdAc::opmode_t mode,
+ const float degrees, const stdAc::fanspeed_t fan,
+ const stdAc::swingv_t swingv, const bool turbo,
+ const bool light, const bool econo, const bool filter,
+ const int16_t sleep) {
+ ac->begin();
+ ac->setPower(on);
+ ac->setMode(ac->convertMode(mode));
+ ac->setTemp(degrees);
+ ac->setFan(ac->convertFan(fan));
+ ac->setSwingV(swingv != stdAc::swingv_t::kOff);
+ // No Quiet setting available.
+ ac->setLight(light);
+ ac->setHealth(filter);
+ ac->setTurbo(turbo);
+ ac->setEcono(econo);
+ // No Clean setting available.
+ // No Beep setting available.
+ ac->setSleep(sleep >= 0); // Convert to a boolean.
+ ac->send();
+}
+#endif // SEND_AIRTON
+
#if SEND_AIRWELL
/// Send an Airwell A/C message with the supplied settings.
/// @param[in, out] ac A Ptr to an IRAirwellAc object to use.
@@ -1530,6 +1572,7 @@ void IRac::mitsubishi(IRMitsubishiAC *ac,
ac->setVane(ac->convertSwingV(swingv));
ac->setWideVane(ac->convertSwingH(swingh));
if (quiet) ac->setFan(kMitsubishiAcFanSilent);
+ ac->setISave10C(false);
// No Turbo setting available.
// No Light setting available.
// No Filter setting available.
@@ -2116,11 +2159,12 @@ void IRac::teco(IRTecoAc *ac,
/// @param[in] swingv The vertical swing setting.
/// @param[in] turbo Run the device in turbo/powerful mode.
/// @param[in] econo Run the device in economical mode.
+/// @param[in] filter Turn on the (Pure/ion/pollen/etc) filter mode.
void IRac::toshiba(IRToshibaAC *ac,
const bool on, const stdAc::opmode_t mode,
const float degrees, const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv,
- const bool turbo, const bool econo) {
+ const bool turbo, const bool econo, const bool filter) {
ac->begin();
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees);
@@ -2133,7 +2177,7 @@ void IRac::toshiba(IRToshibaAC *ac,
ac->setTurbo(turbo);
ac->setEcono(econo);
// No Light setting available.
- // No Filter setting available.
+ ac->setFilter(filter);
// No Clean setting available.
// No Beep setting available.
// No Sleep setting available.
@@ -2603,6 +2647,16 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
#endif // (SEND_LG || SEND_SHARP_AC)
// Per vendor settings & setup.
switch (send.protocol) {
+#if SEND_AIRTON
+ case AIRTON:
+ {
+ IRAirtonAc ac(_pin, _inverted, _modulation);
+ airton(&ac, send.power, send.mode, degC, send.fanspeed,
+ send.swingv, send.turbo, send.light, send.econo, send.filter,
+ send.sleep);
+ break;
+ }
+#endif // SEND_AIRTON
#if SEND_AIRWELL
case AIRWELL:
{
@@ -3062,7 +3116,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
{
IRToshibaAC ac(_pin, _inverted, _modulation);
toshiba(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
- send.turbo, send.econo);
+ send.turbo, send.econo, send.filter);
break;
}
#endif // SEND_TOSHIBA_AC
@@ -3507,6 +3561,13 @@ namespace IRAcUtils {
/// An empty string if we can't.
String resultAcToString(const decode_results * const result) {
switch (result->decode_type) {
+#if DECODE_AIRTON
+ case decode_type_t::AIRTON: {
+ IRAirtonAc ac(kGpioUnused);
+ ac.setRaw(result->value); // AIRTON uses value instead of state.
+ return ac.toString();
+ }
+#endif // DECODE_AIRTON
#if DECODE_AIRWELL
case decode_type_t::AIRWELL: {
IRAirwellAc ac(kGpioUnused);
@@ -3931,6 +3992,14 @@ namespace IRAcUtils {
) {
if (decode == NULL || result == NULL) return false; // Safety check.
switch (decode->decode_type) {
+#if DECODE_AIRTON
+ case decode_type_t::AIRTON: {
+ IRAirtonAc ac(kGpioUnused);
+ ac.setRaw(decode->value); // Uses value instead of state.
+ *result = ac.toCommon();
+ break;
+ }
+#endif // DECODE_AIRTON
#if DECODE_AIRWELL
case decode_type_t::AIRWELL: {
IRAirwellAc ac(kGpioUnused);
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.h
index afa4bcee0..9954eecb0 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.h
@@ -7,6 +7,7 @@
#include
#endif
#include "IRremoteESP8266.h"
+#include "ir_Airton.h"
#include "ir_Airwell.h"
#include "ir_Amcor.h"
#include "ir_Argo.h"
@@ -109,6 +110,14 @@ class IRac {
bool _inverted; ///< IR LED is lit when GPIO is LOW (true) or HIGH (false)?
bool _modulation; ///< Is frequency modulation to be used?
stdAc::state_t _prev; ///< The state we expect the device to currently be in.
+#if SEND_AIRTON
+ void airton(IRAirtonAc *ac,
+ const bool on, const stdAc::opmode_t mode,
+ const float degrees, const stdAc::fanspeed_t fan,
+ const stdAc::swingv_t swingv, const bool turbo,
+ const bool light, const bool econo, const bool filter,
+ const int16_t sleep = -1);
+#endif // SEND_AIRTON
#if SEND_AIRWELL
void airwell(IRAirwellAc *ac,
const bool on, const stdAc::opmode_t mode, const float degrees,
@@ -457,7 +466,7 @@ void electra(IRElectraAc *ac,
void toshiba(IRToshibaAC *ac,
const bool on, const stdAc::opmode_t mode, const float degrees,
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
- const bool turbo, const bool econo);
+ const bool turbo, const bool econo, const bool filter);
#endif // SEND_TOSHIBA_AC
#if SEND_TROTEC
void trotec(IRTrotecESP *ac,
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.cpp
index 4970dcf0b..5b9d91b88 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.cpp
@@ -13,7 +13,7 @@ extern "C" {
}
#endif // ESP8266
#include
-#endif
+#endif // UNIT_TEST
#include
#ifdef UNIT_TEST
#include
@@ -56,6 +56,20 @@ static ETSTimer timer;
} // namespace _IRrecv
#endif // ESP8266
#if defined(ESP32)
+// We need a horrible timer hack for ESP32 Arduino framework < v2.0.0
+#if !defined(_ESP32_IRRECV_TIMER_HACK)
+// Version check
+#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) )
+// No need for the hack if we are running version >= 2.0.0
+#define _ESP32_IRRECV_TIMER_HACK false
+#else // Version check
+// If no ESP_ARDUINO_VERSION_MAJOR is defined, or less than 2, then we are
+// using an old ESP32 core, so we need the hack.
+#define _ESP32_IRRECV_TIMER_HACK true
+#endif // Version check
+#endif // !defined(_ESP32_IRRECV_TIMER_HACK)
+
+#if _ESP32_IRRECV_TIMER_HACK
// Required structs/types from:
// https://github.com/espressif/arduino-esp32/blob/6b0114366baf986c155e8173ab7c22bc0c5fcedc/cores/esp32/esp32-hal-timer.c#L28-L58
// These are needed to be able to directly manipulate the timer registers from
@@ -117,7 +131,7 @@ typedef struct hw_timer_s {
uint8_t timer;
portMUX_TYPE lock;
} hw_timer_t;
-// End of Horrible Hack.
+#endif // _ESP32_IRRECV_TIMER_HACK / End of Horrible Hack.
namespace _IRrecv {
static hw_timer_t * timer = NULL;
@@ -211,6 +225,7 @@ static void USE_IRAM_ATTR gpio_intr() {
#if defined(ESP32)
// Reset the timeout.
//
+#if _ESP32_IRRECV_TIMER_HACK
// The following three lines of code are the equiv of:
// `timerWrite(timer, 0);`
// We can't call that routine safely from inside an ISR as that procedure
@@ -226,6 +241,10 @@ static void USE_IRAM_ATTR gpio_intr() {
// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1350
// @see https://github.com/espressif/arduino-esp32/blob/6b0114366baf986c155e8173ab7c22bc0c5fcedc/cores/esp32/esp32-hal-timer.c#L176-L178
timer->dev->config.alarm_en = 1;
+#else // _ESP32_IRRECV_TIMER_HACK
+ timerWrite(timer, 0);
+ timerAlarmEnable(timer);
+#endif // _ESP32_IRRECV_TIMER_HACK
#endif // ESP32
}
#endif // UNIT_TEST
@@ -337,7 +356,9 @@ void IRrecv::enableIRIn(const bool pullup) {
// Set the timer so it only fires once, and set it's trigger in uSeconds.
timerAlarmWrite(timer, MS_TO_USEC(params.timeout), ONCE);
// Note: Interrupt needs to be attached before it can be enabled or disabled.
- timerAttachInterrupt(timer, &read_timeout, true);
+ // Note: EDGE (true) is not supported, use LEVEL (false). Ref: #1713
+ // See: https://github.com/espressif/arduino-esp32/blob/caef4006af491130136b219c1205bdcf8f08bf2b/cores/esp32/esp32-hal-timer.c#L224-L227
+ timerAttachInterrupt(timer, &read_timeout, false);
#endif // ESP32
// Initialise state machine variables
@@ -695,9 +716,9 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
if (decodeSharp(results, offset)) return true;
#endif
#if DECODE_COOLIX
- DPRINTLN("Attempting Coolix decode");
+ DPRINTLN("Attempting Coolix 24-bit decode");
if (decodeCOOLIX(results, offset)) return true;
-#endif
+#endif // DECODE_COOLIX
#if DECODE_NIKAI
DPRINTLN("Attempting Nikai decode");
if (decodeNikai(results, offset)) return true;
@@ -1047,6 +1068,10 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
DPRINTLN("Attempting Airton decode");
if (decodeAirton(results, offset)) return true;
#endif // DECODE_AIRTON
+#if DECODE_COOLIX48
+ DPRINTLN("Attempting Coolix 48-bit decode");
+ if (decodeCoolix48(results, offset)) return true;
+#endif // DECODE_COOLIX48
// Typically new protocols are added above this line.
}
#if DECODE_HASH
@@ -1079,7 +1104,7 @@ uint32_t IRrecv::ticksLow(const uint32_t usecs, const uint8_t tolerance,
// max() used to ensure the result can't drop below 0 before the cast.
return ((uint32_t)std::max(
(int32_t)(usecs * (1.0 - _validTolerance(tolerance) / 100.0) - delta),
- 0));
+ (int32_t)0));
}
/// Calculate the upper bound of the nr. of ticks.
@@ -1162,7 +1187,8 @@ bool IRrecv::matchAtLeast(uint32_t measured, uint32_t desired,
// We really should never get a value of 0, except as the last value
// in the buffer. If that is the case, then assume infinity and return true.
if (measured == 0) return true;
- return measured >= ticksLow(std::min(desired, MS_TO_USEC(params.timeout)),
+ return measured >= ticksLow(std::min(desired,
+ (uint32_t)MS_TO_USEC(params.timeout)),
tolerance, delta);
}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.h
index f4932b5a6..75070172d 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRrecv.h
@@ -419,7 +419,12 @@ class IRrecv {
bool decodeCOOLIX(decode_results *results, uint16_t offset = kStartOffset,
const uint16_t nbits = kCoolixBits,
const bool strict = true);
-#endif
+#endif // DECODE_COOLIX
+#if DECODE_COOLIX48
+ bool decodeCoolix48(decode_results *results, uint16_t offset = kStartOffset,
+ const uint16_t nbits = kCoolix48Bits,
+ const bool strict = true);
+#endif // DECODE_COOLIX48
#if DECODE_DENON
bool decodeDenon(decode_results *results, uint16_t offset = kStartOffset,
const uint16_t nbits = kDenonBits,
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRremoteESP8266.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRremoteESP8266.h
index 09a3011ce..3cd19a81d 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRremoteESP8266.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRremoteESP8266.h
@@ -52,8 +52,29 @@
#include
#endif // UNIT_TEST
-// Library Version
-#define _IRREMOTEESP8266_VERSION_ "2.8.0"
+// Library Version Information
+// Major version number (X.x.x)
+#define _IRREMOTEESP8266_VERSION_MAJOR 2
+// Minor version number (x.X.x)
+#define _IRREMOTEESP8266_VERSION_MINOR 8
+// Patch version number (x.x.X)
+#define _IRREMOTEESP8266_VERSION_PATCH 1
+// Macro to convert version info into an integer
+#define _IRREMOTEESP8266_VERSION_VAL(major, minor, patch) \
+ ((major << 16) | (minor << 8) | (patch))
+// Macro to convert literal into a string
+#define MKSTR(x) #x
+// Integer version
+#define _IRREMOTEESP8266_VERSION _IRREMOTEESP8266_VERSION_VAL(\
+ _IRREMOTEESP8266_VERSION_MAJOR, \
+ _IRREMOTEESP8266_VERSION_MINOR, \
+ _IRREMOTEESP8266_VERSION_PATCH)
+// String version
+#define _IRREMOTEESP8266_VERSION_STR MKSTR(_IRREMOTEESP8266_VERSION_MAJOR) "." \
+ MKSTR(_IRREMOTEESP8266_VERSION_MINOR) "." \
+ MKSTR(_IRREMOTEESP8266_VERSION_PATCH)
+// String version (DEPRECATED)
+#define _IRREMOTEESP8266_VERSION_ _IRREMOTEESP8266_VERSION_STR
// Set the language & locale for the library. See the `locale` dir for options.
#ifndef _IR_LOCALE_
@@ -314,6 +335,13 @@
#define SEND_COOLIX _IR_ENABLE_DEFAULT_
#endif // SEND_COOLIX
+#ifndef DECODE_COOLIX48
+#define DECODE_COOLIX48 _IR_ENABLE_DEFAULT_
+#endif // DECODE_COOLIX48
+#ifndef SEND_COOLIX48
+#define SEND_COOLIX48 _IR_ENABLE_DEFAULT_
+#endif // SEND_COOLIX48
+
#ifndef DECODE_GLOBALCACHE
#define DECODE_GLOBALCACHE false // Not applicable.
#endif // DECODE_GLOBALCACHE
@@ -975,8 +1003,9 @@ enum decode_type_t {
ARRIS,
RHOSS,
AIRTON,
+ COOLIX48, // 110
// Add new entries before this one, and update it to point to the last entry.
- kLastDecodeType = AIRTON,
+ kLastDecodeType = COOLIX48,
};
// Message lengths & required repeat values
@@ -998,6 +1027,7 @@ const uint16_t kArgoBits = kArgoStateLength * 8;
const uint16_t kArgoDefaultRepeat = kNoRepeat;
const uint16_t kArrisBits = 32;
const uint16_t kCoolixBits = 24;
+const uint16_t kCoolix48Bits = kCoolixBits * 2;
const uint16_t kCoolixDefaultRepeat = kSingleRepeat;
const uint16_t kCarrierAcBits = 32;
const uint16_t kCarrierAcMinRepeat = kNoRepeat;
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.cpp
index e20b97045..e0a66e068 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.cpp
@@ -560,6 +560,7 @@ uint16_t IRsend::minRepeats(const decode_type_t protocol) {
case AIWA_RC_T501:
case AMCOR:
case COOLIX:
+ case COOLIX48:
case ELITESCREENS:
case GICABLE:
case INAX:
@@ -661,6 +662,7 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
return kDoshishaBits; // 40
case SANYO_LC7461:
return kSanyoLC7461Bits; // 42
+ case COOLIX48:
case GOODWEATHER:
case KELON:
case MIDEA:
@@ -829,7 +831,12 @@ bool IRsend::send(const decode_type_t type, const uint64_t data,
case COOLIX:
sendCOOLIX(data, nbits, min_repeat);
break;
-#endif
+#endif // SEND_COOLIX
+#if SEND_COOLIX48
+ case COOLIX48:
+ sendCoolix48(data, nbits, min_repeat);
+ break;
+#endif // SEND_COOLIX48
#if SEND_DAIKIN64
case DAIKIN64:
sendDaikin64(data, nbits, min_repeat);
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.h
index d55ce0238..3696eb40f 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRsend.h
@@ -42,78 +42,78 @@ const uint32_t kDefaultMessageGap = 100000;
/// Enumerators and Structures for the Common A/C API.
namespace stdAc {
- /// Common A/C settings for A/C operating modes.
- enum class opmode_t {
- kOff = -1,
- kAuto = 0,
- kCool = 1,
- kHeat = 2,
- kDry = 3,
- kFan = 4,
- // Add new entries before this one, and update it to point to the last entry
- kLastOpmodeEnum = kFan,
- };
+/// Common A/C settings for A/C operating modes.
+enum class opmode_t {
+ kOff = -1,
+ kAuto = 0,
+ kCool = 1,
+ kHeat = 2,
+ kDry = 3,
+ kFan = 4,
+ // Add new entries before this one, and update it to point to the last entry
+ kLastOpmodeEnum = kFan,
+};
- /// Common A/C settings for Fan Speeds.
- enum class fanspeed_t {
- kAuto = 0,
- kMin = 1,
- kLow = 2,
- kMedium = 3,
- kHigh = 4,
- kMax = 5,
- // Add new entries before this one, and update it to point to the last entry
- kLastFanspeedEnum = kMax,
- };
+/// Common A/C settings for Fan Speeds.
+enum class fanspeed_t {
+ kAuto = 0,
+ kMin = 1,
+ kLow = 2,
+ kMedium = 3,
+ kHigh = 4,
+ kMax = 5,
+ // Add new entries before this one, and update it to point to the last entry
+ kLastFanspeedEnum = kMax,
+};
- /// Common A/C settings for Vertical Swing.
- enum class swingv_t {
- kOff = -1,
- kAuto = 0,
- kHighest = 1,
- kHigh = 2,
- kMiddle = 3,
- kLow = 4,
- kLowest = 5,
- // Add new entries before this one, and update it to point to the last entry
- kLastSwingvEnum = kLowest,
- };
+/// Common A/C settings for Vertical Swing.
+enum class swingv_t {
+ kOff = -1,
+ kAuto = 0,
+ kHighest = 1,
+ kHigh = 2,
+ kMiddle = 3,
+ kLow = 4,
+ kLowest = 5,
+ // Add new entries before this one, and update it to point to the last entry
+ kLastSwingvEnum = kLowest,
+};
- /// Common A/C settings for Horizontal Swing.
- enum class swingh_t {
- kOff = -1,
- kAuto = 0, // a.k.a. On.
- kLeftMax = 1,
- kLeft = 2,
- kMiddle = 3,
- kRight = 4,
- kRightMax = 5,
- kWide = 6, // a.k.a. left & right at the same time.
- // Add new entries before this one, and update it to point to the last entry
- kLastSwinghEnum = kWide,
- };
+/// Common A/C settings for Horizontal Swing.
+enum class swingh_t {
+ kOff = -1,
+ kAuto = 0, // a.k.a. On.
+ kLeftMax = 1,
+ kLeft = 2,
+ kMiddle = 3,
+ kRight = 4,
+ kRightMax = 5,
+ kWide = 6, // a.k.a. left & right at the same time.
+ // Add new entries before this one, and update it to point to the last entry
+ kLastSwinghEnum = kWide,
+};
- /// Structure to hold a common A/C state.
- typedef struct {
- decode_type_t protocol;
- int16_t model;
- bool power;
- stdAc::opmode_t mode;
- float degrees;
- bool celsius;
- stdAc::fanspeed_t fanspeed;
- stdAc::swingv_t swingv;
- stdAc::swingh_t swingh;
- bool quiet;
- bool turbo;
- bool econo;
- bool light;
- bool filter;
- bool clean;
- bool beep;
- int16_t sleep;
- int16_t clock;
- } state_t;
+/// Structure to hold a common A/C state.
+struct state_t {
+ decode_type_t protocol;
+ int16_t model;
+ bool power;
+ stdAc::opmode_t mode;
+ float degrees;
+ bool celsius;
+ stdAc::fanspeed_t fanspeed;
+ stdAc::swingv_t swingv;
+ stdAc::swingh_t swingh;
+ bool quiet;
+ bool turbo;
+ bool econo;
+ bool light;
+ bool filter;
+ bool clean;
+ bool beep;
+ int16_t sleep;
+ int16_t clock;
+};
}; // namespace stdAc
/// Fujitsu A/C model numbers
@@ -381,9 +381,13 @@ class IRsend {
uint16_t repeat = kNoRepeat);
#endif
#if SEND_COOLIX
- void sendCOOLIX(uint64_t data, uint16_t nbits = kCoolixBits,
- uint16_t repeat = kCoolixDefaultRepeat);
-#endif
+ void sendCOOLIX(const uint64_t data, const uint16_t nbits = kCoolixBits,
+ const uint16_t repeat = kCoolixDefaultRepeat);
+#endif // SEND_COOLIX
+#if SEND_COOLIX48
+ void sendCoolix48(const uint64_t data, const uint16_t nbits = kCoolix48Bits,
+ const uint16_t repeat = kCoolixDefaultRepeat);
+#endif // SEND_COOLIX48
#if SEND_WHYNTER
void sendWhynter(const uint64_t data, const uint16_t nbits = kWhynterBits,
const uint16_t repeat = kNoRepeat);
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.cpp
index a580bff9f..077e7b0e7 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.cpp
@@ -81,6 +81,14 @@ IRTEXT_CONST_STRING(kHoldStr, D_STR_HOLD); ///< "Hold"
IRTEXT_CONST_STRING(kButtonStr, D_STR_BUTTON); ///< "Button"
IRTEXT_CONST_STRING(k8CHeatStr, D_STR_8C_HEAT); ///< "8C Heat"
IRTEXT_CONST_STRING(k10CHeatStr, D_STR_10C_HEAT); ///< "10C Heat"
+IRTEXT_CONST_STRING(kISeeStr, D_STR_ISEE); ///< "ISee"
+IRTEXT_CONST_STRING(kAbsenseDetectStr, D_STR_ABSENSEDETECT);
+ ///< "AbsenseDetect"
+IRTEXT_CONST_STRING(kDirectIndirectModeStr, D_STR_DIRECTINDIRECTMODE);
+ ///< "Direct/Indirect mode"
+IRTEXT_CONST_STRING(kDirectStr, D_STR_DIRECT); ///< "Direct"
+IRTEXT_CONST_STRING(kIndirectStr, D_STR_INDIRECT); ///< "Indirect"
+
IRTEXT_CONST_STRING(kNightStr, D_STR_NIGHT); ///< "Night"
IRTEXT_CONST_STRING(kSilentStr, D_STR_SILENT); ///< "Silent"
IRTEXT_CONST_STRING(kFilterStr, D_STR_FILTER); ///< "Filter"
@@ -382,6 +390,7 @@ IRTEXT_CONST_BLOB_DECL(kAllProtocolNamesStr) {
D_STR_ARRIS "\x0"
D_STR_RHOSS "\x0"
D_STR_AIRTON "\x0"
+ D_STR_COOLIX48 "\x0"
///< New protocol strings should be added just above this line.
"\x0" ///< This string requires double null termination.
};
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.h
index ee8ea5934..031f73879 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRtext.h
@@ -231,5 +231,11 @@ extern IRTEXT_CONST_PTR(kYbofbStr);
extern IRTEXT_CONST_PTR(kYesStr);
extern IRTEXT_CONST_PTR(kZoneFollowStr);
extern IRTEXT_CONST_PTR(kAllProtocolNamesStr);
+extern IRTEXT_CONST_PTR(kISeeStr);
+extern IRTEXT_CONST_PTR(kEcocoolStr);
+extern IRTEXT_CONST_PTR(kAbsenseDetectStr);
+extern IRTEXT_CONST_PTR(kDirectIndirectModeStr);
+extern IRTEXT_CONST_PTR(kDirectStr);
+extern IRTEXT_CONST_PTR(kIndirectStr);
#endif // IRTEXT_H_
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.cpp
index d3a83c507..e1f889966 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.cpp
@@ -1049,6 +1049,21 @@ namespace irutils {
return nibbleonly ? sum & 0xF : sum;
}
+ /// Sum all the bytes together in an integer.
+ /// @param[in] data The integer to be summed.
+ /// @param[in] count The number of bytes to sum. Starts from LSB. Max of 8.
+ /// @param[in] init Starting value of the calculation to use. (Default is 0)
+ /// @param[in] byteonly true, the result is 8 bits. false, it's 16 bits.
+ /// @return The 8/16-bit calculated result of all the bytes and init value.
+ uint16_t sumBytes(const uint64_t data, const uint8_t count,
+ const uint8_t init, const bool byteonly) {
+ uint16_t sum = init;
+ uint64_t copy = data;
+ const uint8_t nrofbytes = (count < 8) ? count : (64 / 8);
+ for (uint8_t i = 0; i < nrofbytes; i++, copy >>= 8) sum += (copy & 0xFF);
+ return byteonly ? sum & 0xFF : sum;
+ }
+
/// Convert a byte of Binary Coded Decimal(BCD) into an Integer.
/// @param[in] bcd The BCD value.
/// @return A normal Integer value.
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.h
index 61fe8b269..a5dcde043 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRutils.h
@@ -94,6 +94,8 @@ namespace irutils {
const uint8_t init = 0);
uint8_t sumNibbles(const uint64_t data, const uint8_t count = 16,
const uint8_t init = 0, const bool nibbleonly = true);
+ uint16_t sumBytes(const uint64_t data, const uint8_t count = 8,
+ const uint8_t init = 0, const bool byteonly = true);
uint8_t bcdToUint8(const uint8_t bcd);
uint8_t uint8ToBcd(const uint8_t integer);
bool getBit(const uint64_t data, const uint8_t position,
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Airton.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Airton.cpp
index 507894f37..83ad95ef7 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Airton.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Airton.cpp
@@ -3,12 +3,11 @@
/// @brief Support for Airton protocol
/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1670
-// Supports:
-// Brand: Airton, Model: SMVH09B-2A2A3NH ref. 409730 A/C
-// Brand: Airton, Model: RD1A1 remote
-
+#include "ir_Airton.h"
+#include
#include "IRrecv.h"
#include "IRsend.h"
+#include "IRtext.h"
#include "IRutils.h"
const uint16_t kAirtonHdrMark = 6630;
@@ -18,6 +17,12 @@ const uint16_t kAirtonOneSpace = 1260;
const uint16_t kAirtonZeroSpace = 430;
const uint16_t kAirtonFreq = 38000; // Hz. (Just a guess)
+using irutils::addBoolToString;
+using irutils::addModeToString;
+using irutils::addFanToString;
+using irutils::addTempToString;
+using irutils::sumBytes;
+
#if SEND_AIRTON
// Function should be safe up to 64 bits.
/// Send a Airton formatted message.
@@ -59,7 +64,8 @@ bool IRrecv::decodeAirton(decode_results *results, uint16_t offset,
kAirtonBitMark, kAirtonZeroSpace,
kAirtonBitMark, kDefaultMessageGap,
true, kUseDefTol, kMarkExcess, false)) return false;
-
+ // Compliance
+ if (strict && !IRAirtonAc::validChecksum(results->value)) return false;
// Success
results->decode_type = decode_type_t::AIRTON;
results->bits = nbits;
@@ -68,3 +74,289 @@ bool IRrecv::decodeAirton(decode_results *results, uint16_t offset,
return true;
}
#endif // DECODE_AIRTON
+
+/// Class constructor
+/// @param[in] pin GPIO to be used when sending.
+/// @param[in] inverted Is the output signal to be inverted?
+/// @param[in] use_modulation Is frequency modulation to be used?
+IRAirtonAc::IRAirtonAc(const uint16_t pin, const bool inverted,
+ const bool use_modulation)
+ : _irsend(pin, inverted, use_modulation) { stateReset(); }
+
+/// Set up hardware to be able to send a message.
+void IRAirtonAc::begin(void) { _irsend.begin(); }
+
+#if SEND_AIRTON
+/// Send the current internal state as an IR message.
+/// @param[in] repeat Nr. of times the message will be repeated.
+void IRAirtonAc::send(const uint16_t repeat) {
+ _irsend.sendAirton(getRaw(), kAirtonBits, repeat);
+}
+#endif // SEND_AIRTON
+
+/// Calculate the checksum for the supplied state.
+/// @param[in] state The source state to generate the checksum from.
+/// @return The checksum value.
+uint8_t IRAirtonAc::calcChecksum(const uint64_t state) {
+ return (uint8_t)(0x7F - sumBytes(state, 6)) ^ 0x2C;
+}
+
+/// Verify the checksum is valid for a given state.
+/// @param[in] state The value to verify the checksum of.
+/// @return A boolean indicating if it's checksum is valid.
+bool IRAirtonAc::validChecksum(const uint64_t state) {
+ AirtonProtocol p;
+ p.raw = state;
+ return p.Sum == IRAirtonAc::calcChecksum(state);
+}
+
+/// Update the checksum value for the internal state.
+void IRAirtonAc::checksum(void) { _.Sum = IRAirtonAc::calcChecksum(_.raw); }
+
+/// Reset the internals of the object to a known good state.
+void IRAirtonAc::stateReset(void) { setRaw(0x11D3); }
+
+/// Get the raw state of the object, suitable to be sent with the appropriate
+/// IRsend object method.
+/// @return A copy to the internal state.
+uint64_t IRAirtonAc::getRaw(void) {
+ checksum(); // Ensure correct bit array before returning
+ return _.raw;
+}
+
+/// Set the raw state of the object.
+/// @param[in] state The raw state from the native IR message.
+void IRAirtonAc::setRaw(const uint64_t state) { _.raw = state; }
+
+
+/// Set the internal state to have the power on.
+void IRAirtonAc::on(void) { setPower(true); }
+
+/// Set the internal state to have the power off.
+void IRAirtonAc::off(void) { setPower(false); }
+
+/// Set the internal state to have the desired power.
+/// @param[in] on The desired power state.
+void IRAirtonAc::setPower(const bool on) {
+ _.Power = on;
+ setMode(getMode()); // Re-do the mode incase we need to do something special.
+}
+
+/// Get the power setting from the internal state.
+/// @return A boolean indicating the power setting.
+bool IRAirtonAc::getPower(void) const { return _.Power; }
+
+/// Get the current operation mode setting.
+/// @return The current operation mode.
+uint8_t IRAirtonAc::getMode(void) const { return _.Mode; }
+
+/// Set the desired operation mode.
+/// @param[in] mode The desired operation mode.
+void IRAirtonAc::setMode(const uint8_t mode) {
+ // Changing the mode always removes the sleep setting.
+ if (mode != _.Mode) setSleep(false);
+ // Set the actual mode.
+ _.Mode = (mode > kAirtonHeat) ? kAirtonAuto : mode;
+ // Handle special settings for each mode.
+ switch (_.Mode) {
+ case kAirtonAuto:
+ setTemp(25); // Auto has a fixed temp.
+ _.NotAutoOn = !getPower();
+ break;
+ case kAirtonHeat:
+ // When powered on and in Heat mode, set a special bit.
+ _.HeatOn = getPower();
+ // FALL-THRU
+ default:
+ _.NotAutoOn = true;
+ }
+ // Reset the economy setting if we need to.
+ setEcono(getEcono());
+}
+
+/// Convert a stdAc::opmode_t enum into its native mode.
+/// @param[in] mode The enum to be converted.
+/// @return The native equivalent of the enum.
+uint8_t IRAirtonAc::convertMode(const stdAc::opmode_t mode) {
+ switch (mode) {
+ case stdAc::opmode_t::kCool: return kAirtonCool;
+ case stdAc::opmode_t::kHeat: return kAirtonHeat;
+ case stdAc::opmode_t::kDry: return kAirtonDry;
+ case stdAc::opmode_t::kFan: return kAirtonFan;
+ default: return kAirtonAuto;
+ }
+}
+
+/// Convert a native mode into its stdAc equivalent.
+/// @param[in] mode The native setting to be converted.
+/// @return The stdAc equivalent of the native setting.
+stdAc::opmode_t IRAirtonAc::toCommonMode(const uint8_t mode) {
+ switch (mode) {
+ case kAirtonCool: return stdAc::opmode_t::kCool;
+ case kAirtonHeat: return stdAc::opmode_t::kHeat;
+ case kAirtonDry: return stdAc::opmode_t::kDry;
+ case kAirtonFan: return stdAc::opmode_t::kFan;
+ default: return stdAc::opmode_t::kAuto;
+ }
+}
+
+/// Set the temperature.
+/// @param[in] degrees The temperature in degrees celsius.
+void IRAirtonAc::setTemp(const uint8_t degrees) {
+ uint8_t temp = std::max(kAirtonMinTemp, degrees);
+ temp = std::min(kAirtonMaxTemp, temp);
+ if (_.Mode == kAirtonAuto) temp = kAirtonMaxTemp; // Auto has a fixed temp.
+ _.Temp = temp - kAirtonMinTemp;
+}
+
+/// Get the current temperature setting.
+/// @return Get current setting for temp. in degrees celsius.
+uint8_t IRAirtonAc::getTemp(void) const { return _.Temp + kAirtonMinTemp; }
+
+
+/// Set the speed of the fan.
+/// @param[in] speed The desired setting.
+void IRAirtonAc::setFan(const uint8_t speed) {
+ _.Fan = (speed > kAirtonFanMax) ? kAirtonFanAuto : speed;
+}
+
+/// Get the current fan speed setting.
+/// @return The current fan speed.
+uint8_t IRAirtonAc::getFan(void) const { return _.Fan; }
+
+/// Convert a stdAc::fanspeed_t enum into it's native speed.
+/// @param[in] speed The enum to be converted.
+/// @return The native equivalent of the enum.
+uint8_t IRAirtonAc::convertFan(const stdAc::fanspeed_t speed) {
+ switch (speed) {
+ case stdAc::fanspeed_t::kMin: return kAirtonFanMin;
+ case stdAc::fanspeed_t::kLow: return kAirtonFanLow;
+ case stdAc::fanspeed_t::kMedium: return kAirtonFanMed;
+ case stdAc::fanspeed_t::kHigh: return kAirtonFanHigh;
+ case stdAc::fanspeed_t::kMax: return kAirtonFanMax;
+ default: return kAirtonFanAuto;
+ }
+}
+
+/// Convert a native fan speed into its stdAc equivalent.
+/// @param[in] speed The native setting to be converted.
+/// @return The stdAc equivalent of the native setting.
+stdAc::fanspeed_t IRAirtonAc::toCommonFanSpeed(const uint8_t speed) {
+ switch (speed) {
+ case kAirtonFanMax: return stdAc::fanspeed_t::kMax;
+ case kAirtonFanHigh: return stdAc::fanspeed_t::kHigh;
+ case kAirtonFanMed: return stdAc::fanspeed_t::kMedium;
+ case kAirtonFanLow: return stdAc::fanspeed_t::kLow;
+ case kAirtonFanMin: return stdAc::fanspeed_t::kMin;
+ default: return stdAc::fanspeed_t::kAuto;
+ }
+}
+
+/// Set the Vertical Swing setting of the A/C.
+/// @param[in] on true, the setting is on. false, the setting is off.
+void IRAirtonAc::setSwingV(const bool on) { _.SwingV = on; }
+
+/// Get the Vertical Swing setting of the A/C.
+/// @return true, the setting is on. false, the setting is off.
+bool IRAirtonAc::getSwingV(void) const { return _.SwingV; }
+
+/// Set the Light/LED/Display setting of the A/C.
+/// @param[in] on true, the setting is on. false, the setting is off.
+void IRAirtonAc::setLight(const bool on) { _.Light = on; }
+
+/// Get the Light/LED/Display setting of the A/C.
+/// @return true, the setting is on. false, the setting is off.
+bool IRAirtonAc::getLight(void) const { return _.Light; }
+
+/// Set the Economy setting of the A/C.
+/// @param[in] on true, the setting is on. false, the setting is off.
+/// @note Only available in Cool mode.
+void IRAirtonAc::setEcono(const bool on) {
+ _.Econo = on && (getMode() == kAirtonCool);
+}
+
+/// Get the Economy setting of the A/C.
+/// @return true, the setting is on. false, the setting is off.
+bool IRAirtonAc::getEcono(void) const { return _.Econo; }
+
+/// Set the Turbo setting of the A/C.
+/// @param[in] on true, the setting is on. false, the setting is off.
+void IRAirtonAc::setTurbo(const bool on) {
+ _.Turbo = on;
+ // Pressing the turbo button sets the fan to max as well.
+ if (on) setFan(kAirtonFanMax);
+}
+
+/// Get the Turbo setting of the A/C.
+/// @return true, the setting is on. false, the setting is off.
+bool IRAirtonAc::getTurbo(void) const { return _.Turbo; }
+
+/// Set the Sleep setting of the A/C.
+/// @param[in] on true, the setting is on. false, the setting is off.
+/// @note Sleep not available in fan or auto mode.
+void IRAirtonAc::setSleep(const bool on) {
+ switch (getMode()) {
+ case kAirtonAuto:
+ case kAirtonFan: _.Sleep = false; break;
+ default: _.Sleep = on;
+ }
+}
+
+/// Get the Sleep setting of the A/C.
+/// @return true, the setting is on. false, the setting is off.
+bool IRAirtonAc::getSleep(void) const { return _.Sleep; }
+
+/// Set the Health/Filter setting of the A/C.
+/// @param[in] on true, the setting is on. false, the setting is off.
+void IRAirtonAc::setHealth(const bool on) { _.Health = on; }
+
+/// Get the Health/Filter setting of the A/C.
+/// @return true, the setting is on. false, the setting is off.
+bool IRAirtonAc::getHealth(void) const { return _.Health; }
+
+/// Convert the current internal state into its stdAc::state_t equivalent.
+/// @return The stdAc equivalent of the native settings.
+stdAc::state_t IRAirtonAc::toCommon(void) const {
+ stdAc::state_t result;
+ result.protocol = decode_type_t::AIRTON;
+ result.power = getPower();
+ result.mode = toCommonMode(getMode());
+ result.celsius = true;
+ result.degrees = getTemp();
+ result.fanspeed = toCommonFanSpeed(getFan());
+ result.swingv = getSwingV() ? stdAc::swingv_t::kAuto : stdAc::swingv_t::kOff;
+ result.econo = getEcono();
+ result.turbo = getTurbo();
+ result.filter = getHealth();
+ result.light = getLight();
+ result.sleep = getSleep() ? 0 : -1;
+ // Not supported.
+ result.model = -1;
+ result.swingh = stdAc::swingh_t::kOff;
+ result.quiet = false;
+ result.clean = false;
+ result.beep = false;
+ result.clock = -1;
+ return result;
+}
+
+/// Convert the current internal state into a human readable string.
+/// @return A human readable string.
+String IRAirtonAc::toString(void) const {
+ String result = "";
+ result.reserve(135); // Reserve some heap for the string to reduce fragging.
+ result += addBoolToString(getPower(), kPowerStr, false);
+ result += addModeToString(_.Mode, kAirtonAuto, kAirtonCool,
+ kAirtonHeat, kAirtonDry, kAirtonFan);
+ result += addFanToString(_.Fan, kAirtonFanHigh, kAirtonFanLow,
+ kAirtonFanAuto, kAirtonFanMin, kAirtonFanMed,
+ kAirtonFanMax);
+ result += addTempToString(getTemp());
+ result += addBoolToString(getSwingV(), kSwingVStr);
+ result += addBoolToString(getEcono(), kEconoStr);
+ result += addBoolToString(getTurbo(), kTurboStr);
+ result += addBoolToString(getLight(), kLightStr);
+ result += addBoolToString(getHealth(), kHealthStr);
+ result += addBoolToString(getSleep(), kSleepStr);
+ return result;
+}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Airton.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Airton.h
new file mode 100644
index 000000000..9b5e89f3f
--- /dev/null
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Airton.h
@@ -0,0 +1,134 @@
+// Copyright 2021 David Conran (crankyoldgit)
+/// @file
+/// @brief Support for Airton protocol
+/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1670
+
+// Supports:
+// Brand: Airton, Model: SMVH09B-2A2A3NH ref. 409730 A/C
+// Brand: Airton, Model: RD1A1 remote
+
+#ifndef IR_AIRTON_H_
+#define IR_AIRTON_H_
+
+#define __STDC_LIMIT_MACROS
+#include
+#ifndef UNIT_TEST
+#include
+#endif
+#include "IRremoteESP8266.h"
+#include "IRsend.h"
+#ifdef UNIT_TEST
+#include "IRsend_test.h"
+#endif
+
+/// Native representation of a Airton 56 A/C message.
+/// @see https://docs.google.com/spreadsheets/d/1Kpq7WCkh85heLnTQGlwUfCR6eeu_vfBHvhii8wtP4LU/edit?usp=sharing
+union AirtonProtocol{
+ uint64_t raw; ///< The state in code form.
+ struct { // Common
+ // Byte 1 & 0 (LSB)
+ uint16_t Header :16; // Header. (0x11D3)
+ // Byte 2
+ uint8_t Mode :3; // Operating Mode
+ uint8_t Power :1; // Power Control
+ uint8_t Fan :3;
+ uint8_t Turbo :1;
+ // Byte 3
+ uint8_t Temp :4; // Degrees Celsius (+16 offset)
+ uint8_t :4; // Unknown / Unused.
+ // Byte 4
+ uint8_t SwingV :1;
+ uint8_t :7; // Unknown / Unused.
+ // Byte 5
+ uint8_t Econo :1;
+ uint8_t Sleep :1;
+ uint8_t NotAutoOn :1;
+ uint8_t :1; // Unknown / Unused.
+ uint8_t HeatOn :1;
+ uint8_t :1; // Unknown / Unused.
+ uint8_t Health :1;
+ uint8_t Light :1;
+ // Byte 6
+ uint8_t Sum :8; // Sepecial checksum value
+ };
+};
+
+// Constants
+const uint8_t kAirtonAuto = 0b000; // 0
+const uint8_t kAirtonCool = 0b001; // 1
+const uint8_t kAirtonDry = 0b010; // 2
+const uint8_t kAirtonFan = 0b011; // 3
+const uint8_t kAirtonHeat = 0b100; // 4
+
+const uint8_t kAirtonFanAuto = 0b000; // 0
+const uint8_t kAirtonFanMin = 0b001; // 1
+const uint8_t kAirtonFanLow = 0b010; // 2
+const uint8_t kAirtonFanMed = 0b011; // 3
+const uint8_t kAirtonFanHigh = 0b100; // 4
+const uint8_t kAirtonFanMax = 0b101; // 5
+
+const uint8_t kAirtonMinTemp = 16; // 16C
+const uint8_t kAirtonMaxTemp = 25; // 25C
+
+
+/// Class for handling detailed Airton 56-bit A/C messages.
+class IRAirtonAc {
+ public:
+ explicit IRAirtonAc(const uint16_t pin, const bool inverted = false,
+ const bool use_modulation = true);
+ void stateReset(void);
+#if SEND_AIRTON
+ void send(const uint16_t repeat = kAirtonDefaultRepeat);
+ /// Run the calibration to calculate uSec timing offsets for this platform.
+ /// @return The uSec timing offset needed per modulation of the IR Led.
+ /// @note This will produce a 65ms IR signal pulse at 38kHz.
+ /// Only ever needs to be run once per object instantiation, if at all.
+ int8_t calibrate(void) { return _irsend.calibrate(); }
+#endif // SEND_AIRTON
+ void begin(void);
+ void on(void);
+ void off(void);
+ void setPower(const bool on);
+ bool getPower(void) const;
+ void setTemp(const uint8_t degrees);
+ uint8_t getTemp(void) const;
+ void setFan(const uint8_t speed);
+ uint8_t getFan(void) const;
+ void setMode(const uint8_t mode);
+ uint8_t getMode(void) const;
+ uint64_t getRaw(void);
+ void setRaw(const uint64_t data);
+ void setLight(const bool on);
+ bool getLight(void) const;
+ void setEcono(const bool on);
+ bool getEcono(void) const;
+ void setTurbo(const bool on);
+ bool getTurbo(void) const;
+ void setHealth(const bool on);
+ bool getHealth(void) const;
+ void setSleep(const bool on);
+ bool getSleep(void) const;
+ void setSwingV(const bool on);
+ bool getSwingV(void) const;
+ static bool validChecksum(const uint64_t data);
+ static uint8_t calcChecksum(const uint64_t data);
+ static uint8_t convertMode(const stdAc::opmode_t mode);
+ static uint8_t convertFan(const stdAc::fanspeed_t speed);
+ static uint8_t convertSwingV(const stdAc::swingv_t position);
+ static stdAc::opmode_t toCommonMode(const uint8_t mode);
+ static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
+ stdAc::state_t toCommon(void) const;
+ String toString(void) const;
+#ifndef UNIT_TEST
+
+ private:
+ IRsend _irsend; ///< Instance of the IR send class
+#else // UNIT_TEST
+ /// @cond IGNORE
+ IRsendTest _irsend; ///< Instance of the testing IR send class
+ /// @endcond
+#endif // UNIT_TEST
+ AirtonProtocol _;
+ void checksum(void);
+};
+#endif // IR_AIRTON_H_
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.cpp
index f5cacf0e7..7b5b140f0 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.cpp
@@ -21,17 +21,18 @@
// pulse parameters in usec
const uint16_t kCoolixTick = 276; // Approximately 10.5 cycles at 38kHz
const uint16_t kCoolixBitMarkTicks = 2;
-const uint16_t kCoolixBitMark = kCoolixBitMarkTicks * kCoolixTick;
+const uint16_t kCoolixBitMark = kCoolixBitMarkTicks * kCoolixTick; // 552us
const uint16_t kCoolixOneSpaceTicks = 6;
-const uint16_t kCoolixOneSpace = kCoolixOneSpaceTicks * kCoolixTick;
+const uint16_t kCoolixOneSpace = kCoolixOneSpaceTicks * kCoolixTick; // 1656us
const uint16_t kCoolixZeroSpaceTicks = 2;
-const uint16_t kCoolixZeroSpace = kCoolixZeroSpaceTicks * kCoolixTick;
+const uint16_t kCoolixZeroSpace = kCoolixZeroSpaceTicks * kCoolixTick; // 552us
const uint16_t kCoolixHdrMarkTicks = 17;
-const uint16_t kCoolixHdrMark = kCoolixHdrMarkTicks * kCoolixTick;
+const uint16_t kCoolixHdrMark = kCoolixHdrMarkTicks * kCoolixTick; // 4692us
const uint16_t kCoolixHdrSpaceTicks = 16;
-const uint16_t kCoolixHdrSpace = kCoolixHdrSpaceTicks * kCoolixTick;
+const uint16_t kCoolixHdrSpace = kCoolixHdrSpaceTicks * kCoolixTick; // 4416us
const uint16_t kCoolixMinGapTicks = kCoolixHdrMarkTicks + kCoolixZeroSpaceTicks;
-const uint16_t kCoolixMinGap = kCoolixMinGapTicks * kCoolixTick;
+const uint16_t kCoolixMinGap = kCoolixMinGapTicks * kCoolixTick; // 5244us
+const uint8_t kCoolix48ExtraTolerance = 5; // Percent
using irutils::addBoolToString;
using irutils::addIntToString;
@@ -40,7 +41,7 @@ using irutils::addModeToString;
using irutils::addTempToString;
#if SEND_COOLIX
-/// Send a Coolix message
+/// Send a Coolix 24-bit message
/// Status: STABLE / Confirmed Working.
/// @param[in] data The message to be sent.
/// @param[in] nbits The number of bits of message to be sent.
@@ -620,7 +621,7 @@ String IRCoolixAC::toString(void) const {
}
#if DECODE_COOLIX
-/// Decode the supplied Coolix A/C message.
+/// Decode the supplied Coolix 24-bit A/C message.
/// Status: STABLE / Known Working.
/// @param[in,out] results Ptr to the data to decode & where to store the decode
/// result.
@@ -699,3 +700,58 @@ bool IRrecv::decodeCOOLIX(decode_results *results, uint16_t offset,
return true;
}
#endif // DECODE_COOLIX
+
+#if SEND_COOLIX48
+/// Send a Coolix 48-bit message.
+/// Status: ALPHA / Untested.
+/// @param[in] data The message to be sent.
+/// @param[in] nbits The number of bits of message to be sent.
+/// @param[in] repeat The number of times the command is to be repeated.
+/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1694
+/// @note This is effectively the same as `sendCOOLIX()` except requiring the
+/// bit flipping be done prior to the call.
+void IRsend::sendCoolix48(const uint64_t data, const uint16_t nbits,
+ const uint16_t repeat) {
+ // Header + Data + Footer
+ sendGeneric(kCoolixHdrMark, kCoolixHdrSpace,
+ kCoolixBitMark, kCoolixOneSpace,
+ kCoolixBitMark, kCoolixZeroSpace,
+ kCoolixBitMark, kCoolixMinGap,
+ data, nbits, 38000, true, repeat, 33);
+}
+#endif // SEND_COOLIX48
+
+#if DECODE_COOLIX
+/// Decode the supplied Coolix 48-bit A/C message.
+/// Status: BETA / Probably Working.
+/// @param[in,out] results Ptr to the data to decode & where to store the decode
+/// result.
+/// @param[in] offset The starting index to use when attempting to decode the
+/// raw data. Typically/Defaults to kStartOffset.
+/// @param[in] nbits The number of data bits to expect.
+/// @param[in] strict Flag indicating if we should perform strict matching.
+/// @return A boolean. True if it can decode it, false if it can't.
+/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1694
+bool IRrecv::decodeCoolix48(decode_results *results, uint16_t offset,
+ const uint16_t nbits, const bool strict) {
+ if (strict && nbits != kCoolix48Bits)
+ return false; // Not strictly a COOLIX48 message.
+
+ // Header + Data + Footer
+ if (!matchGeneric(results->rawbuf + offset, &(results->value),
+ results->rawlen - offset, nbits,
+ kCoolixHdrMark, kCoolixHdrSpace,
+ kCoolixBitMark, kCoolixOneSpace,
+ kCoolixBitMark, kCoolixZeroSpace,
+ kCoolixBitMark, kCoolixMinGap,
+ true, _tolerance + kCoolix48ExtraTolerance, 0, true))
+ return false;
+
+ // Success
+ results->decode_type = COOLIX48;
+ results->bits = nbits;
+ results->address = 0;
+ results->command = 0;
+ return true;
+}
+#endif // DECODE_COOLIX48
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.h
index 42a2528d7..2155b54b0 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Coolix.h
@@ -6,6 +6,8 @@
/// @note Kudos:
/// Hamper: For the breakdown and mapping of the bit values.
/// fraschizzato: For additional ZoneFollow & SwingVStep analysis.
+/// @note Timers seem to use the `COOLIX48` protocol.
+/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1694
// Supports:
// Brand: Beko, Model: RG57K7(B)/BGEF Remote
@@ -21,6 +23,8 @@
// Brand: Toshiba, Model: RAS-M13YKV-E A/C
// Brand: Toshiba, Model: RAS-4M27YAV-E A/C
// Brand: Toshiba, Model: WH-E1YE remote
+// Brand: Bosch, Model: RG36B4/BGE remote
+// Brand: Bosch, Model: B1ZAI2441W/B1ZAO2441W A/C
#ifndef IR_COOLIX_H_
#define IR_COOLIX_H_
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Fujitsu.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Fujitsu.h
index 994b6f4a3..70c0a4cf0 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Fujitsu.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Fujitsu.h
@@ -33,6 +33,10 @@
// Brand: Fujitsu, Model: ASU12RLF A/C (ARREB1E)
// Brand: Fujitsu, Model: AR-REW4E remote (ARREW4E)
// Brand: Fujitsu, Model: ASYG09KETA-B A/C (ARREW4E)
+// Brand: Fujitsu, Model: AR-REB4E remote (ARREB1E)
+// Brand: Fujitsu, Model: ASTG09K A/C (ARREW4E)
+// Brand: Fujitsu, Model: ASTG18K A/C (ARREW4E)
+// Brand: Fujitsu, Model: AR-REW1E remote (ARREW4E)
#ifndef IR_FUJITSU_H_
#define IR_FUJITSU_H_
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.cpp
index 160a882bf..1e826a72d 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.cpp
@@ -399,6 +399,8 @@ void IRMitsubishiAC::setTemp(const float degrees) {
// Do we have a half degree celsius?
_.HalfDegree = nrHalfDegrees & 1;
_.Temp = static_cast(nrHalfDegrees / 2 - kMitsubishiAcMinTemp);
+ // If temp is modified, iSave10C cannot be ON (because temp is then > 10C)
+ setISave10C(false);
}
/// Get the current temperature setting.
@@ -452,8 +454,104 @@ void IRMitsubishiAC::setMode(const uint8_t mode) {
return;
}
_.Mode = mode;
+ // iSave10C can only be on in Heat mode.
+ if (mode != kMitsubishiAcHeat) {
+ setISave10C(false);
+ }
}
+/// Set the iSave10C (i-SAVE) mode of the A/C.
+/// @param[in] state true, the setting is on. false, the setting is off.
+/// @note Normal minimum temp is 16C; i-SAVE mode works as gate to enable AC
+/// to use 10C as setting. However, when Remote control shows 10C, it still
+/// emits 16C on the "Temp" bits, and instead it uses other bits to indicate
+/// a target temp of 10C.
+/// Slightly strange, but I guess it's to keep compatibility to systems
+/// without i-SAVE.
+/// i-SAVE only has this 10C functionality when the AC is already in Heat mode.
+/// In all other modes, minimum temp is 16C.
+/// I have found no other difference between normal Heat mode and i-SAVE
+/// other than the ability to go to 10C.
+/// In this implementation, i-SAVE mode is ONLY used to enable the AC
+/// temperature setting to 10C. Therefore "Temp" is set to 16 disregarding
+/// what the remote shows, and mode is set to Heat.
+void IRMitsubishiAC::setISave10C(const bool state) {
+ if (state) setMode(kMitsubishiAcHeat);
+ if (state) setTemp(kMitsubishiAcMinTemp);
+ _.iSave10C = state;
+}
+
+/// Get the iSave10C (i-SAVE) mode of the A/C.
+/// @return true, the setting is on. false, the setting is off.
+bool IRMitsubishiAC::getISave10C(void) const {
+ return _.iSave10C;
+}
+
+/// Set the requested iSee mode.
+/// @param[in] state requested iSee mode.
+void IRMitsubishiAC::setISee(const bool state) {
+ _.ISee = state;
+}
+
+/// Get the iSee mode of the A/C.
+/// @return The iSee mode setting.
+bool IRMitsubishiAC::getISee(void) const {
+ return _.ISee;
+}
+
+/// Set the requested Ecocool mode.
+/// @param[in] state requested Ecocool mode.
+void IRMitsubishiAC::setEcocool(const bool state) {
+ _.Ecocool = state;
+}
+
+/// Get the Ecocool mode of the A/C.
+/// @return The Ecocool mode setting.
+bool IRMitsubishiAC::getEcocool(void) const {
+ return _.Ecocool;
+}
+
+/// Set the requested Absense Detect mode.
+/// @param[in] state requested Absense Detect mode.
+void IRMitsubishiAC::setAbsenseDetect(const bool state) {
+ _.AbsenseDetect = state;
+}
+
+/// Get the Absense Detect mode of the A/C.
+/// @return The Absense Detect mode setting.
+bool IRMitsubishiAC::getAbsenseDetect(void) const {
+ return _.AbsenseDetect;
+}
+
+/// Set the requested Direct/Indirect mode. Only works if I-See mode is ON.
+/// @param[in] mode requested Direct/Indirect mode.
+void IRMitsubishiAC::setDirectIndirect(const uint8_t mode) {
+ if (_.ISee) {
+ _.DirectIndirect = std::min(mode, kMitsubishiAcDirect); // bounds check
+ } else {
+ _.DirectIndirect = 0;
+ }
+}
+
+/// Get the Direct/Indirect mode of the A/C.
+/// @return The native mode setting.
+uint8_t IRMitsubishiAC::getDirectIndirect(void) const {
+ return _.DirectIndirect;
+}
+
+/// Set the requested Natural Flow mode.
+/// @param[in] state requested Natural Flow mode.
+void IRMitsubishiAC::setNaturalFlow(const bool state) {
+ _.NaturalFlow = state;
+}
+
+/// Get the Natural Flow mode of the A/C.
+/// @return The Natural Flow mode setting.
+bool IRMitsubishiAC::getNaturalFlow(void) const {
+ return _.NaturalFlow;
+}
+
+
/// Set the requested vane (Vertical Swing) operation mode of the a/c unit.
/// @note On some models, this represents the Right vertical vane.
/// @param[in] position The position/mode to set the vane to.
@@ -463,12 +561,6 @@ void IRMitsubishiAC::setVane(const uint8_t position) {
_.Vane = pos;
}
-/// Set the requested wide-vane (Horizontal Swing) operation mode of the a/c.
-/// @param[in] position The position/mode to set the wide vane to.
-void IRMitsubishiAC::setWideVane(const uint8_t position) {
- _.WideVane = std::min(position, kMitsubishiAcWideVaneAuto);
-}
-
/// Get the Vane (Vertical Swing) mode of the A/C.
/// @note On some models, this represents the Right vertical vane.
/// @return The native position/mode setting.
@@ -476,12 +568,6 @@ uint8_t IRMitsubishiAC::getVane(void) const {
return _.Vane;
}
-/// Get the Wide Vane (Horizontal Swing) mode of the A/C.
-/// @return The native position/mode setting.
-uint8_t IRMitsubishiAC::getWideVane(void) const {
- return _.WideVane;
-}
-
/// Set the requested Left Vane (Vertical Swing) operation mode of the a/c unit.
/// @param[in] position The position/mode to set the vane to.
void IRMitsubishiAC::setVaneLeft(const uint8_t position) {
@@ -492,6 +578,18 @@ void IRMitsubishiAC::setVaneLeft(const uint8_t position) {
/// @return The native position/mode setting.
uint8_t IRMitsubishiAC::getVaneLeft(void) const { return _.VaneLeft; }
+/// Set the requested wide-vane (Horizontal Swing) operation mode of the a/c.
+/// @param[in] position The position/mode to set the wide vane to.
+void IRMitsubishiAC::setWideVane(const uint8_t position) {
+ _.WideVane = std::min(position, kMitsubishiAcWideVaneAuto);
+}
+
+/// Get the Wide Vane (Horizontal Swing) mode of the A/C.
+/// @return The native position/mode setting.
+uint8_t IRMitsubishiAC::getWideVane(void) const {
+ return _.WideVane;
+}
+
/// Get the clock time of the A/C unit.
/// @return Nr. of 10 minute increments past midnight.
/// @note 1 = 1/6 hour (10 minutes). e.g. 4pm = 48.
@@ -777,6 +875,12 @@ String IRMitsubishiAC::toString(void) const {
result += ')';
}
result += addBoolToString(_.WeeklyTimer, kWeeklyTimerStr);
+ result += addBoolToString(_.iSave10C, k10CHeatStr);
+ result += addBoolToString(_.ISee, kISeeStr);
+ result += addBoolToString(_.Ecocool, kEconoStr);
+ result += addBoolToString(_.AbsenseDetect, kAbsenseDetectStr);
+ result += addIntToString(_.DirectIndirect, kDirectIndirectModeStr);
+ result += addBoolToString(_.NaturalFlow, kFreshStr);
return result;
}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.h
index 1f3a42184..55afcdce6 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Mitsubishi.h
@@ -34,6 +34,7 @@
// Brand: Mitsubishi Electric, Model: MSZ-SF25VE3 A/C (MITSUBISHI_AC)
// Brand: Mitsubishi Electric, Model: SG15D remote (MITSUBISHI_AC)
// Brand: Mitsubishi Electric, Model: MSZ-ZW4017S A/C (MITSUBISHI_AC)
+// Brand: Mitsubishi Electric, Model: MSZ-FHnnVE A/C (MITSUBISHI_AC)
#ifndef IR_MITSUBISHI_H_
#define IR_MITSUBISHI_H_
@@ -62,7 +63,8 @@ union Mitsubishi144Protocol{
// Byte 6
uint8_t :3;
uint8_t Mode :3;
- uint8_t :2;
+ uint8_t ISee : 1;
+ uint8_t :1;
// Byte 7
uint8_t Temp :4;
uint8_t HalfDegree :1;
@@ -72,7 +74,7 @@ union Mitsubishi144Protocol{
uint8_t WideVane:4; // SwingH
// Byte 9
uint8_t Fan :3;
- uint8_t Vane :3; // SwingV
+ uint8_t Vane :3; // SwingV or VaneRight
uint8_t VaneBit :1;
uint8_t FanAuto :1;
// Byte 10
@@ -86,13 +88,21 @@ union Mitsubishi144Protocol{
uint8_t WeeklyTimer :1;
uint8_t :4;
// Byte 14
- uint8_t :8;
+ uint8_t :5;
+ uint8_t Ecocool :1;
+ uint8_t :2;
// Byte 15
- uint8_t :8;
+ uint8_t DirectIndirect:2;
+ uint8_t AbsenseDetect :1;
+ uint8_t :2;
+ uint8_t iSave10C :1; // i-SAVE:mode=Heat & iSave=on AND 10C on remote
+ uint8_t :2;
// Byte 16
- uint8_t :3;
- uint8_t VaneLeft :3; // SwingV(Left)
- uint8_t :2;
+ uint8_t :1;
+ uint8_t NaturalFlow :1;
+ uint8_t :1;
+ uint8_t VaneLeft :3; // SwingV(Left)
+ uint8_t :2;
// Byte 17
uint8_t Sum :8;
};
@@ -126,6 +136,9 @@ const uint8_t kMitsubishiAcWideVaneRight = 0b0100; // 4
const uint8_t kMitsubishiAcWideVaneRightMax = 0b0101; // 5
const uint8_t kMitsubishiAcWideVaneWide = 0b0110; // 6
const uint8_t kMitsubishiAcWideVaneAuto = 0b1000; // 8
+const uint8_t kMitsubishiAcDirectOff = 0b00; // Vanes move when AC wants to.
+const uint8_t kMitsubishiAcIndirect = 0b01;
+const uint8_t kMitsubishiAcDirect = 0b11;
const uint8_t kMitsubishiAcNoTimer = 0;
const uint8_t kMitsubishiAcStartTimer = 5;
const uint8_t kMitsubishiAcStopTimer = 3;
@@ -274,12 +287,24 @@ class IRMitsubishiAC {
uint8_t getFan(void) const;
void setMode(const uint8_t mode);
uint8_t getMode(void) const;
- void setVane(const uint8_t position);
- void setWideVane(const uint8_t position);
+ void setISave10C(const bool state);
+ bool getISave10C(void) const;
+ void setISee(const bool state);
+ bool getISee(void) const;
+ void setDirectIndirect(const uint8_t position);
+ uint8_t getDirectIndirect(void) const;
+ void setEcocool(const bool state);
+ bool getEcocool(void) const;
+ void setAbsenseDetect(const bool state);
+ bool getAbsenseDetect(void) const;
+ void setNaturalFlow(const bool state);
+ bool getNaturalFlow(void) const;
+ void setVane(const uint8_t position); // controls RIGHT vane on some models
uint8_t getVane(void) const;
- uint8_t getWideVane(void) const;
void setVaneLeft(const uint8_t position);
uint8_t getVaneLeft(void) const;
+ void setWideVane(const uint8_t position);
+ uint8_t getWideVane(void) const;
uint8_t* getRaw(void);
void setRaw(const uint8_t* data);
uint8_t getClock(void) const;
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Sony.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Sony.cpp
index 0dbbec3c8..5746ee9b1 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Sony.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Sony.cpp
@@ -120,7 +120,7 @@ uint32_t IRsend::encodeSony(const uint16_t nbits, const uint16_t command,
/// bits long.
bool IRrecv::decodeSony(decode_results *results, uint16_t offset,
const uint16_t nbits, const bool strict) {
- if (results->rawlen <= 2 * nbits + kHeader - 1 + offset)
+ if (results->rawlen < 2 * nbits + kHeader - 1 + offset)
return false; // Message is smaller than we expected.
// Compliance
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Tcl.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Tcl.h
index e1696c42a..c7ae038d0 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Tcl.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Tcl.h
@@ -8,6 +8,8 @@
// Brand: TCL, Model: TAC-09CHSD/XA31I A/C (TAC09CHSD)
// Brand: Teknopoint, Model: Allegro SSA-09H A/C (GZ055BE1)
// Brand: Teknopoint, Model: GZ-055B-E1 remote (GZ055BE1)
+// Brand: Daewoo, Model: DSB-F0934ELH-V A/C
+// Brand: Daewoo, Model: GYKQ-52E remote
#ifndef IR_TCL_H_
#define IR_TCL_H_
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.cpp
index 0e3ac8ba2..7333493ef 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.cpp
@@ -216,9 +216,7 @@ void IRToshibaAC::setTemp(const uint8_t degrees) {
/// Get the current temperature setting.
/// @return The current setting for temp. in degrees celsius.
-uint8_t IRToshibaAC::getTemp(void) const {
- return _.Temp + kToshibaAcMinTemp;
-}
+uint8_t IRToshibaAC::getTemp(void) const { return _.Temp + kToshibaAcMinTemp; }
/// Set the speed of the fan.
/// @param[in] speed The desired setting (0 is Auto, 1-5 is the speed, 5 is Max)
@@ -339,6 +337,19 @@ void IRToshibaAC::setEcono(const bool on) {
}
}
+/// Get the filter (Pure/Ion Filter) setting of the A/C.
+/// @return true, if the current setting is on. Otherwise, false.
+bool IRToshibaAC::getFilter(void) const {
+ return (getStateLength() >= kToshibaACStateLength) ? _.Filter : false;
+}
+
+/// Set the filter (Pure/Ion Filter) setting of the A/C.
+/// @param[in] on true, the setting is on. false, the setting is off.
+void IRToshibaAC::setFilter(const bool on) {
+ _.Filter = on;
+ if (on) setStateLength(std::min(kToshibaACStateLength, getStateLength()));
+}
+
/// Convert a stdAc::opmode_t enum into its native mode.
/// @param[in] mode The enum to be converted.
/// @return The native equivalent of the enum.
@@ -421,6 +432,7 @@ stdAc::state_t IRToshibaAC::toCommon(const stdAc::state_t *prev) const {
result.fanspeed = toCommonFanSpeed(getFan());
result.turbo = getTurbo();
result.econo = getEcono();
+ result.filter = getFilter();
}
switch (getSwing()) {
case kToshibaAcSwingOn:
@@ -436,7 +448,6 @@ stdAc::state_t IRToshibaAC::toCommon(const stdAc::state_t *prev) const {
}
// Not supported.
result.light = false;
- result.filter = false;
result.swingh = stdAc::swingh_t::kOff;
result.quiet = false;
result.clean = false;
@@ -450,7 +461,7 @@ stdAc::state_t IRToshibaAC::toCommon(const stdAc::state_t *prev) const {
/// @return A human readable string.
String IRToshibaAC::toString(void) const {
String result = "";
- result.reserve(80);
+ result.reserve(95);
result += addTempToString(getTemp(), true, false);
switch (getStateLength()) {
case kToshibaACStateLengthShort:
@@ -477,6 +488,7 @@ String IRToshibaAC::toString(void) const {
kToshibaAcFanMed);
result += addBoolToString(getTurbo(), kTurboStr);
result += addBoolToString(getEcono(), kEconoStr);
+ result += addBoolToString(getFilter(), kFilterStr);
}
return result;
}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.h
index 3ebf5e693..1314cf54d 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/ir_Toshiba.h
@@ -8,6 +8,7 @@
/// @see https://docs.google.com/spreadsheets/d/1yidE2fvaO9kpCHfKafIdH31q4uaskYR1OwwrkyOxbp0/edit?usp=drivesdk
/// @see https://www.toshiba-carrier.co.jp/global/about/index.htm
/// @see http://www.toshiba-carrier.co.th/AboutUs/Pages/CompanyProfile.aspx
+/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1692
// Supports:
// Brand: Toshiba, Model: RAS-B13N3KV2
@@ -18,6 +19,8 @@
// Brand: Toshiba, Model: WC-L03SE
// Brand: Toshiba, Model: WH-UB03NJ remote
// Brand: Toshiba, Model: RAS-2558V A/C
+// Brand: Toshiba, Model: WH-TA01JE remote
+// Brand: Toshiba, Model: RAS-25SKVP2-ND A/C
// Brand: Carrier, Model: 42NQV060M2 / 38NYV060M2 A/C
// Brand: Carrier, Model: 42NQV050M2 / 38NYV050M2 A/C
// Brand: Carrier, Model: 42NQV035M2 / 38NYV035M2 A/C
@@ -50,28 +53,31 @@ union ToshibaProtocol{
///< 1 (56 bit message)
///< 3 (72 bit message)
///< 4 (80 bit message)
- uint8_t Length :8;
+ uint8_t Length :8;
// Byte[3] - The bit-inverted value of the "length" byte.
- uint8_t :8;
+ uint8_t :8;
// Byte[4]
- uint8_t :3;
- uint8_t LongMsg :1;
- uint8_t :1;
- uint8_t ShortMsg:1;
- uint8_t :2;
+ uint8_t :3;
+ uint8_t LongMsg :1;
+ uint8_t :1;
+ uint8_t ShortMsg :1;
+ uint8_t :2;
// Byte[5]
- uint8_t Swing :3;
- uint8_t :1;
- uint8_t Temp :4;
+ uint8_t Swing :3;
+ uint8_t :1;
+ uint8_t Temp :4;
// Byte[6]
- uint8_t Mode :3;
- uint8_t :2;
- uint8_t Fan :3;
+ uint8_t Mode :3;
+ uint8_t :2;
+ uint8_t Fan :3;
// Byte[7]
- uint8_t :8;
+ uint8_t :4;
+ uint8_t Filter :1;
+ uint8_t :3;
+
// Byte[8]
// (Checksum for 72 bit messages, Eco/Turbo for long 80 bit messages)
- uint8_t EcoTurbo :8;
+ uint8_t EcoTurbo :8;
};
};
@@ -144,6 +150,8 @@ class IRToshibaAC {
bool getTurbo(void) const;
void setEcono(const bool on);
bool getEcono(void) const;
+ void setFilter(const bool on);
+ bool getFilter(void) const;
void setMode(const uint8_t mode);
uint8_t getMode(const bool raw = false) const;
void setRaw(const uint8_t newState[],
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/locale/defaults.h b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/locale/defaults.h
index 0fcc04791..d8142e20e 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/locale/defaults.h
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/locale/defaults.h
@@ -120,6 +120,9 @@
#ifndef D_STR_IFEEL
#define D_STR_IFEEL "IFeel"
#endif // D_STR_IFEEL
+#ifndef D_STR_ISEE
+#define D_STR_ISEE "ISee"
+#endif // D_STR_ISEE
#ifndef D_STR_HUMID
#define D_STR_HUMID "Humid"
#endif // D_STR_HUMID
@@ -207,6 +210,19 @@
#ifndef D_STR_SENSOR
#define D_STR_SENSOR "Sensor"
#endif // D_STR_SENSOR
+#ifndef D_STR_ABSENSEDETECT
+#define D_STR_ABSENSEDETECT "Absense detect"
+#endif // D_STR_ABSENSEDETECT
+#ifndef D_STR_DIRECT
+#define D_STR_DIRECT "Direct"
+#endif // D_STR_DIRECT
+#ifndef D_STR_INDIRECT
+#define D_STR_INDIRECT "Indirect"
+#endif // D_STR_INDIRECT
+#ifndef D_STR_DIRECTINDIRECTMODE
+#define D_STR_DIRECTINDIRECTMODE D_STR_DIRECT " / " \
+D_STR_INDIRECT " " D_STR_MODE
+#endif // D_STR_DIRECTINDIRECTMODE
#ifndef D_STR_DISPLAY
#define D_STR_DISPLAY "Display"
#endif // D_STR_DISPLAY
@@ -702,6 +718,9 @@
#ifndef D_STR_COOLIX
#define D_STR_COOLIX "COOLIX"
#endif // D_STR_COOLIX
+#ifndef D_STR_COOLIX48
+#define D_STR_COOLIX48 D_STR_COOLIX "48"
+#endif // D_STR_COOLIX48
#ifndef D_STR_CORONA_AC
#define D_STR_CORONA_AC "CORONA_AC"
#endif // D_STR_CORONA_AC
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/IRac_test.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/IRac_test.cpp
index d43cfcd9d..2988e4b4b 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/IRac_test.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/IRac_test.cpp
@@ -1,6 +1,7 @@
// Copyright 2019-2021 David Conran
#include
+#include "ir_Airton.h"
#include "ir_Airwell.h"
#include "ir_Amcor.h"
#include "ir_Argo.h"
@@ -44,6 +45,36 @@
// Tests for IRac class.
+TEST(TestIRac, Airton) {
+ IRAirtonAc ac(kGpioUnused);
+ IRac irac(kGpioUnused);
+ IRrecv capture(kGpioUnused);
+ const char expected[] =
+ "Power: On, Mode: 1 (Cool), Fan: 5 (Maximum), Temp: 18C, "
+ "Swing(V): On, Econo: On, Turbo: On, Light: On, Health: On, Sleep: On";
+
+ ac.begin();
+ irac.airton(&ac,
+ true, // Power
+ stdAc::opmode_t::kCool, // Mode
+ 18, // Celsius
+ stdAc::fanspeed_t::kMax, // Fan speed
+ stdAc::swingv_t::kAuto, // Vertical Swing
+ true, // Turbo
+ true, // Light/Display/LED
+ true, // Econo (Eco)
+ true, // Filter (Health)
+ 9 * 60 + 12); // Sleep (09:12)
+ ASSERT_EQ(expected, ac.toString());
+ ac._irsend.makeDecodeResult();
+ EXPECT_TRUE(capture.decode(&ac._irsend.capture));
+ ASSERT_EQ(AIRTON, ac._irsend.capture.decode_type);
+ ASSERT_EQ(kAirtonBits, ac._irsend.capture.bits);
+ ASSERT_EQ(expected, IRAcUtils::resultAcToString(&ac._irsend.capture));
+ stdAc::state_t r, p;
+ ASSERT_TRUE(IRAcUtils::decodeToState(&ac._irsend.capture, &r, &p));
+}
+
TEST(TestIRac, Airwell) {
IRAirwellAc ac(kGpioUnused);
IRac irac(kGpioUnused);
@@ -1418,7 +1449,9 @@ TEST(TestIRac, Mitsubishi) {
"Power: On, Mode: 3 (Cool), Temp: 20C, Fan: 2 (Medium), "
"Swing(V): 0 (Auto), Swing(H): 3 (Middle), "
"Clock: 14:30, On Timer: 00:00, Off Timer: 00:00, Timer: -, "
- "Weekly Timer: Off";
+ "Weekly Timer: Off"
+ ", 10C Heat: Off, ISee: Off, Econo: Off, Absense detect: Off, "
+ "Direct / Indirect Mode: 0, Fresh: Off";
ac.begin();
irac.mitsubishi(&ac,
@@ -1958,7 +1991,7 @@ TEST(TestIRac, Toshiba) {
IRrecv capture(kGpioUnused);
char expected[] =
"Temp: 29C, Power: On, Mode: 2 (Dry), Fan: 2 (UNKNOWN), "
- "Turbo: Off, Econo: On";
+ "Turbo: Off, Econo: On, Filter: Off";
ac.begin();
irac.toshiba(&ac,
@@ -1968,7 +2001,8 @@ TEST(TestIRac, Toshiba) {
stdAc::fanspeed_t::kLow, // Fan speed
stdAc::swingv_t::kOff, // Vertical Swing
false, // Turbo
- true); // Econo
+ true, // Econo
+ false); // Filter
ASSERT_EQ(expected, ac.toString());
ASSERT_EQ(kToshibaACStateLengthLong, ac.getStateLength());
ac._irsend.makeDecodeResult();
@@ -2873,7 +2907,7 @@ TEST(TestIRac, Issue1250) {
// Now send the state so we can actually decode/capture what we sent.
char expected_on[] =
"Temp: 19C, Power: On, Mode: 4 (Fan), Fan: 0 (Auto), "
- "Turbo: Off, Econo: Off";
+ "Turbo: Off, Econo: Off, Filter: Off";
ac._irsend.reset();
irac.toshiba(&ac,
irac.next.power, // Power
@@ -2882,7 +2916,8 @@ TEST(TestIRac, Issue1250) {
irac.next.fanspeed, // Fan speed
irac.next.swingv, // Vertical Swing
irac.next.turbo, // Turbo
- irac.next.econo); // Econo
+ irac.next.econo, // Econo
+ irac.next.filter); // Filter
ASSERT_EQ(expected_on, ac.toString());
ASSERT_EQ(kToshibaACStateLength, ac.getStateLength());
ac._irsend.makeDecodeResult();
@@ -2898,7 +2933,8 @@ TEST(TestIRac, Issue1250) {
irac.sendAc();
// Now send the state so we can actually decode/capture what we sent.
char expected_off[] =
- "Temp: 19C, Power: Off, Fan: 0 (Auto), Turbo: Off, Econo: Off";
+ "Temp: 19C, Power: Off, Fan: 0 (Auto), Turbo: Off, Econo: Off, "
+ "Filter: Off";
ac._irsend.reset();
irac.toshiba(&ac,
irac.next.power, // Power
@@ -2907,7 +2943,8 @@ TEST(TestIRac, Issue1250) {
irac.next.fanspeed, // Fan speed
irac.next.swingv, // Vertical Swing
irac.next.turbo, // Turbo
- irac.next.econo); // Econo
+ irac.next.econo, // Econo
+ irac.next.filter); // Filter
ASSERT_EQ(expected_off, ac.toString());
ASSERT_EQ(kToshibaACStateLength, ac.getStateLength());
ac._irsend.makeDecodeResult();
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Airton_test.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Airton_test.cpp
index e4e66ee13..2f2bb0bac 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Airton_test.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Airton_test.cpp
@@ -1,5 +1,6 @@
// Copyright 2021 crankyoldgit
+#include "ir_Airton.h"
#include "IRac.h"
#include "IRrecv.h"
#include "IRrecv_test.h"
@@ -34,6 +35,13 @@ TEST(TestDecodeAirton, RealExample) {
EXPECT_EQ(0x5E1400090C11D3, irsend.capture.value);
EXPECT_EQ(0x0, irsend.capture.address);
EXPECT_EQ(0x0, irsend.capture.command);
+ EXPECT_EQ(
+ "Power: On, Mode: 4 (Heat), Fan: 0 (Auto), Temp: 25C, "
+ "Swing(V): Off, Econo: Off, Turbo: Off, Light: Off, "
+ "Health: Off, Sleep: Off",
+ IRAcUtils::resultAcToString(&irsend.capture));
+ stdAc::state_t r, p;
+ ASSERT_TRUE(IRAcUtils::decodeToState(&irsend.capture, &r, &p));
}
TEST(TestDecodeAirton, SyntheticExample) {
@@ -56,7 +64,265 @@ TEST(TestUtils, Housekeeping) {
ASSERT_EQ("AIRTON", typeToString(decode_type_t::AIRTON));
ASSERT_EQ(decode_type_t::AIRTON, strToDecodeType("AIRTON"));
ASSERT_FALSE(hasACState(decode_type_t::AIRTON));
- ASSERT_FALSE(IRac::isProtocolSupported(decode_type_t::AIRTON));
+ ASSERT_TRUE(IRac::isProtocolSupported(decode_type_t::AIRTON));
ASSERT_EQ(kAirtonBits, IRsend::defaultBits(decode_type_t::AIRTON));
ASSERT_EQ(kAirtonDefaultRepeat, IRsend::minRepeats(decode_type_t::AIRTON));
}
+
+// Tests for IRAirtonAc class.
+
+TEST(TestIRAirtonAcClass, Power) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+
+ ac.on();
+ EXPECT_TRUE(ac.getPower());
+
+ ac.off();
+ EXPECT_FALSE(ac.getPower());
+
+ ac.setPower(true);
+ EXPECT_TRUE(ac.getPower());
+
+ ac.setPower(false);
+ EXPECT_FALSE(ac.getPower());
+}
+
+TEST(TestIRAirtonAcClass, Checksums) {
+ ASSERT_TRUE(IRAirtonAc::validChecksum(0x5E1400090C11D3));
+ ASSERT_EQ(0x5E, IRAirtonAc::calcChecksum(0x5E1400090C11D3));
+ ASSERT_FALSE(IRAirtonAc::validChecksum(0x551400090C11D3));
+ ASSERT_TRUE(IRAirtonAc::validChecksum(0x2F8801060911D3));
+ ASSERT_TRUE(IRAirtonAc::validChecksum(0xDB8800021A11D3));
+}
+
+TEST(TestIRAirtonAcClass, Temperature) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+ ac.setMode(kAirtonCool); // Cool mode allows the entire temp range.
+ ac.setTemp(0);
+ EXPECT_EQ(kAirtonMinTemp, ac.getTemp());
+
+ ac.setTemp(255);
+ EXPECT_EQ(kAirtonMaxTemp, ac.getTemp());
+
+ ac.setTemp(kAirtonMinTemp);
+ EXPECT_EQ(kAirtonMinTemp, ac.getTemp());
+
+ ac.setTemp(kAirtonMaxTemp);
+ EXPECT_EQ(kAirtonMaxTemp, ac.getTemp());
+
+ ac.setTemp(kAirtonMinTemp - 1);
+ EXPECT_EQ(kAirtonMinTemp, ac.getTemp());
+
+ ac.setTemp(kAirtonMaxTemp + 1);
+ EXPECT_EQ(kAirtonMaxTemp, ac.getTemp());
+
+ ac.setTemp(17);
+ EXPECT_EQ(17, ac.getTemp());
+
+ ac.setTemp(21);
+ EXPECT_EQ(21, ac.getTemp());
+
+ ac.setTemp(20);
+ EXPECT_EQ(20, ac.getTemp());
+}
+
+TEST(TestIRAirtonAcClass, OperatingMode) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+
+ ac.setMode(kAirtonCool);
+ EXPECT_EQ(kAirtonCool, ac.getMode());
+ ac.setMode(kAirtonDry);
+ EXPECT_EQ(kAirtonDry, ac.getMode());
+ ac.setMode(kAirtonFan);
+ EXPECT_EQ(kAirtonFan, ac.getMode());
+ EXPECT_NE(kAirtonMaxTemp, ac.getTemp());
+ ac.setMode(kAirtonAuto);
+ EXPECT_EQ(kAirtonAuto, ac.getMode());
+ EXPECT_EQ(kAirtonMaxTemp, ac.getTemp());
+ ac.setMode(kAirtonHeat);
+ EXPECT_EQ(kAirtonHeat, ac.getMode());
+
+ ac.setMode(kAirtonHeat + 1);
+ EXPECT_EQ(kAirtonAuto, ac.getMode());
+ ac.setMode(255);
+ EXPECT_EQ(kAirtonAuto, ac.getMode());
+}
+
+TEST(TestIRAirtonAcClass, FanSpeed) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+ ac.setMode(kAirtonCool); // All fan speeds available in this mode.
+
+ ac.setFan(0);
+ EXPECT_EQ(kAirtonFanAuto, ac.getFan());
+
+ ac.setFan(255);
+ EXPECT_EQ(kAirtonFanAuto, ac.getFan());
+
+ ac.setFan(kAirtonFanHigh);
+ EXPECT_EQ(kAirtonFanHigh, ac.getFan());
+
+ ac.setFan(kAirtonFanLow);
+ EXPECT_EQ(kAirtonFanLow, ac.getFan());
+
+ ac.setFan(kAirtonFanMax);
+ EXPECT_EQ(kAirtonFanMax, ac.getFan());
+
+ ac.setFan(kAirtonFanMin);
+ EXPECT_EQ(kAirtonFanMin, ac.getFan());
+
+ ac.setFan(kAirtonFanMed);
+ EXPECT_EQ(kAirtonFanMed, ac.getFan());
+
+ ac.setFan(kAirtonFanMax + 1);
+ EXPECT_EQ(kAirtonFanAuto, ac.getFan());
+}
+
+TEST(TestIRAirtonAcClass, SwingV) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+
+ ac.setSwingV(false);
+ EXPECT_FALSE(ac.getSwingV());
+ ac.setSwingV(true);
+ EXPECT_TRUE(ac.getSwingV());
+ ac.setSwingV(false);
+ EXPECT_FALSE(ac.getSwingV());
+
+ // Known swingv on state
+ ac.setRaw(0xBC0401050111D3);
+ EXPECT_TRUE(ac.getSwingV());
+}
+
+TEST(TestIRAirtonAcClass, Light) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+
+ ac.setLight(false);
+ EXPECT_FALSE(ac.getLight());
+ ac.setLight(true);
+ EXPECT_TRUE(ac.getLight());
+ ac.setLight(false);
+ EXPECT_FALSE(ac.getLight());
+
+ // Known light on state
+ ac.setRaw(0x298801040911D3);
+ EXPECT_TRUE(ac.getLight());
+}
+
+TEST(TestIRAirtonAcClass, ConstructKnownExamples) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+ ac.stateReset();
+ ac.on();
+ ac.setMode(kAirtonHeat);
+ ac.setFan(kAirtonFanAuto);
+ ac.setTemp(25);
+ ac.setSwingV(false);
+ ac.setLight(false);
+ ac.setTurbo(false);
+ ac.setSleep(false);
+ ac.setEcono(false);
+ ac.setHealth(false);
+ EXPECT_EQ(
+ "Power: On, Mode: 4 (Heat), Fan: 0 (Auto), Temp: 25C, "
+ "Swing(V): Off, Econo: Off, Turbo: Off, Light: Off, "
+ "Health: Off, Sleep: Off",
+ ac.toString());
+ EXPECT_EQ(0x5E1400090C11D3, ac.getRaw());
+}
+
+TEST(TestIRAirtonAcClass, Turbo) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+
+ ac.setTurbo(false);
+ EXPECT_FALSE(ac.getTurbo());
+ EXPECT_NE(kAirtonFanMax, ac.getFan());
+ ac.setTurbo(true);
+ EXPECT_TRUE(ac.getTurbo());
+ EXPECT_EQ(kAirtonFanMax, ac.getFan());
+ ac.setTurbo(false);
+ EXPECT_FALSE(ac.getTurbo());
+
+ // Known Turbo on state
+ ac.setRaw(0x92040000D911D3);
+ EXPECT_TRUE(ac.getTurbo());
+}
+
+TEST(TestIRAirtonAcClass, Sleep) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+
+ ac.setMode(kAirtonCool); // Sleep is available in Cool mode.
+ ac.setSleep(false);
+ EXPECT_FALSE(ac.getSleep());
+ ac.setSleep(true);
+ EXPECT_TRUE(ac.getSleep());
+ ac.setSleep(false);
+ EXPECT_FALSE(ac.getSleep());
+
+ ac.setSleep(true);
+ // Sleep is available in Heat mode, but changing modes resets it.
+ ac.setMode(kAirtonHeat);
+ EXPECT_FALSE(ac.getSleep());
+ ac.setSleep(true);
+ EXPECT_TRUE(ac.getSleep());
+
+ ac.setMode(kAirtonAuto); // Sleep is NOT available in Auto mode.
+ EXPECT_FALSE(ac.getSleep());
+ ac.setSleep(true);
+ EXPECT_FALSE(ac.getSleep());
+
+ ac.setMode(kAirtonFan); // Sleep is NOT available in Fan mode.
+ EXPECT_FALSE(ac.getSleep());
+ ac.setSleep(true);
+ EXPECT_FALSE(ac.getSleep());
+
+ // Known Sleep on state
+ ac.setRaw(0xA00600000911D3);
+ EXPECT_TRUE(ac.getSleep());
+ EXPECT_NE(kAirtonAuto, ac.getMode());
+ EXPECT_NE(kAirtonFan, ac.getMode());
+}
+
+TEST(TestIRAirtonAcClass, Health) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+
+ ac.setHealth(false);
+ EXPECT_FALSE(ac.getHealth());
+ ac.setHealth(true);
+ EXPECT_TRUE(ac.getHealth());
+ ac.setHealth(false);
+ EXPECT_FALSE(ac.getHealth());
+
+ // Known Health on state
+ ac.setRaw(0xE5C900000911D3);
+ EXPECT_TRUE(ac.getHealth());
+}
+
+TEST(TestIRAirtonAcClass, Econo) {
+ IRAirtonAc ac(kGpioUnused);
+ ac.begin();
+ ac.setMode(kAirtonCool); // Econo is only available in Cool.
+ ac.setEcono(false);
+ EXPECT_FALSE(ac.getEcono());
+ ac.setEcono(true);
+ EXPECT_TRUE(ac.getEcono());
+ ac.setEcono(false);
+ EXPECT_FALSE(ac.getEcono());
+
+ ac.setEcono(true);
+ ac.setMode(kAirtonHeat); // Econo is only available in Cool, not Heat!
+ EXPECT_FALSE(ac.getEcono());
+ ac.setEcono(true);
+ EXPECT_FALSE(ac.getEcono());
+
+ // Known Econo on state
+ ac.setRaw(0xE5C900000911D3);
+ EXPECT_TRUE(ac.getEcono());
+}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Coolix_test.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Coolix_test.cpp
index 46c554882..62e0d6b0e 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Coolix_test.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Coolix_test.cpp
@@ -6,6 +6,25 @@
#include "IRsend_test.h"
#include "gtest/gtest.h"
+
+TEST(TestUtils, Housekeeping) {
+ // COOLIX
+ ASSERT_EQ("COOLIX", typeToString(decode_type_t::COOLIX));
+ ASSERT_EQ(decode_type_t::COOLIX, strToDecodeType("COOLIX"));
+ ASSERT_FALSE(hasACState(decode_type_t::COOLIX));
+ ASSERT_TRUE(IRac::isProtocolSupported(decode_type_t::COOLIX));
+ ASSERT_EQ(kCoolixBits, IRsend::defaultBits(decode_type_t::COOLIX));
+ ASSERT_EQ(kSingleRepeat, IRsend::minRepeats(decode_type_t::COOLIX));
+
+ // COOLIX48
+ ASSERT_EQ("COOLIX48", typeToString(decode_type_t::COOLIX48));
+ ASSERT_EQ(decode_type_t::COOLIX48, strToDecodeType("COOLIX48"));
+ ASSERT_FALSE(hasACState(decode_type_t::COOLIX48));
+ ASSERT_FALSE(IRac::isProtocolSupported(decode_type_t::COOLIX48));
+ ASSERT_EQ(kCoolix48Bits, IRsend::defaultBits(decode_type_t::COOLIX48));
+ ASSERT_EQ(kSingleRepeat, IRsend::minRepeats(decode_type_t::COOLIX48));
+}
+
// Tests for sendCOOLIX().
// Test sending typical data only.
@@ -941,3 +960,76 @@ TEST(TestCoolixACClass, VerifyZoneFollowFan) {
"Zone Follow: On, Sensor Temp: 19C",
ac.toString());
}
+
+TEST(TestDecodeCoolix48, RealExample) {
+ IRsendTest irsend(kGpioUnused);
+ IRrecv irrecv(kGpioUnused);
+
+ // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1694#issue-1068786691
+ // Off Timer: 1 hour
+ const uint16_t rawData[199] = {
+ 4342, 4454, 486, 1724, 436, 658, 438, 1748, 464, 1718, 462, 634, 440, 656,
+ 462, 1696, 488, 634, 462, 634, 436, 1722, 516, 608, 462, 660, 436, 1694,
+ 488, 1720, 440, 630, 488, 1700, 488, 1704, 458, 660, 462, 1698, 490, 632,
+ 462, 634, 436, 684, 436, 1700, 464, 1748, 462, 634, 462, 1720, 436, 658,
+ 462, 1700, 488, 1692, 512, 1696, 438, 684, 410, 686, 434, 688, 408, 1696,
+ 488, 1694, 464, 682, 414, 1748, 436, 1722, 488, 632, 438, 686, 408, 662,
+ 462, 1696, 488, 1722, 462, 1696, 462, 1746, 436, 1798, 386, 1694, 490,
+ 1720, 516, 5234, 4370, 4446, 490, 1690, 492, 658, 434, 1726, 436, 1746,
+ 464, 604, 488, 658, 412, 1718, 490, 636, 460, 660, 438, 1698, 460, 662,
+ 458, 632, 436, 1718, 490, 1720, 488, 608, 436, 1754, 462, 1726, 438, 682,
+ 414, 1748, 464, 632, 460, 660, 410, 658, 438, 1748, 464, 1694, 464, 660,
+ 436, 1720, 488, 634, 460, 1726, 462, 1724, 462, 1692, 490, 606, 462, 714,
+ 384, 660, 460, 1722, 460, 1722, 490, 606, 464, 1718, 490, 1670, 486, 634,
+ 462, 662, 410, 660, 460, 1722, 464, 1718, 460, 1696, 464, 1720, 462, 1720,
+ 462, 1722, 486, 1700, 462}; // UNKNOWN 1F691B97
+
+ irsend.begin();
+ irsend.reset();
+
+ irsend.sendRaw(rawData, 199, 38000);
+ irsend.makeDecodeResult();
+ ASSERT_TRUE(irrecv.decode(&irsend.capture));
+ EXPECT_EQ(COOLIX48, irsend.capture.decode_type);
+ EXPECT_EQ(kCoolix48Bits, irsend.capture.bits);
+ EXPECT_EQ(0xB24DA35C6C7F, irsend.capture.value);
+ EXPECT_EQ(0x0, irsend.capture.address);
+ EXPECT_EQ(0x0, irsend.capture.command);
+}
+
+TEST(TestDecodeCoolix48, SyntheticSelfDecode) {
+ IRsendTest irsend(kGpioUnused);
+ IRrecv irrecv(kGpioUnused);
+ irsend.begin();
+
+ irsend.reset();
+ irsend.sendCoolix48(0xB24DA35C6C7F);
+ irsend.makeDecodeResult();
+
+ ASSERT_TRUE(irrecv.decode(&irsend.capture));
+ EXPECT_EQ(COOLIX48, irsend.capture.decode_type);
+ EXPECT_EQ(kCoolix48Bits, irsend.capture.bits);
+ EXPECT_EQ(0xB24DA35C6C7F, irsend.capture.value);
+ EXPECT_EQ(0x0, irsend.capture.address);
+ EXPECT_EQ(0x0, irsend.capture.command);
+
+ EXPECT_EQ(
+ "f38000d33"
+ "m4692s4416" // Message.
+ "m552s1656m552s552m552s1656m552s1656m552s552m552s552m552s1656m552s552"
+ "m552s552m552s1656m552s552m552s552m552s1656m552s1656m552s552m552s1656"
+ "m552s1656m552s552m552s1656m552s552m552s552m552s552m552s1656m552s1656"
+ "m552s552m552s1656m552s552m552s1656m552s1656m552s1656m552s552m552s552"
+ "m552s552m552s1656m552s1656m552s552m552s1656m552s1656m552s552m552s552"
+ "m552s552m552s1656m552s1656m552s1656m552s1656m552s1656m552s1656m552s1656"
+ "m552s5244"
+ "m4692s4416" // Repeat
+ "m552s1656m552s552m552s1656m552s1656m552s552m552s552m552s1656m552s552"
+ "m552s552m552s1656m552s552m552s552m552s1656m552s1656m552s552m552s1656"
+ "m552s1656m552s552m552s1656m552s552m552s552m552s552m552s1656m552s1656"
+ "m552s552m552s1656m552s552m552s1656m552s1656m552s1656m552s552m552s552"
+ "m552s552m552s1656m552s1656m552s552m552s1656m552s1656m552s552m552s552"
+ "m552s552m552s1656m552s1656m552s1656m552s1656m552s1656m552s1656m552s1656"
+ "m552s5244",
+ irsend.outputStr());
+}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Mitsubishi_test.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Mitsubishi_test.cpp
index 28cc04d8e..815d4f996 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Mitsubishi_test.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Mitsubishi_test.cpp
@@ -913,7 +913,9 @@ TEST(TestMitsubishiACClass, HumanReadable) {
"Power: On, Mode: 1 (Heat), Temp: 22C, Fan: 6 (Quiet), "
"Swing(V): 0 (Auto), Swing(H): 3 (Middle), "
"Clock: 17:10, On Timer: 00:00, Off Timer: 00:00, Timer: -, "
- "Weekly Timer: Off",
+ "Weekly Timer: Off"
+ ", 10C Heat: Off, ISee: Off, Econo: Off, Absense detect: Off, "
+ "Direct / Indirect Mode: 0, Fresh: Off",
ac.toString());
ac.setTemp(21.5);
ac.setWeeklyTimerEnabled(true);
@@ -921,7 +923,9 @@ TEST(TestMitsubishiACClass, HumanReadable) {
"Power: On, Mode: 1 (Heat), Temp: 21.5C, Fan: 6 (Quiet), "
"Swing(V): 0 (Auto), Swing(H): 3 (Middle), "
"Clock: 17:10, On Timer: 00:00, Off Timer: 00:00, Timer: -, "
- "Weekly Timer: On",
+ "Weekly Timer: On"
+ ", 10C Heat: Off, ISee: Off, Econo: Off, Absense detect: Off, "
+ "Direct / Indirect Mode: 0, Fresh: Off",
ac.toString());
}
@@ -1434,7 +1438,9 @@ TEST(TestDecodeMitsubishiAC, Issue891) {
"Power: Off, Mode: 3 (Cool), Temp: 24C, Fan: 0 (Auto), "
"Swing(V): 0 (Auto), Swing(H): 3 (Middle), "
"Clock: 00:00, On Timer: 00:00, Off Timer: 00:00, Timer: -, "
- "Weekly Timer: Off",
+ "Weekly Timer: Off"
+ ", 10C Heat: Off, ISee: Off, Econo: Off, Absense detect: Off, "
+ "Direct / Indirect Mode: 0, Fresh: Off",
ac.toString());
}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Toshiba_test.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Toshiba_test.cpp
index 1785b3895..4a63780d5 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Toshiba_test.cpp
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/test/ir_Toshiba_test.cpp
@@ -312,20 +312,21 @@ TEST(TestToshibaACClass, HumanReadableOutput) {
ac.setRaw(initial_state);
EXPECT_EQ("Temp: 17C, Power: On, Mode: 0 (Auto), Fan: 0 (Auto), "
- "Turbo: Off, Econo: Off",
+ "Turbo: Off, Econo: Off, Filter: Off",
ac.toString());
ac.setRaw(modified_state);
EXPECT_EQ("Temp: 17C, Power: On, Mode: 1 (Cool), Fan: 5 (High), "
- "Turbo: Off, Econo: Off",
+ "Turbo: Off, Econo: Off, Filter: Off",
ac.toString());
ac.setTemp(25);
ac.setFan(3);
ac.setMode(kToshibaAcDry);
EXPECT_EQ("Temp: 25C, Power: On, Mode: 2 (Dry), Fan: 3 (Medium), "
- "Turbo: Off, Econo: Off",
+ "Turbo: Off, Econo: Off, Filter: Off",
ac.toString());
ac.off();
- EXPECT_EQ("Temp: 25C, Power: Off, Fan: 3 (Medium), Turbo: Off, Econo: Off",
+ EXPECT_EQ("Temp: 25C, Power: Off, Fan: 3 (Medium), Turbo: Off, Econo: Off, "
+ "Filter: Off",
ac.toString());
}
@@ -379,7 +380,7 @@ TEST(TestDecodeToshibaAC, SyntheticExample) {
EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits);
EXPECT_EQ(
"Temp: 17C, Power: On, Mode: 0 (Auto), Fan: 0 (Auto), Turbo: Off, "
- "Econo: Off",
+ "Econo: Off, Filter: Off",
IRAcUtils::resultAcToString(&irsend.capture));
stdAc::state_t r, p;
ASSERT_TRUE(IRAcUtils::decodeToState(&irsend.capture, &r, &p));
@@ -555,6 +556,7 @@ TEST(TestToshibaACClass, toCommon) {
ac.setMode(kToshibaAcCool);
ac.setTemp(20);
ac.setFan(kToshibaAcFanMax);
+ ac.setFilter(true);
// Now test it.
ASSERT_EQ(decode_type_t::TOSHIBA_AC, ac.toCommon().protocol);
ASSERT_EQ(-1, ac.toCommon().model);
@@ -563,13 +565,13 @@ TEST(TestToshibaACClass, toCommon) {
ASSERT_EQ(20, ac.toCommon().degrees);
ASSERT_EQ(stdAc::opmode_t::kCool, ac.toCommon().mode);
ASSERT_EQ(stdAc::fanspeed_t::kMax, ac.toCommon().fanspeed);
+ ASSERT_TRUE(ac.toCommon().filter);
// Unsupported.
ASSERT_EQ(stdAc::swingv_t::kOff, ac.toCommon().swingv);
ASSERT_EQ(stdAc::swingh_t::kOff, ac.toCommon().swingh);
ASSERT_FALSE(ac.toCommon().turbo);
ASSERT_FALSE(ac.toCommon().econo);
ASSERT_FALSE(ac.toCommon().light);
- ASSERT_FALSE(ac.toCommon().filter);
ASSERT_FALSE(ac.toCommon().clean);
ASSERT_FALSE(ac.toCommon().beep);
ASSERT_FALSE(ac.toCommon().quiet);
@@ -626,7 +628,7 @@ TEST(TestDecodeToshibaAC, RealLongExample) {
EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits);
EXPECT_EQ(
"Temp: 22C, Power: On, Mode: 0 (Auto), Fan: 0 (Auto), Turbo: On, "
- "Econo: Off",
+ "Econo: Off, Filter: Off",
IRAcUtils::resultAcToString(&irsend.capture));
}
@@ -731,7 +733,7 @@ TEST(TestToshibaACClass, ConstructLongState) {
ac.setEcono(true);
EXPECT_EQ(
"Temp: 29C, Power: On, Mode: 2 (Dry), Fan: 2 (UNKNOWN), "
- "Turbo: Off, Econo: On",
+ "Turbo: Off, Econo: On, Filter: Off",
ac.toString());
EXPECT_EQ(kToshibaACStateLengthLong, ac.getStateLength());
const uint8_t expectedState[kToshibaACStateLengthLong] = {
@@ -781,7 +783,8 @@ TEST(TestDecodeToshibaAC, RealExample_WHUB03NJ) {
EXPECT_EQ(kToshibaACBits, irsend.capture.bits);
EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits);
EXPECT_EQ(
- "Temp: 20C, Power: Off, Fan: 0 (Auto), Turbo: Off, Econo: Off",
+ "Temp: 20C, Power: Off, Fan: 0 (Auto), Turbo: Off, Econo: Off, "
+ "Filter: Off",
IRAcUtils::resultAcToString(&irsend.capture));
}
@@ -828,3 +831,34 @@ TEST(TestToshibaACClass, SwingCodes) {
"Temp: 17C, Swing(V): 4 (Toggle)",
ac.toString());
}
+
+// For https://github.com/crankyoldgit/IRremoteESP8266/issues/1692
+TEST(TestToshibaACClass, Filter) {
+ IRToshibaAC ac(kGpioUnused);
+ ac.begin();
+ EXPECT_FALSE(ac.getFilter());
+
+ ac.setFilter(true);
+ EXPECT_TRUE(ac.getFilter());
+
+
+ ac.setFilter(false);
+ EXPECT_FALSE(ac.getFilter());
+
+ ac.setFilter(true);
+ EXPECT_TRUE(ac.getFilter());
+
+ const uint8_t pure_off[kToshibaACStateLength] = {
+ 0xF2, 0x0D, 0x03, 0xFC, 0x01, 0x40, 0x03, 0x00, 0x42};
+ ac.setRaw(pure_off);
+ EXPECT_FALSE(ac.getFilter());
+
+ const uint8_t pure_on[kToshibaACStateLength] = {
+ 0xF2, 0x0D, 0x03, 0xFC, 0x01, 0x40, 0x03, 0x10, 0x52};
+ ac.setRaw(pure_on);
+ EXPECT_TRUE(ac.getFilter());
+
+ // Convert a known filter/pure on state to a known off filter/pure state.
+ ac.setFilter(false);
+ EXPECT_STATE_EQ(pure_off, ac.getRaw(), ac.getStateLength() * 8);
+}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/Makefile b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/Makefile
index 15f192efd..bf65a996d 100644
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/Makefile
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/Makefile
@@ -27,7 +27,9 @@ CPPFLAGS += -DUNIT_TEST -D_IR_LOCALE_=en-AU
# Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra -pthread -std=gnu++11
-all : gc_decode mode2_decode
+objects = $(patsubst %.cpp,%,$(wildcard *.cpp))
+
+all : $(objects)
run_tests : all
failed=""; \
@@ -35,6 +37,10 @@ run_tests : all
echo "RUNNING: $${py_unittest}"; \
python3 ./$${py_unittest} || failed="$${failed} $${py_unittest}"; \
done; \
+ for shell_unittest in *_test.sh; do \
+ echo "RUNNING: $${shell_unittest}"; \
+ bash ./$${shell_unittest} || failed="$${failed} $${shell_unittest}"; \
+ done; \
if [ -n "$${failed}" ]; then \
echo "FAIL: :-( :-( Unit test(s)$${failed} failed! :-( :-("; exit 1; \
else \
@@ -46,7 +52,7 @@ run-% : all
python3 ./$*.py;
clean :
- rm -f *.o *.pyc gc_decode mode2_decode
+ rm -f *.o *.pyc $(objects)
# Keep all intermediate files.
@@ -80,7 +86,7 @@ IRrecv.o : $(USER_DIR)/IRrecv.cpp $(USER_DIR)/IRrecv.h $(USER_DIR)/IRremoteESP82
# new specific targets goes above this line
-%_decode : $(COMMON_OBJ) %_decode.o
+$(objects) : %: $(COMMON_OBJ) %.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@
ir_%.o : $(USER_DIR)/ir_%.h $(USER_DIR)/ir_%.cpp $(COMMON_DEPS) $(GTEST_HEADERS)
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/code_to_raw.cpp b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/code_to_raw.cpp
new file mode 100644
index 000000000..7358f16da
--- /dev/null
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/code_to_raw.cpp
@@ -0,0 +1,148 @@
+// Quick and dirty tool to convert a protocol's (hex) codes to raw timings.
+// Copyright 2021 David Conran
+
+#include
+#include
+#include
+#include
+#include
+#include "IRac.h"
+#include "IRsend.h"
+#include "IRsend_test.h"
+#include "IRutils.h"
+
+
+void usage_error(char *name) {
+ std::cerr << "Usage: " << name
+ << " --protocol PROTOCOL_NAME"
+ << " --code "
+ << " [--bits 1-" << kStateSizeMax * 8 << "]"
+ << " [--timinginfo]"
+ << std::endl;
+}
+
+int main(int argc, char *argv[]) {
+ int argv_offset = 1;
+ int repeats = 0;
+ uint64_t code = 0;
+ uint8_t state[kStateSizeMax] = {0}; // All array elements are set to 0.
+ decode_type_t input_type = decode_type_t::UNKNOWN;
+ bool timinginfo = false;
+
+ // Check the invocation/calling usage.
+ if (argc < 5 || argc > 8) {
+ usage_error(argv[0]);
+ return 1;
+ }
+
+ if (strncmp("--protocol", argv[argv_offset], 11) == 0) {
+ argv_offset++;
+ input_type = strToDecodeType(argv[argv_offset]);
+ switch (input_type) {
+ // Unsupported types
+ case decode_type_t::UNUSED:
+ case decode_type_t::UNKNOWN:
+ case decode_type_t::GLOBALCACHE:
+ case decode_type_t::PRONTO:
+ case decode_type_t::RAW:
+ std::cerr << "The protocol specified is not supported by this program."
+ << std::endl;
+ return 1;
+ default:
+ break;
+ }
+ argv_offset++;
+ }
+
+ uint16_t nbits = IRsend::defaultBits(input_type);
+ uint16_t stateSize = nbits / 8;
+ if (strncmp("--code", argv[argv_offset], 7) == 0) {
+ argv_offset++;
+ String hexstr = String(argv[argv_offset]);
+ uint64_t strOffset = 0;
+ if (hexstr.rfind("0x", 0) || hexstr.rfind("0X", 0)) strOffset = 2;
+
+ // Calculate how many hexadecimal characters there are.
+ uint64_t hexstrlength = hexstr.length() - strOffset;
+
+ // Ptr to the least significant byte of the resulting state for this
+ // protocol.
+ uint8_t *statePtr = &state[stateSize - 1];
+
+ // Convert the string into a state array of the correct length.
+ for (uint16_t i = 0; i < hexstrlength; i++) {
+ // Grab the next least sigificant hexadecimal digit from the string.
+ uint8_t c = tolower(hexstr[hexstrlength + strOffset - i - 1]);
+ if (isxdigit(c)) {
+ if (isdigit(c))
+ c -= '0';
+ else
+ c = c - 'a' + 10;
+ } else {
+ std::cerr << "Code " << argv[argv_offset]
+ << " contains non-hexidecimal characters." << std::endl;
+ return 3;
+ }
+ if (i % 2 == 1) { // Odd: Upper half of the byte.
+ *statePtr += (c << 4);
+ statePtr--; // Advance up to the next least significant byte of state.
+ } else { // Even: Lower half of the byte.
+ *statePtr = c;
+ }
+ }
+ if (!hasACState(input_type))
+ code = std::stoull(argv[argv_offset], nullptr, 16);
+ argv_offset++;
+ }
+
+ if (argc - argv_offset > 0 && strncmp("--bits", argv[argv_offset], 7) == 0) {
+ argv_offset++;
+ nbits = std::stoul(argv[argv_offset], nullptr, 10);
+ if (nbits == 0 && (nbits <= kStateSizeMax * 8)) {
+ std::cerr << "Nr. of bits " << argv[argv_offset]
+ << " is invalid." << std::endl;
+ return 1;
+ }
+ stateSize = nbits / 8;
+ argv_offset++;
+ }
+
+ if (argc - argv_offset > 0 &&
+ strncmp("--timinginfo", argv[argv_offset], 13) == 0) {
+ argv_offset++;
+ timinginfo = true;
+ }
+
+ if (argc - argv_offset != 0) {
+ usage_error(argv[0]);
+ return 1;
+ }
+
+ IRsendTest irsend(kGpioUnused);
+ IRrecv irrecv(kGpioUnused);
+ irsend.begin();
+ irsend.reset();
+
+ if (hasACState(input_type)) // Is it larger than 64 bits?
+ irsend.send(input_type, state, stateSize);
+ else
+ irsend.send(input_type, code, nbits, repeats);
+
+ irsend.makeDecodeResult();
+ irrecv.decode(&irsend.capture);
+
+ std::cout << "Code type: " << irsend.capture.decode_type << " ("
+ << typeToString(irsend.capture.decode_type) << ")" << std::endl
+ << "Code bits: " << irsend.capture.bits << std::endl;
+ if (hasACState(irsend.capture.decode_type)) {
+ String description = IRAcUtils::resultAcToString(&irsend.capture);
+ if (description.length()) {
+ std::cout << "Description: " << description.c_str() << std::endl;
+ }
+ }
+
+ std::cout << std::endl << resultToSourceCode(&irsend.capture) << std::endl;
+ if (timinginfo) std::cout << resultToTimingInfo(&irsend.capture);
+
+ return 0;
+}
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/code_to_raw_test.sh b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/code_to_raw_test.sh
new file mode 100755
index 000000000..fd587f2ad
--- /dev/null
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/code_to_raw_test.sh
@@ -0,0 +1,65 @@
+#! /bin/bash
+CODE_TO_RAW=./code_to_raw
+if [[ ! -x ${CODE_TO_RAW} ]]; then
+ echo "'raw_to_code' failed to compile and produce an executable."
+ exit 1
+fi
+
+function unittest_success()
+{
+ COMMAND=$1
+ EXPECTED="$2"
+ echo -n "Testing: \"${COMMAND}\" ..."
+ OUTPUT="$(${COMMAND})"
+ STATUS=$?
+ FAILURE=""
+ if [[ ${STATUS} -ne 0 ]]; then
+ FAILURE="Non-Zero Exit status: ${STATUS}. "
+ fi
+ if [[ "${OUTPUT}" != "${EXPECTED}" ]]; then
+ FAILURE="${FAILURE} Unexpected Output: \"${OUTPUT}\" != \"${EXPECTED}\""
+ fi
+ if [[ -z ${FAILURE} ]]; then
+ echo " ok!"
+ return 0
+ else
+ echo
+ echo "FAILED: ${FAILURE}"
+ return 1
+ fi
+}
+
+read -r -d '' OUT << EOM
+Code type: 4 (SONY)
+Code bits: 12
+
+uint16_t rawData[78] = {2400, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 600, 600, 600, 600, 600, 24600, 2400, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 600, 600, 600, 600, 600, 24600, 2400, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 600, 600, 600, 600, 600, 24600 }; // SONY F50
+uint32_t address = 0x1;
+uint32_t command = 0x2F;
+uint64_t data = 0xF50;
+EOM
+
+unittest_success "${CODE_TO_RAW} --protocol Sony --code 0xf50 --bits 12" "${OUT}"
+
+read -r -d '' OUT << EOM
+Code type: 7 (SAMSUNG)
+Code bits: 32
+
+uint16_t rawData[68] = {4480, 4480, 560, 1680, 560, 1680, 560, 1680, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1680, 560, 1680, 560, 1680, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1680, 560, 560, 560, 560, 560, 1680, 560, 1680, 560, 560, 560, 560, 560, 1680, 560, 560, 560, 1680, 560, 1680, 560, 560, 560, 560, 560, 1680, 560, 1680, 560, 560, 560, 47040 }; // SAMSUNG E0E09966
+uint32_t address = 0x7;
+uint32_t command = 0x99;
+uint64_t data = 0xE0E09966;
+EOM
+
+unittest_success "${CODE_TO_RAW} --protocol SAMSUNG --code 0xE0E09966" "${OUT}"
+
+read -r -d '' OUT << xEOMx
+Code type: 18 (KELVINATOR)
+Code bits: 128
+Description: Power: On, Mode: 1 (Cool), Temp: 27C, Fan: 1 (Low), Turbo: Off, Quiet: Off, XFan: On, Ion: Off, Light: Off, Swing(H): Off, Swing(V): Off
+
+uint16_t rawData[280] = {9010, 4504, 680, 1530, 680, 510, 680, 510, 680, 1530, 680, 1530, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 1530, 680, 510, 680, 1530, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 510, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 510, 680, 1530, 680, 510, 680, 510, 680, 1530, 680, 510, 680, 19974, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 1530, 680, 1530, 680, 39950, 9010, 4504, 680, 1530, 680, 510, 680, 510, 680, 1530, 680, 1530, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 1530, 680, 510, 680, 1530, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 510, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 1530, 680, 1530, 680, 510, 680, 510, 680, 1530, 680, 510, 680, 19974, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 510, 680, 1530, 680, 1530, 680, 1530, 680, 1530, 680, 39950 }; // KELVINATOR
+uint8_t state[16] = {0x19, 0x0B, 0x80, 0x50, 0x00, 0x00, 0x00, 0xE0, 0x19, 0x0B, 0x80, 0x70, 0x00, 0x00, 0x10, 0xF0};
+xEOMx
+
+unittest_success "${CODE_TO_RAW} --protocol KELVINATOR --code 0x190B8050000000E0190B8070000010F0" "${OUT}"
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/extract_lib_version.sh b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/extract_lib_version.sh
new file mode 100755
index 000000000..8bea94334
--- /dev/null
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/extract_lib_version.sh
@@ -0,0 +1,14 @@
+#!/bin/bash -e
+# Copyright 2021 crankyoldgit
+# Extract and constuct the string version of the IRremoteESP8266 Library Version
+function getVerNum()
+{
+ echo $(egrep "^#define\s+_IRREMOTEESP8266_VERSION_$1\s+" \
+ src/IRremoteESP8266.h | awk '{print $3;}')
+}
+
+MAJOR=$(getVerNum "MAJOR")
+MINOR=$(getVerNum "MINOR")
+PATCH=$(getVerNum "PATCH")
+LIB_VERSION="${MAJOR}.${MINOR}.${PATCH}"
+echo $LIB_VERSION
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/mkkeywords b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/mkkeywords
index e050e4964..34def1332 100755
--- a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/mkkeywords
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/mkkeywords
@@ -30,7 +30,8 @@ cat << EndOfTextEndOfTextEndOfText
EndOfTextEndOfTextEndOfText
-CLASSES=$(egrep -h "^ *((enum|class) |} [a-zA-Z0-9_]+_t;$)" src/*.h |
+CLASSES=$(egrep -h \
+ "^ *((enum|class|struct) [a-zA-Z0-9_]+|} [a-zA-Z0-9_]+_t;$)" src/*.h |
sed 's/^ *//;s/enum class//;s/\;$//' | cut -d' ' -f2 | sort -u |
grep -v "^__")
for i in ${CLASSES}; do
@@ -45,7 +46,7 @@ cat << EndOfTextEndOfTextEndOfText
EndOfTextEndOfTextEndOfText
CTYPES="u?int(8|16|32|64)?(_t)?|void|bool|char|float|long|double|String|static"
-OURTYPES="match_result_t|state_t|decode_type_t"
+OURTYPES="match_result_t|stdAc::state_t|decode_type_t"
METHODS=$(egrep -h "^[ ]{0,2}(${CTYPES}|${OURTYPES})\*? [^ ]*\(" src/*.cpp |
sed 's/^ //' | cut -d' ' -f2 | sed 's/^\([^:]*::\| *\* *\)//' |
cut -d'(' -f1 | sort -u | grep -v RAM_ATTR)
diff --git a/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/scrape_supported_devices.py b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/scrape_supported_devices.py
new file mode 100755
index 000000000..f40b3e959
--- /dev/null
+++ b/lib/lib_basic/IRremoteESP8266/IRremoteESP8266/tools/scrape_supported_devices.py
@@ -0,0 +1,426 @@
+#!/usr/bin/env python3
+"""Generate SupportedProtocols.md by scraping source code files"""
+import pathlib
+import argparse
+import subprocess
+from io import StringIO
+import sys
+import re
+import time
+
+CODE_URL = "https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_"
+
+BRAND_MODEL = re.compile(r"""
+ Brand:\s{1,20} # "Brand:" label followd by between 1 and 20 whitespace chars.
+ \b(?P.{1,40})\b # The actual brand of the device, max 40 chars.
+ \s{0,10}, # Followed by at most 10 whitespace chars, then a comma.
+ \s{1,20} # The between 1 and 20 whitespace chars.
+ Model:\s{1,20} # "Model:" label followd by between 1 and 20 whitespace chars.
+ \b(?P.{1,80}) # The model info of the device, max 80 chars.
+ \s{0,5}$ # Followed by at most 5 whitespaces before the end of line.
+ """, re.VERBOSE)
+ENUMS = re.compile(r"enum (\w{1,60}) {(.{1,5000}?)};", re.DOTALL)
+ENUM_ENTRY = re.compile(r"^\s{1,80}(\w{1,80})", re.MULTILINE)
+DECODED_PROTOCOLS = re.compile(r"""
+ .{0,80} # Ignore upto an 80 char line of whitespace/code etc.
+ # Now look for code that looks like we are assigning the Protocol type.
+ # There are two typical styles used:
+ (?:results->decode_type # The first style.
+ | # Or
+ typeguess) # The second style
+ \s{0,5}=\s{0,5} # The assignment operator and potential whitespace
+ (?:decode_type_t::)? # The protocol could have an optional type prefix.
+ (\w{1,40}); # Finally, the last word of code should be the Protocol.
+ """, re.VERBOSE)
+AC_FN = re.compile(r"ir_(.{1,80})\.h")
+AC_MODEL_ENUM_RE = re.compile(r"(.{1,40})_ac_remote_model_t")
+IRSEND_FN_RE = re.compile(r"IRsend\.h")
+ALL_FN = re.compile(r"ir_(.{1,80})\.(h|cpp)")
+
+EXCLUDED_PROTOCOLS = ["UNKNOWN", "UNUSED", "kLastDecodeType", "typeguess"]
+EXCLUDED_ACS = ["Magiquest", "NEC"]
+
+def getgitcommittime():
+ """Call git to get time of last commit
+ """
+ try:
+ label = subprocess.check_output(\
+ ["git", "show", "-s", "--format=%ct", "HEAD"]).strip()
+ return int(label)
+ except FileNotFoundError as err:
+ print("Git failed, which is ok, no git binary found?:", err)
+ return None
+ except subprocess.SubprocessError as err:
+ print("Git failed, which is ok, see output, maybe no git checkout?:", err)
+ return None
+
+def getmarkdownheader():
+ """Get the generated header
+ """
+ srctime = getgitcommittime()
+ # pylint: disable=C0209
+ return """""".format(
+ time.strftime("%a %d %b %Y %H:%M:%S +0000", time.gmtime(srctime)))
+ # pylint: enable=C0209
+
+
+
+def getallprotocols():
+ """Return all protocls configured in IRremoteESP8266.h
+ """
+ irremote = ARGS.directory / "IRremoteESP8266.h"
+ enums = getenums(irremote)["decode_type_t"]
+ if not enums:
+ errorexit("Error getting ENUMS from IRremoteESP8266.h")
+ return enums
+
+
+def getdecodedprotocols():
+ """All protocols that include decoding support"""
+ ret = set()
+ for path in ARGS.directory.iterdir():
+ if path.suffix != ".cpp":
+ continue
+ matches = DECODED_PROTOCOLS.finditer(path.open(encoding="utf-8").read())
+ for match in matches:
+ protocol = match.group(1)
+ if protocol not in EXCLUDED_PROTOCOLS:
+ ret.add(protocol)
+ return ret
+
+
+def getallacs():
+ """All supported A/C codes"""
+ ret = {}
+ for path in ARGS.directory.iterdir():
+ match = AC_FN.match(path.name)
+ if match:
+ acprotocol = match.group(1)
+ rawmodels = getenums(path)
+ models = set()
+ for model in rawmodels:
+ model = model.upper()
+ model = model.replace(f"K{acprotocol.upper()}", "")
+ if model and model not in EXCLUDED_PROTOCOLS:
+ models.add(model)
+ if acprotocol in ret:
+ ret[acprotocol].update(models)
+ else:
+ ret[acprotocol] = models
+ # Parse IRsend.h's enums
+ match = IRSEND_FN_RE.match(path.name)
+ if match:
+ rawmodels = getenums(path)
+ for acprotocol, acmodels in rawmodels.items():
+ models = set()
+ for model in acmodels:
+ model = model.upper()
+ model = model.replace(f"K{acprotocol.upper()}", "")
+ if model and model not in EXCLUDED_PROTOCOLS:
+ models.add(model)
+ if acprotocol in ret:
+ ret[acprotocol].update(models)
+ else:
+ ret[acprotocol] = models
+ return ret
+
+class FnSets():
+ """Container for getalldevices"""
+ def __init__(self):
+ self.allcodes = {}
+ self.fnnomatch = set()
+ self.allhfileprotos = set()
+ self.fnhmatch = set()
+ self.fncppmatch = set()
+
+ def add(self, supports, path):
+ """add the path to correct set based on supports"""
+ if path.suffix == ".h":
+ self.allhfileprotos.add(path.stem)
+ if supports:
+ if path.suffix == ".h":
+ self.fnhmatch.add(path.stem)
+ elif path.suffix == ".cpp":
+ self.fncppmatch.add(path.stem)
+ else:
+ self.fnnomatch.add(path.stem)
+
+ def printwarnings(self):
+ """print warnings"""
+ # all protos with support in .cpp file, when there is a .h file
+ # meaning that the documentation should probably be moved to .h
+ # in the future, with doxygen, that might change
+ protosincppwithh = list(self.fncppmatch & self.allhfileprotos)
+ if protosincppwithh:
+ protosincppwithh.sort()
+ print("The following files has supports section in .cpp, expected in .h")
+ for path in protosincppwithh:
+ print(f"\t{path}")
+
+ protosincppandh = list(self.fncppmatch & self.fnhmatch)
+ if protosincppandh:
+ protosincppandh.sort()
+ print("The following files has supports section in both .h and .cpp")
+ for path in protosincppandh:
+ print(f"\t{path}")
+
+ nosupports = self.getnosupports()
+ if nosupports:
+ nosupports.sort()
+ print("The following files had no supports section:")
+ for path in nosupports:
+ print(f"\t{path}")
+
+ return protosincppwithh or protosincppandh or nosupports
+
+ def getnosupports(self):
+ """get protos without supports sections"""
+ return list(self.fnnomatch - self.fnhmatch - self.fncppmatch)
+
+
+def getalldevices():
+ """All devices and associated branding and model information (if available)
+ """
+ sets = FnSets()
+ for path in ARGS.directory.iterdir():
+ match = ALL_FN.match(path.name)
+ if not match:
+ continue
+ supports = extractsupports(path)
+ sets.add(supports, path)
+ protocol = match.group(1)
+ for brand, model in supports:
+ protocolbrand = (protocol, brand)
+ pbset = sets.allcodes.get(protocolbrand, [])
+ if model in pbset:
+ print(f"Model {model} is duplicated for {protocol}, {brand}")
+ sets.allcodes[protocolbrand] = pbset + [model]
+
+ for fnprotocol in sets.getnosupports():
+ sets.allcodes[(fnprotocol[3:], "Unknown")] = []
+ return sets
+
+
+def getenums(path):
+ """Returns the keys for the first enum type in path
+ """
+ ret = {}
+ for enums in ENUMS.finditer(path.open(encoding="utf-8").read()):
+ if enums:
+ enum_name = AC_MODEL_ENUM_RE.search(enums.group(1))
+ if enum_name:
+ enum_name = enum_name.group(1).capitalize()
+ else:
+ enum_name = enums.group(1)
+ ret[enum_name] = set()
+ for enum in ENUM_ENTRY.finditer(enums.group(2)):
+ enum = enum.group(1)
+ if enum in EXCLUDED_PROTOCOLS:
+ continue
+ ret[enum_name].add(enum)
+ return ret
+
+
+ARGS = None
+
+
+def initargs():
+ """Init the command line arguments"""
+ global ARGS # pylint: disable=global-statement
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "-n",
+ "--noout",
+ help="generate no output data, combine with --alert to only check",
+ action="store_true",
+ )
+ parser.add_argument(
+ "-s",
+ "--stdout",
+ help="output to stdout rather than SupportedProtocols.md",
+ action="store_true",
+ )
+ parser.add_argument("-v",
+ "--verbose",
+ help="increase output verbosity",
+ action="store_true")
+ parser.add_argument(
+ "-a",
+ "--alert",
+ help="alert if a file does not have a supports section, "
+ "non zero exit code if issues where found",
+ action="store_true",
+ )
+ parser.add_argument(
+ "directory",
+ nargs="?",
+ help="directory of the source git checkout",
+ default=None,
+ )
+ ARGS = parser.parse_args()
+ if ARGS.directory is None:
+ src = pathlib.Path("../src")
+ if not src.is_dir():
+ src = pathlib.Path("./src")
+ else:
+ src = pathlib.Path(ARGS.directory) / "src"
+ if not src.is_dir():
+ errorexit(f"Directory not valid: {src!s}")
+ ARGS.directory = src
+ return ARGS
+
+def getmdfile():
+ """Resolves SupportedProtocols.md path"""
+ foutpath = ARGS.directory / "../SupportedProtocols.md"
+ return foutpath.resolve()
+
+def errorexit(msg):
+ """Print an error and exit on critical error"""
+ sys.stderr.write(f"{msg}\n")
+ sys.exit(1)
+
+def extractsupports(path):
+ """Extract all of the Supports: sections and associated brands and models
+ """
+ supports = []
+ insupports = False
+ for line in path.open(encoding="utf-8"):
+ if not line.startswith("//"):
+ continue
+ line = line[2:].strip()
+ if line == "Supports:":
+ insupports = True
+ continue
+ if insupports:
+ match = BRAND_MODEL.match(line)
+ if match:
+ supports.append((match.group("brand"), match.group("model")))
+ else:
+ insupports = False
+ continue
+ # search and inform about any legacy formated supports data
+ elif any(x in line for x in [ \
+ "seems compatible with",
+ "be compatible with",
+ "it working with here"]):
+ print(f"\t{path.name} Legacy supports format found\n\t\t{line}")
+ return supports
+
+
+def makeurl(txt, path):
+ """Make a Markup URL from given filename"""
+ return f"[{txt}]({CODE_URL + path})"
+
+
+def outputprotocols(fout, protocols):
+ """For a given protocol set, sort and output the markdown"""
+ protocols = list(protocols)
+ protocols.sort()
+ for protocol in protocols:
+ fout.write(f"- {protocol}\n")
+
+
+def generate(fout):
+ """Generate data to fout
+ return True on any issues (when alert is active)"""
+ decodedprotocols = getdecodedprotocols()
+ sendonly = getallprotocols() - decodedprotocols
+ allacs = getallacs()
+
+ sets = getalldevices()
+ allcodes = sets.allcodes
+ allbrands = list(allcodes.keys())
+ allbrands.sort()
+
+ fout.write("\n# IR Protocols supported by this library\n\n")
+ fout.write(
+ "| Protocol | Brand | Model | A/C Model | Detailed A/C Support |\n")
+ fout.write("| --- | --- | --- | --- | --- |\n")
+
+ for protocolbrand in allbrands:
+ protocol, brand = protocolbrand
+ codes = allcodes[protocolbrand]
+ codes.sort()
+ acmodels = []
+ acsupport = "-"
+ if protocol in allacs:
+ acmodels = list(allacs[protocol])
+ acmodels.sort()
+ brand = makeurl(brand, protocol + ".h")
+ if protocol not in EXCLUDED_ACS:
+ acsupport = "Yes"
+ # pylint: disable=C0209
+ fout.write("| {} | **{}** | {} | {} | {} |\n".format(
+ makeurl(protocol, protocol + ".cpp"),
+ brand,
+ "
".join(codes).replace("|", "\\|"),
+ "
".join(acmodels),
+ acsupport,
+ ))
+ # pylint: enable=C0209
+
+ fout.write("\n\n## Send only protocols:\n\n")
+ outputprotocols(fout, sendonly)
+
+ fout.write("\n\n## Send & decodable protocols:\n\n")
+ outputprotocols(fout, decodedprotocols)
+
+ return ARGS.alert and sets.printwarnings()
+
+def generatenone():
+ """No out write
+ return True on any issues"""
+ return generate(StringIO())
+
+def generatestdout():
+ """Standard out write
+ return True on any issues"""
+ fout = sys.stdout
+ fout.write(getmarkdownheader())
+ return generate(fout)
+
+def generatefile():
+ """File write, extra detection of changes in existing file
+ return True on any issues, but only if there is changes"""
+ # get file path
+ foutpath = getmdfile()
+ if ARGS.verbose:
+ print(f"Output path: {foutpath!s}")
+ # write data to temp memorystream
+ ftemp = StringIO()
+ ret = generate(ftemp)
+ # get old filedata, skipping header
+ with getmdfile().open("r", encoding="utf-8") as forg:
+ olddata = forg.readlines()[3:]
+ # get new data, skip first empty line
+ ftemp.seek(0)
+ newdata = ftemp.readlines()[1:]
+ # if new data is same as old we don't need to write anything
+ if newdata == olddata:
+ print("No changes, exit without write")
+ return False
+ # write output
+ with foutpath.open("w", encoding="utf-8") as fout:
+ fout.write(getmarkdownheader())
+ fout.write(ftemp.getvalue())
+
+ return ret
+
+def main():
+ """Default main function
+ return True on any issues"""
+ initargs()
+ if ARGS.verbose:
+ print(f"Looking for files in: {ARGS.directory.resolve()!s}")
+ if ARGS.noout:
+ return generatenone()
+ if ARGS.stdout:
+ return generatestdout()
+ # default file
+ return generatefile()
+
+
+if __name__ == "__main__":
+ sys.exit(1 if main() else 0)
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.cpp b/lib/lib_basic/OneWire-Stickbreaker/OneWire.cpp
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.cpp
rename to lib/lib_basic/OneWire-Stickbreaker/OneWire.cpp
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.h b/lib/lib_basic/OneWire-Stickbreaker/OneWire.h
similarity index 95%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.h
rename to lib/lib_basic/OneWire-Stickbreaker/OneWire.h
index edb31d1eb..2747bea4e 100644
--- a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.h
+++ b/lib/lib_basic/OneWire-Stickbreaker/OneWire.h
@@ -161,7 +161,7 @@ IO_REG_TYPE directRead(IO_REG_TYPE pin)
#else // plain ESP32
if ( pin < 32 )
return (GPIO.in >> pin) & 0x1;
- else if ( pin < 40 )
+ else if ( pin < 46 )
return (GPIO.in1.val >> (pin - 32)) & 0x1;
#endif
@@ -176,7 +176,7 @@ void directWriteLow(IO_REG_TYPE pin)
#else // plain ESP32
if ( pin < 32 )
GPIO.out_w1tc = ((uint32_t)1 << pin);
- else if ( pin < 34 )
+ else if ( pin < 46 )
GPIO.out1_w1tc.val = ((uint32_t)1 << (pin - 32));
#endif
}
@@ -189,7 +189,7 @@ void directWriteHigh(IO_REG_TYPE pin)
#else // plain ESP32
if ( pin < 32 )
GPIO.out_w1ts = ((uint32_t)1 << pin);
- else if ( pin < 34 )
+ else if ( pin < 46 )
GPIO.out1_w1ts.val = ((uint32_t)1 << (pin - 32));
#endif
}
@@ -211,19 +211,15 @@ void directModeInput(IO_REG_TYPE pin)
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
}
#elif ESP_IDF_VERSION_MAJOR > 3 // ESP32-S2 needs IDF 4.2 or later
- int rtcio_num = rtc_io_number_get((gpio_num_t)pin);
-
- if (rtcio_num >= 0) {
- uint32_t rtc_reg(rtc_io_desc[rtcio_num].reg);
-
- if ( rtc_reg ) // RTC pins PULL settings
- {
- ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtcio_num].mux);
- ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtcio_num].pullup | rtc_io_desc[rtcio_num].pulldown);
- }
+ int8_t rtc_io = esp32_gpioMux[pin].rtc;
+ uint32_t rtc_reg = (rtc_io != -1)?rtc_io_desc[rtc_io].reg:0;
+ if ( rtc_reg ) // RTC pins PULL settings
+ {
+ ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtc_io].mux);
+ ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtc_io].pullup | rtc_io_desc[rtc_io].pulldown);
}
#endif
-
+ // Input
if ( pin < 32 )
GPIO.enable_w1tc = ((uint32_t)1 << pin);
else
@@ -231,7 +227,7 @@ void directModeInput(IO_REG_TYPE pin)
uint32_t pinFunction((uint32_t)2 << FUN_DRV_S); // what are the drivers?
pinFunction |= FUN_IE; // input enable but required for output as well?
- pinFunction |= ((uint32_t)2 << MCU_SEL_S);
+ pinFunction |= ((uint32_t)PIN_FUNC_GPIO << MCU_SEL_S);
ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = pinFunction;
@@ -257,19 +253,15 @@ void directModeOutput(IO_REG_TYPE pin)
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
}
#elif ESP_IDF_VERSION_MAJOR > 3 // ESP32-S2 needs IDF 4.2 or later
- int rtcio_num = rtc_io_number_get((gpio_num_t)pin);
-
- if (rtcio_num >= 0) {
- uint32_t rtc_reg(rtc_io_desc[rtcio_num].reg);
-
- if ( rtc_reg ) // RTC pins PULL settings
- {
- ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtcio_num].mux);
- ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtcio_num].pullup | rtc_io_desc[rtcio_num].pulldown);
- }
+ int8_t rtc_io = esp32_gpioMux[pin].rtc;
+ uint32_t rtc_reg = (rtc_io != -1)?rtc_io_desc[rtc_io].reg:0;
+ if ( rtc_reg ) // RTC pins PULL settings
+ {
+ ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtc_io].mux);
+ ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[rtc_io].pullup | rtc_io_desc[rtc_io].pulldown);
}
#endif
-
+ // Output
if ( pin < 32 )
GPIO.enable_w1ts = ((uint32_t)1 << pin);
else // already validated to pins <= 33
@@ -277,7 +269,7 @@ void directModeOutput(IO_REG_TYPE pin)
uint32_t pinFunction((uint32_t)2 << FUN_DRV_S); // what are the drivers?
pinFunction |= FUN_IE; // input enable but required for output as well?
- pinFunction |= ((uint32_t)2 << MCU_SEL_S);
+ pinFunction |= ((uint32_t)PIN_FUNC_GPIO << MCU_SEL_S);
ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = pinFunction;
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/README.md b/lib/lib_basic/OneWire-Stickbreaker/README.md
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/README.md
rename to lib/lib_basic/OneWire-Stickbreaker/README.md
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/examples/DS18x20_Temperature/DS18x20_Temperature.pde b/lib/lib_basic/OneWire-Stickbreaker/examples/DS18x20_Temperature/DS18x20_Temperature.pde
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/examples/DS18x20_Temperature/DS18x20_Temperature.pde
rename to lib/lib_basic/OneWire-Stickbreaker/examples/DS18x20_Temperature/DS18x20_Temperature.pde
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/examples/DS2408_Switch/DS2408_Switch.pde b/lib/lib_basic/OneWire-Stickbreaker/examples/DS2408_Switch/DS2408_Switch.pde
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/examples/DS2408_Switch/DS2408_Switch.pde
rename to lib/lib_basic/OneWire-Stickbreaker/examples/DS2408_Switch/DS2408_Switch.pde
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/examples/DS250x_PROM/DS250x_PROM.pde b/lib/lib_basic/OneWire-Stickbreaker/examples/DS250x_PROM/DS250x_PROM.pde
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/examples/DS250x_PROM/DS250x_PROM.pde
rename to lib/lib_basic/OneWire-Stickbreaker/examples/DS250x_PROM/DS250x_PROM.pde
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/keywords.txt b/lib/lib_basic/OneWire-Stickbreaker/keywords.txt
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/keywords.txt
rename to lib/lib_basic/OneWire-Stickbreaker/keywords.txt
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/library.json b/lib/lib_basic/OneWire-Stickbreaker/library.json
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/library.json
rename to lib/lib_basic/OneWire-Stickbreaker/library.json
diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/library.properties b/lib/lib_basic/OneWire-Stickbreaker/library.properties
similarity index 100%
rename from lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/library.properties
rename to lib/lib_basic/OneWire-Stickbreaker/library.properties
diff --git a/lib/lib_basic/TasmotaModbus-1.2.0/README.md b/lib/lib_basic/TasmotaModbus-3.4.0/README.md
similarity index 100%
rename from lib/lib_basic/TasmotaModbus-1.2.0/README.md
rename to lib/lib_basic/TasmotaModbus-3.4.0/README.md
diff --git a/lib/lib_basic/TasmotaModbus-1.2.0/examples/modbustest/modbustest.ino b/lib/lib_basic/TasmotaModbus-3.4.0/examples/modbustest/modbustest.ino
similarity index 100%
rename from lib/lib_basic/TasmotaModbus-1.2.0/examples/modbustest/modbustest.ino
rename to lib/lib_basic/TasmotaModbus-3.4.0/examples/modbustest/modbustest.ino
diff --git a/lib/lib_basic/TasmotaModbus-1.2.0/keywords.txt b/lib/lib_basic/TasmotaModbus-3.4.0/keywords.txt
similarity index 100%
rename from lib/lib_basic/TasmotaModbus-1.2.0/keywords.txt
rename to lib/lib_basic/TasmotaModbus-3.4.0/keywords.txt
diff --git a/lib/lib_basic/TasmotaModbus-1.2.0/library.json b/lib/lib_basic/TasmotaModbus-3.4.0/library.json
similarity index 93%
rename from lib/lib_basic/TasmotaModbus-1.2.0/library.json
rename to lib/lib_basic/TasmotaModbus-3.4.0/library.json
index 3c28959ea..9c93d13b5 100644
--- a/lib/lib_basic/TasmotaModbus-1.2.0/library.json
+++ b/lib/lib_basic/TasmotaModbus-3.4.0/library.json
@@ -1,6 +1,6 @@
{
"name": "TasmotaModbus",
- "version": "1.2.0",
+ "version": "3.4.0",
"keywords": [
"serial", "io", "TasmotaModbus"
],
diff --git a/lib/lib_basic/TasmotaModbus-1.2.0/library.properties b/lib/lib_basic/TasmotaModbus-3.4.0/library.properties
similarity index 93%
rename from lib/lib_basic/TasmotaModbus-1.2.0/library.properties
rename to lib/lib_basic/TasmotaModbus-3.4.0/library.properties
index 7ac182843..748962a53 100644
--- a/lib/lib_basic/TasmotaModbus-1.2.0/library.properties
+++ b/lib/lib_basic/TasmotaModbus-3.4.0/library.properties
@@ -1,5 +1,5 @@
name=TasmotaModbus
-version=1.2.0
+version=3.4.0
author=Theo Arends
maintainer=Theo Arends
sentence=Basic modbus wrapper for TasmotaSerial for ESP8266.
diff --git a/lib/lib_basic/TasmotaModbus-1.2.0/src/TasmotaModbus.cpp b/lib/lib_basic/TasmotaModbus-3.4.0/src/TasmotaModbus.cpp
similarity index 98%
rename from lib/lib_basic/TasmotaModbus-1.2.0/src/TasmotaModbus.cpp
rename to lib/lib_basic/TasmotaModbus-3.4.0/src/TasmotaModbus.cpp
index 8c2180505..bd9b7a06b 100644
--- a/lib/lib_basic/TasmotaModbus-1.2.0/src/TasmotaModbus.cpp
+++ b/lib/lib_basic/TasmotaModbus-3.4.0/src/TasmotaModbus.cpp
@@ -42,11 +42,11 @@ uint16_t TasmotaModbus::CalculateCRC(uint8_t *frame, uint8_t num)
return crc;
}
-int TasmotaModbus::Begin(long speed, int stop_bits)
+int TasmotaModbus::Begin(long speed, uint32_t config)
{
int result = 0;
- if (begin(speed, stop_bits)) {
+ if (begin(speed, config)) {
result = 1;
if (hardwareSerial()) { result = 2; }
}
diff --git a/lib/lib_basic/TasmotaModbus-1.2.0/src/TasmotaModbus.h b/lib/lib_basic/TasmotaModbus-3.4.0/src/TasmotaModbus.h
similarity index 96%
rename from lib/lib_basic/TasmotaModbus-1.2.0/src/TasmotaModbus.h
rename to lib/lib_basic/TasmotaModbus-3.4.0/src/TasmotaModbus.h
index d6c0c2883..78fc3d50b 100644
--- a/lib/lib_basic/TasmotaModbus-1.2.0/src/TasmotaModbus.h
+++ b/lib/lib_basic/TasmotaModbus-3.4.0/src/TasmotaModbus.h
@@ -30,7 +30,7 @@ class TasmotaModbus : public TasmotaSerial {
TasmotaModbus(int receive_pin, int transmit_pin);
virtual ~TasmotaModbus() {}
- int Begin(long speed = TM_MODBUS_BAUDRATE, int stop_bits = 1);
+ int Begin(long speed = TM_MODBUS_BAUDRATE, uint32_t config = SERIAL_8N1);
uint16_t CalculateCRC(uint8_t *frame, uint8_t num);
diff --git a/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp b/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp
index 5e88150cc..398dba0df 100644
--- a/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp
+++ b/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp
@@ -1610,10 +1610,12 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) {
text = _fillcolor;
}
+ #if defined USE_UFILESYS
if (_label[0]=='/') {
draw_picture(_label, _x1, _y1, _w, _h, outline, inverted);
_gfx->drawRect(_x1, _y1, _w, _h, text);
} else {
+ #endif
uint8_t r = min(_w, _h) / 4; // Corner radius
_gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill);
_gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline);
@@ -1622,7 +1624,9 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) {
_gfx->setTextColor(text);
_gfx->setTextSize(_textsize_x, _textsize_y);
_gfx->print(_label);
+ #if defined USE_UFILESYS
}
+ #endif
}
/**************************************************************************/
diff --git a/lib/lib_display/LedControl/src/LedControl.cpp b/lib/lib_display/LedControl/src/LedControl.cpp
index e43211fd8..e2230944c 100644
--- a/lib/lib_display/LedControl/src/LedControl.cpp
+++ b/lib/lib_display/LedControl/src/LedControl.cpp
@@ -208,4 +208,3 @@ void LedControl::spiTransfer(int addr, volatile byte opcode, volatile byte data)
digitalWrite(SPI_CS,HIGH);
}
-
diff --git a/lib/lib_display/LedControl/src/LedControl.h b/lib/lib_display/LedControl/src/LedControl.h
index f8180d07d..1cd3b13b4 100644
--- a/lib/lib_display/LedControl/src/LedControl.h
+++ b/lib/lib_display/LedControl/src/LedControl.h
@@ -187,4 +187,3 @@ class LedControl {
#endif //LedControl.h
-
diff --git a/lib/lib_display/LedControl/src/LedMatrix.cpp b/lib/lib_display/LedControl/src/LedMatrix.cpp
new file mode 100644
index 000000000..fb23fbc26
--- /dev/null
+++ b/lib/lib_display/LedControl/src/LedMatrix.cpp
@@ -0,0 +1,422 @@
+/*
+ * LedMatrix.h - Extends the Library LedControl for multiple 8x8 LED dot matrix maxDevices, based on MAX7219/MAX7221
+ * Copyright (c) 2021 Michael Beuss
+ *
+ * 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:
+ *
+ * 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.
+ */
+
+#include "LedMatrix.h"
+#include "font_6x8_base.h"
+//#include "font_6x8_UTF8_C2.h" // additional characters if needed
+//#include "font_6x8_UTF8_C3.h" // additional characters (latin1) if needed
+#include "../../../../tasmota/my_user_config.h" // to check compiler option USE_UTF8_LATIN1
+#ifdef USE_UTF8_LATIN1
+ #include "font_6x8_UTF8_C2.h" // 256 bytes
+ #include "font_6x8_UTF8_C3.h" // 512 bytes
+#endif
+
+
+//the opcodes for the MAX7221 and MAX7219
+#define OP_NOOP 0
+#define OP_DIGIT0 1
+#define OP_DIGIT1 2
+#define OP_DIGIT2 3
+#define OP_DIGIT3 4
+#define OP_DIGIT4 5
+#define OP_DIGIT5 6
+#define OP_DIGIT6 7
+#define OP_DIGIT7 8
+#define OP_DECODEMODE 9
+#define OP_INTENSITY 10
+#define OP_SCANLIMIT 11
+#define OP_SHUTDOWN 12
+#define OP_DISPLAYTEST 15
+
+LedMatrix::LedMatrix(int dataPin, int clkPin, int csPin, unsigned int colums, unsigned int rows)
+{
+ if (colums * rows > MAX72XX_MAX_DEVICES)
+ {
+ // dimension exeeds maximum buffer size
+ if (colums >= MAX72XX_MAX_DEVICES)
+ {
+ colums = MAX72XX_MAX_DEVICES;
+ rows = 1;
+ }
+ else
+ {
+ rows = MAX72XX_MAX_DEVICES / colums;
+ }
+ }
+
+ charWidth = font_char_width; // defined in header file of font
+ charHeight = font_char_height; // defined in header file of font
+ modulesPerRow = colums;
+ modulesPerCol = rows;
+ displayWidth = colums * 8;
+ displayHeight = rows * 8;
+ maxDevices = colums * rows;
+ moduleOrientation = ORIENTATION_UPSIDE_DOWN; // use setOrientation() to turn it
+ textBuf[0] = 0;
+ textWidth = 0;
+ textPosX = 0;
+ textPosY = 0;
+ appendTextBuf[0] = 0;
+ setScrollAppendText(" ");
+ powerIsOn = false;
+
+ // initialize all connected MAX7219/MAX7221 devices
+ SPI_MOSI = dataPin;
+ SPI_CLK = clkPin;
+ SPI_CS = csPin;
+ pinMode(SPI_MOSI, OUTPUT);
+ pinMode(SPI_CLK, OUTPUT);
+ pinMode(SPI_CS, OUTPUT);
+ SPI_MOSI = dataPin;
+
+ //spiTransfer_value(OP_DISPLAYTEST, 0); // display test
+ spiTransfer_value(OP_SCANLIMIT, 7); // scanlimit is set to max on startup
+ spiTransfer_value(OP_DECODEMODE, 0); // decode is done in source
+ clearDisplay();
+ //spiTransfer_value(OP_SHUTDOWN, 0); //we go into shutdown-mode (LEDs off) on startup
+ setIntensity(7); // initialize with the half of the maximum intensity [0..15]
+ power(true); // power on;
+}
+
+bool LedMatrix::drawText( const char *str, bool clearBefore)
+{
+ if(clearBefore) clearDisplay();
+ strncpy(textBuf, str, TEXT_BUFFER_SIZE -1);
+ textPosX = 0;
+ textPosY = 0;
+ textLen = countChars(str);
+ textWidth = textLen * charWidth;
+ if(textWidth <= displayWidth)
+ {
+ // text fits into the display, place it into the center
+ textPosX = (displayWidth - textWidth) / 2; // center
+ }
+ else
+ {
+ // The text ist longer than the display width. Scrolling is needed.
+ // Add a space in front of text to have a distance to the pervious scroll text.
+ addSpace();
+ }
+ drawTextAt(textBuf, textPosX, textPosY);
+ refresh(); // refresh display with the new drawed string content
+ return true;
+}
+
+bool LedMatrix::drawTextAt( const char *str, const int x, const int y )
+{
+ // draw character by character
+ int xPos = x;
+ const char* fontChar = nullptr;
+ for (unsigned int i = 0; (i= 0x20 && c < 0x80) // basic font
+ {
+ fontChar = font_20_7F[c-0x20];
+ }
+
+#ifdef font_6x8_UTF8_C2_h
+ else if(c == 0xC2) // UTF special characters
+ {
+ i++;
+ c= str[i];
+ if(c>= 0xA0 && c < 0xC0)
+ {
+ fontChar = font_UTF_C2_A0_BF[c - 0xA0];
+ }
+ }
+#endif // font_6x8_UTF8_C2_h
+
+#ifdef font_6x8_UTF8_C3_h
+ else if(c == 0xC3) // UTF latin1
+ {
+ i++;
+ c= str[i];
+ if(c>= 0x80 && c < 0xC0)
+ {
+ fontChar = font_UTF_C3_80_BF[c - 0x80];
+ }
+ }
+#endif // font_6x8_UTF8_C3_h
+
+ else if(c>= 0xC0 && c <= 0xDF)
+ {
+ i += 1; // 2 byte UTF sequence
+ }
+ else if(c>= 0xE0 && c <= 0xEF)
+ {
+ i += 2; // 3 byte UTF sequence
+ }
+ else if(c>= 0xF0 && c <= 0xF7)
+ {
+ i += 3; // 4 byte UTF sequence
+ }
+
+ drawCharAt(fontChar, xPos, y);
+ xPos += charWidth;
+ }
+ return true;
+}
+
+int LedMatrix::countChars( const char* utfText)
+{
+ int len = 0;
+ for( int i = 0; (i 15)
+ return false;
+
+ spiTransfer_value(OP_INTENSITY, intensity);
+ return true;
+}
+
+bool LedMatrix::setOrientation(LedMatrix::ModuleOrientation orientation)
+{
+ if(moduleOrientation != orientation)
+ {
+ moduleOrientation = orientation;
+ refresh();
+ }
+ return true;
+}
+
+bool LedMatrix::setScrollAppendText(const char* append )
+{
+ strncpy(appendTextBuf, append, TEXT_APPEND_BUFFER_SIZE -1);
+ return (strlen(append) < TEXT_APPEND_BUFFER_SIZE);
+}
+
+bool LedMatrix::setPixel(const int x, const int y, bool on)
+{
+ if (x >= displayWidth || y >= displayHeight)
+ return false;
+
+ int modul_col = x / 8; // x pos divided by 8 is the index of the modul to the right
+ int buffer_pos = modul_col + y * modulesPerRow;
+ byte buffer_byte = 0x80 >> (x % 8);
+ if (on)
+ {
+ buffer[buffer_pos] |= buffer_byte; // set bit
+ }
+ else
+ {
+ buffer[buffer_pos] &= ~buffer_byte; // reset bit
+ }
+ return true;
+}
+
+void LedMatrix::refresh()
+{
+ int col = 0;
+ int pixelRow = 0;
+ int bufPos = 0;
+ int deviceRow = 0;
+ for(int ledRow = 7; ledRow >= 0; ledRow--) // refresh from buttom to top
+ {
+ for( int addr = 0; addr < maxDevices; addr++)
+ {
+ if(moduleOrientation == ORIENTATION_NORMAL || moduleOrientation == ORIENTATION_UPSIDE_DOWN)
+ {
+ col = addr % modulesPerRow;
+ pixelRow = (addr / modulesPerRow) * 8 + ledRow;
+ bufPos = pixelRow * modulesPerRow + col;
+ if(moduleOrientation == ORIENTATION_NORMAL)
+ {
+ // ORIENTATION_NORMAL
+ deviceDataBuff[addr] = revereBitorder(buffer[bufPos]); // mirror
+ deviceRow = 7 - ledRow; // upside down
+ }
+ else
+ {
+ // ORIENTATION_UPSIDE_DOWN
+ deviceDataBuff[maxDevices -1 - addr] = buffer[bufPos];
+ deviceRow = ledRow;
+ }
+ }
+ else // ORIENTATION_TURN_RIGHT || ORIENTATION_TURN_LEFT
+ {
+ // not implemented yet
+ }
+ }
+ setRow_allDevices(deviceRow, deviceDataBuff);
+ }
+}
+
+// private functions
+/**
+ * @brief
+ *
+ * @param fontChar defines the pixelrows of a character. const char fontChar[charHeight]
+ * @param x
+ * @param y
+ */
+bool LedMatrix::drawCharAt( const char* fontChar, const int x, const int y)
+{
+ // ignore when the character position is not visible on the display
+ bool visible = (
+ x > 0 - (int)charWidth && x < (int)displayWidth &&
+ y > 0 - (int)charHeight && y < (int)displayHeight
+ );
+ if (!visible) return false;
+
+ // ignore the leading bits above charWidth of the font definition
+ static const byte charOffset = 8 - charWidth;
+
+ for (byte charY = 0; charY < charHeight; charY++)
+ {
+ char pixelRow = (fontChar[charY]) << charOffset; // skip the first bits when the character width is smaller than 8 pixel
+ for (byte charX = 0; charX < charWidth; charX++)
+ {
+ bool pixel = (pixelRow & 0x80); // pixel=true when upper bit is set
+ setPixel(x + charX, y + charY, pixel);
+ pixelRow = pixelRow << 1; // next pixel
+ }
+ }
+ return true;
+}
+
+byte LedMatrix::revereBitorder (byte b)
+{
+ static const byte lookup[16] = {
+ 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe,
+ 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf
+ };
+ return (lookup[b & 0b1111] << 4) | lookup[b >> 4];
+}
+
+void LedMatrix::addSpace()
+{
+ strncat(textBuf, appendTextBuf, TEXT_BUFFER_SIZE -1);
+ textPosX = strlen(appendTextBuf) * charWidth; // start scrolling with space
+ textLen = countChars(textBuf);
+ textWidth = countChars(textBuf) * charWidth;
+}
+
+void LedMatrix::setRow_allDevices(int row, byte *data)
+{
+ if (row < 0 || row > 7)
+ return;
+ spiTransfer_array(row + 1, data);
+}
+
+void LedMatrix::spiTransfer_array(byte opcode, const byte* data) {
+ // create an array with the data to shift out
+ for (int addr = 0; addr < maxDevices; addr++)
+ {
+ spidata[addr * 2 + 1] = opcode;
+ spidata[addr * 2] = data[addr];
+ }
+ // enable the line
+ digitalWrite(SPI_CS, LOW);
+ // shift out the data
+ for (int i = maxDevices * 2 -1; i >= 0; i--)
+ {
+ shiftOut(SPI_MOSI, SPI_CLK, MSBFIRST, spidata[i]);
+ }
+ // latch the data onto the display
+ digitalWrite(SPI_CS, HIGH);
+}
+
+void LedMatrix::spiTransfer_value(byte opcode, byte value)
+{
+ memset(deviceDataBuff, (byte)value, maxDevices);
+ spiTransfer_array(opcode, deviceDataBuff);
+}
+
+
+
diff --git a/lib/lib_display/LedControl/src/LedMatrix.h b/lib/lib_display/LedControl/src/LedMatrix.h
new file mode 100644
index 000000000..b77038ecc
--- /dev/null
+++ b/lib/lib_display/LedControl/src/LedMatrix.h
@@ -0,0 +1,211 @@
+/*
+ * LedMatrix.h - Extends the Library LedControl for multiple 8x8 LED dot matrix devices, based on MAX7219/MAX7221
+ * Copyright (c) 2021 Michael Beuss
+ *
+ * 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:
+ *
+ * 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.
+ */
+
+#ifndef LedMatrix_h
+#define LedMatrix_h
+
+#include
+
+#if (ARDUINO >= 100)
+#include
+#else
+#include
+#endif
+
+#ifndef MAX72XX_MAX_DEVICES
+#define MAX72XX_MAX_DEVICES 32 // maximum number of devices based on MXA7219/MAX7221
+#endif
+
+#define MATRIX_BUFFER_SIZE MAX72XX_MAX_DEVICES * 8 // 8 bytes per modul. One byte represents 8 LEDs.
+#define TEXT_BUFFER_SIZE 256 // maximum text length that can be scrolled
+#define TEXT_APPEND_BUFFER_SIZE 16 // used for characters that are appended to the scroll text, before it repeats
+#define SPI_BUFFER_SIZE MAX72XX_MAX_DEVICES * 2 // buffer size fort shifting commands to all devices (2 bytes each)
+
+
+/**
+ * @brief LedMatrix controls multiple 8x8 LED dot matrx devices.
+ * All devices in rows and clolums together build a common display pixel matrix.
+ *
+ */
+class LedMatrix
+{
+ public:
+ enum ModuleOrientation // orientation of 8x8 LED dot matrix mdules (first module starts at top left)
+ {
+ ORIENTATION_NORMAL, // first pixel is on top left, no turn is necessary
+ ORIENTATION_TURN_RIGHT, // first pixel is on bottom left, for correction it has to turn 90° right
+ ORIENTATION_UPSIDE_DOWN, // first pixel is on bottom right, fpr correction it has to turn 180°
+ ORIENTATION_TURN_LEFT, // first pixel is on top right, for correction is has to turn 90° left.
+ };
+
+ public:
+ /**
+ * @brief Construct a new LED Matrix object
+ *
+ * @param colums of 8x8 LED dot matrix devices
+ * @param rows of 8x8 LED dot matrix devices
+ */
+ LedMatrix(int dataPin, int clkPin, int csPin, unsigned int colums, unsigned int rows);
+
+ /**
+ * @brief Draws a string to the display.
+ * When the text fits into the display, it will be shown in the center.
+ * When the text is longer than than the display width, it can be scrolled per pixel with function scrollText().
+ *
+ * @param str string to display
+ * @param clearBefore true (default) clears old display content before, false: do not clear display before
+ */
+ bool drawText( const char *str, bool clearBefore = true );
+
+ /**
+ * @brief Dwaws a character string to a defined display position. The position (x,y) is used for the upper left pixel of the text.
+ * Existing content outside the drawing text area will not be cleared. But you can use clearDisplay() before.
+ * Use refresh() after all text parts are drawed.
+ *
+ * @param str string to display
+ * @param x horizantal pixel position to start with string (0 is most left)
+ * @param y vertical pixel position for the top position of the string (0 is top)
+ */
+ bool drawTextAt( const char *str, const int x, const int y );
+
+ /**
+ * @brief Scroll the current text one pixel to the left.
+ * Repeat with from start when end of text reached. This function can be called every 50 ms to get a propper scroll speed.
+ *
+ */
+ bool scrollText();
+
+ /**
+ * @brief switches the display on or off
+ *
+ * @param on true: on false: off
+ */
+
+ void power( bool on );
+
+ bool isPowerOn();
+
+ /**
+ * @brief cleares the display and text buffer
+ *
+ */
+ bool clearDisplay(void);
+
+ /**
+ * @brief Set the brightness of the display
+ *
+ * @param dim 0..15 (0: dark .. 15: light)
+ */
+ bool setIntensity(byte dim);
+
+ /**
+ * @brief Set the orientation of the 8x8 LED dot matrix module
+ *
+ * @param orientation
+ */
+ bool setOrientation(LedMatrix::ModuleOrientation orientation);
+
+ /**
+ * @brief Set ap pixel at a defined position.
+ * After all Pixels are set, call refresh() to send it to the display.
+ *
+ * @param x horizontal position from left
+ * @param y vertical position from top
+ * @param on true: on, false: off
+ */
+
+ /**
+ * @brief Adds a string before the scrolling text to set a distance. Usually some spaces are used.
+ *
+ * @param append text to append to the scrolling text before repeating.
+ */
+ bool setScrollAppendText(const char* append );
+
+ bool setPixel( const int x, const int y, bool on=true);
+ /**
+ * @brief sends the changed content of the buffer to the display
+ *
+ */
+ void refresh();
+
+ private:
+
+ bool drawCharAt( const char* fontChar, int x, int y ); // Draws a character to a defined position
+ int countChars( const char* utfText); // count the characters of an UTF8 string. To be uesd instead of strlen().
+ byte revereBitorder(byte b); // returnes the byte in the reverse bit order.
+ void addSpace(); // adds characters in front of the text to get a distance to the repeating scroll text
+
+ // device contrl MAX7219/MAX7221
+ /**
+ * @brief Set data for the same row of all devices
+ *
+ * @param row [0..8]
+ * @param value array of bytes, one for each device
+ */
+ void setRow_allDevices(int row, byte* value);
+
+ /* Send out a command with the same opcode to all devices */
+ /**
+ * @brief sends opcode with specific data values to each device
+ *
+ * @param opcode
+ * @param data array of byte values (data[0] is the value for the first device)
+ */
+ void spiTransfer_array(byte opcode, const byte* data);
+
+ /**
+ * @brief sends opcode with same value to all devices
+ */
+ void spiTransfer_value(byte opcode, byte value);
+
+
+ private:
+ int SPI_MOSI; // Data is shifted out of this pin
+ int SPI_CLK; // The clock is signaled on this pin
+ int SPI_CS; // This one is driven LOW for chip selectzion
+
+ unsigned int modulesPerRow;
+ unsigned int modulesPerCol;
+ unsigned int displayWidth; // matrix width [pixel]
+ unsigned int displayHeight; // matrix height [pixel]
+ int maxDevices; // number of used 8x8 devices
+ uint8_t moduleOrientation;
+ byte buffer[MATRIX_BUFFER_SIZE];
+ byte deviceDataBuff[MAX72XX_MAX_DEVICES];
+ int charWidth;
+ int charHeight;
+ char textBuf[TEXT_BUFFER_SIZE];
+ char appendTextBuf[TEXT_APPEND_BUFFER_SIZE];
+ int textLen; // number of UTF8 characters
+ int textWidth; // width of text [pixel]
+ int textPosX; // horizontal pixel position of scrolling text
+ int textPosY; // vertical pixelposition of scrolling text;
+ byte spidata[SPI_BUFFER_SIZE]; // The array for shifting the data to the devices
+ bool powerIsOn;
+
+};
+
+#endif //LedMatrix_h
\ No newline at end of file
diff --git a/lib/lib_display/LedControl/src/font_6x8_UTF8_C2.h b/lib/lib_display/LedControl/src/font_6x8_UTF8_C2.h
new file mode 100644
index 000000000..72854b4da
--- /dev/null
+++ b/lib/lib_display/LedControl/src/font_6x8_UTF8_C2.h
@@ -0,0 +1,340 @@
+// 6x8 ascii font
+#ifndef font_6x8_UTF8_C2_h
+#define font_6x8_UTF8_C2_h
+/**
+ * additional characters to font_6x8_base.h
+ * 256 bytes
+ *
+ */
+
+/*
+UTF8 after 0xC2
+ …0 …1 …2 …3 …4 …5 …6 …7 …8 …9 …A …B …C …D …E …F
+A… NBSP¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ SHY ® ¯
+B… ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+*/
+const char font_UTF_C2_A0_BF[0xC0-0xA0][8] = {
+
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x80 NBSP
+ {
+ 0b00000100,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00001110,
+ 0b00001110,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x81 ¡
+ {
+ 0b00000000,
+ 0b00000100,
+ 0b00001110,
+ 0b00010000,
+ 0b00010000,
+ 0b00001110,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x82 ¢
+ {
+ 0b00000110,
+ 0b00001001,
+ 0b00001000,
+ 0b00011110,
+ 0b00001000,
+ 0b00001001,
+ 0b00010111,
+ 0b00000000,
+ }, // 0x83 £
+ {
+ 0b00010001,
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x84 ¤
+ {
+ 0b00010001,
+ 0b00001010,
+ 0b00000100,
+ 0b00011111,
+ 0b00000100,
+ 0b00011111,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x85 ¥
+ {
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x86 ¦
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00001100,
+ 0b00001010,
+ 0b00000110,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x87 §
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00001010,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x88 ¨
+ {
+ 0b00011110,
+ 0b00100001,
+ 0b00101101,
+ 0b00101001,
+ 0b00101101,
+ 0b00100001,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x89 ©
+ {
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ 0b00001111,
+ 0b00000000,
+ }, // 0x8A ª
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001001,
+ 0b00010010,
+ 0b00001001,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x8B «
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00111111,
+ 0b00000001,
+ 0b00000001,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x8C ¬
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000001,
+ 0b00000001,
+ 0b00000000,
+ 0b11111111,
+ 0b00000000,
+ }, // 0x8D SHY
+ {
+ 0b00011110,
+ 0b00100101,
+ 0b00101011,
+ 0b00101101,
+ 0b00101011,
+ 0b00100001,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x8E ®
+ {
+ 0b00000000,
+ 0b00001110,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x8F ¯
+ {
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x90 °
+ {
+ 0b00000000,
+ 0b00000100,
+ 0b00001110,
+ 0b00000100,
+ 0b00000000,
+ 0b00001110,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x91 ±
+ {
+ 0b00011000,
+ 0b00000100,
+ 0b00001000,
+ 0b00011100,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x92 ²
+ {
+ 0b00011100,
+ 0b00001000,
+ 0b00001100,
+ 0b00011000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x93 ³
+ {
+ 0b00001100,
+ 0b00001100,
+ 0b00001000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x94 ´
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00011100,
+ 0b00010000,
+ 0b00010000,
+ }, // 0x95 µ
+ {
+ 0b00001111,
+ 0b00010101,
+ 0b00010101,
+ 0b00001101,
+ 0b00000101,
+ 0b00000101,
+ 0b00000101,
+ 0b00000000,
+ }, // 0x96 ¶
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00001000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x97 ·
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00001110,
+ 0b00000110,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x98 ¸
+ {
+ 0b00001000,
+ 0b00011000,
+ 0b00001000,
+ 0b00001000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x99 ¹
+ {
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x9A º
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010010,
+ 0b00001001,
+ 0b00010010,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x9B »
+ {
+ 0b00010000,
+ 0b00010010,
+ 0b00010100,
+ 0b00001011,
+ 0b00010101,
+ 0b00000111,
+ 0b00000001,
+ 0b00000000,
+ }, // 0x9C ¼
+ {
+ 0b00010000,
+ 0b00010010,
+ 0b00010100,
+ 0b00001110,
+ 0b00010001,
+ 0b00000010,
+ 0b00000111,
+ 0b00000000,
+ }, // 0x9D ½
+ {
+ 0b00110000,
+ 0b00011010,
+ 0b00110100,
+ 0b00001011,
+ 0b00010101,
+ 0b00000111,
+ 0b00000001,
+ 0b00000000,
+ }, // 0x9E ¾
+ {
+ 0b00000100,
+ 0b00000000,
+ 0b00000100,
+ 0b00001100,
+ 0b00010000,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x9F ¿
+};
+
+#endif // font_6x8_UTF8_C2_h
\ No newline at end of file
diff --git a/lib/lib_display/LedControl/src/font_6x8_UTF8_C3.h b/lib/lib_display/LedControl/src/font_6x8_UTF8_C3.h
new file mode 100644
index 000000000..aa32f434a
--- /dev/null
+++ b/lib/lib_display/LedControl/src/font_6x8_UTF8_C3.h
@@ -0,0 +1,678 @@
+// 6x8 ascii font
+#ifndef font_6x8_UTF8_C3_h
+#define font_6x8_UTF8_C3_h
+/**
+ * additional characters to font_6x8_base.h
+ * 512 bytes
+ *
+ */
+
+/*
+UTF8 after 0xC3
+ …0 …1 …2 …3 …4 …5 …6 …7 …8 …9 …A …B …C …D …E …F
+8… À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+9… Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+A… à á â ã ä å æ ç è é ê ë ì í î ï
+B… ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+*/
+const char font_UTF_C3_80_BF[0xC0-0x80][8] = {
+
+ {
+ 0b00001100,
+ 0b00000000,
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x80 À
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x81 Á
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x82 Â
+ {
+ 0b00000101,
+ 0b00001010,
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x83 Ã
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x84 Ä
+ {
+ 0b00001110,
+ 0b00001010,
+ 0b00001110,
+ 0b00011011,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x85 Å
+ {
+ 0b00000111,
+ 0b00001100,
+ 0b00010100,
+ 0b00010111,
+ 0b00011100,
+ 0b00010100,
+ 0b00010111,
+ 0b00000000,
+ }, // 0x86 Æ
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010000,
+ 0b00010000,
+ 0b00010001,
+ 0b00001110,
+ 0b00000100,
+ 0b00001100,
+ }, // 0x87 Ç
+ {
+ 0b00001100,
+ 0b00000000,
+ 0b00011111,
+ 0b00010000,
+ 0b00011110,
+ 0b00010000,
+ 0b00011111,
+ 0b00000000,
+ }, // 0x88 È
+
+ {
+ 0b00000011,
+ 0b00000000,
+ 0b00011111,
+ 0b00010000,
+ 0b00011110,
+ 0b00010000,
+ 0b00011111,
+ 0b00000000,
+ }, // 0x89 É
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00011111,
+ 0b00010000,
+ 0b00011110,
+ 0b00010000,
+ 0b00011111,
+ 0b00000000,
+ }, // 0x8A Ê
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00011111,
+ 0b00010000,
+ 0b00011110,
+ 0b00010000,
+ 0b00011111,
+ 0b00000000,
+ }, // 0x8B Ë
+ {
+ 0b00001100,
+ 0b00000000,
+ 0b00001110,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x8C Ì
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00001110,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x8D Í
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00001110,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x8E Î
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00001110,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x8F Ï
+
+ {
+ 0b00001110,
+ 0b00001001,
+ 0b00001001,
+ 0b00011101,
+ 0b00001001,
+ 0b00001001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x90 Ð
+ {
+ 0b00001010,
+ 0b00010100,
+ 0b00000000,
+ 0b00010010,
+ 0b00011010,
+ 0b00010110,
+ 0b00010010,
+ 0b00000000,
+ }, // 0x91 Ñ
+ {
+ 0b00011000,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x92 Ò
+ {
+ 0b00000110,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x93 Ó
+ {
+ 0b00001110,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x94 Ô
+ {
+ 0b00001010,
+ 0b00010100,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x95 Õ
+ {
+ 0b00010010,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x96 Ö
+ {
+ 0b00000000,
+ 0b00010001,
+ 0b00001010,
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x97 ×
+ {
+ 0b00001111,
+ 0b00010011,
+ 0b00010101,
+ 0b00010101,
+ 0b00010101,
+ 0b00011001,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x98 Ø
+
+ {
+ 0b00011000,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x99 Ù
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x9A Ú
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x9B Û
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x9C Ü
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00010001,
+ 0b00001010,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x9D Ý
+ {
+ 0b00011000,
+ 0b00010000,
+ 0b00011100,
+ 0b00010010,
+ 0b00010010,
+ 0b00011100,
+ 0b00010000,
+ 0b00011000,
+ }, // 0x9E Þ
+ {
+ 0b00000000,
+ 0b00011100,
+ 0b00010010,
+ 0b00011100,
+ 0b00010010,
+ 0b00010010,
+ 0b00011100,
+ 0b00010000,
+ }, // 0x9F ß
+
+ {
+ 0b00001100,
+ 0b00000000,
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0xA0 à
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0xA1 á
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0xA2 â
+ {
+ 0b00000101,
+ 0b00001010,
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0xA3 ã
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0xA4 ä
+ {
+ 0b00001110,
+ 0b00001010,
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0xA5 å
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00011110,
+ 0b00000101,
+ 0b00011111,
+ 0b00010100,
+ 0b00001111,
+ 0b00000000,
+ }, // 0xA6 æ
+ {
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00010000,
+ 0b00010001,
+ 0b00001110,
+ 0b00000100,
+ 0b00001100,
+ }, // 0xA7 ç
+ {
+ 0b00001100,
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00011110,
+ 0b00010000,
+ 0b00001110,
+ 0b00000000,
+ }, // 0xA8 è
+ {
+ 0b00000011,
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00011110,
+ 0b00010000,
+ 0b00001110,
+ 0b00000000,
+ }, // 0xA9 é
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00011110,
+ 0b00010000,
+ 0b00001110,
+ 0b00000000,
+ }, // 0xAA ê
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00011110,
+ 0b00010000,
+ 0b00001110,
+ 0b00000000,
+ }, // 0xAB ë
+ {
+ 0b00001000,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000110,
+ 0b00000000,
+ }, // 0xAC ì
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000110,
+ 0b00000000,
+ }, // 0xAD í
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000110,
+ 0b00000000,
+ }, // 0xAE î
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000110,
+ 0b00000000,
+ }, // 0xAF ï
+
+ {
+ 0b00001100,
+ 0b00010000,
+ 0b00001000,
+ 0b00000100,
+ 0b00001110,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0xB0 ð
+ {
+ 0b00001010,
+ 0b00010100,
+ 0b00000000,
+ 0b00011100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00000000,
+ }, // 0xB1 ñ
+ {
+ 0b00011000,
+ 0b00000000,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0xB2 ò
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0xB3 ó
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0xB4 ô
+ {
+ 0b00001010,
+ 0b00010100,
+ 0b00000000,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0xB5 õ
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0xB6 ö
+ {
+ 0b00000000,
+ 0b00000100,
+ 0b00000000,
+ 0b00011111,
+ 0b00000000,
+ 0b00000100,
+ 0b00000000,
+ 0b00000000,
+ }, // 0xB7 ÷
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000001,
+ 0b00001110,
+ 0b00010110,
+ 0b00011010,
+ 0b00011100,
+ 0b00100000,
+ }, // 0xB8 ø
+ {
+ 0b00011000,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010110,
+ 0b00001010,
+ 0b00000000,
+ }, // 0xB9 ù
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010110,
+ 0b00001010,
+ 0b00000000,
+ }, // 0xBA ú
+ {
+ 0b00001110,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010110,
+ 0b00001010,
+ 0b00000000,
+ }, // 0xBB û
+ {
+ 0b00010010,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010110,
+ 0b00001010,
+ 0b00000000,
+ }, // 0xBC ü
+ {
+ 0b00000110,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001110,
+ 0b00000100,
+ 0b00011000,
+ }, // 0xBD ý
+ {
+ 0b00000000,
+ 0b00011000,
+ 0b00010000,
+ 0b00011100,
+ 0b00010010,
+ 0b00011100,
+ 0b00010000,
+ 0b00011000,
+ }, // 0xBE þ
+ {
+ 0b00001010,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001110,
+ 0b00000100,
+ 0b00011000,
+ }, // 0xBF ÿ
+};
+
+/*
+ISO/IEC 8859-1 (latin1)
+ …0 …1 …2 …3 …4 …5 …6 …7 …8 …9 …A …B …C …D …E …F
+A… NBSP ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ SHY ® ¯
+B… ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+C… À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+D… Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+E… à á â ã ä å æ ç è é ê ë ì í î ï
+F… ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+*/
+
+#endif // font_6x8_UTF8_C3_h
\ No newline at end of file
diff --git a/lib/lib_display/LedControl/src/font_6x8_base.h b/lib/lib_display/LedControl/src/font_6x8_base.h
new file mode 100644
index 000000000..084b28c00
--- /dev/null
+++ b/lib/lib_display/LedControl/src/font_6x8_base.h
@@ -0,0 +1,986 @@
+// 6x8 ascii font
+#ifndef font_6x8_base_h
+#define font_6x8_base_h
+/**
+ * Momory size of basic ascii font: 768 bytes
+ *
+ */
+
+/*
+ …0 …1 …2 …3 …4 …5 …6 …7 …8 …9 …A …B …C …D …E …F
+2… SP ! " # $ % & ' ( ) * + , - . /
+3… 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+4… @ A B C D E F G H I J K L M N O
+5… P Q R S T U V W X Y Z [ \ ] ^ _
+6… ` a b c d e f g h i j k l m n o
+7… p q r s t u v w x y z { | } ~
+*/
+
+const unsigned int font_char_width = 6;
+const unsigned int font_char_height = 8;
+
+const char font_20_7F[0x80-0x20][8] = {
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x20
+ {
+ 0b00000100,
+ 0b00001110,
+ 0b00001110,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x21 !
+ {
+ 0b00011011,
+ 0b00011011,
+ 0b00010010,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x22 "
+ {
+ 0b00000000,
+ 0b00001010,
+ 0b00011111,
+ 0b00001010,
+ 0b00001010,
+ 0b00011111,
+ 0b00001010,
+ 0b00000000,
+ }, // 0x23 #
+ {
+ 0b00001000,
+ 0b00001110,
+ 0b00010000,
+ 0b00001100,
+ 0b00000010,
+ 0b00011100,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x24 $
+ {
+ 0b00011001,
+ 0b00011001,
+ 0b00000010,
+ 0b00000100,
+ 0b00001000,
+ 0b00010011,
+ 0b00010011,
+ 0b00000000,
+ }, // 0x25 %
+ {
+ 0b00001000,
+ 0b00010100,
+ 0b00010100,
+ 0b00001000,
+ 0b00010101,
+ 0b00010010,
+ 0b00001101,
+ 0b00000000,
+ }, // 0x26 &
+ {
+ 0b00001100,
+ 0b00001100,
+ 0b00001000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x27 '
+ {
+ 0b00000100,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x28 (
+ {
+ 0b00001000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00001000,
+ 0b00000000,
+ }, // 0x29 )
+ {
+ 0b00000000,
+ 0b00001010,
+ 0b00001110,
+ 0b00011111,
+ 0b00001110,
+ 0b00001010,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x2A *
+ {
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00011111,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x2B +
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00001100,
+ 0b00001100,
+ 0b00001000,
+ }, // 0x2C ,
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00011111,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x2D -
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00001100,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x2E .
+ {
+ 0b00000000,
+ 0b00000001,
+ 0b00000010,
+ 0b00000100,
+ 0b00001000,
+ 0b00010000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x2F /
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010011,
+ 0b00010101,
+ 0b00011001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x30 0
+ {
+ 0b00000100,
+ 0b00001100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x31 1
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00000001,
+ 0b00000110,
+ 0b00001000,
+ 0b00010000,
+ 0b00011111,
+ 0b00000000,
+ }, // 0x32 2
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00000001,
+ 0b00001110,
+ 0b00000001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x33 3
+ {
+ 0b00000010,
+ 0b00000110,
+ 0b00001010,
+ 0b00010010,
+ 0b00011111,
+ 0b00000010,
+ 0b00000010,
+ 0b00000000,
+ }, // 0x34 4
+ {
+ 0b00011111,
+ 0b00010000,
+ 0b00010000,
+ 0b00011110,
+ 0b00000001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x35 5
+ {
+ 0b00000110,
+ 0b00001000,
+ 0b00010000,
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x36 6
+ {
+ 0b00011111,
+ 0b00000001,
+ 0b00000010,
+ 0b00000100,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00000000,
+ }, // 0x37 7
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x38 8
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00001111,
+ 0b00000001,
+ 0b00000010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x39 9
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001100,
+ 0b00001100,
+ 0b00000000,
+ 0b00001100,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x3A :
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001100,
+ 0b00001100,
+ 0b00000000,
+ 0b00001100,
+ 0b00001100,
+ 0b00001000,
+ }, // 0x3B ;
+ {
+ 0b00000010,
+ 0b00000100,
+ 0b00001000,
+ 0b00010000,
+ 0b00001000,
+ 0b00000100,
+ 0b00000010,
+ 0b00000000,
+ }, // 0x3C <
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00011111,
+ 0b00000000,
+ 0b00000000,
+ 0b00011111,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x3D =
+ {
+ 0b00001000,
+ 0b00000100,
+ 0b00000010,
+ 0b00000001,
+ 0b00000010,
+ 0b00000100,
+ 0b00001000,
+ 0b00000000,
+ }, // 0x3E >
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00000001,
+ 0b00000110,
+ 0b00000100,
+ 0b00000000,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x3F ?
+
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010111,
+ 0b00010101,
+ 0b00010111,
+ 0b00010000,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x40 @
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x41 A
+ {
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x42 B
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x43 C
+ {
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x44 D
+ {
+ 0b00011111,
+ 0b00010000,
+ 0b00010000,
+ 0b00011110,
+ 0b00010000,
+ 0b00010000,
+ 0b00011111,
+ 0b00000000,
+ }, // 0x45 E
+ {
+ 0b00011111,
+ 0b00010000,
+ 0b00010000,
+ 0b00011110,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00000000,
+ }, // 0x46 F
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010000,
+ 0b00010111,
+ 0b00010001,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0x47 G
+ {
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00011111,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x48 H
+ {
+ 0b00001110,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x49 I
+ {
+ 0b00000001,
+ 0b00000001,
+ 0b00000001,
+ 0b00000001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x4A J
+ {
+ 0b00010001,
+ 0b00010010,
+ 0b00010100,
+ 0b00011000,
+ 0b00010100,
+ 0b00010010,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x4B K
+ {
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00011111,
+ 0b00000000,
+ }, // 0x4C L
+ {
+ 0b00010001,
+ 0b00011011,
+ 0b00010101,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x4D M
+ {
+ 0b00010001,
+ 0b00011001,
+ 0b00010101,
+ 0b00010011,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x4E N
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x4F O
+ {
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00011110,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00000000,
+ }, // 0x50 P
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010101,
+ 0b00010010,
+ 0b00001101,
+ 0b00000000,
+ }, // 0x51 Q
+ {
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00011110,
+ 0b00010010,
+ 0b00010001,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x52 R
+ {
+ 0b00001110,
+ 0b00010001,
+ 0b00010000,
+ 0b00001110,
+ 0b00000001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x53 S
+ {
+ 0b00011111,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x54 T
+ {
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x55 U
+ {
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001010,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x56 V
+ {
+ 0b00010001,
+ 0b00010001,
+ 0b00010101,
+ 0b00010101,
+ 0b00010101,
+ 0b00010101,
+ 0b00001010,
+ 0b00000000,
+ }, // 0x57 W
+ {
+ 0b00010001,
+ 0b00010001,
+ 0b00001010,
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x58 X
+ {
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001010,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x59 Y
+ {
+ 0b00011110,
+ 0b00000010,
+ 0b00000100,
+ 0b00001000,
+ 0b00010000,
+ 0b00010000,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x5A Z
+ {
+ 0b00001110,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x5B [
+ {
+ 0b00000000,
+ 0b00010000,
+ 0b00001000,
+ 0b00000100,
+ 0b00000010,
+ 0b00000001,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x5C backslash
+ {
+ 0b00001110,
+ 0b00000010,
+ 0b00000010,
+ 0b00000010,
+ 0b00000010,
+ 0b00000010,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x5D ]
+ {
+ 0b00000100,
+ 0b00001010,
+ 0b00010001,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x5E ^
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00111111,
+ }, // 0x5F _
+ {
+ 0b00001100,
+ 0b00001100,
+ 0b00000100,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x60 `
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001110,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0x61 a
+ {
+ 0b00010000,
+ 0b00010000,
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x62 b
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00010000,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x63 c
+ {
+ 0b00000001,
+ 0b00000001,
+ 0b00001111,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001111,
+ 0b00000000,
+ }, // 0x64 d
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00011110,
+ 0b00010000,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x65 e
+ {
+ 0b00000110,
+ 0b00001000,
+ 0b00001000,
+ 0b00011110,
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
+ 0b00000000,
+ }, // 0x66 f
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001111,
+ 0b00010001,
+ 0b00010001,
+ 0b00001111,
+ 0b00000001,
+ 0b00001110,
+ }, // 0x67 g
+ {
+ 0b00010000,
+ 0b00010000,
+ 0b00011100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00000000,
+ }, // 0x68 h
+ {
+ 0b00000100,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000110,
+ 0b00000000,
+ }, // 0x69 i
+ {
+ 0b00000010,
+ 0b00000000,
+ 0b00000110,
+ 0b00000010,
+ 0b00000010,
+ 0b00000010,
+ 0b00010010,
+ 0b00001100,
+ }, // 0x6A j
+ {
+ 0b00010000,
+ 0b00010000,
+ 0b00010010,
+ 0b00010100,
+ 0b00011000,
+ 0b00010100,
+ 0b00010010,
+ 0b00000000,
+ }, // 0x6B k
+ {
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000110,
+ 0b00000000,
+ }, // 0x6C l
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00011010,
+ 0b00010101,
+ 0b00010101,
+ 0b00010001,
+ 0b00010001,
+ 0b00000000,
+ }, // 0x6D m
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00011100,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00000000,
+ }, // 0x6E n
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x6F o
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00011110,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00011110,
+ 0b00010000,
+ }, // 0x70 p
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001111,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001111,
+ 0b00000001,
+ }, // 0x71 q
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010110,
+ 0b00001001,
+ 0b00001000,
+ 0b00001000,
+ 0b00011100,
+ 0b00000000,
+ }, // 0x72 r
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00001110,
+ 0b00010000,
+ 0b00001110,
+ 0b00000001,
+ 0b00001110,
+ 0b00000000,
+ }, // 0x73 s
+ {
+ 0b00000000,
+ 0b00001000,
+ 0b00011110,
+ 0b00001000,
+ 0b00001000,
+ 0b00001010,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x74 t
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00010110,
+ 0b00001010,
+ 0b00000000,
+ }, // 0x75 u
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010001,
+ 0b00010001,
+ 0b00010001,
+ 0b00001010,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x76 v
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010001,
+ 0b00010001,
+ 0b00010101,
+ 0b00011111,
+ 0b00001010,
+ 0b00000000,
+ }, // 0x77 w
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00001100,
+ 0b00010010,
+ 0b00010010,
+ 0b00000000,
+ }, // 0x78 x
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00010010,
+ 0b00010010,
+ 0b00010010,
+ 0b00001110,
+ 0b00000100,
+ 0b00011000,
+ }, // 0x79 y
+ {
+ 0b00000000,
+ 0b00000000,
+ 0b00011110,
+ 0b00000010,
+ 0b00001100,
+ 0b00010000,
+ 0b00011110,
+ 0b00000000,
+ }, // 0x7A z
+ {
+ 0b00000110,
+ 0b00001000,
+ 0b00001000,
+ 0b00011000,
+ 0b00001000,
+ 0b00001000,
+ 0b00000110,
+ 0b00000000,
+ }, // 0x7B {
+ {
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ 0b00000100,
+ 0b00000100,
+ 0b00000100,
+ 0b00000000,
+ }, // 0x7C |
+ {
+ 0b00001100,
+ 0b00000010,
+ 0b00000010,
+ 0b00000011,
+ 0b00000010,
+ 0b00000010,
+ 0b00001100,
+ 0b00000000,
+ }, // 0x7D }
+ {
+ 0b00001010,
+ 0b00010100,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x7E ~
+ {
+ 0b00000100,
+ 0b00001110,
+ 0b00011011,
+ 0b00010001,
+ 0b00010001,
+ 0b00011111,
+ 0b00000000,
+ 0b00000000,
+ }, // 0x7F ␡
+};
+
+#endif // font_6x8_base_h
\ No newline at end of file
diff --git a/lib/lib_display/UDisplay/uDisplay.cpp b/lib/lib_display/UDisplay/uDisplay.cpp
index 8414795e0..f6ac1a20b 100755
--- a/lib/lib_display/UDisplay/uDisplay.cpp
+++ b/lib/lib_display/UDisplay/uDisplay.cpp
@@ -20,7 +20,7 @@
#include
#include "uDisplay.h"
-#define UDSP_DEBUG
+// #define UDSP_DEBUG
const uint16_t udisp_colors[]={UDISP_BLACK,UDISP_WHITE,UDISP_RED,UDISP_GREEN,UDISP_BLUE,UDISP_CYAN,UDISP_MAGENTA,\
UDISP_YELLOW,UDISP_NAVY,UDISP_DARKGREEN,UDISP_DARKCYAN,UDISP_MAROON,UDISP_PURPLE,UDISP_OLIVE,\
diff --git a/lib/lib_display/arduino-tm1637/SevenSegmentTM1637.h b/lib/lib_display/arduino-tm1637/SevenSegmentTM1637.h
index 95a06b113..eeaf7adc2 100644
--- a/lib/lib_display/arduino-tm1637/SevenSegmentTM1637.h
+++ b/lib/lib_display/arduino-tm1637/SevenSegmentTM1637.h
@@ -183,24 +183,24 @@ public:
void setPrintDelay(uint16_t printDelay);
// helpers //////////////////////////////////////////////////////////////////
- /* Encodes a character to sevensegment binairy
+ /* Encodes a character to sevensegment binary
*
@param [in] c a character to encode
*/
uint8_t encode(char c);
- /* Encodes a single digit to sevensegment binairy
+ /* Encodes a single digit to sevensegment binary
*
@param [in] d a digit to encode
*/
uint8_t encode(int16_t d);
- /* Encodes a null terminated c string (char array) to sevensegment binairy
+ /* Encodes a null terminated c string (char array) to sevensegment binary
*
@param [out] buffer holds the encodes char array
@param [in] str the c string to encode
@param [in] bufferSize the size/length of the buffer
*/
size_t encode(uint8_t* buffer, const char* str, size_t bufferSize);
- /* Encodes a byte array to sevensegment binairy
+ /* Encodes a byte array to sevensegment binary
*
@param [out] buffer holds the encodes char array
@param [in] byteArr the byte array to encode
diff --git a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-send.cpp b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-send.cpp
index 92492167a..9a805fb2b 100644
--- a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-send.cpp
+++ b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-send.cpp
@@ -77,7 +77,14 @@ void ESPKNXIP::send(address_t const &receiver, knx_command_type_t ct, uint8_t da
DEBUG_PRINTLN(F(""));
#endif
+#ifdef ESP8266
udp.beginPacketMulticast(MULTICAST_IP, MULTICAST_PORT, WiFi.localIP());
+#else
+ if (0 == udp.beginMulticastPacket()) {
+ udp.beginMulticast(MULTICAST_IP, MULTICAST_PORT);
+ udp.beginMulticastPacket();
+ }
+#endif
udp.write(buf, len);
udp.endPacket();
delay(1);
diff --git a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-webserver.cpp b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-webserver.cpp
index bdbc013fd..be2745ab4 100644
--- a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-webserver.cpp
+++ b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-webserver.cpp
@@ -42,7 +42,7 @@ void ESPKNXIP::__handle_root()
case FEEDBACK_TYPE_FLOAT:
m += F("");
m += feedbacks[i].options.float_options.prefix;
- m += String(*(float *)feedbacks[i].data, feedbacks[i].options.float_options.precision);
+ m += String(*(float *)feedbacks[i].data, (unsigned int)feedbacks[i].options.float_options.precision);
m += feedbacks[i].options.float_options.suffix;
m += F("");
break;
diff --git a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip.cpp b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip.cpp
index 35cbb2161..cc2bbf49a 100644
--- a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip.cpp
+++ b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip.cpp
@@ -95,7 +95,11 @@ void ESPKNXIP::__start()
#endif
server->begin();
}
+#ifdef ESP8266
udp.beginMulticast(WiFi.localIP(), MULTICAST_IP, MULTICAST_PORT);
+#else
+ udp.beginMulticast(MULTICAST_IP, MULTICAST_PORT);
+#endif
}
void ESPKNXIP::save_to_eeprom()
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/LICENSE b/lib/lib_i2c/BME680_driver-bme680_v3.5.9/LICENSE
deleted file mode 100644
index ab7a8c8b2..000000000
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/LICENSE
+++ /dev/null
@@ -1,39 +0,0 @@
-Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-Neither the name of the copyright holder nor the names of the
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
-OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
-
-The information provided is believed to be accurate and reliable.
-The copyright holder assumes no responsibility
-for the consequences of use
-of such information nor for any infringement of patents or
-other rights of third parties which may result from its use.
-No license is granted by implication or otherwise under any patent or
-patent rights of the copyright holder.
\ No newline at end of file
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/README.md b/lib/lib_i2c/BME680_driver-bme680_v3.5.9/README.md
deleted file mode 100644
index 43abe55c8..000000000
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/README.md
+++ /dev/null
@@ -1,282 +0,0 @@
-# BME680 sensor API
-
-## Introduction
-
-This package contains the Bosch Sensortec's BME680 gas sensor API
-
-The sensor driver package includes bme680.h, bme680.c and bme680_defs.h files
-
-## Version
-
-File | Version | Date
---------------|---------|-------------
-bme680.c | 3.5.9 | 19 Jun 2018
-bme680.h | 3.5.9 | 19 Jun 2018
-bme680_defs.h | 3.5.9 | 19 Jun 2018
-
-## Integration details
-
-* Integrate bme680.h, bme680_defs.h and bme680.c file in to your project.
-* Include the bme680.h file in your code like below.
-
-``` c
-#include "bme680.h"
-```
-
-## File information
-
-* bme680_defs.h : This header file has the constants, macros and datatype declarations.
-* bme680.h : This header file contains the declarations of the sensor driver APIs.
-* bme680.c : This source file contains the definitions of the sensor driver APIs.
-
-## Supported sensor interfaces
-
-* SPI 4-wire
-* I2C
-
-## Usage guide
-
-### Initializing the sensor
-
-To initialize the sensor, you will first need to create a device structure. You
-can do this by creating an instance of the structure bme680_dev. Then go on to
-fill in the various parameters as shown below
-
-#### Example for SPI 4-Wire
-
-``` c
- struct bme680_dev gas_sensor;
-
- /* You may assign a chip select identifier to be handled later */
- gas_sensor.dev_id = 0;
- gas_sensor.intf = BME680_SPI_INTF;
- gas_sensor.read = user_spi_read;
- gas_sensor.write = user_spi_write;
- gas_sensor.delay_ms = user_delay_ms;
- /* amb_temp can be set to 25 prior to configuring the gas sensor
- * or by performing a few temperature readings without operating the gas sensor.
- */
- gas_sensor.amb_temp = 25;
-
- int8_t rslt = BME680_OK;
- rslt = bme680_init(&gas_sensor);
-```
-
-#### Example for I2C
-
-``` c
- struct bme680_dev gas_sensor;
-
- gas_sensor.dev_id = BME680_I2C_ADDR_PRIMARY;
- gas_sensor.intf = BME680_I2C_INTF;
- gas_sensor.read = user_i2c_read;
- gas_sensor.write = user_i2c_write;
- gas_sensor.delay_ms = user_delay_ms;
- /* amb_temp can be set to 25 prior to configuring the gas sensor
- * or by performing a few temperature readings without operating the gas sensor.
- */
- gas_sensor.amb_temp = 25;
-
-
- int8_t rslt = BME680_OK;
- rslt = bme680_init(&gas_sensor);
-```
-
-Regarding compensation functions for temperature, pressure, humidity and gas we have two implementations.
-
- - Integer version
- - floating point version
-
-By default, Integer version is used in the API
-
-If the user needs the floating point version, the user has to un-comment BME680_FLOAT_POINT_COMPENSATION macro
-in bme680_defs.h file or to add it in the compiler flags.
-
-### Configuring the sensor
-
-#### Example for configuring the sensor in forced mode
-
-``` c
- uint8_t set_required_settings;
-
- /* Set the temperature, pressure and humidity settings */
- gas_sensor.tph_sett.os_hum = BME680_OS_2X;
- gas_sensor.tph_sett.os_pres = BME680_OS_4X;
- gas_sensor.tph_sett.os_temp = BME680_OS_8X;
- gas_sensor.tph_sett.filter = BME680_FILTER_SIZE_3;
-
- /* Set the remaining gas sensor settings and link the heating profile */
- gas_sensor.gas_sett.run_gas = BME680_ENABLE_GAS_MEAS;
- /* Create a ramp heat waveform in 3 steps */
- gas_sensor.gas_sett.heatr_temp = 320; /* degree Celsius */
- gas_sensor.gas_sett.heatr_dur = 150; /* milliseconds */
-
- /* Select the power mode */
- /* Must be set before writing the sensor configuration */
- gas_sensor.power_mode = BME680_FORCED_MODE;
-
- /* Set the required sensor settings needed */
- set_required_settings = BME680_OST_SEL | BME680_OSP_SEL | BME680_OSH_SEL | BME680_FILTER_SEL
- | BME680_GAS_SENSOR_SEL;
-
- /* Set the desired sensor configuration */
- rslt = bme680_set_sensor_settings(set_required_settings,&gas_sensor);
-
- /* Set the power mode */
- rslt = bme680_set_sensor_mode(&gas_sensor);
-
-
-```
-
-### Reading sensor data
-
-#### Example for reading all sensor data
-
-``` c
- /* Get the total measurement duration so as to sleep or wait till the
- * measurement is complete */
- uint16_t meas_period;
- bme680_get_profile_dur(&meas_period, &gas_sensor);
-
- struct bme680_field_data data;
-
- while(1)
- {
- user_delay_ms(meas_period); /* Delay till the measurement is ready */
-
- rslt = bme680_get_sensor_data(&data, &gas_sensor);
-
- printf("T: %.2f degC, P: %.2f hPa, H %.2f %%rH ", data.temperature / 100.0f,
- data.pressure / 100.0f, data.humidity / 1000.0f );
- /* Avoid using measurements from an unstable heating setup */
- if(data.status & BME680_GASM_VALID_MSK)
- printf(", G: %d ohms", data.gas_resistance);
-
- printf("\r\n");
-
- /* Trigger the next measurement if you would like to read data out continuously */
- if (gas_sensor.power_mode == BME680_FORCED_MODE) {
- rslt = bme680_set_sensor_mode(&gas_sensor);
- }
- }
-```
-
-### Templates for function pointers
-
-``` c
-
-void user_delay_ms(uint32_t period)
-{
- /*
- * Return control or wait,
- * for a period amount of milliseconds
- */
-}
-
-int8_t user_spi_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
-{
- int8_t rslt = 0; /* Return 0 for Success, non-zero for failure */
-
- /*
- * The parameter dev_id can be used as a variable to select which Chip Select pin has
- * to be set low to activate the relevant device on the SPI bus
- */
-
- /*
- * Data on the bus should be like
- * |----------------+---------------------+-------------|
- * | MOSI | MISO | Chip Select |
- * |----------------+---------------------|-------------|
- * | (don't care) | (don't care) | HIGH |
- * | (reg_addr) | (don't care) | LOW |
- * | (don't care) | (reg_data[0]) | LOW |
- * | (....) | (....) | LOW |
- * | (don't care) | (reg_data[len - 1]) | LOW |
- * | (don't care) | (don't care) | HIGH |
- * |----------------+---------------------|-------------|
- */
-
- return rslt;
-}
-
-int8_t user_spi_write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
-{
- int8_t rslt = 0; /* Return 0 for Success, non-zero for failure */
-
- /*
- * The parameter dev_id can be used as a variable to select which Chip Select pin has
- * to be set low to activate the relevant device on the SPI bus
- */
-
- /*
- * Data on the bus should be like
- * |---------------------+--------------+-------------|
- * | MOSI | MISO | Chip Select |
- * |---------------------+--------------|-------------|
- * | (don't care) | (don't care) | HIGH |
- * | (reg_addr) | (don't care) | LOW |
- * | (reg_data[0]) | (don't care) | LOW |
- * | (....) | (....) | LOW |
- * | (reg_data[len - 1]) | (don't care) | LOW |
- * | (don't care) | (don't care) | HIGH |
- * |---------------------+--------------|-------------|
- */
-
- return rslt;
-}
-
-int8_t user_i2c_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
-{
- int8_t rslt = 0; /* Return 0 for Success, non-zero for failure */
-
- /*
- * The parameter dev_id can be used as a variable to store the I2C address of the device
- */
-
- /*
- * Data on the bus should be like
- * |------------+---------------------|
- * | I2C action | Data |
- * |------------+---------------------|
- * | Start | - |
- * | Write | (reg_addr) |
- * | Stop | - |
- * | Start | - |
- * | Read | (reg_data[0]) |
- * | Read | (....) |
- * | Read | (reg_data[len - 1]) |
- * | Stop | - |
- * |------------+---------------------|
- */
-
- return rslt;
-}
-
-int8_t user_i2c_write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
-{
- int8_t rslt = 0; /* Return 0 for Success, non-zero for failure */
-
- /*
- * The parameter dev_id can be used as a variable to store the I2C address of the device
- */
-
- /*
- * Data on the bus should be like
- * |------------+---------------------|
- * | I2C action | Data |
- * |------------+---------------------|
- * | Start | - |
- * | Write | (reg_addr) |
- * | Write | (reg_data[0]) |
- * | Write | (....) |
- * | Write | (reg_data[len - 1]) |
- * | Stop | - |
- * |------------+---------------------|
- */
-
- return rslt;
-}
-
-```
-
-## Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
\ No newline at end of file
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/Self test/bme680_selftest.c b/lib/lib_i2c/BME680_driver-bme680_v3.5.9/Self test/bme680_selftest.c
deleted file mode 100644
index c64e5f421..000000000
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/Self test/bme680_selftest.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/**\mainpage
- * Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the copyright holder nor the names of the
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
- * OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
- *
- * The information provided is believed to be accurate and reliable.
- * The copyright holder assumes no responsibility
- * for the consequences of use
- * of such information nor for any infringement of patents or
- * other rights of third parties which may result from its use.
- * No license is granted by implication or otherwise under any patent or
- * patent rights of the copyright holder.
- *
- * File bme680_selftest.c
- * @date 16 May 2018
- * @version 3.5.3
- *
- */
-
-/*!
- * @addtogroup bme680_selftest
- * @brief
- * @{*/
-
-#include "bme680_selftest.h"
-
-#define MIN_TEMPERATURE INT16_C(0) /* 0 degree Celsius */
-#define MAX_TEMPERATURE INT16_C(6000) /* 60 degree Celsius */
-
-#define MIN_PRESSURE UINT32_C(90000) /* 900 hecto Pascals */
-#define MAX_PRESSURE UINT32_C(110000) /* 1100 hecto Pascals */
-
-#define MIN_HUMIDITY UINT32_C(20000) /* 20% relative humidity */
-#define MAX_HUMIDITY UINT32_C(80000) /* 80% relative humidity*/
-
-#define HEATR_DUR 2000
-#define N_MEAS 6
-#define LOW_TEMP 150
-#define HIGH_TEMP 350
-
-/*!
- * @brief Function to analyze the sensor data
- *
- * @param[in] data Array of measurement data
- * @param[in] n_meas Number of measurements
- *
- * @return Error code
- * @retval 0 Success
- * @retval > 0 Warning
- */
-static int8_t analyze_sensor_data(struct bme680_field_data *data, uint8_t n_meas);
-
-/*!
- * @brief Self-test API for the BME680
- */
-int8_t bme680_self_test(struct bme680_dev *dev)
-{
- int8_t rslt = BME680_OK;
- struct bme680_field_data data[N_MEAS];
-
- struct bme680_dev t_dev;
-
- /* Copy required parameters from reference bme680_dev struct */
- t_dev.dev_id = dev->dev_id;
- t_dev.amb_temp = 25;
- t_dev.read = dev->read;
- t_dev.write = dev->write;
- t_dev.intf = dev->intf;
- t_dev.delay_ms = dev->delay_ms;
-
- rslt = bme680_init(&t_dev);
-
- if (rslt == BME680_OK) {
- /* Select the power mode */
- /* Must be set before writing the sensor configuration */
- t_dev.power_mode = BME680_FORCED_MODE;
-
- uint16_t settings_sel;
-
- /* Set the temperature, pressure and humidity & filter settings */
- t_dev.tph_sett.os_hum = BME680_OS_1X;
- t_dev.tph_sett.os_pres = BME680_OS_16X;
- t_dev.tph_sett.os_temp = BME680_OS_2X;
-
- /* Set the remaining gas sensor settings and link the heating profile */
- t_dev.gas_sett.run_gas = BME680_ENABLE_GAS_MEAS;
- t_dev.gas_sett.heatr_dur = HEATR_DUR;
-
- settings_sel = BME680_OST_SEL | BME680_OSP_SEL | BME680_OSH_SEL | BME680_GAS_SENSOR_SEL;
-
- uint16_t profile_dur = 0;
- bme680_get_profile_dur(&profile_dur, &t_dev);
-
- uint8_t i = 0;
- while ((rslt == BME680_OK) && (i < N_MEAS)) {
- if (rslt == BME680_OK) {
-
- if (i % 2 == 0)
- t_dev.gas_sett.heatr_temp = HIGH_TEMP; /* Higher temperature */
- else
- t_dev.gas_sett.heatr_temp = LOW_TEMP; /* Lower temperature */
-
- rslt = bme680_set_sensor_settings(settings_sel, &t_dev);
-
- if (rslt == BME680_OK) {
-
- rslt = bme680_set_sensor_mode(&t_dev); /* Trigger a measurement */
-
- t_dev.delay_ms(profile_dur); /* Wait for the measurement to complete */
-
- rslt = bme680_get_sensor_data(&data[i], &t_dev);
- }
- }
-
- i++;
- }
-
- if (rslt == BME680_OK)
- rslt = analyze_sensor_data(data, N_MEAS);
- }
-
- return rslt;
-}
-
-/*!
- * @brief Function to analyze the sensor data
- */
-static int8_t analyze_sensor_data(struct bme680_field_data *data, uint8_t n_meas)
-{
- int8_t rslt = BME680_OK;
- uint8_t self_test_failed = 0, i;
- uint32_t cent_res = 0;
-
- if ((data[0].temperature < MIN_TEMPERATURE) || (data[0].temperature > MAX_TEMPERATURE))
- self_test_failed++;
-
- if ((data[0].pressure < MIN_PRESSURE) || (data[0].pressure > MAX_PRESSURE))
- self_test_failed++;
-
- if ((data[0].humidity < MIN_HUMIDITY) || (data[0].humidity > MAX_HUMIDITY))
- self_test_failed++;
-
- for (i = 0; i < n_meas; i++) /* Every gas measurement should be valid */
- if (!(data[i].status & BME680_GASM_VALID_MSK))
- self_test_failed++;
-
- if (n_meas >= 6)
- cent_res = (data[3].gas_resistance + data[5].gas_resistance) / (2 * data[4].gas_resistance);
-
- if ((cent_res * 5) < 6)
- self_test_failed++;
-
- if (self_test_failed)
- rslt = BME680_W_SELF_TEST_FAILED;
-
- return rslt;
-}
-
-/** @}*/
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/Self test/bme680_selftest.h b/lib/lib_i2c/BME680_driver-bme680_v3.5.9/Self test/bme680_selftest.h
deleted file mode 100644
index 7cc4e639f..000000000
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/Self test/bme680_selftest.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the copyright holder nor the names of the
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
- * OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
- *
- * The information provided is believed to be accurate and reliable.
- * The copyright holder assumes no responsibility
- * for the consequences of use
- * of such information nor for any infringement of patents or
- * other rights of third parties which may result from its use.
- * No license is granted by implication or otherwise under any patent or
- * patent rights of the copyright holder.
- *
- * @file bme680_selftest.h
- * @date 16 May 2018
- * @version 3.5.3
- * @brief
- *
- */
-
-/*!
- * @addtogroup bme680_selftest
- * @brief
- * @{*/
-
-
-#ifndef BME680_SELFTEST_H_
-#define BME680_SELFTEST_H_
-
-#include "bme680.h"
-
-/*! CPP guard */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define BME680_W_SELF_TEST_FAILED 3
-
-/*!
- * @brief Self-test API for the BME680
- *
- * @param[in] Device structure containing relevant information on how
- * to communicate with the sensor
- *
- * @return Error code
- * @retval 0 Success
- * @retval < 0 Error
- * @retval > 0 Warning
- */
-int8_t bme680_self_test(struct bme680_dev *dev);
-
-/*! CPP guard */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BME680_SELFTEST_H_ */
-
-/** @}*/
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680.c b/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680.c
deleted file mode 100644
index 6067725a9..000000000
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680.c
+++ /dev/null
@@ -1,1367 +0,0 @@
-/**\mainpage
- * Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the copyright holder nor the names of the
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
- * OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
- *
- * The information provided is believed to be accurate and reliable.
- * The copyright holder assumes no responsibility
- * for the consequences of use
- * of such information nor for any infringement of patents or
- * other rights of third parties which may result from its use.
- * No license is granted by implication or otherwise under any patent or
- * patent rights of the copyright holder.
- *
- * File bme680.c
- * @date 19 Jun 2018
- * @version 3.5.9
- *
- */
-
-/*! @file bme680.c
- @brief Sensor driver for BME680 sensor */
-#include "bme680.h"
-
-/*!
- * @brief This internal API is used to read the calibrated data from the sensor.
- *
- * This function is used to retrieve the calibration
- * data from the image registers of the sensor.
- *
- * @note Registers 89h to A1h for calibration data 1 to 24
- * from bit 0 to 7
- * @note Registers E1h to F0h for calibration data 25 to 40
- * from bit 0 to 7
- * @param[in] dev :Structure instance of bme680_dev.
- *
- * @return Result of API execution status.
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-static int8_t get_calib_data(struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to set the gas configuration of the sensor.
- *
- * @param[in] dev :Structure instance of bme680_dev.
- *
- * @return Result of API execution status.
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-static int8_t set_gas_config(struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to get the gas configuration of the sensor.
- * @note heatr_temp and heatr_dur values are currently register data
- * and not the actual values set
- *
- * @param[in] dev :Structure instance of bme680_dev.
- *
- * @return Result of API execution status.
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-static int8_t get_gas_config(struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the Heat duration value.
- *
- * @param[in] dur :Value of the duration to be shared.
- *
- * @return uint8_t threshold duration after calculation.
- */
-static uint8_t calc_heater_dur(uint16_t dur);
-
-#ifndef BME680_FLOAT_POINT_COMPENSATION
-
-/*!
- * @brief This internal API is used to calculate the temperature value.
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] temp_adc :Contains the temperature ADC value .
- *
- * @return uint32_t calculated temperature.
- */
-static int16_t calc_temperature(uint32_t temp_adc, struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the pressure value.
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] pres_adc :Contains the pressure ADC value .
- *
- * @return uint32_t calculated pressure.
- */
-static uint32_t calc_pressure(uint32_t pres_adc, const struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the humidity value.
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] hum_adc :Contains the humidity ADC value.
- *
- * @return uint32_t calculated humidity.
- */
-static uint32_t calc_humidity(uint16_t hum_adc, const struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the Gas Resistance value.
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] gas_res_adc :Contains the Gas Resistance ADC value.
- * @param[in] gas_range :Contains the range of gas values.
- *
- * @return uint32_t calculated gas resistance.
- */
-static uint32_t calc_gas_resistance(uint16_t gas_res_adc, uint8_t gas_range, const struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the Heat Resistance value.
- *
- * @param[in] dev : Structure instance of bme680_dev
- * @param[in] temp : Contains the target temperature value.
- *
- * @return uint8_t calculated heater resistance.
- */
-static uint8_t calc_heater_res(uint16_t temp, const struct bme680_dev *dev);
-
-#else
-/*!
- * @brief This internal API is used to calculate the
- * temperature value value in float format
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] temp_adc :Contains the temperature ADC value .
- *
- * @return Calculated temperature in float
- */
-static float calc_temperature(uint32_t temp_adc, struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the
- * pressure value value in float format
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] pres_adc :Contains the pressure ADC value .
- *
- * @return Calculated pressure in float.
- */
-static float calc_pressure(uint32_t pres_adc, const struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the
- * humidity value value in float format
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] hum_adc :Contains the humidity ADC value.
- *
- * @return Calculated humidity in float.
- */
-static float calc_humidity(uint16_t hum_adc, const struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the
- * gas resistance value value in float format
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] gas_res_adc :Contains the Gas Resistance ADC value.
- * @param[in] gas_range :Contains the range of gas values.
- *
- * @return Calculated gas resistance in float.
- */
-static float calc_gas_resistance(uint16_t gas_res_adc, uint8_t gas_range, const struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to calculate the
- * heater resistance value in float format
- *
- * @param[in] temp : Contains the target temperature value.
- * @param[in] dev : Structure instance of bme680_dev.
- *
- * @return Calculated heater resistance in float.
- */
-static float calc_heater_res(uint16_t temp, const struct bme680_dev *dev);
-
-#endif
-
-/*!
- * @brief This internal API is used to calculate the field data of sensor.
- *
- * @param[out] data :Structure instance to hold the data
- * @param[in] dev :Structure instance of bme680_dev.
- *
- * @return int8_t result of the field data from sensor.
- */
-static int8_t read_field_data(struct bme680_field_data *data, struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to set the memory page
- * based on register address.
- *
- * The value of memory page
- * value | Description
- * --------|--------------
- * 0 | BME680_PAGE0_SPI
- * 1 | BME680_PAGE1_SPI
- *
- * @param[in] dev :Structure instance of bme680_dev.
- * @param[in] reg_addr :Contains the register address array.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-static int8_t set_mem_page(uint8_t reg_addr, struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to get the memory page based
- * on register address.
- *
- * The value of memory page
- * value | Description
- * --------|--------------
- * 0 | BME680_PAGE0_SPI
- * 1 | BME680_PAGE1_SPI
- *
- * @param[in] dev :Structure instance of bme680_dev.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-static int8_t get_mem_page(struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to validate the device pointer for
- * null conditions.
- *
- * @param[in] dev :Structure instance of bme680_dev.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-static int8_t null_ptr_check(const struct bme680_dev *dev);
-
-/*!
- * @brief This internal API is used to check the boundary
- * conditions.
- *
- * @param[in] value :pointer to the value.
- * @param[in] min :minimum value.
- * @param[in] max :maximum value.
- * @param[in] dev :Structure instance of bme680_dev.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-static int8_t boundary_check(uint8_t *value, uint8_t min, uint8_t max, struct bme680_dev *dev);
-
-/****************** Global Function Definitions *******************************/
-/*!
- *@brief This API is the entry point.
- *It reads the chip-id and calibration data from the sensor.
- */
-int8_t bme680_init(struct bme680_dev *dev)
-{
- int8_t rslt;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- /* Soft reset to restore it to default values*/
- rslt = bme680_soft_reset(dev);
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(BME680_CHIP_ID_ADDR, &dev->chip_id, 1, dev);
- if (rslt == BME680_OK) {
- if (dev->chip_id == BME680_CHIP_ID) {
- /* Get the Calibration data */
- rslt = get_calib_data(dev);
- } else {
- rslt = BME680_E_DEV_NOT_FOUND;
- }
- }
- }
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API reads the data from the given register address of the sensor.
- */
-int8_t bme680_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint16_t len, struct bme680_dev *dev)
-{
- int8_t rslt;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- if (dev->intf == BME680_SPI_INTF) {
- /* Set the memory page */
- rslt = set_mem_page(reg_addr, dev);
- if (rslt == BME680_OK)
- reg_addr = reg_addr | BME680_SPI_RD_MSK;
- }
- dev->com_rslt = dev->read(dev->dev_id, reg_addr, reg_data, len);
- if (dev->com_rslt != 0)
- rslt = BME680_E_COM_FAIL;
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API writes the given data to the register address
- * of the sensor.
- */
-int8_t bme680_set_regs(const uint8_t *reg_addr, const uint8_t *reg_data, uint8_t len, struct bme680_dev *dev)
-{
- int8_t rslt;
- /* Length of the temporary buffer is 2*(length of register)*/
- uint8_t tmp_buff[BME680_TMP_BUFFER_LENGTH] = { 0 };
- uint16_t index;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- if ((len > 0) && (len < BME680_TMP_BUFFER_LENGTH / 2)) {
- /* Interleave the 2 arrays */
- for (index = 0; index < len; index++) {
- if (dev->intf == BME680_SPI_INTF) {
- /* Set the memory page */
- rslt = set_mem_page(reg_addr[index], dev);
- tmp_buff[(2 * index)] = reg_addr[index] & BME680_SPI_WR_MSK;
- } else {
- tmp_buff[(2 * index)] = reg_addr[index];
- }
- tmp_buff[(2 * index) + 1] = reg_data[index];
- }
- /* Write the interleaved array */
- if (rslt == BME680_OK) {
- dev->com_rslt = dev->write(dev->dev_id, tmp_buff[0], &tmp_buff[1], (2 * len) - 1);
- if (dev->com_rslt != 0)
- rslt = BME680_E_COM_FAIL;
- }
- } else {
- rslt = BME680_E_INVALID_LENGTH;
- }
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API performs the soft reset of the sensor.
- */
-int8_t bme680_soft_reset(struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t reg_addr = BME680_SOFT_RESET_ADDR;
- /* 0xb6 is the soft reset command */
- uint8_t soft_rst_cmd = BME680_SOFT_RESET_CMD;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- if (dev->intf == BME680_SPI_INTF)
- rslt = get_mem_page(dev);
-
- /* Reset the device */
- if (rslt == BME680_OK) {
- rslt = bme680_set_regs(®_addr, &soft_rst_cmd, 1, dev);
- /* Wait for 5ms */
- dev->delay_ms(BME680_RESET_PERIOD);
-
- if (rslt == BME680_OK) {
- /* After reset get the memory page */
- if (dev->intf == BME680_SPI_INTF)
- rslt = get_mem_page(dev);
- }
- }
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API is used to set the oversampling, filter and T,P,H, gas selection
- * settings in the sensor.
- */
-int8_t bme680_set_sensor_settings(uint16_t desired_settings, struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t reg_addr;
- uint8_t data = 0;
- uint8_t count = 0;
- uint8_t reg_array[BME680_REG_BUFFER_LENGTH] = { 0 };
- uint8_t data_array[BME680_REG_BUFFER_LENGTH] = { 0 };
- uint8_t intended_power_mode = dev->power_mode; /* Save intended power mode */
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- if (desired_settings & BME680_GAS_MEAS_SEL)
- rslt = set_gas_config(dev);
-
- dev->power_mode = BME680_SLEEP_MODE;
- if (rslt == BME680_OK)
- rslt = bme680_set_sensor_mode(dev);
-
- /* Selecting the filter */
- if (desired_settings & BME680_FILTER_SEL) {
- rslt = boundary_check(&dev->tph_sett.filter, BME680_FILTER_SIZE_0, BME680_FILTER_SIZE_127, dev);
- reg_addr = BME680_CONF_ODR_FILT_ADDR;
-
- if (rslt == BME680_OK)
- rslt = bme680_get_regs(reg_addr, &data, 1, dev);
-
- if (desired_settings & BME680_FILTER_SEL)
- data = BME680_SET_BITS(data, BME680_FILTER, dev->tph_sett.filter);
-
- reg_array[count] = reg_addr; /* Append configuration */
- data_array[count] = data;
- count++;
- }
-
- /* Selecting heater control for the sensor */
- if (desired_settings & BME680_HCNTRL_SEL) {
- rslt = boundary_check(&dev->gas_sett.heatr_ctrl, BME680_ENABLE_HEATER,
- BME680_DISABLE_HEATER, dev);
- reg_addr = BME680_CONF_HEAT_CTRL_ADDR;
-
- if (rslt == BME680_OK)
- rslt = bme680_get_regs(reg_addr, &data, 1, dev);
- data = BME680_SET_BITS_POS_0(data, BME680_HCTRL, dev->gas_sett.heatr_ctrl);
-
- reg_array[count] = reg_addr; /* Append configuration */
- data_array[count] = data;
- count++;
- }
-
- /* Selecting heater T,P oversampling for the sensor */
- if (desired_settings & (BME680_OST_SEL | BME680_OSP_SEL)) {
- rslt = boundary_check(&dev->tph_sett.os_temp, BME680_OS_NONE, BME680_OS_16X, dev);
- reg_addr = BME680_CONF_T_P_MODE_ADDR;
-
- if (rslt == BME680_OK)
- rslt = bme680_get_regs(reg_addr, &data, 1, dev);
-
- if (desired_settings & BME680_OST_SEL)
- data = BME680_SET_BITS(data, BME680_OST, dev->tph_sett.os_temp);
-
- if (desired_settings & BME680_OSP_SEL)
- data = BME680_SET_BITS(data, BME680_OSP, dev->tph_sett.os_pres);
-
- reg_array[count] = reg_addr;
- data_array[count] = data;
- count++;
- }
-
- /* Selecting humidity oversampling for the sensor */
- if (desired_settings & BME680_OSH_SEL) {
- rslt = boundary_check(&dev->tph_sett.os_hum, BME680_OS_NONE, BME680_OS_16X, dev);
- reg_addr = BME680_CONF_OS_H_ADDR;
-
- if (rslt == BME680_OK)
- rslt = bme680_get_regs(reg_addr, &data, 1, dev);
- data = BME680_SET_BITS_POS_0(data, BME680_OSH, dev->tph_sett.os_hum);
-
- reg_array[count] = reg_addr; /* Append configuration */
- data_array[count] = data;
- count++;
- }
-
- /* Selecting the runGas and NB conversion settings for the sensor */
- if (desired_settings & (BME680_RUN_GAS_SEL | BME680_NBCONV_SEL)) {
- rslt = boundary_check(&dev->gas_sett.run_gas, BME680_RUN_GAS_DISABLE,
- BME680_RUN_GAS_ENABLE, dev);
- if (rslt == BME680_OK) {
- /* Validate boundary conditions */
- rslt = boundary_check(&dev->gas_sett.nb_conv, BME680_NBCONV_MIN,
- BME680_NBCONV_MAX, dev);
- }
-
- reg_addr = BME680_CONF_ODR_RUN_GAS_NBC_ADDR;
-
- if (rslt == BME680_OK)
- rslt = bme680_get_regs(reg_addr, &data, 1, dev);
-
- if (desired_settings & BME680_RUN_GAS_SEL)
- data = BME680_SET_BITS(data, BME680_RUN_GAS, dev->gas_sett.run_gas);
-
- if (desired_settings & BME680_NBCONV_SEL)
- data = BME680_SET_BITS_POS_0(data, BME680_NBCONV, dev->gas_sett.nb_conv);
-
- reg_array[count] = reg_addr; /* Append configuration */
- data_array[count] = data;
- count++;
- }
-
- if (rslt == BME680_OK)
- rslt = bme680_set_regs(reg_array, data_array, count, dev);
-
- /* Restore previous intended power mode */
- dev->power_mode = intended_power_mode;
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API is used to get the oversampling, filter and T,P,H, gas selection
- * settings in the sensor.
- */
-int8_t bme680_get_sensor_settings(uint16_t desired_settings, struct bme680_dev *dev)
-{
- int8_t rslt;
- /* starting address of the register array for burst read*/
- uint8_t reg_addr = BME680_CONF_HEAT_CTRL_ADDR;
- uint8_t data_array[BME680_REG_BUFFER_LENGTH] = { 0 };
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(reg_addr, data_array, BME680_REG_BUFFER_LENGTH, dev);
-
- if (rslt == BME680_OK) {
- if (desired_settings & BME680_GAS_MEAS_SEL)
- rslt = get_gas_config(dev);
-
- /* get the T,P,H ,Filter,ODR settings here */
- if (desired_settings & BME680_FILTER_SEL)
- dev->tph_sett.filter = BME680_GET_BITS(data_array[BME680_REG_FILTER_INDEX],
- BME680_FILTER);
-
- if (desired_settings & (BME680_OST_SEL | BME680_OSP_SEL)) {
- dev->tph_sett.os_temp = BME680_GET_BITS(data_array[BME680_REG_TEMP_INDEX], BME680_OST);
- dev->tph_sett.os_pres = BME680_GET_BITS(data_array[BME680_REG_PRES_INDEX], BME680_OSP);
- }
-
- if (desired_settings & BME680_OSH_SEL)
- dev->tph_sett.os_hum = BME680_GET_BITS_POS_0(data_array[BME680_REG_HUM_INDEX],
- BME680_OSH);
-
- /* get the gas related settings */
- if (desired_settings & BME680_HCNTRL_SEL)
- dev->gas_sett.heatr_ctrl = BME680_GET_BITS_POS_0(data_array[BME680_REG_HCTRL_INDEX],
- BME680_HCTRL);
-
- if (desired_settings & (BME680_RUN_GAS_SEL | BME680_NBCONV_SEL)) {
- dev->gas_sett.nb_conv = BME680_GET_BITS_POS_0(data_array[BME680_REG_NBCONV_INDEX],
- BME680_NBCONV);
- dev->gas_sett.run_gas = BME680_GET_BITS(data_array[BME680_REG_RUN_GAS_INDEX],
- BME680_RUN_GAS);
- }
- }
- } else {
- rslt = BME680_E_NULL_PTR;
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API is used to set the power mode of the sensor.
- */
-int8_t bme680_set_sensor_mode(struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t tmp_pow_mode;
- uint8_t pow_mode = 0;
- uint8_t reg_addr = BME680_CONF_T_P_MODE_ADDR;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- /* Call repeatedly until in sleep */
- do {
- rslt = bme680_get_regs(BME680_CONF_T_P_MODE_ADDR, &tmp_pow_mode, 1, dev);
- if (rslt == BME680_OK) {
- /* Put to sleep before changing mode */
- pow_mode = (tmp_pow_mode & BME680_MODE_MSK);
-
- if (pow_mode != BME680_SLEEP_MODE) {
- tmp_pow_mode = tmp_pow_mode & (~BME680_MODE_MSK); /* Set to sleep */
- rslt = bme680_set_regs(®_addr, &tmp_pow_mode, 1, dev);
- dev->delay_ms(BME680_POLL_PERIOD_MS);
- }
- }
- } while (pow_mode != BME680_SLEEP_MODE);
-
- /* Already in sleep */
- if (dev->power_mode != BME680_SLEEP_MODE) {
- tmp_pow_mode = (tmp_pow_mode & ~BME680_MODE_MSK) | (dev->power_mode & BME680_MODE_MSK);
- if (rslt == BME680_OK)
- rslt = bme680_set_regs(®_addr, &tmp_pow_mode, 1, dev);
- }
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API is used to get the power mode of the sensor.
- */
-int8_t bme680_get_sensor_mode(struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t mode;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(BME680_CONF_T_P_MODE_ADDR, &mode, 1, dev);
- /* Masking the other register bit info*/
- dev->power_mode = mode & BME680_MODE_MSK;
- }
-
- return rslt;
-}
-
-/*!
- * @brief This API is used to set the profile duration of the sensor.
- */
-void bme680_set_profile_dur(uint16_t duration, struct bme680_dev *dev)
-{
- uint32_t tph_dur; /* Calculate in us */
- uint32_t meas_cycles;
- uint8_t os_to_meas_cycles[6] = {0, 1, 2, 4, 8, 16};
-
- meas_cycles = os_to_meas_cycles[dev->tph_sett.os_temp];
- meas_cycles += os_to_meas_cycles[dev->tph_sett.os_pres];
- meas_cycles += os_to_meas_cycles[dev->tph_sett.os_hum];
-
- /* TPH measurement duration */
- tph_dur = meas_cycles * UINT32_C(1963);
- tph_dur += UINT32_C(477 * 4); /* TPH switching duration */
- tph_dur += UINT32_C(477 * 5); /* Gas measurement duration */
- tph_dur += UINT32_C(500); /* Get it to the closest whole number.*/
- tph_dur /= UINT32_C(1000); /* Convert to ms */
-
- tph_dur += UINT32_C(1); /* Wake up duration of 1ms */
- /* The remaining time should be used for heating */
- dev->gas_sett.heatr_dur = duration - (uint16_t) tph_dur;
-}
-
-/*!
- * @brief This API is used to get the profile duration of the sensor.
- */
-void bme680_get_profile_dur(uint16_t *duration, const struct bme680_dev *dev)
-{
- uint32_t tph_dur; /* Calculate in us */
- uint32_t meas_cycles;
- uint8_t os_to_meas_cycles[6] = {0, 1, 2, 4, 8, 16};
-
- meas_cycles = os_to_meas_cycles[dev->tph_sett.os_temp];
- meas_cycles += os_to_meas_cycles[dev->tph_sett.os_pres];
- meas_cycles += os_to_meas_cycles[dev->tph_sett.os_hum];
-
- /* TPH measurement duration */
- tph_dur = meas_cycles * UINT32_C(1963);
- tph_dur += UINT32_C(477 * 4); /* TPH switching duration */
- tph_dur += UINT32_C(477 * 5); /* Gas measurement duration */
- tph_dur += UINT32_C(500); /* Get it to the closest whole number.*/
- tph_dur /= UINT32_C(1000); /* Convert to ms */
-
- tph_dur += UINT32_C(1); /* Wake up duration of 1ms */
-
- *duration = (uint16_t) tph_dur;
-
- /* Get the gas duration only when the run gas is enabled */
- if (dev->gas_sett.run_gas) {
- /* The remaining time should be used for heating */
- *duration += dev->gas_sett.heatr_dur;
- }
-}
-
-/*!
- * @brief This API reads the pressure, temperature and humidity and gas data
- * from the sensor, compensates the data and store it in the bme680_data
- * structure instance passed by the user.
- */
-int8_t bme680_get_sensor_data(struct bme680_field_data *data, struct bme680_dev *dev)
-{
- int8_t rslt;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- /* Reading the sensor data in forced mode only */
- rslt = read_field_data(data, dev);
- if (rslt == BME680_OK) {
- if (data->status & BME680_NEW_DATA_MSK)
- dev->new_fields = 1;
- else
- dev->new_fields = 0;
- }
- }
-
- return rslt;
-}
-
-/*!
- * @brief This internal API is used to read the calibrated data from the sensor.
- */
-static int8_t get_calib_data(struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t coeff_array[BME680_COEFF_SIZE] = { 0 };
- uint8_t temp_var = 0; /* Temporary variable */
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(BME680_COEFF_ADDR1, coeff_array, BME680_COEFF_ADDR1_LEN, dev);
- /* Append the second half in the same array */
- if (rslt == BME680_OK)
- rslt = bme680_get_regs(BME680_COEFF_ADDR2, &coeff_array[BME680_COEFF_ADDR1_LEN]
- , BME680_COEFF_ADDR2_LEN, dev);
-
- /* Temperature related coefficients */
- dev->calib.par_t1 = (uint16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_T1_MSB_REG],
- coeff_array[BME680_T1_LSB_REG]));
- dev->calib.par_t2 = (int16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_T2_MSB_REG],
- coeff_array[BME680_T2_LSB_REG]));
- dev->calib.par_t3 = (int8_t) (coeff_array[BME680_T3_REG]);
-
- /* Pressure related coefficients */
- dev->calib.par_p1 = (uint16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_P1_MSB_REG],
- coeff_array[BME680_P1_LSB_REG]));
- dev->calib.par_p2 = (int16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_P2_MSB_REG],
- coeff_array[BME680_P2_LSB_REG]));
- dev->calib.par_p3 = (int8_t) coeff_array[BME680_P3_REG];
- dev->calib.par_p4 = (int16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_P4_MSB_REG],
- coeff_array[BME680_P4_LSB_REG]));
- dev->calib.par_p5 = (int16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_P5_MSB_REG],
- coeff_array[BME680_P5_LSB_REG]));
- dev->calib.par_p6 = (int8_t) (coeff_array[BME680_P6_REG]);
- dev->calib.par_p7 = (int8_t) (coeff_array[BME680_P7_REG]);
- dev->calib.par_p8 = (int16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_P8_MSB_REG],
- coeff_array[BME680_P8_LSB_REG]));
- dev->calib.par_p9 = (int16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_P9_MSB_REG],
- coeff_array[BME680_P9_LSB_REG]));
- dev->calib.par_p10 = (uint8_t) (coeff_array[BME680_P10_REG]);
-
- /* Humidity related coefficients */
- dev->calib.par_h1 = (uint16_t) (((uint16_t) coeff_array[BME680_H1_MSB_REG] << BME680_HUM_REG_SHIFT_VAL)
- | (coeff_array[BME680_H1_LSB_REG] & BME680_BIT_H1_DATA_MSK));
- dev->calib.par_h2 = (uint16_t) (((uint16_t) coeff_array[BME680_H2_MSB_REG] << BME680_HUM_REG_SHIFT_VAL)
- | ((coeff_array[BME680_H2_LSB_REG]) >> BME680_HUM_REG_SHIFT_VAL));
- dev->calib.par_h3 = (int8_t) coeff_array[BME680_H3_REG];
- dev->calib.par_h4 = (int8_t) coeff_array[BME680_H4_REG];
- dev->calib.par_h5 = (int8_t) coeff_array[BME680_H5_REG];
- dev->calib.par_h6 = (uint8_t) coeff_array[BME680_H6_REG];
- dev->calib.par_h7 = (int8_t) coeff_array[BME680_H7_REG];
-
- /* Gas heater related coefficients */
- dev->calib.par_gh1 = (int8_t) coeff_array[BME680_GH1_REG];
- dev->calib.par_gh2 = (int16_t) (BME680_CONCAT_BYTES(coeff_array[BME680_GH2_MSB_REG],
- coeff_array[BME680_GH2_LSB_REG]));
- dev->calib.par_gh3 = (int8_t) coeff_array[BME680_GH3_REG];
-
- /* Other coefficients */
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(BME680_ADDR_RES_HEAT_RANGE_ADDR, &temp_var, 1, dev);
-
- dev->calib.res_heat_range = ((temp_var & BME680_RHRANGE_MSK) / 16);
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(BME680_ADDR_RES_HEAT_VAL_ADDR, &temp_var, 1, dev);
-
- dev->calib.res_heat_val = (int8_t) temp_var;
- if (rslt == BME680_OK)
- rslt = bme680_get_regs(BME680_ADDR_RANGE_SW_ERR_ADDR, &temp_var, 1, dev);
- }
- }
- dev->calib.range_sw_err = ((int8_t) temp_var & (int8_t) BME680_RSERROR_MSK) / 16;
- }
-
- return rslt;
-}
-
-/*!
- * @brief This internal API is used to set the gas configuration of the sensor.
- */
-static int8_t set_gas_config(struct bme680_dev *dev)
-{
- int8_t rslt;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
-
- uint8_t reg_addr[2] = {0};
- uint8_t reg_data[2] = {0};
-
- if (dev->power_mode == BME680_FORCED_MODE) {
- reg_addr[0] = BME680_RES_HEAT0_ADDR;
- reg_data[0] = calc_heater_res(dev->gas_sett.heatr_temp, dev);
- reg_addr[1] = BME680_GAS_WAIT0_ADDR;
- reg_data[1] = calc_heater_dur(dev->gas_sett.heatr_dur);
- dev->gas_sett.nb_conv = 0;
- } else {
- rslt = BME680_W_DEFINE_PWR_MODE;
- }
- if (rslt == BME680_OK)
- rslt = bme680_set_regs(reg_addr, reg_data, 2, dev);
- }
-
- return rslt;
-}
-
-/*!
- * @brief This internal API is used to get the gas configuration of the sensor.
- * @note heatr_temp and heatr_dur values are currently register data
- * and not the actual values set
- */
-static int8_t get_gas_config(struct bme680_dev *dev)
-{
- int8_t rslt;
- /* starting address of the register array for burst read*/
- uint8_t reg_addr1 = BME680_ADDR_SENS_CONF_START;
- uint8_t reg_addr2 = BME680_ADDR_GAS_CONF_START;
- uint8_t reg_data = 0;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- if (BME680_SPI_INTF == dev->intf) {
- /* Memory page switch the SPI address*/
- rslt = set_mem_page(reg_addr1, dev);
- }
-
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(reg_addr1, ®_data, 1, dev);
- if (rslt == BME680_OK) {
- dev->gas_sett.heatr_temp = reg_data;
- rslt = bme680_get_regs(reg_addr2, ®_data, 1, dev);
- if (rslt == BME680_OK) {
- /* Heating duration register value */
- dev->gas_sett.heatr_dur = reg_data;
- }
- }
- }
- }
-
- return rslt;
-}
-
-#ifndef BME680_FLOAT_POINT_COMPENSATION
-
-/*!
- * @brief This internal API is used to calculate the temperature value.
- */
-static int16_t calc_temperature(uint32_t temp_adc, struct bme680_dev *dev)
-{
- int64_t var1;
- int64_t var2;
- int64_t var3;
- int16_t calc_temp;
-
- var1 = ((int32_t) temp_adc >> 3) - ((int32_t) dev->calib.par_t1 << 1);
- var2 = (var1 * (int32_t) dev->calib.par_t2) >> 11;
- var3 = ((var1 >> 1) * (var1 >> 1)) >> 12;
- var3 = ((var3) * ((int32_t) dev->calib.par_t3 << 4)) >> 14;
- dev->calib.t_fine = (int32_t) (var2 + var3);
- calc_temp = (int16_t) (((dev->calib.t_fine * 5) + 128) >> 8);
-
- return calc_temp;
-}
-
-/*!
- * @brief This internal API is used to calculate the pressure value.
- */
-static uint32_t calc_pressure(uint32_t pres_adc, const struct bme680_dev *dev)
-{
- int32_t var1;
- int32_t var2;
- int32_t var3;
- int32_t pressure_comp;
-
- var1 = (((int32_t)dev->calib.t_fine) >> 1) - 64000;
- var2 = ((((var1 >> 2) * (var1 >> 2)) >> 11) *
- (int32_t)dev->calib.par_p6) >> 2;
- var2 = var2 + ((var1 * (int32_t)dev->calib.par_p5) << 1);
- var2 = (var2 >> 2) + ((int32_t)dev->calib.par_p4 << 16);
- var1 = (((((var1 >> 2) * (var1 >> 2)) >> 13) *
- ((int32_t)dev->calib.par_p3 << 5)) >> 3) +
- (((int32_t)dev->calib.par_p2 * var1) >> 1);
- var1 = var1 >> 18;
- var1 = ((32768 + var1) * (int32_t)dev->calib.par_p1) >> 15;
- pressure_comp = 1048576 - pres_adc;
- pressure_comp = (int32_t)((pressure_comp - (var2 >> 12)) * ((uint32_t)3125));
- if (pressure_comp >= BME680_MAX_OVERFLOW_VAL)
- pressure_comp = ((pressure_comp / var1) << 1);
- else
- pressure_comp = ((pressure_comp << 1) / var1);
- var1 = ((int32_t)dev->calib.par_p9 * (int32_t)(((pressure_comp >> 3) *
- (pressure_comp >> 3)) >> 13)) >> 12;
- var2 = ((int32_t)(pressure_comp >> 2) *
- (int32_t)dev->calib.par_p8) >> 13;
- var3 = ((int32_t)(pressure_comp >> 8) * (int32_t)(pressure_comp >> 8) *
- (int32_t)(pressure_comp >> 8) *
- (int32_t)dev->calib.par_p10) >> 17;
-
- pressure_comp = (int32_t)(pressure_comp) + ((var1 + var2 + var3 +
- ((int32_t)dev->calib.par_p7 << 7)) >> 4);
-
- return (uint32_t)pressure_comp;
-
-}
-
-/*!
- * @brief This internal API is used to calculate the humidity value.
- */
-static uint32_t calc_humidity(uint16_t hum_adc, const struct bme680_dev *dev)
-{
- int32_t var1;
- int32_t var2;
- int32_t var3;
- int32_t var4;
- int32_t var5;
- int32_t var6;
- int32_t temp_scaled;
- int32_t calc_hum;
-
- temp_scaled = (((int32_t) dev->calib.t_fine * 5) + 128) >> 8;
- var1 = (int32_t) (hum_adc - ((int32_t) ((int32_t) dev->calib.par_h1 * 16)))
- - (((temp_scaled * (int32_t) dev->calib.par_h3) / ((int32_t) 100)) >> 1);
- var2 = ((int32_t) dev->calib.par_h2
- * (((temp_scaled * (int32_t) dev->calib.par_h4) / ((int32_t) 100))
- + (((temp_scaled * ((temp_scaled * (int32_t) dev->calib.par_h5) / ((int32_t) 100))) >> 6)
- / ((int32_t) 100)) + (int32_t) (1 << 14))) >> 10;
- var3 = var1 * var2;
- var4 = (int32_t) dev->calib.par_h6 << 7;
- var4 = ((var4) + ((temp_scaled * (int32_t) dev->calib.par_h7) / ((int32_t) 100))) >> 4;
- var5 = ((var3 >> 14) * (var3 >> 14)) >> 10;
- var6 = (var4 * var5) >> 1;
- calc_hum = (((var3 + var6) >> 10) * ((int32_t) 1000)) >> 12;
-
- if (calc_hum > 100000) /* Cap at 100%rH */
- calc_hum = 100000;
- else if (calc_hum < 0)
- calc_hum = 0;
-
- return (uint32_t) calc_hum;
-}
-
-/*!
- * @brief This internal API is used to calculate the Gas Resistance value.
- */
-static uint32_t calc_gas_resistance(uint16_t gas_res_adc, uint8_t gas_range, const struct bme680_dev *dev)
-{
- int64_t var1;
- uint64_t var2;
- int64_t var3;
- uint32_t calc_gas_res;
- /**Look up table 1 for the possible gas range values */
- uint32_t lookupTable1[16] = { UINT32_C(2147483647), UINT32_C(2147483647), UINT32_C(2147483647), UINT32_C(2147483647),
- UINT32_C(2147483647), UINT32_C(2126008810), UINT32_C(2147483647), UINT32_C(2130303777),
- UINT32_C(2147483647), UINT32_C(2147483647), UINT32_C(2143188679), UINT32_C(2136746228),
- UINT32_C(2147483647), UINT32_C(2126008810), UINT32_C(2147483647), UINT32_C(2147483647) };
- /**Look up table 2 for the possible gas range values */
- uint32_t lookupTable2[16] = { UINT32_C(4096000000), UINT32_C(2048000000), UINT32_C(1024000000), UINT32_C(512000000),
- UINT32_C(255744255), UINT32_C(127110228), UINT32_C(64000000), UINT32_C(32258064), UINT32_C(16016016),
- UINT32_C(8000000), UINT32_C(4000000), UINT32_C(2000000), UINT32_C(1000000), UINT32_C(500000),
- UINT32_C(250000), UINT32_C(125000) };
-
- var1 = (int64_t) ((1340 + (5 * (int64_t) dev->calib.range_sw_err)) *
- ((int64_t) lookupTable1[gas_range])) >> 16;
- var2 = (((int64_t) ((int64_t) gas_res_adc << 15) - (int64_t) (16777216)) + var1);
- var3 = (((int64_t) lookupTable2[gas_range] * (int64_t) var1) >> 9);
- calc_gas_res = (uint32_t) ((var3 + ((int64_t) var2 >> 1)) / (int64_t) var2);
-
- return calc_gas_res;
-}
-
-/*!
- * @brief This internal API is used to calculate the Heat Resistance value.
- */
-static uint8_t calc_heater_res(uint16_t temp, const struct bme680_dev *dev)
-{
- uint8_t heatr_res;
- int32_t var1;
- int32_t var2;
- int32_t var3;
- int32_t var4;
- int32_t var5;
- int32_t heatr_res_x100;
-
- if (temp > 400) /* Cap temperature */
- temp = 400;
-
- var1 = (((int32_t) dev->amb_temp * dev->calib.par_gh3) / 1000) * 256;
- var2 = (dev->calib.par_gh1 + 784) * (((((dev->calib.par_gh2 + 154009) * temp * 5) / 100) + 3276800) / 10);
- var3 = var1 + (var2 / 2);
- var4 = (var3 / (dev->calib.res_heat_range + 4));
- var5 = (131 * dev->calib.res_heat_val) + 65536;
- heatr_res_x100 = (int32_t) (((var4 / var5) - 250) * 34);
- heatr_res = (uint8_t) ((heatr_res_x100 + 50) / 100);
-
- return heatr_res;
-}
-
-#else
-
-
-/*!
- * @brief This internal API is used to calculate the
- * temperature value in float format
- */
-static float calc_temperature(uint32_t temp_adc, struct bme680_dev *dev)
-{
- float var1 = 0;
- float var2 = 0;
- float calc_temp = 0;
-
- /* calculate var1 data */
- var1 = ((((float)temp_adc / 16384.0f) - ((float)dev->calib.par_t1 / 1024.0f))
- * ((float)dev->calib.par_t2));
-
- /* calculate var2 data */
- var2 = (((((float)temp_adc / 131072.0f) - ((float)dev->calib.par_t1 / 8192.0f)) *
- (((float)temp_adc / 131072.0f) - ((float)dev->calib.par_t1 / 8192.0f))) *
- ((float)dev->calib.par_t3 * 16.0f));
-
- /* t_fine value*/
- dev->calib.t_fine = (var1 + var2);
-
- /* compensated temperature data*/
- calc_temp = ((dev->calib.t_fine) / 5120.0f);
-
- return calc_temp;
-}
-
-/*!
- * @brief This internal API is used to calculate the
- * pressure value in float format
- */
-static float calc_pressure(uint32_t pres_adc, const struct bme680_dev *dev)
-{
- float var1 = 0;
- float var2 = 0;
- float var3 = 0;
- float calc_pres = 0;
-
- var1 = (((float)dev->calib.t_fine / 2.0f) - 64000.0f);
- var2 = var1 * var1 * (((float)dev->calib.par_p6) / (131072.0f));
- var2 = var2 + (var1 * ((float)dev->calib.par_p5) * 2.0f);
- var2 = (var2 / 4.0f) + (((float)dev->calib.par_p4) * 65536.0f);
- var1 = (((((float)dev->calib.par_p3 * var1 * var1) / 16384.0f)
- + ((float)dev->calib.par_p2 * var1)) / 524288.0f);
- var1 = ((1.0f + (var1 / 32768.0f)) * ((float)dev->calib.par_p1));
- calc_pres = (1048576.0f - ((float)pres_adc));
-
- /* Avoid exception caused by division by zero */
- if ((int)var1 != 0) {
- calc_pres = (((calc_pres - (var2 / 4096.0f)) * 6250.0f) / var1);
- var1 = (((float)dev->calib.par_p9) * calc_pres * calc_pres) / 2147483648.0f;
- var2 = calc_pres * (((float)dev->calib.par_p8) / 32768.0f);
- var3 = ((calc_pres / 256.0f) * (calc_pres / 256.0f) * (calc_pres / 256.0f)
- * (dev->calib.par_p10 / 131072.0f));
- calc_pres = (calc_pres + (var1 + var2 + var3 + ((float)dev->calib.par_p7 * 128.0f)) / 16.0f);
- } else {
- calc_pres = 0;
- }
-
- return calc_pres;
-}
-
-/*!
- * @brief This internal API is used to calculate the
- * humidity value in float format
- */
-static float calc_humidity(uint16_t hum_adc, const struct bme680_dev *dev)
-{
- float calc_hum = 0;
- float var1 = 0;
- float var2 = 0;
- float var3 = 0;
- float var4 = 0;
- float temp_comp;
-
- /* compensated temperature data*/
- temp_comp = ((dev->calib.t_fine) / 5120.0f);
-
- var1 = (float)((float)hum_adc) - (((float)dev->calib.par_h1 * 16.0f) + (((float)dev->calib.par_h3 / 2.0f)
- * temp_comp));
-
- var2 = var1 * ((float)(((float) dev->calib.par_h2 / 262144.0f) * (1.0f + (((float)dev->calib.par_h4 / 16384.0f)
- * temp_comp) + (((float)dev->calib.par_h5 / 1048576.0f) * temp_comp * temp_comp))));
-
- var3 = (float) dev->calib.par_h6 / 16384.0f;
-
- var4 = (float) dev->calib.par_h7 / 2097152.0f;
-
- calc_hum = var2 + ((var3 + (var4 * temp_comp)) * var2 * var2);
-
- if (calc_hum > 100.0f)
- calc_hum = 100.0f;
- else if (calc_hum < 0.0f)
- calc_hum = 0.0f;
-
- return calc_hum;
-}
-
-/*!
- * @brief This internal API is used to calculate the
- * gas resistance value in float format
- */
-static float calc_gas_resistance(uint16_t gas_res_adc, uint8_t gas_range, const struct bme680_dev *dev)
-{
- float calc_gas_res;
- float var1 = 0;
- float var2 = 0;
- float var3 = 0;
-
- const float lookup_k1_range[16] = {
- 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, -0.8,
- 0.0, 0.0, -0.2, -0.5, 0.0, -1.0, 0.0, 0.0};
- const float lookup_k2_range[16] = {
- 0.0, 0.0, 0.0, 0.0, 0.1, 0.7, 0.0, -0.8,
- -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-
- var1 = (1340.0f + (5.0f * dev->calib.range_sw_err));
- var2 = (var1) * (1.0f + lookup_k1_range[gas_range]/100.0f);
- var3 = 1.0f + (lookup_k2_range[gas_range]/100.0f);
-
- calc_gas_res = 1.0f / (float)(var3 * (0.000000125f) * (float)(1 << gas_range) * (((((float)gas_res_adc)
- - 512.0f)/var2) + 1.0f));
-
- return calc_gas_res;
-}
-
-/*!
- * @brief This internal API is used to calculate the
- * heater resistance value in float format
- */
-static float calc_heater_res(uint16_t temp, const struct bme680_dev *dev)
-{
- float var1 = 0;
- float var2 = 0;
- float var3 = 0;
- float var4 = 0;
- float var5 = 0;
- float res_heat = 0;
-
- if (temp > 400) /* Cap temperature */
- temp = 400;
-
- var1 = (((float)dev->calib.par_gh1 / (16.0f)) + 49.0f);
- var2 = ((((float)dev->calib.par_gh2 / (32768.0f)) * (0.0005f)) + 0.00235f);
- var3 = ((float)dev->calib.par_gh3 / (1024.0f));
- var4 = (var1 * (1.0f + (var2 * (float)temp)));
- var5 = (var4 + (var3 * (float)dev->amb_temp));
- res_heat = (uint8_t)(3.4f * ((var5 * (4 / (4 + (float)dev->calib.res_heat_range)) *
- (1/(1 + ((float) dev->calib.res_heat_val * 0.002f)))) - 25));
-
- return res_heat;
-}
-
-#endif
-
-/*!
- * @brief This internal API is used to calculate the Heat duration value.
- */
-static uint8_t calc_heater_dur(uint16_t dur)
-{
- uint8_t factor = 0;
- uint8_t durval;
-
- if (dur >= 0xfc0) {
- durval = 0xff; /* Max duration*/
- } else {
- while (dur > 0x3F) {
- dur = dur / 4;
- factor += 1;
- }
- durval = (uint8_t) (dur + (factor * 64));
- }
-
- return durval;
-}
-
-/*!
- * @brief This internal API is used to calculate the field data of sensor.
- */
-static int8_t read_field_data(struct bme680_field_data *data, struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t buff[BME680_FIELD_LENGTH] = { 0 };
- uint8_t gas_range;
- uint32_t adc_temp;
- uint32_t adc_pres;
- uint16_t adc_hum;
- uint16_t adc_gas_res;
- uint8_t tries = 10;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- do {
- if (rslt == BME680_OK) {
- rslt = bme680_get_regs(((uint8_t) (BME680_FIELD0_ADDR)), buff, (uint16_t) BME680_FIELD_LENGTH,
- dev);
-
- data->status = buff[0] & BME680_NEW_DATA_MSK;
- data->gas_index = buff[0] & BME680_GAS_INDEX_MSK;
- data->meas_index = buff[1];
-
- /* read the raw data from the sensor */
- adc_pres = (uint32_t) (((uint32_t) buff[2] * 4096) | ((uint32_t) buff[3] * 16)
- | ((uint32_t) buff[4] / 16));
- adc_temp = (uint32_t) (((uint32_t) buff[5] * 4096) | ((uint32_t) buff[6] * 16)
- | ((uint32_t) buff[7] / 16));
- adc_hum = (uint16_t) (((uint32_t) buff[8] * 256) | (uint32_t) buff[9]);
- adc_gas_res = (uint16_t) ((uint32_t) buff[13] * 4 | (((uint32_t) buff[14]) / 64));
- gas_range = buff[14] & BME680_GAS_RANGE_MSK;
-
- data->status |= buff[14] & BME680_GASM_VALID_MSK;
- data->status |= buff[14] & BME680_HEAT_STAB_MSK;
-
- if (data->status & BME680_NEW_DATA_MSK) {
- data->temperature = calc_temperature(adc_temp, dev);
- data->pressure = calc_pressure(adc_pres, dev);
- data->humidity = calc_humidity(adc_hum, dev);
- data->gas_resistance = calc_gas_resistance(adc_gas_res, gas_range, dev);
- break;
- }
- /* Delay to poll the data */
- dev->delay_ms(BME680_POLL_PERIOD_MS);
- }
- tries--;
- } while (tries);
-
- if (!tries)
- rslt = BME680_W_NO_NEW_DATA;
-
- return rslt;
-}
-
-/*!
- * @brief This internal API is used to set the memory page based on register address.
- */
-static int8_t set_mem_page(uint8_t reg_addr, struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t reg;
- uint8_t mem_page;
-
- /* Check for null pointers in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- if (reg_addr > 0x7f)
- mem_page = BME680_MEM_PAGE1;
- else
- mem_page = BME680_MEM_PAGE0;
-
- if (mem_page != dev->mem_page) {
- dev->mem_page = mem_page;
-
- dev->com_rslt = dev->read(dev->dev_id, BME680_MEM_PAGE_ADDR | BME680_SPI_RD_MSK, ®, 1);
- if (dev->com_rslt != 0)
- rslt = BME680_E_COM_FAIL;
-
- if (rslt == BME680_OK) {
- reg = reg & (~BME680_MEM_PAGE_MSK);
- reg = reg | (dev->mem_page & BME680_MEM_PAGE_MSK);
-
- dev->com_rslt = dev->write(dev->dev_id, BME680_MEM_PAGE_ADDR & BME680_SPI_WR_MSK,
- ®, 1);
- if (dev->com_rslt != 0)
- rslt = BME680_E_COM_FAIL;
- }
- }
- }
-
- return rslt;
-}
-
-/*!
- * @brief This internal API is used to get the memory page based on register address.
- */
-static int8_t get_mem_page(struct bme680_dev *dev)
-{
- int8_t rslt;
- uint8_t reg;
-
- /* Check for null pointer in the device structure*/
- rslt = null_ptr_check(dev);
- if (rslt == BME680_OK) {
- dev->com_rslt = dev->read(dev->dev_id, BME680_MEM_PAGE_ADDR | BME680_SPI_RD_MSK, ®, 1);
- if (dev->com_rslt != 0)
- rslt = BME680_E_COM_FAIL;
- else
- dev->mem_page = reg & BME680_MEM_PAGE_MSK;
- }
-
- return rslt;
-}
-
-/*!
- * @brief This internal API is used to validate the boundary
- * conditions.
- */
-static int8_t boundary_check(uint8_t *value, uint8_t min, uint8_t max, struct bme680_dev *dev)
-{
- int8_t rslt = BME680_OK;
-
- if (value != NULL) {
- /* Check if value is below minimum value */
- if (*value < min) {
- /* Auto correct the invalid value to minimum value */
- *value = min;
- dev->info_msg |= BME680_I_MIN_CORRECTION;
- }
- /* Check if value is above maximum value */
- if (*value > max) {
- /* Auto correct the invalid value to maximum value */
- *value = max;
- dev->info_msg |= BME680_I_MAX_CORRECTION;
- }
- } else {
- rslt = BME680_E_NULL_PTR;
- }
-
- return rslt;
-}
-
-/*!
- * @brief This internal API is used to validate the device structure pointer for
- * null conditions.
- */
-static int8_t null_ptr_check(const struct bme680_dev *dev)
-{
- int8_t rslt;
-
- if ((dev == NULL) || (dev->read == NULL) || (dev->write == NULL) || (dev->delay_ms == NULL)) {
- /* Device structure pointer is not valid */
- rslt = BME680_E_NULL_PTR;
- } else {
- /* Device structure is fine */
- rslt = BME680_OK;
- }
-
- return rslt;
-}
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680.h b/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680.h
deleted file mode 100644
index 7c59be0f6..000000000
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
- * Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the copyright holder nor the names of the
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
- * OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
- *
- * The information provided is believed to be accurate and reliable.
- * The copyright holder assumes no responsibility
- * for the consequences of use
- * of such information nor for any infringement of patents or
- * other rights of third parties which may result from its use.
- * No license is granted by implication or otherwise under any patent or
- * patent rights of the copyright holder.
- *
- * @file bme680.h
- * @date 19 Jun 2018
- * @version 3.5.9
- * @brief
- *
- */
-/*! @file bme680.h
- @brief Sensor driver for BME680 sensor */
-/*!
- * @defgroup BME680 SENSOR API
- * @{*/
-#ifndef BME680_H_
-#define BME680_H_
-
-/*! CPP guard */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/* Header includes */
-#include "bme680_defs.h"
-
-/* function prototype declarations */
-/*!
- * @brief This API is the entry point.
- * It reads the chip-id and calibration data from the sensor.
- *
- * @param[in,out] dev : Structure instance of bme680_dev
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-int8_t bme680_init(struct bme680_dev *dev);
-
-/*!
- * @brief This API writes the given data to the register address
- * of the sensor.
- *
- * @param[in] reg_addr : Register address from where the data to be written.
- * @param[in] reg_data : Pointer to data buffer which is to be written
- * in the sensor.
- * @param[in] len : No of bytes of data to write..
- * @param[in] dev : Structure instance of bme680_dev.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-int8_t bme680_set_regs(const uint8_t *reg_addr, const uint8_t *reg_data, uint8_t len, struct bme680_dev *dev);
-
-/*!
- * @brief This API reads the data from the given register address of the sensor.
- *
- * @param[in] reg_addr : Register address from where the data to be read
- * @param[out] reg_data : Pointer to data buffer to store the read data.
- * @param[in] len : No of bytes of data to be read.
- * @param[in] dev : Structure instance of bme680_dev.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-int8_t bme680_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint16_t len, struct bme680_dev *dev);
-
-/*!
- * @brief This API performs the soft reset of the sensor.
- *
- * @param[in] dev : Structure instance of bme680_dev.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error.
- */
-int8_t bme680_soft_reset(struct bme680_dev *dev);
-
-/*!
- * @brief This API is used to set the power mode of the sensor.
- *
- * @param[in] dev : Structure instance of bme680_dev
- * @note : Pass the value to bme680_dev.power_mode structure variable.
- *
- * value | mode
- * -------------|------------------
- * 0x00 | BME680_SLEEP_MODE
- * 0x01 | BME680_FORCED_MODE
- *
- * * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-int8_t bme680_set_sensor_mode(struct bme680_dev *dev);
-
-/*!
- * @brief This API is used to get the power mode of the sensor.
- *
- * @param[in] dev : Structure instance of bme680_dev
- * @note : bme680_dev.power_mode structure variable hold the power mode.
- *
- * value | mode
- * ---------|------------------
- * 0x00 | BME680_SLEEP_MODE
- * 0x01 | BME680_FORCED_MODE
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-int8_t bme680_get_sensor_mode(struct bme680_dev *dev);
-
-/*!
- * @brief This API is used to set the profile duration of the sensor.
- *
- * @param[in] dev : Structure instance of bme680_dev.
- * @param[in] duration : Duration of the measurement in ms.
- *
- * @return Nothing
- */
-void bme680_set_profile_dur(uint16_t duration, struct bme680_dev *dev);
-
-/*!
- * @brief This API is used to get the profile duration of the sensor.
- *
- * @param[in] dev : Structure instance of bme680_dev.
- * @param[in] duration : Duration of the measurement in ms.
- *
- * @return Nothing
- */
-void bme680_get_profile_dur(uint16_t *duration, const struct bme680_dev *dev);
-
-/*!
- * @brief This API reads the pressure, temperature and humidity and gas data
- * from the sensor, compensates the data and store it in the bme680_data
- * structure instance passed by the user.
- *
- * @param[out] data: Structure instance to hold the data.
- * @param[in] dev : Structure instance of bme680_dev.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error
- */
-int8_t bme680_get_sensor_data(struct bme680_field_data *data, struct bme680_dev *dev);
-
-/*!
- * @brief This API is used to set the oversampling, filter and T,P,H, gas selection
- * settings in the sensor.
- *
- * @param[in] dev : Structure instance of bme680_dev.
- * @param[in] desired_settings : Variable used to select the settings which
- * are to be set in the sensor.
- *
- * Macros | Functionality
- *---------------------------------|----------------------------------------------
- * BME680_OST_SEL | To set temperature oversampling.
- * BME680_OSP_SEL | To set pressure oversampling.
- * BME680_OSH_SEL | To set humidity oversampling.
- * BME680_GAS_MEAS_SEL | To set gas measurement setting.
- * BME680_FILTER_SEL | To set filter setting.
- * BME680_HCNTRL_SEL | To set humidity control setting.
- * BME680_RUN_GAS_SEL | To set run gas setting.
- * BME680_NBCONV_SEL | To set NB conversion setting.
- * BME680_GAS_SENSOR_SEL | To set all gas sensor related settings
- *
- * @note : Below are the macros to be used by the user for selecting the
- * desired settings. User can do OR operation of these macros for configuring
- * multiple settings.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error.
- */
-int8_t bme680_set_sensor_settings(uint16_t desired_settings, struct bme680_dev *dev);
-
-/*!
- * @brief This API is used to get the oversampling, filter and T,P,H, gas selection
- * settings in the sensor.
- *
- * @param[in] dev : Structure instance of bme680_dev.
- * @param[in] desired_settings : Variable used to select the settings which
- * are to be get from the sensor.
- *
- * @return Result of API execution status
- * @retval zero -> Success / +ve value -> Warning / -ve value -> Error.
- */
-int8_t bme680_get_sensor_settings(uint16_t desired_settings, struct bme680_dev *dev);
-#ifdef __cplusplus
-}
-#endif /* End of CPP guard */
-#endif /* BME680_H_ */
-/** @}*/
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680_defs.h b/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680_defs.h
deleted file mode 100644
index 495edfe00..000000000
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/bme680_defs.h
+++ /dev/null
@@ -1,545 +0,0 @@
-/**
- * Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the copyright holder nor the names of the
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
- * OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
- *
- * The information provided is believed to be accurate and reliable.
- * The copyright holder assumes no responsibility
- * for the consequences of use
- * of such information nor for any infringement of patents or
- * other rights of third parties which may result from its use.
- * No license is granted by implication or otherwise under any patent or
- * patent rights of the copyright holder.
- *
- * @file bme680_defs.h
- * @date 19 Jun 2018
- * @version 3.5.9
- * @brief
- *
- */
-
-/*! @file bme680_defs.h
- @brief Sensor driver for BME680 sensor */
-/*!
- * @defgroup BME680 SENSOR API
- * @brief
- * @{*/
-#ifndef BME680_DEFS_H_
-#define BME680_DEFS_H_
-
-/********************************************************/
-/* header includes */
-#ifdef __KERNEL__
-#include
-#include
-#else
-#include
-#include
-#endif
-
-/******************************************************************************/
-/*! @name Common macros */
-/******************************************************************************/
-
-#if !defined(UINT8_C) && !defined(INT8_C)
-#define INT8_C(x) S8_C(x)
-#define UINT8_C(x) U8_C(x)
-#endif
-
-#if !defined(UINT16_C) && !defined(INT16_C)
-#define INT16_C(x) S16_C(x)
-#define UINT16_C(x) U16_C(x)
-#endif
-
-#if !defined(INT32_C) && !defined(UINT32_C)
-#define INT32_C(x) S32_C(x)
-#define UINT32_C(x) U32_C(x)
-#endif
-
-#if !defined(INT64_C) && !defined(UINT64_C)
-#define INT64_C(x) S64_C(x)
-#define UINT64_C(x) U64_C(x)
-#endif
-
-/**@}*/
-
-/**\name C standard macros */
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void *) 0)
-#endif
-#endif
-
-/** BME680 configuration macros */
-/** Enable or un-comment the macro to provide floating point data output */
-#ifndef BME680_FLOAT_POINT_COMPENSATION
-/* #define BME680_FLOAT_POINT_COMPENSATION */
-#endif
-
-/** BME680 General config */
-#define BME680_POLL_PERIOD_MS UINT8_C(10)
-
-/** BME680 I2C addresses */
-#define BME680_I2C_ADDR_PRIMARY UINT8_C(0x76)
-#define BME680_I2C_ADDR_SECONDARY UINT8_C(0x77)
-
-/** BME680 unique chip identifier */
-#define BME680_CHIP_ID UINT8_C(0x61)
-
-/** BME680 coefficients related defines */
-#define BME680_COEFF_SIZE UINT8_C(41)
-#define BME680_COEFF_ADDR1_LEN UINT8_C(25)
-#define BME680_COEFF_ADDR2_LEN UINT8_C(16)
-
-/** BME680 field_x related defines */
-#define BME680_FIELD_LENGTH UINT8_C(15)
-#define BME680_FIELD_ADDR_OFFSET UINT8_C(17)
-
-/** Soft reset command */
-#define BME680_SOFT_RESET_CMD UINT8_C(0xb6)
-
-/** Error code definitions */
-#define BME680_OK INT8_C(0)
-/* Errors */
-#define BME680_E_NULL_PTR INT8_C(-1)
-#define BME680_E_COM_FAIL INT8_C(-2)
-#define BME680_E_DEV_NOT_FOUND INT8_C(-3)
-#define BME680_E_INVALID_LENGTH INT8_C(-4)
-
-/* Warnings */
-#define BME680_W_DEFINE_PWR_MODE INT8_C(1)
-#define BME680_W_NO_NEW_DATA INT8_C(2)
-
-/* Info's */
-#define BME680_I_MIN_CORRECTION UINT8_C(1)
-#define BME680_I_MAX_CORRECTION UINT8_C(2)
-
-/** Register map */
-/** Other coefficient's address */
-#define BME680_ADDR_RES_HEAT_VAL_ADDR UINT8_C(0x00)
-#define BME680_ADDR_RES_HEAT_RANGE_ADDR UINT8_C(0x02)
-#define BME680_ADDR_RANGE_SW_ERR_ADDR UINT8_C(0x04)
-#define BME680_ADDR_SENS_CONF_START UINT8_C(0x5A)
-#define BME680_ADDR_GAS_CONF_START UINT8_C(0x64)
-
-/** Field settings */
-#define BME680_FIELD0_ADDR UINT8_C(0x1d)
-
-/** Heater settings */
-#define BME680_RES_HEAT0_ADDR UINT8_C(0x5a)
-#define BME680_GAS_WAIT0_ADDR UINT8_C(0x64)
-
-/** Sensor configuration registers */
-#define BME680_CONF_HEAT_CTRL_ADDR UINT8_C(0x70)
-#define BME680_CONF_ODR_RUN_GAS_NBC_ADDR UINT8_C(0x71)
-#define BME680_CONF_OS_H_ADDR UINT8_C(0x72)
-#define BME680_MEM_PAGE_ADDR UINT8_C(0xf3)
-#define BME680_CONF_T_P_MODE_ADDR UINT8_C(0x74)
-#define BME680_CONF_ODR_FILT_ADDR UINT8_C(0x75)
-
-/** Coefficient's address */
-#define BME680_COEFF_ADDR1 UINT8_C(0x89)
-#define BME680_COEFF_ADDR2 UINT8_C(0xe1)
-
-/** Chip identifier */
-#define BME680_CHIP_ID_ADDR UINT8_C(0xd0)
-
-/** Soft reset register */
-#define BME680_SOFT_RESET_ADDR UINT8_C(0xe0)
-
-/** Heater control settings */
-#define BME680_ENABLE_HEATER UINT8_C(0x00)
-#define BME680_DISABLE_HEATER UINT8_C(0x08)
-
-/** Gas measurement settings */
-#define BME680_DISABLE_GAS_MEAS UINT8_C(0x00)
-#define BME680_ENABLE_GAS_MEAS UINT8_C(0x01)
-
-/** Over-sampling settings */
-#define BME680_OS_NONE UINT8_C(0)
-#define BME680_OS_1X UINT8_C(1)
-#define BME680_OS_2X UINT8_C(2)
-#define BME680_OS_4X UINT8_C(3)
-#define BME680_OS_8X UINT8_C(4)
-#define BME680_OS_16X UINT8_C(5)
-
-/** IIR filter settings */
-#define BME680_FILTER_SIZE_0 UINT8_C(0)
-#define BME680_FILTER_SIZE_1 UINT8_C(1)
-#define BME680_FILTER_SIZE_3 UINT8_C(2)
-#define BME680_FILTER_SIZE_7 UINT8_C(3)
-#define BME680_FILTER_SIZE_15 UINT8_C(4)
-#define BME680_FILTER_SIZE_31 UINT8_C(5)
-#define BME680_FILTER_SIZE_63 UINT8_C(6)
-#define BME680_FILTER_SIZE_127 UINT8_C(7)
-
-/** Power mode settings */
-#define BME680_SLEEP_MODE UINT8_C(0)
-#define BME680_FORCED_MODE UINT8_C(1)
-
-/** Delay related macro declaration */
-#define BME680_RESET_PERIOD UINT32_C(10)
-
-/** SPI memory page settings */
-#define BME680_MEM_PAGE0 UINT8_C(0x10)
-#define BME680_MEM_PAGE1 UINT8_C(0x00)
-
-/** Ambient humidity shift value for compensation */
-#define BME680_HUM_REG_SHIFT_VAL UINT8_C(4)
-
-/** Run gas enable and disable settings */
-#define BME680_RUN_GAS_DISABLE UINT8_C(0)
-#define BME680_RUN_GAS_ENABLE UINT8_C(1)
-
-/** Buffer length macro declaration */
-#define BME680_TMP_BUFFER_LENGTH UINT8_C(40)
-#define BME680_REG_BUFFER_LENGTH UINT8_C(6)
-#define BME680_FIELD_DATA_LENGTH UINT8_C(3)
-#define BME680_GAS_REG_BUF_LENGTH UINT8_C(20)
-
-/** Settings selector */
-#define BME680_OST_SEL UINT16_C(1)
-#define BME680_OSP_SEL UINT16_C(2)
-#define BME680_OSH_SEL UINT16_C(4)
-#define BME680_GAS_MEAS_SEL UINT16_C(8)
-#define BME680_FILTER_SEL UINT16_C(16)
-#define BME680_HCNTRL_SEL UINT16_C(32)
-#define BME680_RUN_GAS_SEL UINT16_C(64)
-#define BME680_NBCONV_SEL UINT16_C(128)
-#define BME680_GAS_SENSOR_SEL (BME680_GAS_MEAS_SEL | BME680_RUN_GAS_SEL | BME680_NBCONV_SEL)
-
-/** Number of conversion settings*/
-#define BME680_NBCONV_MIN UINT8_C(0)
-#define BME680_NBCONV_MAX UINT8_C(10)
-
-/** Mask definitions */
-#define BME680_GAS_MEAS_MSK UINT8_C(0x30)
-#define BME680_NBCONV_MSK UINT8_C(0X0F)
-#define BME680_FILTER_MSK UINT8_C(0X1C)
-#define BME680_OST_MSK UINT8_C(0XE0)
-#define BME680_OSP_MSK UINT8_C(0X1C)
-#define BME680_OSH_MSK UINT8_C(0X07)
-#define BME680_HCTRL_MSK UINT8_C(0x08)
-#define BME680_RUN_GAS_MSK UINT8_C(0x10)
-#define BME680_MODE_MSK UINT8_C(0x03)
-#define BME680_RHRANGE_MSK UINT8_C(0x30)
-#define BME680_RSERROR_MSK UINT8_C(0xf0)
-#define BME680_NEW_DATA_MSK UINT8_C(0x80)
-#define BME680_GAS_INDEX_MSK UINT8_C(0x0f)
-#define BME680_GAS_RANGE_MSK UINT8_C(0x0f)
-#define BME680_GASM_VALID_MSK UINT8_C(0x20)
-#define BME680_HEAT_STAB_MSK UINT8_C(0x10)
-#define BME680_MEM_PAGE_MSK UINT8_C(0x10)
-#define BME680_SPI_RD_MSK UINT8_C(0x80)
-#define BME680_SPI_WR_MSK UINT8_C(0x7f)
-#define BME680_BIT_H1_DATA_MSK UINT8_C(0x0F)
-
-/** Bit position definitions for sensor settings */
-#define BME680_GAS_MEAS_POS UINT8_C(4)
-#define BME680_FILTER_POS UINT8_C(2)
-#define BME680_OST_POS UINT8_C(5)
-#define BME680_OSP_POS UINT8_C(2)
-#define BME680_RUN_GAS_POS UINT8_C(4)
-
-/** Array Index to Field data mapping for Calibration Data*/
-#define BME680_T2_LSB_REG (1)
-#define BME680_T2_MSB_REG (2)
-#define BME680_T3_REG (3)
-#define BME680_P1_LSB_REG (5)
-#define BME680_P1_MSB_REG (6)
-#define BME680_P2_LSB_REG (7)
-#define BME680_P2_MSB_REG (8)
-#define BME680_P3_REG (9)
-#define BME680_P4_LSB_REG (11)
-#define BME680_P4_MSB_REG (12)
-#define BME680_P5_LSB_REG (13)
-#define BME680_P5_MSB_REG (14)
-#define BME680_P7_REG (15)
-#define BME680_P6_REG (16)
-#define BME680_P8_LSB_REG (19)
-#define BME680_P8_MSB_REG (20)
-#define BME680_P9_LSB_REG (21)
-#define BME680_P9_MSB_REG (22)
-#define BME680_P10_REG (23)
-#define BME680_H2_MSB_REG (25)
-#define BME680_H2_LSB_REG (26)
-#define BME680_H1_LSB_REG (26)
-#define BME680_H1_MSB_REG (27)
-#define BME680_H3_REG (28)
-#define BME680_H4_REG (29)
-#define BME680_H5_REG (30)
-#define BME680_H6_REG (31)
-#define BME680_H7_REG (32)
-#define BME680_T1_LSB_REG (33)
-#define BME680_T1_MSB_REG (34)
-#define BME680_GH2_LSB_REG (35)
-#define BME680_GH2_MSB_REG (36)
-#define BME680_GH1_REG (37)
-#define BME680_GH3_REG (38)
-
-/** BME680 register buffer index settings*/
-#define BME680_REG_FILTER_INDEX UINT8_C(5)
-#define BME680_REG_TEMP_INDEX UINT8_C(4)
-#define BME680_REG_PRES_INDEX UINT8_C(4)
-#define BME680_REG_HUM_INDEX UINT8_C(2)
-#define BME680_REG_NBCONV_INDEX UINT8_C(1)
-#define BME680_REG_RUN_GAS_INDEX UINT8_C(1)
-#define BME680_REG_HCTRL_INDEX UINT8_C(0)
-
-/** BME680 pressure calculation macros */
-/*! This max value is used to provide precedence to multiplication or division
- * in pressure compensation equation to achieve least loss of precision and
- * avoiding overflows.
- * i.e Comparing value, BME680_MAX_OVERFLOW_VAL = INT32_C(1 << 30)
- */
-#define BME680_MAX_OVERFLOW_VAL INT32_C(0x40000000)
-
-/** Macro to combine two 8 bit data's to form a 16 bit data */
-#define BME680_CONCAT_BYTES(msb, lsb) (((uint16_t)msb << 8) | (uint16_t)lsb)
-
-/** Macro to SET and GET BITS of a register */
-#define BME680_SET_BITS(reg_data, bitname, data) \
- ((reg_data & ~(bitname##_MSK)) | \
- ((data << bitname##_POS) & bitname##_MSK))
-#define BME680_GET_BITS(reg_data, bitname) ((reg_data & (bitname##_MSK)) >> \
- (bitname##_POS))
-
-/** Macro variant to handle the bitname position if it is zero */
-#define BME680_SET_BITS_POS_0(reg_data, bitname, data) \
- ((reg_data & ~(bitname##_MSK)) | \
- (data & bitname##_MSK))
-#define BME680_GET_BITS_POS_0(reg_data, bitname) (reg_data & (bitname##_MSK))
-
-/** Type definitions */
-/*!
- * Generic communication function pointer
- * @param[in] dev_id: Place holder to store the id of the device structure
- * Can be used to store the index of the Chip select or
- * I2C address of the device.
- * @param[in] reg_addr: Used to select the register the where data needs to
- * be read from or written to.
- * @param[in/out] reg_data: Data array to read/write
- * @param[in] len: Length of the data array
- */
-typedef int8_t (*bme680_com_fptr_t)(uint8_t dev_id, uint8_t reg_addr, uint8_t *data, uint16_t len);
-
-/*!
- * Delay function pointer
- * @param[in] period: Time period in milliseconds
- */
-typedef void (*bme680_delay_fptr_t)(uint32_t period);
-
-/*!
- * @brief Interface selection Enumerations
- */
-enum bme680_intf {
- /*! SPI interface */
- BME680_SPI_INTF,
- /*! I2C interface */
- BME680_I2C_INTF
-};
-
-/* structure definitions */
-/*!
- * @brief Sensor field data structure
- */
-struct bme680_field_data {
- /*! Contains new_data, gasm_valid & heat_stab */
- uint8_t status;
- /*! The index of the heater profile used */
- uint8_t gas_index;
- /*! Measurement index to track order */
- uint8_t meas_index;
-
-#ifndef BME680_FLOAT_POINT_COMPENSATION
- /*! Temperature in degree celsius x100 */
- int16_t temperature;
- /*! Pressure in Pascal */
- uint32_t pressure;
- /*! Humidity in % relative humidity x1000 */
- uint32_t humidity;
- /*! Gas resistance in Ohms */
- uint32_t gas_resistance;
-#else
- /*! Temperature in degree celsius */
- float temperature;
- /*! Pressure in Pascal */
- float pressure;
- /*! Humidity in % relative humidity x1000 */
- float humidity;
- /*! Gas resistance in Ohms */
- float gas_resistance;
-
-#endif
-
-};
-
-/*!
- * @brief Structure to hold the Calibration data
- */
-struct bme680_calib_data {
- /*! Variable to store calibrated humidity data */
- uint16_t par_h1;
- /*! Variable to store calibrated humidity data */
- uint16_t par_h2;
- /*! Variable to store calibrated humidity data */
- int8_t par_h3;
- /*! Variable to store calibrated humidity data */
- int8_t par_h4;
- /*! Variable to store calibrated humidity data */
- int8_t par_h5;
- /*! Variable to store calibrated humidity data */
- uint8_t par_h6;
- /*! Variable to store calibrated humidity data */
- int8_t par_h7;
- /*! Variable to store calibrated gas data */
- int8_t par_gh1;
- /*! Variable to store calibrated gas data */
- int16_t par_gh2;
- /*! Variable to store calibrated gas data */
- int8_t par_gh3;
- /*! Variable to store calibrated temperature data */
- uint16_t par_t1;
- /*! Variable to store calibrated temperature data */
- int16_t par_t2;
- /*! Variable to store calibrated temperature data */
- int8_t par_t3;
- /*! Variable to store calibrated pressure data */
- uint16_t par_p1;
- /*! Variable to store calibrated pressure data */
- int16_t par_p2;
- /*! Variable to store calibrated pressure data */
- int8_t par_p3;
- /*! Variable to store calibrated pressure data */
- int16_t par_p4;
- /*! Variable to store calibrated pressure data */
- int16_t par_p5;
- /*! Variable to store calibrated pressure data */
- int8_t par_p6;
- /*! Variable to store calibrated pressure data */
- int8_t par_p7;
- /*! Variable to store calibrated pressure data */
- int16_t par_p8;
- /*! Variable to store calibrated pressure data */
- int16_t par_p9;
- /*! Variable to store calibrated pressure data */
- uint8_t par_p10;
-
-#ifndef BME680_FLOAT_POINT_COMPENSATION
- /*! Variable to store t_fine size */
- int32_t t_fine;
-#else
- /*! Variable to store t_fine size */
- float t_fine;
-#endif
- /*! Variable to store heater resistance range */
- uint8_t res_heat_range;
- /*! Variable to store heater resistance value */
- int8_t res_heat_val;
- /*! Variable to store error range */
- int8_t range_sw_err;
-};
-
-/*!
- * @brief BME680 sensor settings structure which comprises of ODR,
- * over-sampling and filter settings.
- */
-struct bme680_tph_sett {
- /*! Humidity oversampling */
- uint8_t os_hum;
- /*! Temperature oversampling */
- uint8_t os_temp;
- /*! Pressure oversampling */
- uint8_t os_pres;
- /*! Filter coefficient */
- uint8_t filter;
-};
-
-/*!
- * @brief BME680 gas sensor which comprises of gas settings
- * and status parameters
- */
-struct bme680_gas_sett {
- /*! Variable to store nb conversion */
- uint8_t nb_conv;
- /*! Variable to store heater control */
- uint8_t heatr_ctrl;
- /*! Run gas enable value */
- uint8_t run_gas;
- /*! Heater temperature value */
- uint16_t heatr_temp;
- /*! Duration profile value */
- uint16_t heatr_dur;
-};
-
-/*!
- * @brief BME680 device structure
- */
-struct bme680_dev {
- /*! Chip Id */
- uint8_t chip_id;
- /*! Device Id */
- uint8_t dev_id;
- /*! SPI/I2C interface */
- enum bme680_intf intf;
- /*! Memory page used */
- uint8_t mem_page;
- /*! Ambient temperature in Degree C */
- int8_t amb_temp;
- /*! Sensor calibration data */
- struct bme680_calib_data calib;
- /*! Sensor settings */
- struct bme680_tph_sett tph_sett;
- /*! Gas Sensor settings */
- struct bme680_gas_sett gas_sett;
- /*! Sensor power modes */
- uint8_t power_mode;
- /*! New sensor fields */
- uint8_t new_fields;
- /*! Store the info messages */
- uint8_t info_msg;
- /*! Bus read function pointer */
- bme680_com_fptr_t read;
- /*! Bus write function pointer */
- bme680_com_fptr_t write;
- /*! delay function pointer */
- bme680_delay_fptr_t delay_ms;
- /*! Communication function result */
- int8_t com_rslt;
-};
-
-
-
-#endif /* BME680_DEFS_H_ */
-/** @}*/
-/** @}*/
diff --git a/lib/lib_i2c/BME68x-Sensor-API/LICENSE b/lib/lib_i2c/BME68x-Sensor-API/LICENSE
new file mode 100644
index 000000000..39d644246
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/LICENSE
@@ -0,0 +1,30 @@
+Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
+
+BSD-3-Clause
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/lib/lib_i2c/BME68x-Sensor-API/README.md b/lib/lib_i2c/BME68x-Sensor-API/README.md
new file mode 100644
index 000000000..77f94ffec
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/README.md
@@ -0,0 +1,30 @@
+# BME68X Sensor API
+
+> Bosch Sensortec's BME680 and BME688 sensor API
+
+## Sensor Overview
+BME680 is an integrated environmental sensor developed specifically for mobile applications and wearables where size and low power consumption are key requirements. Expanding Bosch Sensortec’s existing family of environmental sensors, the BME680 integrates for the first time high-linearity and high-accuracy gas, pressure, humidity and temperature sensors. It consists of an 8-pin metal-lid 3.0 x 3.0 x 0.93 mm³ LGA package which is designed for optimized consumption depending on the specific operating mode, long term stability and high EMC robustness. The gas sensor within the BME680 can detect a broad range of gases to measure air quality for personal well being. Gases that can be detected by the BME680 include Volatile Organic Compounds (VOC) from paints (such as formaldehyde), lacquers, paint strippers, cleaning supplies, furnishings, office equipment, glues, adhesives and alcohol.
+
+### Features
+
+- Air quality measurement
+- Personalized weather station
+- Context awareness, e.g. skin moisture detection, room change detection
+- Fitness monitoring / well-being
+- Warning regarding dryness or high temperatures
+- Measurement of volume and air flow
+- Home automation control (e.g. HVAC)
+- GPS enhancement (e.g. time-to-first-fix improvement, dead reckoning, slope detection)
+- Indoor navigation (change of floor detection, elevator detection)
+- Altitude tracking and calories expenditure for sports activities
+
+#### Important links:
+For more information, please refer to:
+
+- [BME680 Product page](https://www.bosch-sensortec.com/bst/products/all_products/bme680)
+- [BME680 & BME688 Github page](https://github.com/BoschSensortec/BME68x-Sensor-API)
+- [BME680 gas sensor design guide](https://community.bosch-sensortec.com/t5/Knowledge-base/BME680-gas-sensor-series-design-guide/ta-p/5952)
+- [Knowledge base page](https://community.bosch-sensortec.com/t5/Knowledge-base/tkb-p/bst_community-mems-tkb)
+- [Community support page](https://community.bosch-sensortec.com)
+
+---
\ No newline at end of file
diff --git a/lib/lib_i2c/BME68x-Sensor-API/bme68x.c b/lib/lib_i2c/BME68x-Sensor-API/bme68x.c
new file mode 100644
index 000000000..7c3c9356b
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/bme68x.c
@@ -0,0 +1,1848 @@
+/**
+* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
+*
+* BSD-3-Clause
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* 3. Neither the name of the copyright holder nor the names of its
+* contributors may be used to endorse or promote products derived from
+* this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*
+* @file bme68x.c
+* @date 2021-11-09
+* @version v4.4.7
+*
+*/
+
+#include "bme68x.h"
+#include
+
+/* This internal API is used to read the calibration coefficients */
+static int8_t get_calib_data(struct bme68x_dev *dev);
+
+/* This internal API is used to read variant ID information register status */
+static int8_t read_variant_id(struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the gas wait */
+static uint8_t calc_gas_wait(uint16_t dur);
+
+#ifndef BME68X_USE_FPU
+
+/* This internal API is used to calculate the temperature in integer */
+static int16_t calc_temperature(uint32_t temp_adc, struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the pressure in integer */
+static uint32_t calc_pressure(uint32_t pres_adc, const struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the humidity in integer */
+static uint32_t calc_humidity(uint16_t hum_adc, const struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the gas resistance high */
+static uint32_t calc_gas_resistance_high(uint16_t gas_res_adc, uint8_t gas_range);
+
+/* This internal API is used to calculate the gas resistance low */
+static uint32_t calc_gas_resistance_low(uint16_t gas_res_adc, uint8_t gas_range, const struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the heater resistance using integer */
+static uint8_t calc_res_heat(uint16_t temp, const struct bme68x_dev *dev);
+
+#else
+
+/* This internal API is used to calculate the temperature value in float */
+static float calc_temperature(uint32_t temp_adc, struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the pressure value in float */
+static float calc_pressure(uint32_t pres_adc, const struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the humidity value in float */
+static float calc_humidity(uint16_t hum_adc, const struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the gas resistance high value in float */
+static float calc_gas_resistance_high(uint16_t gas_res_adc, uint8_t gas_range);
+
+/* This internal API is used to calculate the gas resistance low value in float */
+static float calc_gas_resistance_low(uint16_t gas_res_adc, uint8_t gas_range, const struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the heater resistance value using float */
+static uint8_t calc_res_heat(uint16_t temp, const struct bme68x_dev *dev);
+
+#endif
+
+/* This internal API is used to read a single data of the sensor */
+static int8_t read_field_data(uint8_t index, struct bme68x_data *data, struct bme68x_dev *dev);
+
+/* This internal API is used to read all data fields of the sensor */
+static int8_t read_all_field_data(struct bme68x_data * const data[], struct bme68x_dev *dev);
+
+/* This internal API is used to switch between SPI memory pages */
+static int8_t set_mem_page(uint8_t reg_addr, struct bme68x_dev *dev);
+
+/* This internal API is used to get the current SPI memory page */
+static int8_t get_mem_page(struct bme68x_dev *dev);
+
+/* This internal API is used to check the bme68x_dev for null pointers */
+static int8_t null_ptr_check(const struct bme68x_dev *dev);
+
+/* This internal API is used to set heater configurations */
+static int8_t set_conf(const struct bme68x_heatr_conf *conf, uint8_t op_mode, uint8_t *nb_conv, struct bme68x_dev *dev);
+
+/* This internal API is used to limit the max value of a parameter */
+static int8_t boundary_check(uint8_t *value, uint8_t max, struct bme68x_dev *dev);
+
+/* This internal API is used to calculate the register value for
+ * shared heater duration */
+static uint8_t calc_heatr_dur_shared(uint16_t dur);
+
+/* This internal API is used to swap two fields */
+static void swap_fields(uint8_t index1, uint8_t index2, struct bme68x_data *field[]);
+
+/* This internal API is used sort the sensor data */
+static void sort_sensor_data(uint8_t low_index, uint8_t high_index, struct bme68x_data *field[]);
+
+/*
+ * @brief Function to analyze the sensor data
+ *
+ * @param[in] data Array of measurement data
+ * @param[in] n_meas Number of measurements
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+static int8_t analyze_sensor_data(const struct bme68x_data *data, uint8_t n_meas);
+
+/******************************************************************************************/
+/* Global API definitions */
+/******************************************************************************************/
+
+/* @brief This API reads the chip-id of the sensor which is the first step to
+* verify the sensor and also calibrates the sensor
+* As this API is the entry point, call this API before using other APIs.
+*/
+int8_t bme68x_init(struct bme68x_dev *dev)
+{
+ int8_t rslt;
+
+ rslt = bme68x_soft_reset(dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_CHIP_ID, &dev->chip_id, 1, dev);
+ if (rslt == BME68X_OK)
+ {
+ if (dev->chip_id == BME68X_CHIP_ID)
+ {
+ /* Read Variant ID */
+ rslt = read_variant_id(dev);
+
+ if (rslt == BME68X_OK)
+ {
+ /* Get the Calibration data */
+ rslt = get_calib_data(dev);
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_DEV_NOT_FOUND;
+ }
+ }
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API writes the given data to the register address of the sensor
+ */
+int8_t bme68x_set_regs(const uint8_t *reg_addr, const uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+
+ /* Length of the temporary buffer is 2*(length of register)*/
+ uint8_t tmp_buff[BME68X_LEN_INTERLEAVE_BUFF] = { 0 };
+ uint16_t index;
+
+ /* Check for null pointer in the device structure*/
+ rslt = null_ptr_check(dev);
+ if ((rslt == BME68X_OK) && reg_addr && reg_data)
+ {
+ if ((len > 0) && (len <= (BME68X_LEN_INTERLEAVE_BUFF / 2)))
+ {
+ /* Interleave the 2 arrays */
+ for (index = 0; index < len; index++)
+ {
+ if (dev->intf == BME68X_SPI_INTF)
+ {
+ /* Set the memory page */
+ rslt = set_mem_page(reg_addr[index], dev);
+ tmp_buff[(2 * index)] = reg_addr[index] & BME68X_SPI_WR_MSK;
+ }
+ else
+ {
+ tmp_buff[(2 * index)] = reg_addr[index];
+ }
+
+ tmp_buff[(2 * index) + 1] = reg_data[index];
+ }
+
+ /* Write the interleaved array */
+ if (rslt == BME68X_OK)
+ {
+ dev->intf_rslt = dev->write(tmp_buff[0], &tmp_buff[1], (2 * len) - 1, dev->intf_ptr);
+ if (dev->intf_rslt != 0)
+ {
+ rslt = BME68X_E_COM_FAIL;
+ }
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_INVALID_LENGTH;
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API reads the data from the given register address of sensor.
+ */
+int8_t bme68x_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+
+ /* Check for null pointer in the device structure*/
+ rslt = null_ptr_check(dev);
+ if ((rslt == BME68X_OK) && reg_data)
+ {
+ if (dev->intf == BME68X_SPI_INTF)
+ {
+ /* Set the memory page */
+ rslt = set_mem_page(reg_addr, dev);
+ if (rslt == BME68X_OK)
+ {
+ reg_addr = reg_addr | BME68X_SPI_RD_MSK;
+ }
+ }
+
+ dev->intf_rslt = dev->read(reg_addr, reg_data, len, dev->intf_ptr);
+ if (dev->intf_rslt != 0)
+ {
+ rslt = BME68X_E_COM_FAIL;
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API soft-resets the sensor.
+ */
+int8_t bme68x_soft_reset(struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t reg_addr = BME68X_REG_SOFT_RESET;
+
+ /* 0xb6 is the soft reset command */
+ uint8_t soft_rst_cmd = BME68X_SOFT_RESET_CMD;
+
+ /* Check for null pointer in the device structure*/
+ rslt = null_ptr_check(dev);
+ if (rslt == BME68X_OK)
+ {
+ if (dev->intf == BME68X_SPI_INTF)
+ {
+ rslt = get_mem_page(dev);
+ }
+
+ /* Reset the device */
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_regs(®_addr, &soft_rst_cmd, 1, dev);
+
+ /* Wait for 5ms */
+ dev->delay_us(BME68X_PERIOD_RESET, dev->intf_ptr);
+ if (rslt == BME68X_OK)
+ {
+ /* After reset get the memory page */
+ if (dev->intf == BME68X_SPI_INTF)
+ {
+ rslt = get_mem_page(dev);
+ }
+ }
+ }
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API is used to set the oversampling, filter and odr configuration
+ */
+int8_t bme68x_set_conf(struct bme68x_conf *conf, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t odr20 = 0, odr3 = 1;
+ uint8_t current_op_mode;
+
+ /* Register data starting from BME68X_REG_CTRL_GAS_1(0x71) up to BME68X_REG_CONFIG(0x75) */
+ uint8_t reg_array[BME68X_LEN_CONFIG] = { 0x71, 0x72, 0x73, 0x74, 0x75 };
+ uint8_t data_array[BME68X_LEN_CONFIG] = { 0 };
+
+ rslt = bme68x_get_op_mode(¤t_op_mode, dev);
+ if (rslt == BME68X_OK)
+ {
+ /* Configure only in the sleep mode */
+ rslt = bme68x_set_op_mode(BME68X_SLEEP_MODE, dev);
+ }
+
+ if (conf == NULL)
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+ else if (rslt == BME68X_OK)
+ {
+ /* Read the whole configuration and write it back once later */
+ rslt = bme68x_get_regs(reg_array[0], data_array, BME68X_LEN_CONFIG, dev);
+ dev->info_msg = BME68X_OK;
+ if (rslt == BME68X_OK)
+ {
+ rslt = boundary_check(&conf->filter, BME68X_FILTER_SIZE_127, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = boundary_check(&conf->os_temp, BME68X_OS_16X, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = boundary_check(&conf->os_pres, BME68X_OS_16X, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = boundary_check(&conf->os_hum, BME68X_OS_16X, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = boundary_check(&conf->odr, BME68X_ODR_NONE, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ data_array[4] = BME68X_SET_BITS(data_array[4], BME68X_FILTER, conf->filter);
+ data_array[3] = BME68X_SET_BITS(data_array[3], BME68X_OST, conf->os_temp);
+ data_array[3] = BME68X_SET_BITS(data_array[3], BME68X_OSP, conf->os_pres);
+ data_array[1] = BME68X_SET_BITS_POS_0(data_array[1], BME68X_OSH, conf->os_hum);
+ if (conf->odr != BME68X_ODR_NONE)
+ {
+ odr20 = conf->odr;
+ odr3 = 0;
+ }
+
+ data_array[4] = BME68X_SET_BITS(data_array[4], BME68X_ODR20, odr20);
+ data_array[0] = BME68X_SET_BITS(data_array[0], BME68X_ODR3, odr3);
+ }
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_regs(reg_array, data_array, BME68X_LEN_CONFIG, dev);
+ }
+
+ if ((current_op_mode != BME68X_SLEEP_MODE) && (rslt == BME68X_OK))
+ {
+ rslt = bme68x_set_op_mode(current_op_mode, dev);
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API is used to get the oversampling, filter and odr
+ */
+int8_t bme68x_get_conf(struct bme68x_conf *conf, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+
+ /* starting address of the register array for burst read*/
+ uint8_t reg_addr = BME68X_REG_CTRL_GAS_1;
+ uint8_t data_array[BME68X_LEN_CONFIG];
+
+ rslt = bme68x_get_regs(reg_addr, data_array, 5, dev);
+ if (!conf)
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+ else if (rslt == BME68X_OK)
+ {
+ conf->os_hum = BME68X_GET_BITS_POS_0(data_array[1], BME68X_OSH);
+ conf->filter = BME68X_GET_BITS(data_array[4], BME68X_FILTER);
+ conf->os_temp = BME68X_GET_BITS(data_array[3], BME68X_OST);
+ conf->os_pres = BME68X_GET_BITS(data_array[3], BME68X_OSP);
+ if (BME68X_GET_BITS(data_array[0], BME68X_ODR3))
+ {
+ conf->odr = BME68X_ODR_NONE;
+ }
+ else
+ {
+ conf->odr = BME68X_GET_BITS(data_array[4], BME68X_ODR20);
+ }
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API is used to set the operation mode of the sensor
+ */
+int8_t bme68x_set_op_mode(const uint8_t op_mode, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t tmp_pow_mode;
+ uint8_t pow_mode = 0;
+ uint8_t reg_addr = BME68X_REG_CTRL_MEAS;
+
+ /* Call until in sleep */
+ do
+ {
+ rslt = bme68x_get_regs(BME68X_REG_CTRL_MEAS, &tmp_pow_mode, 1, dev);
+ if (rslt == BME68X_OK)
+ {
+ /* Put to sleep before changing mode */
+ pow_mode = (tmp_pow_mode & BME68X_MODE_MSK);
+ if (pow_mode != BME68X_SLEEP_MODE)
+ {
+ tmp_pow_mode &= ~BME68X_MODE_MSK; /* Set to sleep */
+ rslt = bme68x_set_regs(®_addr, &tmp_pow_mode, 1, dev);
+ dev->delay_us(BME68X_PERIOD_POLL, dev->intf_ptr);
+ }
+ }
+ } while ((pow_mode != BME68X_SLEEP_MODE) && (rslt == BME68X_OK));
+
+ /* Already in sleep */
+ if ((op_mode != BME68X_SLEEP_MODE) && (rslt == BME68X_OK))
+ {
+ tmp_pow_mode = (tmp_pow_mode & ~BME68X_MODE_MSK) | (op_mode & BME68X_MODE_MSK);
+ rslt = bme68x_set_regs(®_addr, &tmp_pow_mode, 1, dev);
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API is used to get the operation mode of the sensor.
+ */
+int8_t bme68x_get_op_mode(uint8_t *op_mode, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t mode;
+
+ if (op_mode)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_CTRL_MEAS, &mode, 1, dev);
+
+ /* Masking the other register bit info*/
+ *op_mode = mode & BME68X_MODE_MSK;
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API is used to get the remaining duration that can be used for heating.
+ */
+uint32_t bme68x_get_meas_dur(const uint8_t op_mode, struct bme68x_conf *conf, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint32_t meas_dur = 0; /* Calculate in us */
+ uint32_t meas_cycles;
+ uint8_t os_to_meas_cycles[6] = { 0, 1, 2, 4, 8, 16 };
+
+ if (conf != NULL)
+ {
+ /* Boundary check for temperature oversampling */
+ rslt = boundary_check(&conf->os_temp, BME68X_OS_16X, dev);
+
+ if (rslt == BME68X_OK)
+ {
+ /* Boundary check for pressure oversampling */
+ rslt = boundary_check(&conf->os_pres, BME68X_OS_16X, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ /* Boundary check for humidity oversampling */
+ rslt = boundary_check(&conf->os_hum, BME68X_OS_16X, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ meas_cycles = os_to_meas_cycles[conf->os_temp];
+ meas_cycles += os_to_meas_cycles[conf->os_pres];
+ meas_cycles += os_to_meas_cycles[conf->os_hum];
+
+ /* TPH measurement duration */
+ meas_dur = meas_cycles * UINT32_C(1963);
+ meas_dur += UINT32_C(477 * 4); /* TPH switching duration */
+ meas_dur += UINT32_C(477 * 5); /* Gas measurement duration */
+
+ if (op_mode != BME68X_PARALLEL_MODE)
+ {
+ meas_dur += UINT32_C(1000); /* Wake up duration of 1ms */
+ }
+ }
+ }
+
+ return meas_dur;
+}
+
+/*
+ * @brief This API reads the pressure, temperature and humidity and gas data
+ * from the sensor, compensates the data and store it in the bme68x_data
+ * structure instance passed by the user.
+ */
+int8_t bme68x_get_data(uint8_t op_mode, struct bme68x_data *data, uint8_t *n_data, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t i = 0, j = 0, new_fields = 0;
+ struct bme68x_data *field_ptr[3] = { 0 };
+ struct bme68x_data field_data[3] = { { 0 } };
+
+ field_ptr[0] = &field_data[0];
+ field_ptr[1] = &field_data[1];
+ field_ptr[2] = &field_data[2];
+
+ rslt = null_ptr_check(dev);
+ if ((rslt == BME68X_OK) && (data != NULL))
+ {
+ /* Reading the sensor data in forced mode only */
+ if (op_mode == BME68X_FORCED_MODE)
+ {
+ rslt = read_field_data(0, data, dev);
+ if (rslt == BME68X_OK)
+ {
+ if (data->status & BME68X_NEW_DATA_MSK)
+ {
+ new_fields = 1;
+ }
+ else
+ {
+ new_fields = 0;
+ rslt = BME68X_W_NO_NEW_DATA;
+ }
+ }
+ }
+ else if ((op_mode == BME68X_PARALLEL_MODE) || (op_mode == BME68X_SEQUENTIAL_MODE))
+ {
+ /* Read the 3 fields and count the number of new data fields */
+ rslt = read_all_field_data(field_ptr, dev);
+
+ new_fields = 0;
+ for (i = 0; (i < 3) && (rslt == BME68X_OK); i++)
+ {
+ if (field_ptr[i]->status & BME68X_NEW_DATA_MSK)
+ {
+ new_fields++;
+ }
+ }
+
+ /* Sort the sensor data in parallel & sequential modes*/
+ for (i = 0; (i < 2) && (rslt == BME68X_OK); i++)
+ {
+ for (j = i + 1; j < 3; j++)
+ {
+ sort_sensor_data(i, j, field_ptr);
+ }
+ }
+
+ /* Copy the sorted data */
+ for (i = 0; ((i < 3) && (rslt == BME68X_OK)); i++)
+ {
+ data[i] = *field_ptr[i];
+ }
+
+ if (new_fields == 0)
+ {
+ rslt = BME68X_W_NO_NEW_DATA;
+ }
+ }
+ else
+ {
+ rslt = BME68X_W_DEFINE_OP_MODE;
+ }
+
+ if (n_data == NULL)
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+ else
+ {
+ *n_data = new_fields;
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API is used to set the gas configuration of the sensor.
+ */
+int8_t bme68x_set_heatr_conf(uint8_t op_mode, const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t nb_conv = 0;
+ uint8_t hctrl, run_gas = 0;
+ uint8_t ctrl_gas_data[2];
+ uint8_t ctrl_gas_addr[2] = { BME68X_REG_CTRL_GAS_0, BME68X_REG_CTRL_GAS_1 };
+
+ if (conf != NULL)
+ {
+ rslt = bme68x_set_op_mode(BME68X_SLEEP_MODE, dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = set_conf(conf, op_mode, &nb_conv, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_CTRL_GAS_0, ctrl_gas_data, 2, dev);
+ if (rslt == BME68X_OK)
+ {
+ if (conf->enable == BME68X_ENABLE)
+ {
+ hctrl = BME68X_ENABLE_HEATER;
+ if (dev->variant_id == BME68X_VARIANT_GAS_HIGH)
+ {
+ run_gas = BME68X_ENABLE_GAS_MEAS_H;
+ }
+ else
+ {
+ run_gas = BME68X_ENABLE_GAS_MEAS_L;
+ }
+ }
+ else
+ {
+ hctrl = BME68X_DISABLE_HEATER;
+ run_gas = BME68X_DISABLE_GAS_MEAS;
+ }
+
+ ctrl_gas_data[0] = BME68X_SET_BITS(ctrl_gas_data[0], BME68X_HCTRL, hctrl);
+ ctrl_gas_data[1] = BME68X_SET_BITS_POS_0(ctrl_gas_data[1], BME68X_NBCONV, nb_conv);
+ ctrl_gas_data[1] = BME68X_SET_BITS(ctrl_gas_data[1], BME68X_RUN_GAS, run_gas);
+ rslt = bme68x_set_regs(ctrl_gas_addr, ctrl_gas_data, 2, dev);
+ }
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API is used to get the gas configuration of the sensor.
+ */
+int8_t bme68x_get_heatr_conf(const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t data_array[10] = { 0 };
+ uint8_t i;
+
+ /* FIXME: Add conversion to deg C and ms and add the other parameters */
+ rslt = bme68x_get_regs(BME68X_REG_RES_HEAT0, data_array, 10, dev);
+ if (rslt == BME68X_OK)
+ {
+ if (conf && conf->heatr_dur_prof && conf->heatr_temp_prof)
+ {
+ for (i = 0; i < 10; i++)
+ {
+ conf->heatr_temp_prof[i] = data_array[i];
+ }
+
+ rslt = bme68x_get_regs(BME68X_REG_GAS_WAIT0, data_array, 10, dev);
+ if (rslt == BME68X_OK)
+ {
+ for (i = 0; i < 10; i++)
+ {
+ conf->heatr_dur_prof[i] = data_array[i];
+ }
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+ }
+
+ return rslt;
+}
+
+/*
+ * @brief This API performs Self-test of low and high gas variants of BME68X
+ */
+int8_t bme68x_selftest_check(const struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t n_fields;
+ uint8_t i = 0;
+ struct bme68x_data data[BME68X_N_MEAS] = { { 0 } };
+ struct bme68x_dev t_dev;
+ struct bme68x_conf conf;
+ struct bme68x_heatr_conf heatr_conf;
+
+ /* Copy required parameters from reference bme68x_dev struct */
+ t_dev.amb_temp = 25;
+ t_dev.read = dev->read;
+ t_dev.write = dev->write;
+ t_dev.intf = dev->intf;
+ t_dev.delay_us = dev->delay_us;
+ t_dev.intf_ptr = dev->intf_ptr;
+ rslt = bme68x_init(&t_dev);
+ if (rslt == BME68X_OK)
+ {
+ /* Set the temperature, pressure and humidity & filter settings */
+ conf.os_hum = BME68X_OS_1X;
+ conf.os_pres = BME68X_OS_16X;
+ conf.os_temp = BME68X_OS_2X;
+
+ /* Set the remaining gas sensor settings and link the heating profile */
+ heatr_conf.enable = BME68X_ENABLE;
+ heatr_conf.heatr_dur = BME68X_HEATR_DUR1;
+ heatr_conf.heatr_temp = BME68X_HIGH_TEMP;
+ rslt = bme68x_set_heatr_conf(BME68X_FORCED_MODE, &heatr_conf, &t_dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_conf(&conf, &t_dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_op_mode(BME68X_FORCED_MODE, &t_dev); /* Trigger a measurement */
+ if (rslt == BME68X_OK)
+ {
+ /* Wait for the measurement to complete */
+ t_dev.delay_us(BME68X_HEATR_DUR1_DELAY, t_dev.intf_ptr);
+ rslt = bme68x_get_data(BME68X_FORCED_MODE, &data[0], &n_fields, &t_dev);
+ if (rslt == BME68X_OK)
+ {
+ if ((data[0].idac != 0x00) && (data[0].idac != 0xFF) &&
+ (data[0].status & BME68X_GASM_VALID_MSK))
+ {
+ rslt = BME68X_OK;
+ }
+ else
+ {
+ rslt = BME68X_E_SELF_TEST;
+ }
+ }
+ }
+ }
+ }
+
+ heatr_conf.heatr_dur = BME68X_HEATR_DUR2;
+ while ((rslt == BME68X_OK) && (i < BME68X_N_MEAS))
+ {
+ if (i % 2 == 0)
+ {
+ heatr_conf.heatr_temp = BME68X_HIGH_TEMP; /* Higher temperature */
+ }
+ else
+ {
+ heatr_conf.heatr_temp = BME68X_LOW_TEMP; /* Lower temperature */
+ }
+
+ rslt = bme68x_set_heatr_conf(BME68X_FORCED_MODE, &heatr_conf, &t_dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_conf(&conf, &t_dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_op_mode(BME68X_FORCED_MODE, &t_dev); /* Trigger a measurement */
+ if (rslt == BME68X_OK)
+ {
+ /* Wait for the measurement to complete */
+ t_dev.delay_us(BME68X_HEATR_DUR2_DELAY, t_dev.intf_ptr);
+ rslt = bme68x_get_data(BME68X_FORCED_MODE, &data[i], &n_fields, &t_dev);
+ }
+ }
+ }
+
+ i++;
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = analyze_sensor_data(data, BME68X_N_MEAS);
+ }
+ }
+
+ return rslt;
+}
+
+/*****************************INTERNAL APIs***********************************************/
+#ifndef BME68X_USE_FPU
+
+/* @brief This internal API is used to calculate the temperature value. */
+static int16_t calc_temperature(uint32_t temp_adc, struct bme68x_dev *dev)
+{
+ int64_t var1;
+ int64_t var2;
+ int64_t var3;
+ int16_t calc_temp;
+
+ /*lint -save -e701 -e702 -e704 */
+ var1 = ((int32_t)temp_adc >> 3) - ((int32_t)dev->calib.par_t1 << 1);
+ var2 = (var1 * (int32_t)dev->calib.par_t2) >> 11;
+ var3 = ((var1 >> 1) * (var1 >> 1)) >> 12;
+ var3 = ((var3) * ((int32_t)dev->calib.par_t3 << 4)) >> 14;
+ dev->calib.t_fine = (int32_t)(var2 + var3);
+ calc_temp = (int16_t)(((dev->calib.t_fine * 5) + 128) >> 8);
+
+ /*lint -restore */
+ return calc_temp;
+}
+
+/* @brief This internal API is used to calculate the pressure value. */
+static uint32_t calc_pressure(uint32_t pres_adc, const struct bme68x_dev *dev)
+{
+ int32_t var1;
+ int32_t var2;
+ int32_t var3;
+ int32_t pressure_comp;
+
+ /* This value is used to check precedence to multiplication or division
+ * in the pressure compensation equation to achieve least loss of precision and
+ * avoiding overflows.
+ * i.e Comparing value, pres_ovf_check = (1 << 31) >> 1
+ */
+ const int32_t pres_ovf_check = INT32_C(0x40000000);
+
+ /*lint -save -e701 -e702 -e713 */
+ var1 = (((int32_t)dev->calib.t_fine) >> 1) - 64000;
+ var2 = ((((var1 >> 2) * (var1 >> 2)) >> 11) * (int32_t)dev->calib.par_p6) >> 2;
+ var2 = var2 + ((var1 * (int32_t)dev->calib.par_p5) << 1);
+ var2 = (var2 >> 2) + ((int32_t)dev->calib.par_p4 << 16);
+ var1 = (((((var1 >> 2) * (var1 >> 2)) >> 13) * ((int32_t)dev->calib.par_p3 << 5)) >> 3) +
+ (((int32_t)dev->calib.par_p2 * var1) >> 1);
+ var1 = var1 >> 18;
+ var1 = ((32768 + var1) * (int32_t)dev->calib.par_p1) >> 15;
+ pressure_comp = 1048576 - pres_adc;
+ pressure_comp = (int32_t)((pressure_comp - (var2 >> 12)) * ((uint32_t)3125));
+ if (pressure_comp >= pres_ovf_check)
+ {
+ pressure_comp = ((pressure_comp / var1) << 1);
+ }
+ else
+ {
+ pressure_comp = ((pressure_comp << 1) / var1);
+ }
+
+ var1 = ((int32_t)dev->calib.par_p9 * (int32_t)(((pressure_comp >> 3) * (pressure_comp >> 3)) >> 13)) >> 12;
+ var2 = ((int32_t)(pressure_comp >> 2) * (int32_t)dev->calib.par_p8) >> 13;
+ var3 =
+ ((int32_t)(pressure_comp >> 8) * (int32_t)(pressure_comp >> 8) * (int32_t)(pressure_comp >> 8) *
+ (int32_t)dev->calib.par_p10) >> 17;
+ pressure_comp = (int32_t)(pressure_comp) + ((var1 + var2 + var3 + ((int32_t)dev->calib.par_p7 << 7)) >> 4);
+
+ /*lint -restore */
+ return (uint32_t)pressure_comp;
+}
+
+/* This internal API is used to calculate the humidity in integer */
+static uint32_t calc_humidity(uint16_t hum_adc, const struct bme68x_dev *dev)
+{
+ int32_t var1;
+ int32_t var2;
+ int32_t var3;
+ int32_t var4;
+ int32_t var5;
+ int32_t var6;
+ int32_t temp_scaled;
+ int32_t calc_hum;
+
+ /*lint -save -e702 -e704 */
+ temp_scaled = (((int32_t)dev->calib.t_fine * 5) + 128) >> 8;
+ var1 = (int32_t)(hum_adc - ((int32_t)((int32_t)dev->calib.par_h1 * 16))) -
+ (((temp_scaled * (int32_t)dev->calib.par_h3) / ((int32_t)100)) >> 1);
+ var2 =
+ ((int32_t)dev->calib.par_h2 *
+ (((temp_scaled * (int32_t)dev->calib.par_h4) / ((int32_t)100)) +
+ (((temp_scaled * ((temp_scaled * (int32_t)dev->calib.par_h5) / ((int32_t)100))) >> 6) / ((int32_t)100)) +
+ (int32_t)(1 << 14))) >> 10;
+ var3 = var1 * var2;
+ var4 = (int32_t)dev->calib.par_h6 << 7;
+ var4 = ((var4) + ((temp_scaled * (int32_t)dev->calib.par_h7) / ((int32_t)100))) >> 4;
+ var5 = ((var3 >> 14) * (var3 >> 14)) >> 10;
+ var6 = (var4 * var5) >> 1;
+ calc_hum = (((var3 + var6) >> 10) * ((int32_t)1000)) >> 12;
+ if (calc_hum > 100000) /* Cap at 100%rH */
+ {
+ calc_hum = 100000;
+ }
+ else if (calc_hum < 0)
+ {
+ calc_hum = 0;
+ }
+
+ /*lint -restore */
+ return (uint32_t)calc_hum;
+}
+
+/* This internal API is used to calculate the gas resistance low */
+static uint32_t calc_gas_resistance_low(uint16_t gas_res_adc, uint8_t gas_range, const struct bme68x_dev *dev)
+{
+ int64_t var1;
+ uint64_t var2;
+ int64_t var3;
+ uint32_t calc_gas_res;
+ uint32_t lookup_table1[16] = {
+ UINT32_C(2147483647), UINT32_C(2147483647), UINT32_C(2147483647), UINT32_C(2147483647), UINT32_C(2147483647),
+ UINT32_C(2126008810), UINT32_C(2147483647), UINT32_C(2130303777), UINT32_C(2147483647), UINT32_C(2147483647),
+ UINT32_C(2143188679), UINT32_C(2136746228), UINT32_C(2147483647), UINT32_C(2126008810), UINT32_C(2147483647),
+ UINT32_C(2147483647)
+ };
+ uint32_t lookup_table2[16] = {
+ UINT32_C(4096000000), UINT32_C(2048000000), UINT32_C(1024000000), UINT32_C(512000000), UINT32_C(255744255),
+ UINT32_C(127110228), UINT32_C(64000000), UINT32_C(32258064), UINT32_C(16016016), UINT32_C(8000000), UINT32_C(
+ 4000000), UINT32_C(2000000), UINT32_C(1000000), UINT32_C(500000), UINT32_C(250000), UINT32_C(125000)
+ };
+
+ /*lint -save -e704 */
+ var1 = (int64_t)((1340 + (5 * (int64_t)dev->calib.range_sw_err)) * ((int64_t)lookup_table1[gas_range])) >> 16;
+ var2 = (((int64_t)((int64_t)gas_res_adc << 15) - (int64_t)(16777216)) + var1);
+ var3 = (((int64_t)lookup_table2[gas_range] * (int64_t)var1) >> 9);
+ calc_gas_res = (uint32_t)((var3 + ((int64_t)var2 >> 1)) / (int64_t)var2);
+
+ /*lint -restore */
+ return calc_gas_res;
+}
+
+/* This internal API is used to calculate the gas resistance */
+static uint32_t calc_gas_resistance_high(uint16_t gas_res_adc, uint8_t gas_range)
+{
+ uint32_t calc_gas_res;
+ uint32_t var1 = UINT32_C(262144) >> gas_range;
+ int32_t var2 = (int32_t)gas_res_adc - INT32_C(512);
+
+ var2 *= INT32_C(3);
+ var2 = INT32_C(4096) + var2;
+
+ /* multiplying 10000 then dividing then multiplying by 100 instead of multiplying by 1000000 to prevent overflow */
+ calc_gas_res = (UINT32_C(10000) * var1) / (uint32_t)var2;
+ calc_gas_res = calc_gas_res * 100;
+
+ return calc_gas_res;
+}
+
+/* This internal API is used to calculate the heater resistance value using float */
+static uint8_t calc_res_heat(uint16_t temp, const struct bme68x_dev *dev)
+{
+ uint8_t heatr_res;
+ int32_t var1;
+ int32_t var2;
+ int32_t var3;
+ int32_t var4;
+ int32_t var5;
+ int32_t heatr_res_x100;
+
+ if (temp > 400) /* Cap temperature */
+ {
+ temp = 400;
+ }
+
+ var1 = (((int32_t)dev->amb_temp * dev->calib.par_gh3) / 1000) * 256;
+ var2 = (dev->calib.par_gh1 + 784) * (((((dev->calib.par_gh2 + 154009) * temp * 5) / 100) + 3276800) / 10);
+ var3 = var1 + (var2 / 2);
+ var4 = (var3 / (dev->calib.res_heat_range + 4));
+ var5 = (131 * dev->calib.res_heat_val) + 65536;
+ heatr_res_x100 = (int32_t)(((var4 / var5) - 250) * 34);
+ heatr_res = (uint8_t)((heatr_res_x100 + 50) / 100);
+
+ return heatr_res;
+}
+
+#else
+
+/* @brief This internal API is used to calculate the temperature value. */
+static float calc_temperature(uint32_t temp_adc, struct bme68x_dev *dev)
+{
+ float var1;
+ float var2;
+ float calc_temp;
+
+ /* calculate var1 data */
+ var1 = ((((float)temp_adc / 16384.0f) - ((float)dev->calib.par_t1 / 1024.0f)) * ((float)dev->calib.par_t2));
+
+ /* calculate var2 data */
+ var2 =
+ (((((float)temp_adc / 131072.0f) - ((float)dev->calib.par_t1 / 8192.0f)) *
+ (((float)temp_adc / 131072.0f) - ((float)dev->calib.par_t1 / 8192.0f))) * ((float)dev->calib.par_t3 * 16.0f));
+
+ /* t_fine value*/
+ dev->calib.t_fine = (var1 + var2);
+
+ /* compensated temperature data*/
+ calc_temp = ((dev->calib.t_fine) / 5120.0f);
+
+ return calc_temp;
+}
+
+/* @brief This internal API is used to calculate the pressure value. */
+static float calc_pressure(uint32_t pres_adc, const struct bme68x_dev *dev)
+{
+ float var1;
+ float var2;
+ float var3;
+ float calc_pres;
+
+ var1 = (((float)dev->calib.t_fine / 2.0f) - 64000.0f);
+ var2 = var1 * var1 * (((float)dev->calib.par_p6) / (131072.0f));
+ var2 = var2 + (var1 * ((float)dev->calib.par_p5) * 2.0f);
+ var2 = (var2 / 4.0f) + (((float)dev->calib.par_p4) * 65536.0f);
+ var1 = (((((float)dev->calib.par_p3 * var1 * var1) / 16384.0f) + ((float)dev->calib.par_p2 * var1)) / 524288.0f);
+ var1 = ((1.0f + (var1 / 32768.0f)) * ((float)dev->calib.par_p1));
+ calc_pres = (1048576.0f - ((float)pres_adc));
+
+ /* Avoid exception caused by division by zero */
+ if ((int)var1 != 0)
+ {
+ calc_pres = (((calc_pres - (var2 / 4096.0f)) * 6250.0f) / var1);
+ var1 = (((float)dev->calib.par_p9) * calc_pres * calc_pres) / 2147483648.0f;
+ var2 = calc_pres * (((float)dev->calib.par_p8) / 32768.0f);
+ var3 = ((calc_pres / 256.0f) * (calc_pres / 256.0f) * (calc_pres / 256.0f) * (dev->calib.par_p10 / 131072.0f));
+ calc_pres = (calc_pres + (var1 + var2 + var3 + ((float)dev->calib.par_p7 * 128.0f)) / 16.0f);
+ }
+ else
+ {
+ calc_pres = 0;
+ }
+
+ return calc_pres;
+}
+
+/* This internal API is used to calculate the humidity in integer */
+static float calc_humidity(uint16_t hum_adc, const struct bme68x_dev *dev)
+{
+ float calc_hum;
+ float var1;
+ float var2;
+ float var3;
+ float var4;
+ float temp_comp;
+
+ /* compensated temperature data*/
+ temp_comp = ((dev->calib.t_fine) / 5120.0f);
+ var1 = (float)((float)hum_adc) -
+ (((float)dev->calib.par_h1 * 16.0f) + (((float)dev->calib.par_h3 / 2.0f) * temp_comp));
+ var2 = var1 *
+ ((float)(((float)dev->calib.par_h2 / 262144.0f) *
+ (1.0f + (((float)dev->calib.par_h4 / 16384.0f) * temp_comp) +
+ (((float)dev->calib.par_h5 / 1048576.0f) * temp_comp * temp_comp))));
+ var3 = (float)dev->calib.par_h6 / 16384.0f;
+ var4 = (float)dev->calib.par_h7 / 2097152.0f;
+ calc_hum = var2 + ((var3 + (var4 * temp_comp)) * var2 * var2);
+ if (calc_hum > 100.0f)
+ {
+ calc_hum = 100.0f;
+ }
+ else if (calc_hum < 0.0f)
+ {
+ calc_hum = 0.0f;
+ }
+
+ return calc_hum;
+}
+
+/* This internal API is used to calculate the gas resistance low value in float */
+static float calc_gas_resistance_low(uint16_t gas_res_adc, uint8_t gas_range, const struct bme68x_dev *dev)
+{
+ float calc_gas_res;
+ float var1;
+ float var2;
+ float var3;
+ float gas_res_f = gas_res_adc;
+ float gas_range_f = (1U << gas_range); /*lint !e790 / Suspicious truncation, integral to float */
+ const float lookup_k1_range[16] = {
+ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, -0.8f, 0.0f, 0.0f, -0.2f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f
+ };
+ const float lookup_k2_range[16] = {
+ 0.0f, 0.0f, 0.0f, 0.0f, 0.1f, 0.7f, 0.0f, -0.8f, -0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f
+ };
+
+ var1 = (1340.0f + (5.0f * dev->calib.range_sw_err));
+ var2 = (var1) * (1.0f + lookup_k1_range[gas_range] / 100.0f);
+ var3 = 1.0f + (lookup_k2_range[gas_range] / 100.0f);
+ calc_gas_res = 1.0f / (float)(var3 * (0.000000125f) * gas_range_f * (((gas_res_f - 512.0f) / var2) + 1.0f));
+
+ return calc_gas_res;
+}
+
+/* This internal API is used to calculate the gas resistance value in float */
+static float calc_gas_resistance_high(uint16_t gas_res_adc, uint8_t gas_range)
+{
+ float calc_gas_res;
+ uint32_t var1 = UINT32_C(262144) >> gas_range;
+ int32_t var2 = (int32_t)gas_res_adc - INT32_C(512);
+
+ var2 *= INT32_C(3);
+ var2 = INT32_C(4096) + var2;
+
+ calc_gas_res = 1000000.0f * (float)var1 / (float)var2;
+
+ return calc_gas_res;
+}
+
+/* This internal API is used to calculate the heater resistance value */
+static uint8_t calc_res_heat(uint16_t temp, const struct bme68x_dev *dev)
+{
+ float var1;
+ float var2;
+ float var3;
+ float var4;
+ float var5;
+ uint8_t res_heat;
+
+ if (temp > 400) /* Cap temperature */
+ {
+ temp = 400;
+ }
+
+ var1 = (((float)dev->calib.par_gh1 / (16.0f)) + 49.0f);
+ var2 = ((((float)dev->calib.par_gh2 / (32768.0f)) * (0.0005f)) + 0.00235f);
+ var3 = ((float)dev->calib.par_gh3 / (1024.0f));
+ var4 = (var1 * (1.0f + (var2 * (float)temp)));
+ var5 = (var4 + (var3 * (float)dev->amb_temp));
+ res_heat =
+ (uint8_t)(3.4f *
+ ((var5 * (4 / (4 + (float)dev->calib.res_heat_range)) *
+ (1 / (1 + ((float)dev->calib.res_heat_val * 0.002f)))) -
+ 25));
+
+ return res_heat;
+}
+
+#endif
+
+/* This internal API is used to calculate the gas wait */
+static uint8_t calc_gas_wait(uint16_t dur)
+{
+ uint8_t factor = 0;
+ uint8_t durval;
+
+ if (dur >= 0xfc0)
+ {
+ durval = 0xff; /* Max duration*/
+ }
+ else
+ {
+ while (dur > 0x3F)
+ {
+ dur = dur / 4;
+ factor += 1;
+ }
+
+ durval = (uint8_t)(dur + (factor * 64));
+ }
+
+ return durval;
+}
+
+/* This internal API is used to read a single data of the sensor */
+static int8_t read_field_data(uint8_t index, struct bme68x_data *data, struct bme68x_dev *dev)
+{
+ int8_t rslt = BME68X_OK;
+ uint8_t buff[BME68X_LEN_FIELD] = { 0 };
+ uint8_t gas_range_l, gas_range_h;
+ uint32_t adc_temp;
+ uint32_t adc_pres;
+ uint16_t adc_hum;
+ uint16_t adc_gas_res_low, adc_gas_res_high;
+ uint8_t tries = 5;
+
+ while ((tries) && (rslt == BME68X_OK))
+ {
+ rslt = bme68x_get_regs(((uint8_t)(BME68X_REG_FIELD0 + (index * BME68X_LEN_FIELD_OFFSET))),
+ buff,
+ (uint16_t)BME68X_LEN_FIELD,
+ dev);
+ if (!data)
+ {
+ rslt = BME68X_E_NULL_PTR;
+ break;
+ }
+
+ data->status = buff[0] & BME68X_NEW_DATA_MSK;
+ data->gas_index = buff[0] & BME68X_GAS_INDEX_MSK;
+ data->meas_index = buff[1];
+
+ /* read the raw data from the sensor */
+ adc_pres = (uint32_t)(((uint32_t)buff[2] * 4096) | ((uint32_t)buff[3] * 16) | ((uint32_t)buff[4] / 16));
+ adc_temp = (uint32_t)(((uint32_t)buff[5] * 4096) | ((uint32_t)buff[6] * 16) | ((uint32_t)buff[7] / 16));
+ adc_hum = (uint16_t)(((uint32_t)buff[8] * 256) | (uint32_t)buff[9]);
+ adc_gas_res_low = (uint16_t)((uint32_t)buff[13] * 4 | (((uint32_t)buff[14]) / 64));
+ adc_gas_res_high = (uint16_t)((uint32_t)buff[15] * 4 | (((uint32_t)buff[16]) / 64));
+ gas_range_l = buff[14] & BME68X_GAS_RANGE_MSK;
+ gas_range_h = buff[16] & BME68X_GAS_RANGE_MSK;
+ if (dev->variant_id == BME68X_VARIANT_GAS_HIGH)
+ {
+ data->status |= buff[16] & BME68X_GASM_VALID_MSK;
+ data->status |= buff[16] & BME68X_HEAT_STAB_MSK;
+ }
+ else
+ {
+ data->status |= buff[14] & BME68X_GASM_VALID_MSK;
+ data->status |= buff[14] & BME68X_HEAT_STAB_MSK;
+ }
+
+ if ((data->status & BME68X_NEW_DATA_MSK) && (rslt == BME68X_OK))
+ {
+ rslt = bme68x_get_regs(BME68X_REG_RES_HEAT0 + data->gas_index, &data->res_heat, 1, dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_IDAC_HEAT0 + data->gas_index, &data->idac, 1, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_GAS_WAIT0 + data->gas_index, &data->gas_wait, 1, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ data->temperature = calc_temperature(adc_temp, dev);
+ data->pressure = calc_pressure(adc_pres, dev);
+ data->humidity = calc_humidity(adc_hum, dev);
+ if (dev->variant_id == BME68X_VARIANT_GAS_HIGH)
+ {
+ data->gas_resistance = calc_gas_resistance_high(adc_gas_res_high, gas_range_h);
+ }
+ else
+ {
+ data->gas_resistance = calc_gas_resistance_low(adc_gas_res_low, gas_range_l, dev);
+ }
+
+ break;
+ }
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ dev->delay_us(BME68X_PERIOD_POLL, dev->intf_ptr);
+ }
+
+ tries--;
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to read all data fields of the sensor */
+static int8_t read_all_field_data(struct bme68x_data * const data[], struct bme68x_dev *dev)
+{
+ int8_t rslt = BME68X_OK;
+ uint8_t buff[BME68X_LEN_FIELD * 3] = { 0 };
+ uint8_t gas_range_l, gas_range_h;
+ uint32_t adc_temp;
+ uint32_t adc_pres;
+ uint16_t adc_hum;
+ uint16_t adc_gas_res_low, adc_gas_res_high;
+ uint8_t off;
+ uint8_t set_val[30] = { 0 }; /* idac, res_heat, gas_wait */
+ uint8_t i;
+
+ if (!data[0] && !data[1] && !data[2])
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_FIELD0, buff, (uint32_t) BME68X_LEN_FIELD * 3, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_IDAC_HEAT0, set_val, 30, dev);
+ }
+
+ for (i = 0; ((i < 3) && (rslt == BME68X_OK)); i++)
+ {
+ off = (uint8_t)(i * BME68X_LEN_FIELD);
+ data[i]->status = buff[off] & BME68X_NEW_DATA_MSK;
+ data[i]->gas_index = buff[off] & BME68X_GAS_INDEX_MSK;
+ data[i]->meas_index = buff[off + 1];
+
+ /* read the raw data from the sensor */
+ adc_pres =
+ (uint32_t) (((uint32_t) buff[off + 2] * 4096) | ((uint32_t) buff[off + 3] * 16) |
+ ((uint32_t) buff[off + 4] / 16));
+ adc_temp =
+ (uint32_t) (((uint32_t) buff[off + 5] * 4096) | ((uint32_t) buff[off + 6] * 16) |
+ ((uint32_t) buff[off + 7] / 16));
+ adc_hum = (uint16_t) (((uint32_t) buff[off + 8] * 256) | (uint32_t) buff[off + 9]);
+ adc_gas_res_low = (uint16_t) ((uint32_t) buff[off + 13] * 4 | (((uint32_t) buff[off + 14]) / 64));
+ adc_gas_res_high = (uint16_t) ((uint32_t) buff[off + 15] * 4 | (((uint32_t) buff[off + 16]) / 64));
+ gas_range_l = buff[off + 14] & BME68X_GAS_RANGE_MSK;
+ gas_range_h = buff[off + 16] & BME68X_GAS_RANGE_MSK;
+ if (dev->variant_id == BME68X_VARIANT_GAS_HIGH)
+ {
+ data[i]->status |= buff[off + 16] & BME68X_GASM_VALID_MSK;
+ data[i]->status |= buff[off + 16] & BME68X_HEAT_STAB_MSK;
+ }
+ else
+ {
+ data[i]->status |= buff[off + 14] & BME68X_GASM_VALID_MSK;
+ data[i]->status |= buff[off + 14] & BME68X_HEAT_STAB_MSK;
+ }
+
+ data[i]->idac = set_val[data[i]->gas_index];
+ data[i]->res_heat = set_val[10 + data[i]->gas_index];
+ data[i]->gas_wait = set_val[20 + data[i]->gas_index];
+ data[i]->temperature = calc_temperature(adc_temp, dev);
+ data[i]->pressure = calc_pressure(adc_pres, dev);
+ data[i]->humidity = calc_humidity(adc_hum, dev);
+ if (dev->variant_id == BME68X_VARIANT_GAS_HIGH)
+ {
+ data[i]->gas_resistance = calc_gas_resistance_high(adc_gas_res_high, gas_range_h);
+ }
+ else
+ {
+ data[i]->gas_resistance = calc_gas_resistance_low(adc_gas_res_low, gas_range_l, dev);
+ }
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to switch between SPI memory pages */
+static int8_t set_mem_page(uint8_t reg_addr, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t reg;
+ uint8_t mem_page;
+
+ /* Check for null pointers in the device structure*/
+ rslt = null_ptr_check(dev);
+ if (rslt == BME68X_OK)
+ {
+ if (reg_addr > 0x7f)
+ {
+ mem_page = BME68X_MEM_PAGE1;
+ }
+ else
+ {
+ mem_page = BME68X_MEM_PAGE0;
+ }
+
+ if (mem_page != dev->mem_page)
+ {
+ dev->mem_page = mem_page;
+ dev->intf_rslt = dev->read(BME68X_REG_MEM_PAGE | BME68X_SPI_RD_MSK, ®, 1, dev->intf_ptr);
+ if (dev->intf_rslt != 0)
+ {
+ rslt = BME68X_E_COM_FAIL;
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ reg = reg & (~BME68X_MEM_PAGE_MSK);
+ reg = reg | (dev->mem_page & BME68X_MEM_PAGE_MSK);
+ dev->intf_rslt = dev->write(BME68X_REG_MEM_PAGE & BME68X_SPI_WR_MSK, ®, 1, dev->intf_ptr);
+ if (dev->intf_rslt != 0)
+ {
+ rslt = BME68X_E_COM_FAIL;
+ }
+ }
+ }
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to get the current SPI memory page */
+static int8_t get_mem_page(struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t reg;
+
+ /* Check for null pointer in the device structure*/
+ rslt = null_ptr_check(dev);
+ if (rslt == BME68X_OK)
+ {
+ dev->intf_rslt = dev->read(BME68X_REG_MEM_PAGE | BME68X_SPI_RD_MSK, ®, 1, dev->intf_ptr);
+ if (dev->intf_rslt != 0)
+ {
+ rslt = BME68X_E_COM_FAIL;
+ }
+ else
+ {
+ dev->mem_page = reg & BME68X_MEM_PAGE_MSK;
+ }
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to limit the max value of a parameter */
+static int8_t boundary_check(uint8_t *value, uint8_t max, struct bme68x_dev *dev)
+{
+ int8_t rslt;
+
+ rslt = null_ptr_check(dev);
+ if ((value != NULL) && (rslt == BME68X_OK))
+ {
+ /* Check if value is above maximum value */
+ if (*value > max)
+ {
+ /* Auto correct the invalid value to maximum value */
+ *value = max;
+ dev->info_msg |= BME68X_I_PARAM_CORR;
+ }
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to check the bme68x_dev for null pointers */
+static int8_t null_ptr_check(const struct bme68x_dev *dev)
+{
+ int8_t rslt = BME68X_OK;
+
+ if ((dev == NULL) || (dev->read == NULL) || (dev->write == NULL) || (dev->delay_us == NULL))
+ {
+ /* Device structure pointer is not valid */
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to set heater configurations */
+static int8_t set_conf(const struct bme68x_heatr_conf *conf, uint8_t op_mode, uint8_t *nb_conv, struct bme68x_dev *dev)
+{
+ int8_t rslt = BME68X_OK;
+ uint8_t i;
+ uint8_t shared_dur;
+ uint8_t write_len = 0;
+ uint8_t heater_dur_shared_addr = BME68X_REG_SHD_HEATR_DUR;
+ uint8_t rh_reg_addr[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ uint8_t rh_reg_data[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ uint8_t gw_reg_addr[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ uint8_t gw_reg_data[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ switch (op_mode)
+ {
+ case BME68X_FORCED_MODE:
+ rh_reg_addr[0] = BME68X_REG_RES_HEAT0;
+ rh_reg_data[0] = calc_res_heat(conf->heatr_temp, dev);
+ gw_reg_addr[0] = BME68X_REG_GAS_WAIT0;
+ gw_reg_data[0] = calc_gas_wait(conf->heatr_dur);
+ (*nb_conv) = 0;
+ write_len = 1;
+ break;
+ case BME68X_SEQUENTIAL_MODE:
+ if ((!conf->heatr_dur_prof) || (!conf->heatr_temp_prof))
+ {
+ rslt = BME68X_E_NULL_PTR;
+ break;
+ }
+
+ for (i = 0; i < conf->profile_len; i++)
+ {
+ rh_reg_addr[i] = BME68X_REG_RES_HEAT0 + i;
+ rh_reg_data[i] = calc_res_heat(conf->heatr_temp_prof[i], dev);
+ gw_reg_addr[i] = BME68X_REG_GAS_WAIT0 + i;
+ gw_reg_data[i] = calc_gas_wait(conf->heatr_dur_prof[i]);
+ }
+
+ (*nb_conv) = conf->profile_len;
+ write_len = conf->profile_len;
+ break;
+ case BME68X_PARALLEL_MODE:
+ if ((!conf->heatr_dur_prof) || (!conf->heatr_temp_prof))
+ {
+ rslt = BME68X_E_NULL_PTR;
+ break;
+ }
+
+ if (conf->shared_heatr_dur == 0)
+ {
+ rslt = BME68X_W_DEFINE_SHD_HEATR_DUR;
+ }
+
+ for (i = 0; i < conf->profile_len; i++)
+ {
+ rh_reg_addr[i] = BME68X_REG_RES_HEAT0 + i;
+ rh_reg_data[i] = calc_res_heat(conf->heatr_temp_prof[i], dev);
+ gw_reg_addr[i] = BME68X_REG_GAS_WAIT0 + i;
+ gw_reg_data[i] = (uint8_t) conf->heatr_dur_prof[i];
+ }
+
+ (*nb_conv) = conf->profile_len;
+ write_len = conf->profile_len;
+ shared_dur = calc_heatr_dur_shared(conf->shared_heatr_dur);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_regs(&heater_dur_shared_addr, &shared_dur, 1, dev);
+ }
+
+ break;
+ default:
+ rslt = BME68X_W_DEFINE_OP_MODE;
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_regs(rh_reg_addr, rh_reg_data, write_len, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_set_regs(gw_reg_addr, gw_reg_data, write_len, dev);
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to calculate the register value for
+ * shared heater duration */
+static uint8_t calc_heatr_dur_shared(uint16_t dur)
+{
+ uint8_t factor = 0;
+ uint8_t heatdurval;
+
+ if (dur >= 0x783)
+ {
+ heatdurval = 0xff; /* Max duration */
+ }
+ else
+ {
+ /* Step size of 0.477ms */
+ dur = (uint16_t)(((uint32_t)dur * 1000) / 477);
+ while (dur > 0x3F)
+ {
+ dur = dur >> 2;
+ factor += 1;
+ }
+
+ heatdurval = (uint8_t)(dur + (factor * 64));
+ }
+
+ return heatdurval;
+}
+
+/* This internal API is used sort the sensor data */
+static void sort_sensor_data(uint8_t low_index, uint8_t high_index, struct bme68x_data *field[])
+{
+ int16_t meas_index1;
+ int16_t meas_index2;
+
+ meas_index1 = (int16_t)field[low_index]->meas_index;
+ meas_index2 = (int16_t)field[high_index]->meas_index;
+ if ((field[low_index]->status & BME68X_NEW_DATA_MSK) && (field[high_index]->status & BME68X_NEW_DATA_MSK))
+ {
+ int16_t diff = meas_index2 - meas_index1;
+ if (((diff > -3) && (diff < 0)) || (diff > 2))
+ {
+ swap_fields(low_index, high_index, field);
+ }
+ }
+ else if (field[high_index]->status & BME68X_NEW_DATA_MSK)
+ {
+ swap_fields(low_index, high_index, field);
+ }
+
+ /* Sorting field data
+ *
+ * The 3 fields are filled in a fixed order with data in an incrementing
+ * 8-bit sub-measurement index which looks like
+ * Field index | Sub-meas index
+ * 0 | 0
+ * 1 | 1
+ * 2 | 2
+ * 0 | 3
+ * 1 | 4
+ * 2 | 5
+ * ...
+ * 0 | 252
+ * 1 | 253
+ * 2 | 254
+ * 0 | 255
+ * 1 | 0
+ * 2 | 1
+ *
+ * The fields are sorted in a way so as to always deal with only a snapshot
+ * of comparing 2 fields at a time. The order being
+ * field0 & field1
+ * field0 & field2
+ * field1 & field2
+ * Here the oldest data should be in field0 while the newest is in field2.
+ * In the following documentation, field0's position would referred to as
+ * the lowest and field2 as the highest.
+ *
+ * In order to sort we have to consider the following cases,
+ *
+ * Case A: No fields have new data
+ * Then do not sort, as this data has already been read.
+ *
+ * Case B: Higher field has new data
+ * Then the new field get's the lowest position.
+ *
+ * Case C: Both fields have new data
+ * We have to put the oldest sample in the lowest position. Since the
+ * sub-meas index contains in essence the age of the sample, we calculate
+ * the difference between the higher field and the lower field.
+ * Here we have 3 sub-cases,
+ * Case 1: Regular read without overwrite
+ * Field index | Sub-meas index
+ * 0 | 3
+ * 1 | 4
+ *
+ * Field index | Sub-meas index
+ * 0 | 3
+ * 2 | 5
+ *
+ * The difference is always <= 2. There is no need to swap as the
+ * oldest sample is already in the lowest position.
+ *
+ * Case 2: Regular read with an overflow and without an overwrite
+ * Field index | Sub-meas index
+ * 0 | 255
+ * 1 | 0
+ *
+ * Field index | Sub-meas index
+ * 0 | 254
+ * 2 | 0
+ *
+ * The difference is always <= -3. There is no need to swap as the
+ * oldest sample is already in the lowest position.
+ *
+ * Case 3: Regular read with overwrite
+ * Field index | Sub-meas index
+ * 0 | 6
+ * 1 | 4
+ *
+ * Field index | Sub-meas index
+ * 0 | 6
+ * 2 | 5
+ *
+ * The difference is always > -3. There is a need to swap as the
+ * oldest sample is not in the lowest position.
+ *
+ * Case 4: Regular read with overwrite and overflow
+ * Field index | Sub-meas index
+ * 0 | 0
+ * 1 | 254
+ *
+ * Field index | Sub-meas index
+ * 0 | 0
+ * 2 | 255
+ *
+ * The difference is always > 2. There is a need to swap as the
+ * oldest sample is not in the lowest position.
+ *
+ * To summarize, we have to swap when
+ * - The higher field has new data and the lower field does not.
+ * - If both fields have new data, then the difference of sub-meas index
+ * between the higher field and the lower field creates the
+ * following condition for swapping.
+ * - (diff > -3) && (diff < 0), combination of cases 1, 2, and 3.
+ * - diff > 2, case 4.
+ *
+ * Here the limits of -3 and 2 derive from the fact that there are 3 fields.
+ * These values decrease or increase respectively if the number of fields increases.
+ */
+}
+
+/* This internal API is used sort the sensor data */
+static void swap_fields(uint8_t index1, uint8_t index2, struct bme68x_data *field[])
+{
+ struct bme68x_data *temp;
+
+ temp = field[index1];
+ field[index1] = field[index2];
+ field[index2] = temp;
+}
+
+/* This Function is to analyze the sensor data */
+static int8_t analyze_sensor_data(const struct bme68x_data *data, uint8_t n_meas)
+{
+ int8_t rslt = BME68X_OK;
+ uint8_t self_test_failed = 0, i;
+ uint32_t cent_res = 0;
+
+ if ((data[0].temperature < BME68X_MIN_TEMPERATURE) || (data[0].temperature > BME68X_MAX_TEMPERATURE))
+ {
+ self_test_failed++;
+ }
+
+ if ((data[0].pressure < BME68X_MIN_PRESSURE) || (data[0].pressure > BME68X_MAX_PRESSURE))
+ {
+ self_test_failed++;
+ }
+
+ if ((data[0].humidity < BME68X_MIN_HUMIDITY) || (data[0].humidity > BME68X_MAX_HUMIDITY))
+ {
+ self_test_failed++;
+ }
+
+ for (i = 0; i < n_meas; i++) /* Every gas measurement should be valid */
+ {
+ if (!(data[i].status & BME68X_GASM_VALID_MSK))
+ {
+ self_test_failed++;
+ }
+ }
+
+ if (n_meas >= 6)
+ {
+ cent_res = (uint32_t)((5 * (data[3].gas_resistance + data[5].gas_resistance)) / (2 * data[4].gas_resistance));
+ }
+
+ if (cent_res < 6)
+ {
+ self_test_failed++;
+ }
+
+ if (self_test_failed)
+ {
+ rslt = BME68X_E_SELF_TEST;
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to read the calibration coefficients */
+static int8_t get_calib_data(struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t coeff_array[BME68X_LEN_COEFF_ALL];
+
+ rslt = bme68x_get_regs(BME68X_REG_COEFF1, coeff_array, BME68X_LEN_COEFF1, dev);
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_COEFF2, &coeff_array[BME68X_LEN_COEFF1], BME68X_LEN_COEFF2, dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ rslt = bme68x_get_regs(BME68X_REG_COEFF3,
+ &coeff_array[BME68X_LEN_COEFF1 + BME68X_LEN_COEFF2],
+ BME68X_LEN_COEFF3,
+ dev);
+ }
+
+ if (rslt == BME68X_OK)
+ {
+ /* Temperature related coefficients */
+ dev->calib.par_t1 =
+ (uint16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_T1_MSB], coeff_array[BME68X_IDX_T1_LSB]));
+ dev->calib.par_t2 =
+ (int16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_T2_MSB], coeff_array[BME68X_IDX_T2_LSB]));
+ dev->calib.par_t3 = (int8_t)(coeff_array[BME68X_IDX_T3]);
+
+ /* Pressure related coefficients */
+ dev->calib.par_p1 =
+ (uint16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_P1_MSB], coeff_array[BME68X_IDX_P1_LSB]));
+ dev->calib.par_p2 =
+ (int16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_P2_MSB], coeff_array[BME68X_IDX_P2_LSB]));
+ dev->calib.par_p3 = (int8_t)coeff_array[BME68X_IDX_P3];
+ dev->calib.par_p4 =
+ (int16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_P4_MSB], coeff_array[BME68X_IDX_P4_LSB]));
+ dev->calib.par_p5 =
+ (int16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_P5_MSB], coeff_array[BME68X_IDX_P5_LSB]));
+ dev->calib.par_p6 = (int8_t)(coeff_array[BME68X_IDX_P6]);
+ dev->calib.par_p7 = (int8_t)(coeff_array[BME68X_IDX_P7]);
+ dev->calib.par_p8 =
+ (int16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_P8_MSB], coeff_array[BME68X_IDX_P8_LSB]));
+ dev->calib.par_p9 =
+ (int16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_P9_MSB], coeff_array[BME68X_IDX_P9_LSB]));
+ dev->calib.par_p10 = (uint8_t)(coeff_array[BME68X_IDX_P10]);
+
+ /* Humidity related coefficients */
+ dev->calib.par_h1 =
+ (uint16_t)(((uint16_t)coeff_array[BME68X_IDX_H1_MSB] << 4) |
+ (coeff_array[BME68X_IDX_H1_LSB] & BME68X_BIT_H1_DATA_MSK));
+ dev->calib.par_h2 =
+ (uint16_t)(((uint16_t)coeff_array[BME68X_IDX_H2_MSB] << 4) | ((coeff_array[BME68X_IDX_H2_LSB]) >> 4));
+ dev->calib.par_h3 = (int8_t)coeff_array[BME68X_IDX_H3];
+ dev->calib.par_h4 = (int8_t)coeff_array[BME68X_IDX_H4];
+ dev->calib.par_h5 = (int8_t)coeff_array[BME68X_IDX_H5];
+ dev->calib.par_h6 = (uint8_t)coeff_array[BME68X_IDX_H6];
+ dev->calib.par_h7 = (int8_t)coeff_array[BME68X_IDX_H7];
+
+ /* Gas heater related coefficients */
+ dev->calib.par_gh1 = (int8_t)coeff_array[BME68X_IDX_GH1];
+ dev->calib.par_gh2 =
+ (int16_t)(BME68X_CONCAT_BYTES(coeff_array[BME68X_IDX_GH2_MSB], coeff_array[BME68X_IDX_GH2_LSB]));
+ dev->calib.par_gh3 = (int8_t)coeff_array[BME68X_IDX_GH3];
+
+ /* Other coefficients */
+ dev->calib.res_heat_range = ((coeff_array[BME68X_IDX_RES_HEAT_RANGE] & BME68X_RHRANGE_MSK) / 16);
+ dev->calib.res_heat_val = (int8_t)coeff_array[BME68X_IDX_RES_HEAT_VAL];
+ dev->calib.range_sw_err = ((int8_t)(coeff_array[BME68X_IDX_RANGE_SW_ERR] & BME68X_RSERROR_MSK)) / 16;
+ }
+
+ return rslt;
+}
+
+/* This internal API is used to read variant ID information from the register */
+static int8_t read_variant_id(struct bme68x_dev *dev)
+{
+ int8_t rslt;
+ uint8_t reg_data = 0;
+
+ /* Read variant ID information register */
+ rslt = bme68x_get_regs(BME68X_REG_VARIANT_ID, ®_data, 1, dev);
+
+ if (rslt == BME68X_OK)
+ {
+ dev->variant_id = reg_data;
+ }
+
+ return rslt;
+}
diff --git a/lib/lib_i2c/BME68x-Sensor-API/bme68x.h b/lib/lib_i2c/BME68x-Sensor-API/bme68x.h
new file mode 100644
index 000000000..e6d482855
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/bme68x.h
@@ -0,0 +1,323 @@
+/**
+* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
+*
+* BSD-3-Clause
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* 3. Neither the name of the copyright holder nor the names of its
+* contributors may be used to endorse or promote products derived from
+* this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*
+* @file bme68x.h
+* @date 2021-11-09
+* @version v4.4.7
+*
+*/
+
+/*!
+ * @defgroup bme68x BME68X
+ * @brief Product Overview
+ * and Sensor API Source Code
+ */
+
+#ifndef BME68X_H_
+#define BME68X_H_
+
+#include "bme68x_defs.h"
+
+/* CPP guard */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \ingroup bme68x
+ * \defgroup bme68xApiInit Initialization
+ * @brief Initialize the sensor and device structure
+ */
+
+/*!
+ * \ingroup bme68xApiInit
+ * \page bme68x_api_bme68x_init bme68x_init
+ * \code
+ * int8_t bme68x_init(struct bme68x_dev *dev);
+ * \endcode
+ * @details This API reads the chip-id of the sensor which is the first step to
+ * verify the sensor and also calibrates the sensor
+ * As this API is the entry point, call this API before using other APIs.
+ *
+ * @param[in,out] dev : Structure instance of bme68x_dev
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_init(struct bme68x_dev *dev);
+
+/**
+ * \ingroup bme68x
+ * \defgroup bme68xApiRegister Registers
+ * @brief Generic API for accessing sensor registers
+ */
+
+/*!
+ * \ingroup bme68xApiRegister
+ * \page bme68x_api_bme68x_set_regs bme68x_set_regs
+ * \code
+ * int8_t bme68x_set_regs(const uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev)
+ * \endcode
+ * @details This API writes the given data to the register address of the sensor
+ *
+ * @param[in] reg_addr : Register addresses to where the data is to be written
+ * @param[in] reg_data : Pointer to data buffer which is to be written
+ * in the reg_addr of sensor.
+ * @param[in] len : No of bytes of data to write
+ * @param[in,out] dev : Structure instance of bme68x_dev
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_set_regs(const uint8_t *reg_addr, const uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev);
+
+/*!
+ * \ingroup bme68xApiRegister
+ * \page bme68x_api_bme68x_get_regs bme68x_get_regs
+ * \code
+ * int8_t bme68x_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev)
+ * \endcode
+ * @details This API reads the data from the given register address of sensor.
+ *
+ * @param[in] reg_addr : Register address from where the data to be read
+ * @param[out] reg_data : Pointer to data buffer to store the read data.
+ * @param[in] len : No of bytes of data to be read.
+ * @param[in,out] dev : Structure instance of bme68x_dev.
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev);
+
+/**
+ * \ingroup bme68x
+ * \defgroup bme68xApiSystem System
+ * @brief API that performs system-level operations
+ */
+
+/*!
+ * \ingroup bme68xApiSystem
+ * \page bme68x_api_bme68x_soft_reset bme68x_soft_reset
+ * \code
+ * int8_t bme68x_soft_reset(struct bme68x_dev *dev);
+ * \endcode
+ * @details This API soft-resets the sensor.
+ *
+ * @param[in,out] dev : Structure instance of bme68x_dev.
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_soft_reset(struct bme68x_dev *dev);
+
+/**
+ * \ingroup bme68x
+ * \defgroup bme68xApiOm Operation mode
+ * @brief API to configure operation mode
+ */
+
+/*!
+ * \ingroup bme68xApiOm
+ * \page bme68x_api_bme68x_set_op_mode bme68x_set_op_mode
+ * \code
+ * int8_t bme68x_set_op_mode(const uint8_t op_mode, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API is used to set the operation mode of the sensor
+ * @param[in] op_mode : Desired operation mode.
+ * @param[in] dev : Structure instance of bme68x_dev
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_set_op_mode(const uint8_t op_mode, struct bme68x_dev *dev);
+
+/*!
+ * \ingroup bme68xApiOm
+ * \page bme68x_api_bme68x_get_op_mode bme68x_get_op_mode
+ * \code
+ * int8_t bme68x_get_op_mode(uint8_t *op_mode, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API is used to get the operation mode of the sensor.
+ *
+ * @param[out] op_mode : Desired operation mode.
+ * @param[in,out] dev : Structure instance of bme68x_dev
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_get_op_mode(uint8_t *op_mode, struct bme68x_dev *dev);
+
+/*!
+ * \ingroup bme68xApiConfig
+ * \page bme68x_api_bme68x_get_meas_dur bme68x_get_meas_dur
+ * \code
+ * uint32_t bme68x_get_meas_dur(const uint8_t op_mode, struct bme68x_conf *conf, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API is used to get the remaining duration that can be used for heating.
+ *
+ * @param[in] op_mode : Desired operation mode.
+ * @param[in] conf : Desired sensor configuration.
+ * @param[in] dev : Structure instance of bme68x_dev
+ *
+ * @return Measurement duration calculated in microseconds
+ */
+uint32_t bme68x_get_meas_dur(const uint8_t op_mode, struct bme68x_conf *conf, struct bme68x_dev *dev);
+
+/**
+ * \ingroup bme68x
+ * \defgroup bme68xApiData Data Read out
+ * @brief Read our data from the sensor
+ */
+
+/*!
+ * \ingroup bme68xApiData
+ * \page bme68x_api_bme68x_get_data bme68x_get_data
+ * \code
+ * int8_t bme68x_get_data(uint8_t op_mode, struct bme68x_data *data, uint8_t *n_data, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API reads the pressure, temperature and humidity and gas data
+ * from the sensor, compensates the data and store it in the bme68x_data
+ * structure instance passed by the user.
+ *
+ * @param[in] op_mode : Expected operation mode.
+ * @param[out] data : Structure instance to hold the data.
+ * @param[out] n_data : Number of data instances available.
+ * @param[in,out] dev : Structure instance of bme68x_dev
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_get_data(uint8_t op_mode, struct bme68x_data *data, uint8_t *n_data, struct bme68x_dev *dev);
+
+/**
+ * \ingroup bme68x
+ * \defgroup bme68xApiConfig Configuration
+ * @brief Configuration API of sensor
+ */
+
+/*!
+ * \ingroup bme68xApiConfig
+ * \page bme68x_api_bme68x_set_conf bme68x_set_conf
+ * \code
+ * int8_t bme68x_set_conf(struct bme68x_conf *conf, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API is used to set the oversampling, filter and odr configuration
+ *
+ * @param[in] conf : Desired sensor configuration.
+ * @param[in,out] dev : Structure instance of bme68x_dev.
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_set_conf(struct bme68x_conf *conf, struct bme68x_dev *dev);
+
+/*!
+ * \ingroup bme68xApiConfig
+ * \page bme68x_api_bme68x_get_conf bme68x_get_conf
+ * \code
+ * int8_t bme68x_get_conf(struct bme68x_conf *conf, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API is used to get the oversampling, filter and odr
+ * configuration
+ *
+ * @param[out] conf : Present sensor configuration.
+ * @param[in,out] dev : Structure instance of bme68x_dev.
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_get_conf(struct bme68x_conf *conf, struct bme68x_dev *dev);
+
+/*!
+ * \ingroup bme68xApiConfig
+ * \page bme68x_api_bme68x_set_heatr_conf bme68x_set_heatr_conf
+ * \code
+ * int8_t bme68x_set_heatr_conf(uint8_t op_mode, const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API is used to set the gas configuration of the sensor.
+ *
+ * @param[in] op_mode : Expected operation mode of the sensor.
+ * @param[in] conf : Desired heating configuration.
+ * @param[in,out] dev : Structure instance of bme68x_dev.
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_set_heatr_conf(uint8_t op_mode, const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev);
+
+/*!
+ * \ingroup bme68xApiConfig
+ * \page bme68x_api_bme68x_get_heatr_conf bme68x_get_heatr_conf
+ * \code
+ * int8_t bme68x_get_heatr_conf(const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev);
+ * \endcode
+ * @details This API is used to get the gas configuration of the sensor.
+ *
+ * @param[out] conf : Current configurations of the gas sensor.
+ * @param[in,out] dev : Structure instance of bme68x_dev.
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_get_heatr_conf(const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev);
+
+/*!
+ * \ingroup bme68xApiSystem
+ * \page bme68x_api_bme68x_selftest_check bme68x_selftest_check
+ * \code
+ * int8_t bme68x_selftest_check(const struct bme68x_dev *dev);
+ * \endcode
+ * @details This API performs Self-test of low gas variant of BME68X
+ *
+ * @param[in, out] dev : Structure instance of bme68x_dev
+ *
+ * @return Result of API execution status
+ * @retval 0 -> Success
+ * @retval < 0 -> Fail
+ */
+int8_t bme68x_selftest_check(const struct bme68x_dev *dev);
+
+#ifdef __cplusplus
+}
+#endif /* End of CPP guard */
+#endif /* BME68X_H_ */
diff --git a/lib/lib_i2c/BME68x-Sensor-API/bme68x_defs.h b/lib/lib_i2c/BME68x-Sensor-API/bme68x_defs.h
new file mode 100644
index 000000000..861b2f7c2
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/bme68x_defs.h
@@ -0,0 +1,972 @@
+/**
+* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
+*
+* BSD-3-Clause
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* 3. Neither the name of the copyright holder nor the names of its
+* contributors may be used to endorse or promote products derived from
+* this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*
+* @file bme68x_defs.h
+* @date 2021-11-09
+* @version v4.4.7
+*
+*/
+
+/*! @cond DOXYGEN_SUPRESS */
+
+#ifndef BME68X_DEFS_H_
+#define BME68X_DEFS_H_
+
+/********************************************************* */
+/*! Header includes */
+/********************************************************* */
+#ifdef __KERNEL__
+#include
+#include
+#else
+#include
+#include
+#endif
+
+/********************************************************* */
+/*! Common Macros */
+/********************************************************* */
+#ifdef __KERNEL__
+#if !defined(UINT8_C) && !defined(INT8_C)
+#define INT8_C(x) S8_C(x)
+#define UINT8_C(x) U8_C(x)
+#endif
+
+#if !defined(UINT16_C) && !defined(INT16_C)
+#define INT16_C(x) S16_C(x)
+#define UINT16_C(x) U16_C(x)
+#endif
+
+#if !defined(INT32_C) && !defined(UINT32_C)
+#define INT32_C(x) S32_C(x)
+#define UINT32_C(x) U32_C(x)
+#endif
+
+#if !defined(INT64_C) && !defined(UINT64_C)
+#define INT64_C(x) S64_C(x)
+#define UINT64_C(x) U64_C(x)
+#endif
+#endif
+
+/*! C standard macros */
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *) 0)
+#endif
+#endif
+
+#ifndef BME68X_DO_NOT_USE_FPU
+
+/* Comment or un-comment the macro to provide floating point data output */
+#define BME68X_USE_FPU
+#endif
+
+/* Period between two polls (value can be given by user) */
+#ifndef BME68X_PERIOD_POLL
+#define BME68X_PERIOD_POLL UINT32_C(10000)
+#endif
+
+/* BME68X unique chip identifier */
+#define BME68X_CHIP_ID UINT8_C(0x61)
+
+/* Period for a soft reset */
+#define BME68X_PERIOD_RESET UINT32_C(10000)
+
+/* BME68X lower I2C address */
+#define BME68X_I2C_ADDR_LOW UINT8_C(0x76)
+
+/* BME68X higher I2C address */
+#define BME68X_I2C_ADDR_HIGH UINT8_C(0x77)
+
+/* Soft reset command */
+#define BME68X_SOFT_RESET_CMD UINT8_C(0xb6)
+
+/* Return code definitions */
+/* Success */
+#define BME68X_OK INT8_C(0)
+
+/* Errors */
+/* Null pointer passed */
+#define BME68X_E_NULL_PTR INT8_C(-1)
+
+/* Communication failure */
+#define BME68X_E_COM_FAIL INT8_C(-2)
+
+/* Sensor not found */
+#define BME68X_E_DEV_NOT_FOUND INT8_C(-3)
+
+/* Incorrect length parameter */
+#define BME68X_E_INVALID_LENGTH INT8_C(-4)
+
+/* Self test fail error */
+#define BME68X_E_SELF_TEST INT8_C(-5)
+
+/* Warnings */
+/* Define a valid operation mode */
+#define BME68X_W_DEFINE_OP_MODE INT8_C(1)
+
+/* No new data was found */
+#define BME68X_W_NO_NEW_DATA INT8_C(2)
+
+/* Define the shared heating duration */
+#define BME68X_W_DEFINE_SHD_HEATR_DUR INT8_C(3)
+
+/* Information - only available via bme68x_dev.info_msg */
+#define BME68X_I_PARAM_CORR UINT8_C(1)
+
+/* Register map addresses in I2C */
+/* Register for 3rd group of coefficients */
+#define BME68X_REG_COEFF3 UINT8_C(0x00)
+
+/* 0th Field address*/
+#define BME68X_REG_FIELD0 UINT8_C(0x1d)
+
+/* 0th Current DAC address*/
+#define BME68X_REG_IDAC_HEAT0 UINT8_C(0x50)
+
+/* 0th Res heat address */
+#define BME68X_REG_RES_HEAT0 UINT8_C(0x5a)
+
+/* 0th Gas wait address */
+#define BME68X_REG_GAS_WAIT0 UINT8_C(0x64)
+
+/* Shared heating duration address */
+#define BME68X_REG_SHD_HEATR_DUR UINT8_C(0x6E)
+
+/* CTRL_GAS_0 address */
+#define BME68X_REG_CTRL_GAS_0 UINT8_C(0x70)
+
+/* CTRL_GAS_1 address */
+#define BME68X_REG_CTRL_GAS_1 UINT8_C(0x71)
+
+/* CTRL_HUM address */
+#define BME68X_REG_CTRL_HUM UINT8_C(0x72)
+
+/* CTRL_MEAS address */
+#define BME68X_REG_CTRL_MEAS UINT8_C(0x74)
+
+/* CONFIG address */
+#define BME68X_REG_CONFIG UINT8_C(0x75)
+
+/* MEM_PAGE address */
+#define BME68X_REG_MEM_PAGE UINT8_C(0xf3)
+
+/* Unique ID address */
+#define BME68X_REG_UNIQUE_ID UINT8_C(0x83)
+
+/* Register for 1st group of coefficients */
+#define BME68X_REG_COEFF1 UINT8_C(0x8a)
+
+/* Chip ID address */
+#define BME68X_REG_CHIP_ID UINT8_C(0xd0)
+
+/* Soft reset address */
+#define BME68X_REG_SOFT_RESET UINT8_C(0xe0)
+
+/* Register for 2nd group of coefficients */
+#define BME68X_REG_COEFF2 UINT8_C(0xe1)
+
+/* Variant ID Register */
+#define BME68X_REG_VARIANT_ID UINT8_C(0xF0)
+
+/* Enable/Disable macros */
+
+/* Enable */
+#define BME68X_ENABLE UINT8_C(0x01)
+
+/* Disable */
+#define BME68X_DISABLE UINT8_C(0x00)
+
+/* Variant ID macros */
+
+/* Low Gas variant */
+#define BME68X_VARIANT_GAS_LOW UINT8_C(0x00)
+
+/* High Gas variant */
+#define BME68X_VARIANT_GAS_HIGH UINT8_C(0x01)
+
+/* Oversampling setting macros */
+
+/* Switch off measurement */
+#define BME68X_OS_NONE UINT8_C(0)
+
+/* Perform 1 measurement */
+#define BME68X_OS_1X UINT8_C(1)
+
+/* Perform 2 measurements */
+#define BME68X_OS_2X UINT8_C(2)
+
+/* Perform 4 measurements */
+#define BME68X_OS_4X UINT8_C(3)
+
+/* Perform 8 measurements */
+#define BME68X_OS_8X UINT8_C(4)
+
+/* Perform 16 measurements */
+#define BME68X_OS_16X UINT8_C(5)
+
+/* IIR Filter settings */
+
+/* Switch off the filter */
+#define BME68X_FILTER_OFF UINT8_C(0)
+
+/* Filter coefficient of 2 */
+#define BME68X_FILTER_SIZE_1 UINT8_C(1)
+
+/* Filter coefficient of 4 */
+#define BME68X_FILTER_SIZE_3 UINT8_C(2)
+
+/* Filter coefficient of 8 */
+#define BME68X_FILTER_SIZE_7 UINT8_C(3)
+
+/* Filter coefficient of 16 */
+#define BME68X_FILTER_SIZE_15 UINT8_C(4)
+
+/* Filter coefficient of 32 */
+#define BME68X_FILTER_SIZE_31 UINT8_C(5)
+
+/* Filter coefficient of 64 */
+#define BME68X_FILTER_SIZE_63 UINT8_C(6)
+
+/* Filter coefficient of 128 */
+#define BME68X_FILTER_SIZE_127 UINT8_C(7)
+
+/* ODR/Standby time macros */
+
+/* Standby time of 0.59ms */
+#define BME68X_ODR_0_59_MS UINT8_C(0)
+
+/* Standby time of 62.5ms */
+#define BME68X_ODR_62_5_MS UINT8_C(1)
+
+/* Standby time of 125ms */
+#define BME68X_ODR_125_MS UINT8_C(2)
+
+/* Standby time of 250ms */
+#define BME68X_ODR_250_MS UINT8_C(3)
+
+/* Standby time of 500ms */
+#define BME68X_ODR_500_MS UINT8_C(4)
+
+/* Standby time of 1s */
+#define BME68X_ODR_1000_MS UINT8_C(5)
+
+/* Standby time of 10ms */
+#define BME68X_ODR_10_MS UINT8_C(6)
+
+/* Standby time of 20ms */
+#define BME68X_ODR_20_MS UINT8_C(7)
+
+/* No standby time */
+#define BME68X_ODR_NONE UINT8_C(8)
+
+/* Operating mode macros */
+
+/* Sleep operation mode */
+#define BME68X_SLEEP_MODE UINT8_C(0)
+
+/* Forced operation mode */
+#define BME68X_FORCED_MODE UINT8_C(1)
+
+/* Parallel operation mode */
+#define BME68X_PARALLEL_MODE UINT8_C(2)
+
+/* Sequential operation mode */
+#define BME68X_SEQUENTIAL_MODE UINT8_C(3)
+
+/* SPI page macros */
+
+/* SPI memory page 0 */
+#define BME68X_MEM_PAGE0 UINT8_C(0x10)
+
+/* SPI memory page 1 */
+#define BME68X_MEM_PAGE1 UINT8_C(0x00)
+
+/* Coefficient index macros */
+
+/* Length for all coefficients */
+#define BME68X_LEN_COEFF_ALL UINT8_C(42)
+
+/* Length for 1st group of coefficients */
+#define BME68X_LEN_COEFF1 UINT8_C(23)
+
+/* Length for 2nd group of coefficients */
+#define BME68X_LEN_COEFF2 UINT8_C(14)
+
+/* Length for 3rd group of coefficients */
+#define BME68X_LEN_COEFF3 UINT8_C(5)
+
+/* Length of the field */
+#define BME68X_LEN_FIELD UINT8_C(17)
+
+/* Length between two fields */
+#define BME68X_LEN_FIELD_OFFSET UINT8_C(17)
+
+/* Length of the configuration register */
+#define BME68X_LEN_CONFIG UINT8_C(5)
+
+/* Length of the interleaved buffer */
+#define BME68X_LEN_INTERLEAVE_BUFF UINT8_C(20)
+
+/* Coefficient index macros */
+
+/* Coefficient T2 LSB position */
+#define BME68X_IDX_T2_LSB (0)
+
+/* Coefficient T2 MSB position */
+#define BME68X_IDX_T2_MSB (1)
+
+/* Coefficient T3 position */
+#define BME68X_IDX_T3 (2)
+
+/* Coefficient P1 LSB position */
+#define BME68X_IDX_P1_LSB (4)
+
+/* Coefficient P1 MSB position */
+#define BME68X_IDX_P1_MSB (5)
+
+/* Coefficient P2 LSB position */
+#define BME68X_IDX_P2_LSB (6)
+
+/* Coefficient P2 MSB position */
+#define BME68X_IDX_P2_MSB (7)
+
+/* Coefficient P3 position */
+#define BME68X_IDX_P3 (8)
+
+/* Coefficient P4 LSB position */
+#define BME68X_IDX_P4_LSB (10)
+
+/* Coefficient P4 MSB position */
+#define BME68X_IDX_P4_MSB (11)
+
+/* Coefficient P5 LSB position */
+#define BME68X_IDX_P5_LSB (12)
+
+/* Coefficient P5 MSB position */
+#define BME68X_IDX_P5_MSB (13)
+
+/* Coefficient P7 position */
+#define BME68X_IDX_P7 (14)
+
+/* Coefficient P6 position */
+#define BME68X_IDX_P6 (15)
+
+/* Coefficient P8 LSB position */
+#define BME68X_IDX_P8_LSB (18)
+
+/* Coefficient P8 MSB position */
+#define BME68X_IDX_P8_MSB (19)
+
+/* Coefficient P9 LSB position */
+#define BME68X_IDX_P9_LSB (20)
+
+/* Coefficient P9 MSB position */
+#define BME68X_IDX_P9_MSB (21)
+
+/* Coefficient P10 position */
+#define BME68X_IDX_P10 (22)
+
+/* Coefficient H2 MSB position */
+#define BME68X_IDX_H2_MSB (23)
+
+/* Coefficient H2 LSB position */
+#define BME68X_IDX_H2_LSB (24)
+
+/* Coefficient H1 LSB position */
+#define BME68X_IDX_H1_LSB (24)
+
+/* Coefficient H1 MSB position */
+#define BME68X_IDX_H1_MSB (25)
+
+/* Coefficient H3 position */
+#define BME68X_IDX_H3 (26)
+
+/* Coefficient H4 position */
+#define BME68X_IDX_H4 (27)
+
+/* Coefficient H5 position */
+#define BME68X_IDX_H5 (28)
+
+/* Coefficient H6 position */
+#define BME68X_IDX_H6 (29)
+
+/* Coefficient H7 position */
+#define BME68X_IDX_H7 (30)
+
+/* Coefficient T1 LSB position */
+#define BME68X_IDX_T1_LSB (31)
+
+/* Coefficient T1 MSB position */
+#define BME68X_IDX_T1_MSB (32)
+
+/* Coefficient GH2 LSB position */
+#define BME68X_IDX_GH2_LSB (33)
+
+/* Coefficient GH2 MSB position */
+#define BME68X_IDX_GH2_MSB (34)
+
+/* Coefficient GH1 position */
+#define BME68X_IDX_GH1 (35)
+
+/* Coefficient GH3 position */
+#define BME68X_IDX_GH3 (36)
+
+/* Coefficient res heat value position */
+#define BME68X_IDX_RES_HEAT_VAL (37)
+
+/* Coefficient res heat range position */
+#define BME68X_IDX_RES_HEAT_RANGE (39)
+
+/* Coefficient range switching error position */
+#define BME68X_IDX_RANGE_SW_ERR (41)
+
+/* Gas measurement macros */
+
+/* Disable gas measurement */
+#define BME68X_DISABLE_GAS_MEAS UINT8_C(0x00)
+
+/* Enable gas measurement low */
+#define BME68X_ENABLE_GAS_MEAS_L UINT8_C(0x01)
+
+/* Enable gas measurement high */
+#define BME68X_ENABLE_GAS_MEAS_H UINT8_C(0x02)
+
+/* Heater control macros */
+
+/* Enable heater */
+#define BME68X_ENABLE_HEATER UINT8_C(0x00)
+
+/* Disable heater */
+#define BME68X_DISABLE_HEATER UINT8_C(0x01)
+
+#ifdef BME68X_USE_FPU
+
+/* 0 degree Celsius */
+#define BME68X_MIN_TEMPERATURE INT16_C(0)
+
+/* 60 degree Celsius */
+#define BME68X_MAX_TEMPERATURE INT16_C(60)
+
+/* 900 hecto Pascals */
+#define BME68X_MIN_PRESSURE UINT32_C(90000)
+
+/* 1100 hecto Pascals */
+#define BME68X_MAX_PRESSURE UINT32_C(110000)
+
+/* 20% relative humidity */
+#define BME68X_MIN_HUMIDITY UINT32_C(20)
+
+/* 80% relative humidity*/
+#define BME68X_MAX_HUMIDITY UINT32_C(80)
+#else
+
+/* 0 degree Celsius */
+#define BME68X_MIN_TEMPERATURE INT16_C(0)
+
+/* 60 degree Celsius */
+#define BME68X_MAX_TEMPERATURE INT16_C(6000)
+
+/* 900 hecto Pascals */
+#define BME68X_MIN_PRESSURE UINT32_C(90000)
+
+/* 1100 hecto Pascals */
+#define BME68X_MAX_PRESSURE UINT32_C(110000)
+
+/* 20% relative humidity */
+#define BME68X_MIN_HUMIDITY UINT32_C(20000)
+
+/* 80% relative humidity*/
+#define BME68X_MAX_HUMIDITY UINT32_C(80000)
+
+#endif
+
+#define BME68X_HEATR_DUR1 UINT16_C(1000)
+#define BME68X_HEATR_DUR2 UINT16_C(2000)
+#define BME68X_HEATR_DUR1_DELAY UINT32_C(1000000)
+#define BME68X_HEATR_DUR2_DELAY UINT32_C(2000000)
+#define BME68X_N_MEAS UINT8_C(6)
+#define BME68X_LOW_TEMP UINT8_C(150)
+#define BME68X_HIGH_TEMP UINT16_C(350)
+
+/* Mask macros */
+/* Mask for number of conversions */
+#define BME68X_NBCONV_MSK UINT8_C(0X0f)
+
+/* Mask for IIR filter */
+#define BME68X_FILTER_MSK UINT8_C(0X1c)
+
+/* Mask for ODR[3] */
+#define BME68X_ODR3_MSK UINT8_C(0x80)
+
+/* Mask for ODR[2:0] */
+#define BME68X_ODR20_MSK UINT8_C(0xe0)
+
+/* Mask for temperature oversampling */
+#define BME68X_OST_MSK UINT8_C(0Xe0)
+
+/* Mask for pressure oversampling */
+#define BME68X_OSP_MSK UINT8_C(0X1c)
+
+/* Mask for humidity oversampling */
+#define BME68X_OSH_MSK UINT8_C(0X07)
+
+/* Mask for heater control */
+#define BME68X_HCTRL_MSK UINT8_C(0x08)
+
+/* Mask for run gas */
+#define BME68X_RUN_GAS_MSK UINT8_C(0x30)
+
+/* Mask for operation mode */
+#define BME68X_MODE_MSK UINT8_C(0x03)
+
+/* Mask for res heat range */
+#define BME68X_RHRANGE_MSK UINT8_C(0x30)
+
+/* Mask for range switching error */
+#define BME68X_RSERROR_MSK UINT8_C(0xf0)
+
+/* Mask for new data */
+#define BME68X_NEW_DATA_MSK UINT8_C(0x80)
+
+/* Mask for gas index */
+#define BME68X_GAS_INDEX_MSK UINT8_C(0x0f)
+
+/* Mask for gas range */
+#define BME68X_GAS_RANGE_MSK UINT8_C(0x0f)
+
+/* Mask for gas measurement valid */
+#define BME68X_GASM_VALID_MSK UINT8_C(0x20)
+
+/* Mask for heater stability */
+#define BME68X_HEAT_STAB_MSK UINT8_C(0x10)
+
+/* Mask for SPI memory page */
+#define BME68X_MEM_PAGE_MSK UINT8_C(0x10)
+
+/* Mask for reading a register in SPI */
+#define BME68X_SPI_RD_MSK UINT8_C(0x80)
+
+/* Mask for writing a register in SPI */
+#define BME68X_SPI_WR_MSK UINT8_C(0x7f)
+
+/* Mask for the H1 calibration coefficient */
+#define BME68X_BIT_H1_DATA_MSK UINT8_C(0x0f)
+
+/* Position macros */
+
+/* Filter bit position */
+#define BME68X_FILTER_POS UINT8_C(2)
+
+/* Temperature oversampling bit position */
+#define BME68X_OST_POS UINT8_C(5)
+
+/* Pressure oversampling bit position */
+#define BME68X_OSP_POS UINT8_C(2)
+
+/* ODR[3] bit position */
+#define BME68X_ODR3_POS UINT8_C(7)
+
+/* ODR[2:0] bit position */
+#define BME68X_ODR20_POS UINT8_C(5)
+
+/* Run gas bit position */
+#define BME68X_RUN_GAS_POS UINT8_C(4)
+
+/* Heater control bit position */
+#define BME68X_HCTRL_POS UINT8_C(3)
+
+/* Macro to combine two 8 bit data's to form a 16 bit data */
+#define BME68X_CONCAT_BYTES(msb, lsb) (((uint16_t)msb << 8) | (uint16_t)lsb)
+
+/* Macro to set bits */
+#define BME68X_SET_BITS(reg_data, bitname, data) \
+ ((reg_data & ~(bitname##_MSK)) | \
+ ((data << bitname##_POS) & bitname##_MSK))
+
+/* Macro to get bits */
+#define BME68X_GET_BITS(reg_data, bitname) ((reg_data & (bitname##_MSK)) >> \
+ (bitname##_POS))
+
+/* Macro to set bits starting from position 0 */
+#define BME68X_SET_BITS_POS_0(reg_data, bitname, data) \
+ ((reg_data & ~(bitname##_MSK)) | \
+ (data & bitname##_MSK))
+
+/* Macro to get bits starting from position 0 */
+#define BME68X_GET_BITS_POS_0(reg_data, bitname) (reg_data & (bitname##_MSK))
+
+/**
+ * BME68X_INTF_RET_TYPE is the read/write interface return type which can be overwritten by the build system.
+ * The default is set to int8_t.
+ */
+#ifndef BME68X_INTF_RET_TYPE
+#define BME68X_INTF_RET_TYPE int8_t
+#endif
+
+/**
+ * BME68X_INTF_RET_SUCCESS is the success return value read/write interface return type which can be
+ * overwritten by the build system. The default is set to 0. It is used to check for a successful
+ * execution of the read/write functions
+ */
+#ifndef BME68X_INTF_RET_SUCCESS
+#define BME68X_INTF_RET_SUCCESS INT8_C(0)
+#endif
+
+/********************************************************* */
+/*! Function Pointers */
+/********************************************************* */
+
+/*!
+ * @brief Bus communication function pointer which should be mapped to
+ * the platform specific read functions of the user
+ *
+ * @param[in] reg_addr : 8bit register address of the sensor
+ * @param[out] reg_data : Data from the specified address
+ * @param[in] length : Length of the reg_data array
+ * @param[in,out] intf_ptr : Void pointer that can enable the linking of descriptors
+ * for interface related callbacks
+ * @retval 0 for Success
+ * @retval Non-zero for Failure
+ */
+typedef BME68X_INTF_RET_TYPE (*bme68x_read_fptr_t)(uint8_t reg_addr, uint8_t *reg_data, uint32_t length,
+ void *intf_ptr);
+
+/*!
+ * @brief Bus communication function pointer which should be mapped to
+ * the platform specific write functions of the user
+ *
+ * @param[in] reg_addr : 8bit register address of the sensor
+ * @param[out] reg_data : Data to the specified address
+ * @param[in] length : Length of the reg_data array
+ * @param[in,out] intf_ptr : Void pointer that can enable the linking of descriptors
+ * for interface related callbacks
+ * @retval 0 for Success
+ * @retval Non-zero for Failure
+ *
+ */
+typedef BME68X_INTF_RET_TYPE (*bme68x_write_fptr_t)(uint8_t reg_addr, const uint8_t *reg_data, uint32_t length,
+ void *intf_ptr);
+
+/*!
+ * @brief Delay function pointer which should be mapped to
+ * delay function of the user
+ *
+ * @param period - The time period in microseconds
+ * @param[in,out] intf_ptr : Void pointer that can enable the linking of descriptors
+ * for interface related callbacks
+ */
+typedef void (*bme68x_delay_us_fptr_t)(uint32_t period, void *intf_ptr);
+
+/*
+ * @brief Generic communication function pointer
+ * @param[in] dev_id: Place holder to store the id of the device structure
+ * Can be used to store the index of the Chip select or
+ * I2C address of the device.
+ * @param[in] reg_addr: Used to select the register the where data needs to
+ * be read from or written to.
+ * @param[in,out] reg_data: Data array to read/write
+ * @param[in] len: Length of the data array
+ */
+
+/*
+ * @brief Interface selection Enumerations
+ */
+enum bme68x_intf {
+ /*! SPI interface */
+ BME68X_SPI_INTF,
+ /*! I2C interface */
+ BME68X_I2C_INTF
+};
+
+/* Structure definitions */
+
+/*
+ * @brief Sensor field data structure
+ */
+struct bme68x_data
+{
+ /*! Contains new_data, gasm_valid & heat_stab */
+ uint8_t status;
+
+ /*! The index of the heater profile used */
+ uint8_t gas_index;
+
+ /*! Measurement index to track order */
+ uint8_t meas_index;
+
+ /*! Heater resistance */
+ uint8_t res_heat;
+
+ /*! Current DAC */
+ uint8_t idac;
+
+ /*! Gas wait period */
+ uint8_t gas_wait;
+#ifndef BME68X_USE_FPU
+
+ /*! Temperature in degree celsius x100 */
+ int16_t temperature;
+
+ /*! Pressure in Pascal */
+ uint32_t pressure;
+
+ /*! Humidity in % relative humidity x1000 */
+ uint32_t humidity;
+
+ /*! Gas resistance in Ohms */
+ uint32_t gas_resistance;
+#else
+
+ /*! Temperature in degree celsius */
+ float temperature;
+
+ /*! Pressure in Pascal */
+ float pressure;
+
+ /*! Humidity in % relative humidity x1000 */
+ float humidity;
+
+ /*! Gas resistance in Ohms */
+ float gas_resistance;
+
+#endif
+
+};
+
+/*
+ * @brief Structure to hold the calibration coefficients
+ */
+struct bme68x_calib_data
+{
+ /*! Calibration coefficient for the humidity sensor */
+ uint16_t par_h1;
+
+ /*! Calibration coefficient for the humidity sensor */
+ uint16_t par_h2;
+
+ /*! Calibration coefficient for the humidity sensor */
+ int8_t par_h3;
+
+ /*! Calibration coefficient for the humidity sensor */
+ int8_t par_h4;
+
+ /*! Calibration coefficient for the humidity sensor */
+ int8_t par_h5;
+
+ /*! Calibration coefficient for the humidity sensor */
+ uint8_t par_h6;
+
+ /*! Calibration coefficient for the humidity sensor */
+ int8_t par_h7;
+
+ /*! Calibration coefficient for the gas sensor */
+ int8_t par_gh1;
+
+ /*! Calibration coefficient for the gas sensor */
+ int16_t par_gh2;
+
+ /*! Calibration coefficient for the gas sensor */
+ int8_t par_gh3;
+
+ /*! Calibration coefficient for the temperature sensor */
+ uint16_t par_t1;
+
+ /*! Calibration coefficient for the temperature sensor */
+ int16_t par_t2;
+
+ /*! Calibration coefficient for the temperature sensor */
+ int8_t par_t3;
+
+ /*! Calibration coefficient for the pressure sensor */
+ uint16_t par_p1;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int16_t par_p2;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int8_t par_p3;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int16_t par_p4;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int16_t par_p5;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int8_t par_p6;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int8_t par_p7;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int16_t par_p8;
+
+ /*! Calibration coefficient for the pressure sensor */
+ int16_t par_p9;
+
+ /*! Calibration coefficient for the pressure sensor */
+ uint8_t par_p10;
+#ifndef BME68X_USE_FPU
+
+ /*! Variable to store the intermediate temperature coefficient */
+ int32_t t_fine;
+#else
+
+ /*! Variable to store the intermediate temperature coefficient */
+ float t_fine;
+#endif
+
+ /*! Heater resistance range coefficient */
+ uint8_t res_heat_range;
+
+ /*! Heater resistance value coefficient */
+ int8_t res_heat_val;
+
+ /*! Gas resistance range switching error coefficient */
+ int8_t range_sw_err;
+};
+
+/*
+ * @brief BME68X sensor settings structure which comprises of ODR,
+ * over-sampling and filter settings.
+ */
+struct bme68x_conf
+{
+ /*! Humidity oversampling. Refer @ref osx*/
+ uint8_t os_hum;
+
+ /*! Temperature oversampling. Refer @ref osx */
+ uint8_t os_temp;
+
+ /*! Pressure oversampling. Refer @ref osx */
+ uint8_t os_pres;
+
+ /*! Filter coefficient. Refer @ref filter*/
+ uint8_t filter;
+
+ /*!
+ * Standby time between sequential mode measurement profiles.
+ * Refer @ref odr
+ */
+ uint8_t odr;
+};
+
+/*
+ * @brief BME68X gas heater configuration
+ */
+struct bme68x_heatr_conf
+{
+ /*! Enable gas measurement. Refer @ref en_dis */
+ uint8_t enable;
+
+ /*! Store the heater temperature for forced mode degree Celsius */
+ uint16_t heatr_temp;
+
+ /*! Store the heating duration for forced mode in milliseconds */
+ uint16_t heatr_dur;
+
+ /*! Store the heater temperature profile in degree Celsius */
+ uint16_t *heatr_temp_prof;
+
+ /*! Store the heating duration profile in milliseconds */
+ uint16_t *heatr_dur_prof;
+
+ /*! Variable to store the length of the heating profile */
+ uint8_t profile_len;
+
+ /*!
+ * Variable to store heating duration for parallel mode
+ * in milliseconds
+ */
+ uint16_t shared_heatr_dur;
+};
+
+/*
+ * @brief BME68X device structure
+ */
+struct bme68x_dev
+{
+ /*! Chip Id */
+ uint8_t chip_id;
+
+ /*!
+ * The interface pointer is used to enable the user
+ * to link their interface descriptors for reference during the
+ * implementation of the read and write interfaces to the
+ * hardware.
+ */
+ void *intf_ptr;
+
+ /*!
+ * Variant id
+ * ----------------------------------------
+ * Value | Variant
+ * ----------------------------------------
+ * 0 | BME68X_VARIANT_GAS_LOW
+ * 1 | BME68X_VARIANT_GAS_HIGH
+ * ----------------------------------------
+ */
+ uint32_t variant_id;
+
+ /*! SPI/I2C interface */
+ enum bme68x_intf intf;
+
+ /*! Memory page used */
+ uint8_t mem_page;
+
+ /*! Ambient temperature in Degree C*/
+ int8_t amb_temp;
+
+ /*! Sensor calibration data */
+ struct bme68x_calib_data calib;
+
+ /*! Read function pointer */
+ bme68x_read_fptr_t read;
+
+ /*! Write function pointer */
+ bme68x_write_fptr_t write;
+
+ /*! Delay function pointer */
+ bme68x_delay_us_fptr_t delay_us;
+
+ /*! To store interface pointer error */
+ BME68X_INTF_RET_TYPE intf_rslt;
+
+ /*! Store the info messages */
+ uint8_t info_msg;
+};
+
+#endif /* BME68X_DEFS_H_ */
+/*! @endcond */
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/common/common.c b/lib/lib_i2c/BME68x-Sensor-API/examples/common/common.c
new file mode 100644
index 000000000..9439ebb31
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/common/common.c
@@ -0,0 +1,191 @@
+/**
+ * Copyright (C) 2021 Bosch Sensortec GmbH. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include
+#include
+#include
+
+#include "bme68x.h"
+#include "coines.h"
+#include "common.h"
+
+/******************************************************************************/
+/*! Macro definitions */
+/*! BME68X shuttle board ID */
+#define BME68X_SHUTTLE_ID 0x93
+
+/******************************************************************************/
+/*! Static variable definition */
+static uint8_t dev_addr;
+
+/******************************************************************************/
+/*! User interface functions */
+
+/*!
+ * I2C read function map to COINES platform
+ */
+BME68X_INTF_RET_TYPE bme68x_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
+{
+ uint8_t dev_addr = *(uint8_t*)intf_ptr;
+
+ return coines_read_i2c(dev_addr, reg_addr, reg_data, (uint16_t)len);
+}
+
+/*!
+ * I2C write function map to COINES platform
+ */
+BME68X_INTF_RET_TYPE bme68x_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
+{
+ uint8_t dev_addr = *(uint8_t*)intf_ptr;
+
+ return coines_write_i2c(dev_addr, reg_addr, (uint8_t *)reg_data, (uint16_t)len);
+}
+
+/*!
+ * SPI read function map to COINES platform
+ */
+BME68X_INTF_RET_TYPE bme68x_spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
+{
+ uint8_t dev_addr = *(uint8_t*)intf_ptr;
+
+ return coines_read_spi(dev_addr, reg_addr, reg_data, (uint16_t)len);
+}
+
+/*!
+ * SPI write function map to COINES platform
+ */
+BME68X_INTF_RET_TYPE bme68x_spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
+{
+ uint8_t dev_addr = *(uint8_t*)intf_ptr;
+
+ return coines_write_spi(dev_addr, reg_addr, (uint8_t *)reg_data, (uint16_t)len);
+}
+
+/*!
+ * Delay function map to COINES platform
+ */
+void bme68x_delay_us(uint32_t period, void *intf_ptr)
+{
+ coines_delay_usec(period);
+}
+
+void bme68x_check_rslt(const char api_name[], int8_t rslt)
+{
+ switch (rslt)
+ {
+ case BME68X_OK:
+
+ /* Do nothing */
+ break;
+ case BME68X_E_NULL_PTR:
+ printf("API name [%s] Error [%d] : Null pointer\r\n", api_name, rslt);
+ break;
+ case BME68X_E_COM_FAIL:
+ printf("API name [%s] Error [%d] : Communication failure\r\n", api_name, rslt);
+ break;
+ case BME68X_E_INVALID_LENGTH:
+ printf("API name [%s] Error [%d] : Incorrect length parameter\r\n", api_name, rslt);
+ break;
+ case BME68X_E_DEV_NOT_FOUND:
+ printf("API name [%s] Error [%d] : Device not found\r\n", api_name, rslt);
+ break;
+ case BME68X_E_SELF_TEST:
+ printf("API name [%s] Error [%d] : Self test error\r\n", api_name, rslt);
+ break;
+ case BME68X_W_NO_NEW_DATA:
+ printf("API name [%s] Warning [%d] : No new data found\r\n", api_name, rslt);
+ break;
+ default:
+ printf("API name [%s] Error [%d] : Unknown error code\r\n", api_name, rslt);
+ break;
+ }
+}
+
+int8_t bme68x_interface_init(struct bme68x_dev *bme, uint8_t intf)
+{
+ int8_t rslt = BME68X_OK;
+ struct coines_board_info board_info;
+
+ if (bme != NULL)
+ {
+ int16_t result = coines_open_comm_intf(COINES_COMM_INTF_USB);
+ if (result < COINES_SUCCESS)
+ {
+ printf(
+ "\n Unable to connect with Application Board ! \n" " 1. Check if the board is connected and powered on. \n" " 2. Check if Application Board USB driver is installed. \n"
+ " 3. Check if board is in use by another application. (Insufficient permissions to access USB) \n");
+ exit(result);
+ }
+
+ result = coines_get_board_info(&board_info);
+
+#if defined(PC)
+ setbuf(stdout, NULL);
+#endif
+
+ if (result == COINES_SUCCESS)
+ {
+ if ((board_info.shuttle_id != BME68X_SHUTTLE_ID))
+ {
+ printf("! Warning invalid sensor shuttle \n ," "This application will not support this sensor \n");
+ exit(COINES_E_FAILURE);
+ }
+ }
+
+ coines_set_shuttleboard_vdd_vddio_config(0, 0);
+ coines_delay_msec(100);
+
+ /* Bus configuration : I2C */
+ if (intf == BME68X_I2C_INTF)
+ {
+ printf("I2C Interface\n");
+ dev_addr = BME68X_I2C_ADDR_LOW;
+ bme->read = bme68x_i2c_read;
+ bme->write = bme68x_i2c_write;
+ bme->intf = BME68X_I2C_INTF;
+ coines_config_i2c_bus(COINES_I2C_BUS_0, COINES_I2C_STANDARD_MODE);
+ }
+ /* Bus configuration : SPI */
+ else if (intf == BME68X_SPI_INTF)
+ {
+ printf("SPI Interface\n");
+ dev_addr = COINES_SHUTTLE_PIN_7;
+ bme->read = bme68x_spi_read;
+ bme->write = bme68x_spi_write;
+ bme->intf = BME68X_SPI_INTF;
+ coines_config_spi_bus(COINES_SPI_BUS_0, COINES_SPI_SPEED_7_5_MHZ, COINES_SPI_MODE0);
+ }
+
+ coines_delay_msec(100);
+
+ coines_set_shuttleboard_vdd_vddio_config(3300, 3300);
+
+ coines_delay_msec(100);
+
+ bme->delay_us = bme68x_delay_us;
+ bme->intf_ptr = &dev_addr;
+ bme->amb_temp = 25; /* The ambient temperature in deg C is used for defining the heater temperature */
+ }
+ else
+ {
+ rslt = BME68X_E_NULL_PTR;
+ }
+
+ return rslt;
+}
+
+void bme68x_coines_deinit(void)
+{
+ fflush(stdout);
+
+ coines_set_shuttleboard_vdd_vddio_config(0, 0);
+ coines_delay_msec(1000);
+
+ /* Coines interface reset */
+ coines_soft_reset();
+ coines_delay_msec(1000);
+ coines_close_comm_intf(COINES_COMM_INTF_USB);
+}
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/common/common.h b/lib/lib_i2c/BME68x-Sensor-API/examples/common/common.h
new file mode 100644
index 000000000..5560f3712
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/common/common.h
@@ -0,0 +1,116 @@
+/**
+ * Copyright (C) 2021 Bosch Sensortec GmbH. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus */
+
+#include "bme68x.h"
+
+/*!
+ * @brief Function to select the interface between SPI and I2C.
+ *
+ * @param[in] bme : Structure instance of bme68x_dev
+ * @param[in] intf : Interface selection parameter
+ *
+ * @return Status of execution
+ * @retval 0 -> Success
+ * @retval < 0 -> Failure Info
+ */
+int8_t bme68x_interface_init(struct bme68x_dev *bme, uint8_t intf);
+
+/*!
+ * @brief Function for reading the sensor's registers through I2C bus.
+ *
+ * @param[in] reg_addr : Register address.
+ * @param[out] reg_data : Pointer to the data buffer to store the read data.
+ * @param[in] len : No of bytes to read.
+ * @param[in] intf_ptr : Interface pointer
+ *
+ * @return Status of execution
+ * @retval = BME68X_INTF_RET_SUCCESS -> Success
+ * @retval != BME68X_INTF_RET_SUCCESS -> Failure Info
+ *
+ */
+BME68X_INTF_RET_TYPE bme68x_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr);
+
+/*!
+ * @brief Function for writing the sensor's registers through I2C bus.
+ *
+ * @param[in] reg_addr : Register address.
+ * @param[in] reg_data : Pointer to the data buffer whose value is to be written.
+ * @param[in] len : No of bytes to write.
+ * @param[in] intf_ptr : Interface pointer
+ *
+ * @return Status of execution
+ * @retval = BME68X_INTF_RET_SUCCESS -> Success
+ * @retval != BME68X_INTF_RET_SUCCESS -> Failure Info
+ *
+ */
+BME68X_INTF_RET_TYPE bme68x_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr);
+
+/*!
+ * @brief Function for reading the sensor's registers through SPI bus.
+ *
+ * @param[in] reg_addr : Register address.
+ * @param[out] reg_data : Pointer to the data buffer to store the read data.
+ * @param[in] len : No of bytes to read.
+ * @param[in] intf_ptr : Interface pointer
+ *
+ * @return Status of execution
+ * @retval = BME68X_INTF_RET_SUCCESS -> Success
+ * @retval != BME68X_INTF_RET_SUCCESS -> Failure Info
+ *
+ */
+BME68X_INTF_RET_TYPE bme68x_spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr);
+
+/*!
+ * @brief Function for writing the sensor's registers through SPI bus.
+ *
+ * @param[in] reg_addr : Register address.
+ * @param[in] reg_data : Pointer to the data buffer whose data has to be written.
+ * @param[in] len : No of bytes to write.
+ * @param[in] intf_ptr : Interface pointer
+ *
+ * @return Status of execution
+ * @retval = BME68X_INTF_RET_SUCCESS -> Success
+ * @retval != BME68X_INTF_RET_SUCCESS -> Failure Info
+ *
+ */
+BME68X_INTF_RET_TYPE bme68x_spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr);
+
+/*!
+ * @brief This function provides the delay for required time (Microsecond) as per the input provided in some of the
+ * APIs.
+ *
+ * @param[in] period : The required wait time in microsecond.
+ * @param[in] intf_ptr : Interface pointer
+ *
+ * @return void.
+ *
+ */
+void bme68x_delay_us(uint32_t period, void *intf_ptr);
+
+/*!
+ * @brief Prints the execution status of the APIs.
+ *
+ * @param[in] api_name : Name of the API whose execution status has to be printed.
+ * @param[in] rslt : Error code returned by the API whose execution status has to be printed.
+ *
+ * @return void.
+ */
+void bme68x_check_rslt(const char api_name[], int8_t rslt);
+
+/*!
+ * @brief Deinitializes coines platform
+ *
+ * @return void.
+ */
+void bme68x_coines_deinit(void);
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus */
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/forced_mode/Makefile b/lib/lib_i2c/BME68x-Sensor-API/examples/forced_mode/Makefile
new file mode 100644
index 000000000..095e56614
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/forced_mode/Makefile
@@ -0,0 +1,15 @@
+COINES_INSTALL_PATH ?= ../../../..
+
+EXAMPLE_FILE ?= forced_mode.c
+
+API_LOCATION ?= ../..
+
+C_SRCS += \
+$(API_LOCATION)/bme68x.c \
+../common/common.c
+
+INCLUDEPATHS += \
+$(API_LOCATION) \
+../common
+
+include $(COINES_INSTALL_PATH)/coines.mk
\ No newline at end of file
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/forced_mode/forced_mode.c b/lib/lib_i2c/BME68x-Sensor-API/examples/forced_mode/forced_mode.c
new file mode 100644
index 000000000..4991df45a
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/forced_mode/forced_mode.c
@@ -0,0 +1,108 @@
+/**
+ * Copyright (C) 2021 Bosch Sensortec GmbH
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include
+
+#include "bme68x.h"
+#include "common.h"
+#include "coines.h"
+
+/***********************************************************************/
+/* Macros */
+/***********************************************************************/
+
+/* Macro for count of samples to be displayed */
+#define SAMPLE_COUNT UINT16_C(300)
+
+/***********************************************************************/
+/* Test code */
+/***********************************************************************/
+
+int main(void)
+{
+ struct bme68x_dev bme;
+ int8_t rslt;
+ struct bme68x_conf conf;
+ struct bme68x_heatr_conf heatr_conf;
+ struct bme68x_data data;
+ uint32_t del_period;
+ uint32_t time_ms = 0;
+ uint8_t n_fields;
+ uint16_t sample_count = 1;
+
+ /* Interface preference is updated as a parameter
+ * For I2C : BME68X_I2C_INTF
+ * For SPI : BME68X_SPI_INTF
+ */
+ rslt = bme68x_interface_init(&bme, BME68X_I2C_INTF);
+ bme68x_check_rslt("bme68x_interface_init", rslt);
+
+ rslt = bme68x_init(&bme);
+ bme68x_check_rslt("bme68x_init", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ conf.filter = BME68X_FILTER_OFF;
+ conf.odr = BME68X_ODR_NONE;
+ conf.os_hum = BME68X_OS_16X;
+ conf.os_pres = BME68X_OS_1X;
+ conf.os_temp = BME68X_OS_2X;
+ rslt = bme68x_set_conf(&conf, &bme);
+ bme68x_check_rslt("bme68x_set_conf", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ heatr_conf.enable = BME68X_ENABLE;
+ heatr_conf.heatr_temp = 300;
+ heatr_conf.heatr_dur = 100;
+ rslt = bme68x_set_heatr_conf(BME68X_FORCED_MODE, &heatr_conf, &bme);
+ bme68x_check_rslt("bme68x_set_heatr_conf", rslt);
+
+ printf("Sample, TimeStamp(ms), Temperature(deg C), Pressure(Pa), Humidity(%%), Gas resistance(ohm), Status\n");
+
+ while (sample_count <= SAMPLE_COUNT)
+ {
+ rslt = bme68x_set_op_mode(BME68X_FORCED_MODE, &bme);
+ bme68x_check_rslt("bme68x_set_op_mode", rslt);
+
+ /* Calculate delay period in microseconds */
+ del_period = bme68x_get_meas_dur(BME68X_FORCED_MODE, &conf, &bme) + (heatr_conf.heatr_dur * 1000);
+ bme.delay_us(del_period, bme.intf_ptr);
+
+ time_ms = coines_get_millis();
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ rslt = bme68x_get_data(BME68X_FORCED_MODE, &data, &n_fields, &bme);
+ bme68x_check_rslt("bme68x_get_data", rslt);
+
+ if (n_fields)
+ {
+#ifdef BME68X_USE_FPU
+ printf("%u, %lu, %.2f, %.2f, %.2f, %.2f, 0x%x\n",
+ sample_count,
+ (long unsigned int)time_ms,
+ data.temperature,
+ data.pressure,
+ data.humidity,
+ data.gas_resistance,
+ data.status);
+#else
+ printf("%u, %lu, %d, %lu, %lu, %lu, 0x%x\n",
+ sample_count,
+ (long unsigned int)time_ms,
+ (data.temperature / 100),
+ (long unsigned int)data.pressure,
+ (long unsigned int)(data.humidity / 1000),
+ (long unsigned int)data.gas_resistance,
+ data.status);
+#endif
+ sample_count++;
+ }
+ }
+
+ bme68x_coines_deinit();
+
+ return rslt;
+}
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/parallel_mode/Makefile b/lib/lib_i2c/BME68x-Sensor-API/examples/parallel_mode/Makefile
new file mode 100644
index 000000000..5f939662e
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/parallel_mode/Makefile
@@ -0,0 +1,15 @@
+COINES_INSTALL_PATH ?= ../../../..
+
+EXAMPLE_FILE ?= parallel_mode.c
+
+API_LOCATION ?= ../..
+
+C_SRCS += \
+$(API_LOCATION)/bme68x.c \
+../common/common.c
+
+INCLUDEPATHS += \
+$(API_LOCATION) \
+../common
+
+include $(COINES_INSTALL_PATH)/coines.mk
\ No newline at end of file
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/parallel_mode/parallel_mode.c b/lib/lib_i2c/BME68x-Sensor-API/examples/parallel_mode/parallel_mode.c
new file mode 100644
index 000000000..ec4011d61
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/parallel_mode/parallel_mode.c
@@ -0,0 +1,141 @@
+/**
+ * Copyright (C) 2021 Bosch Sensortec GmbH
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include
+
+#include "bme68x.h"
+#include "common.h"
+#include "coines.h"
+
+/***********************************************************************/
+/* Macros */
+/***********************************************************************/
+
+/*
+ * Macro definition for valid new data (0x80) AND
+ * heater stability (0x10) AND gas resistance (0x20) values
+ */
+#define BME68X_VALID_DATA UINT8_C(0xB0)
+
+/* Macro for count of samples to be displayed */
+#define SAMPLE_COUNT UINT8_C(50)
+
+/***********************************************************************/
+/* Test code */
+/***********************************************************************/
+
+int main(void)
+{
+ struct bme68x_dev bme;
+ int8_t rslt;
+ struct bme68x_conf conf;
+ struct bme68x_heatr_conf heatr_conf;
+ struct bme68x_data data[3];
+ uint32_t del_period;
+ uint8_t n_fields;
+ uint32_t time_ms = 0;
+ uint16_t sample_count = 1;
+
+ /* Heater temperature in degree Celsius */
+ uint16_t temp_prof[10] = { 320, 100, 100, 100, 200, 200, 200, 320, 320, 320 };
+
+ /* Multiplier to the shared heater duration */
+ uint16_t mul_prof[10] = { 5, 2, 10, 30, 5, 5, 5, 5, 5, 5 };
+
+ /* Interface preference is updated as a parameter
+ * For I2C : BME68X_I2C_INTF
+ * For SPI : BME68X_SPI_INTF
+ */
+ rslt = bme68x_interface_init(&bme, BME68X_I2C_INTF);
+ bme68x_check_rslt("bme68x_interface_init", rslt);
+
+ rslt = bme68x_init(&bme);
+ bme68x_check_rslt("bme68x_init", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ rslt = bme68x_get_conf(&conf, &bme);
+ bme68x_check_rslt("bme68x_get_conf", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ conf.filter = BME68X_FILTER_OFF;
+ conf.odr = BME68X_ODR_NONE;
+ conf.os_hum = BME68X_OS_1X;
+ conf.os_pres = BME68X_OS_16X;
+ conf.os_temp = BME68X_OS_2X;
+ rslt = bme68x_set_conf(&conf, &bme);
+ bme68x_check_rslt("bme68x_set_conf", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ heatr_conf.enable = BME68X_ENABLE;
+ heatr_conf.heatr_temp_prof = temp_prof;
+ heatr_conf.heatr_dur_prof = mul_prof;
+
+ /* Shared heating duration in milliseconds */
+ heatr_conf.shared_heatr_dur = 140 - (bme68x_get_meas_dur(BME68X_PARALLEL_MODE, &conf, &bme) / 1000);
+
+ heatr_conf.profile_len = 10;
+ rslt = bme68x_set_heatr_conf(BME68X_PARALLEL_MODE, &heatr_conf, &bme);
+ bme68x_check_rslt("bme68x_set_heatr_conf", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ rslt = bme68x_set_op_mode(BME68X_PARALLEL_MODE, &bme);
+ bme68x_check_rslt("bme68x_set_op_mode", rslt);
+
+ printf(
+ "Print parallel mode data if mask for new data(0x80), gas measurement(0x20) and heater stability(0x10) are set\n\n");
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ printf(
+ "Sample, TimeStamp(ms), Temperature(deg C), Pressure(Pa), Humidity(%%), Gas resistance(ohm), Status, Gas index, Meas index\n");
+ while (sample_count <= SAMPLE_COUNT)
+ {
+ /* Calculate delay period in microseconds */
+ del_period = bme68x_get_meas_dur(BME68X_PARALLEL_MODE, &conf, &bme) + (heatr_conf.shared_heatr_dur * 1000);
+ bme.delay_us(del_period, bme.intf_ptr);
+
+ time_ms = coines_get_millis();
+
+ rslt = bme68x_get_data(BME68X_PARALLEL_MODE, data, &n_fields, &bme);
+ bme68x_check_rslt("bme68x_get_data", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ for (uint8_t i = 0; i < n_fields; i++)
+ {
+ if (data[i].status == BME68X_VALID_DATA)
+ {
+#ifdef BME68X_USE_FPU
+ printf("%u, %lu, %.2f, %.2f, %.2f, %.2f, 0x%x, %d, %d\n",
+ sample_count,
+ (long unsigned int)time_ms,
+ data[i].temperature,
+ data[i].pressure,
+ data[i].humidity,
+ data[i].gas_resistance,
+ data[i].status,
+ data[i].gas_index,
+ data[i].meas_index);
+#else
+ printf("%u, %lu, %d, %lu, %lu, %lu, 0x%x, %d, %d\n",
+ sample_count,
+ (long unsigned int)time_ms,
+ (data[i].temperature / 100),
+ (long unsigned int)data[i].pressure,
+ (long unsigned int)(data[i].humidity / 1000),
+ (long unsigned int)data[i].gas_resistance,
+ data[i].status,
+ data[i].gas_index,
+ data[i].meas_index);
+#endif
+ sample_count++;
+ }
+ }
+ }
+
+ bme68x_coines_deinit();
+
+ return 0;
+}
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/self_test/Makefile b/lib/lib_i2c/BME68x-Sensor-API/examples/self_test/Makefile
new file mode 100644
index 000000000..71a84bf0d
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/self_test/Makefile
@@ -0,0 +1,15 @@
+COINES_INSTALL_PATH ?= ../../../..
+
+EXAMPLE_FILE ?= self_test.c
+
+API_LOCATION ?= ../..
+
+C_SRCS += \
+$(API_LOCATION)/bme68x.c \
+../common/common.c
+
+INCLUDEPATHS += \
+$(API_LOCATION) \
+../common
+
+include $(COINES_INSTALL_PATH)/coines.mk
\ No newline at end of file
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/self_test/self_test.c b/lib/lib_i2c/BME68x-Sensor-API/examples/self_test/self_test.c
new file mode 100644
index 000000000..a6096a0e0
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/self_test/self_test.c
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2021 Bosch Sensortec GmbH
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include
+
+#include "bme68x.h"
+#include "common.h"
+#include "coines.h"
+
+/***********************************************************************/
+/* Test code */
+/***********************************************************************/
+
+int main(void)
+{
+ struct bme68x_dev bme;
+ int8_t rslt;
+
+ /* Interface preference is updated as a parameter
+ * For I2C : BME68X_I2C_INTF
+ * For SPI : BME68X_SPI_INTF
+ */
+ rslt = bme68x_interface_init(&bme, BME68X_I2C_INTF);
+ bme68x_check_rslt("bme68x_interface_init", rslt);
+
+ rslt = bme68x_init(&bme);
+ bme68x_check_rslt("bme68x_init", rslt);
+
+ rslt = bme68x_selftest_check(&bme);
+ bme68x_check_rslt("bme68x_selftest_check", rslt);
+
+ if (rslt == BME68X_OK)
+ {
+ printf("Self-test passed\n");
+ }
+
+ if (rslt == BME68X_E_SELF_TEST)
+ {
+ printf("Self-test failed\n");
+ }
+
+ bme68x_coines_deinit();
+
+ return rslt;
+}
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/sequential_mode/Makefile b/lib/lib_i2c/BME68x-Sensor-API/examples/sequential_mode/Makefile
new file mode 100644
index 000000000..cfd7a6bf3
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/sequential_mode/Makefile
@@ -0,0 +1,15 @@
+COINES_INSTALL_PATH ?= ../../../..
+
+EXAMPLE_FILE ?= sequential_mode.c
+
+API_LOCATION ?= ../..
+
+C_SRCS += \
+$(API_LOCATION)/bme68x.c \
+../common/common.c
+
+INCLUDEPATHS += \
+$(API_LOCATION) \
+../common
+
+include $(COINES_INSTALL_PATH)/coines.mk
\ No newline at end of file
diff --git a/lib/lib_i2c/BME68x-Sensor-API/examples/sequential_mode/sequential_mode.c b/lib/lib_i2c/BME68x-Sensor-API/examples/sequential_mode/sequential_mode.c
new file mode 100644
index 000000000..0717cf9c1
--- /dev/null
+++ b/lib/lib_i2c/BME68x-Sensor-API/examples/sequential_mode/sequential_mode.c
@@ -0,0 +1,125 @@
+/**
+ * Copyright (C) 2021 Bosch Sensortec GmbH
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include
+
+#include "bme68x.h"
+#include "common.h"
+#include "coines.h"
+
+/***********************************************************************/
+/* Macros */
+/***********************************************************************/
+
+/* Macro for count of samples to be displayed */
+#define SAMPLE_COUNT UINT8_C(300)
+
+/***********************************************************************/
+/* Test code */
+/***********************************************************************/
+
+int main(void)
+{
+ struct bme68x_dev bme;
+ int8_t rslt;
+ struct bme68x_conf conf;
+ struct bme68x_heatr_conf heatr_conf;
+ struct bme68x_data data[3];
+ uint32_t del_period;
+ uint32_t time_ms = 0;
+ uint8_t n_fields;
+ uint16_t sample_count = 1;
+
+ /* Heater temperature in degree Celsius */
+ uint16_t temp_prof[10] = { 200, 240, 280, 320, 360, 360, 320, 280, 240, 200 };
+
+ /* Heating duration in milliseconds */
+ uint16_t dur_prof[10] = { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 };
+
+ /* Interface preference is updated as a parameter
+ * For I2C : BME68X_I2C_INTF
+ * For SPI : BME68X_SPI_INTF
+ */
+ rslt = bme68x_interface_init(&bme, BME68X_I2C_INTF);
+ bme68x_check_rslt("bme68x_interface_init", rslt);
+
+ rslt = bme68x_init(&bme);
+ bme68x_check_rslt("bme68x_init", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ rslt = bme68x_get_conf(&conf, &bme);
+ bme68x_check_rslt("bme68x_get_conf", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ conf.filter = BME68X_FILTER_OFF;
+ conf.odr = BME68X_ODR_NONE; /* This parameter defines the sleep duration after each profile */
+ conf.os_hum = BME68X_OS_16X;
+ conf.os_pres = BME68X_OS_1X;
+ conf.os_temp = BME68X_OS_2X;
+ rslt = bme68x_set_conf(&conf, &bme);
+ bme68x_check_rslt("bme68x_set_conf", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ heatr_conf.enable = BME68X_ENABLE;
+ heatr_conf.heatr_temp_prof = temp_prof;
+ heatr_conf.heatr_dur_prof = dur_prof;
+ heatr_conf.profile_len = 10;
+ rslt = bme68x_set_heatr_conf(BME68X_SEQUENTIAL_MODE, &heatr_conf, &bme);
+ bme68x_check_rslt("bme68x_set_heatr_conf", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ rslt = bme68x_set_op_mode(BME68X_SEQUENTIAL_MODE, &bme);
+ bme68x_check_rslt("bme68x_set_op_mode", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ printf(
+ "Sample, TimeStamp(ms), Temperature(deg C), Pressure(Pa), Humidity(%%), Gas resistance(ohm), Status, Profile index, Measurement index\n");
+ while (sample_count <= SAMPLE_COUNT)
+ {
+ /* Calculate delay period in microseconds */
+ del_period = bme68x_get_meas_dur(BME68X_SEQUENTIAL_MODE, &conf, &bme) + (heatr_conf.heatr_dur_prof[0] * 1000);
+ bme.delay_us(del_period, bme.intf_ptr);
+
+ time_ms = coines_get_millis();
+
+ rslt = bme68x_get_data(BME68X_SEQUENTIAL_MODE, data, &n_fields, &bme);
+ bme68x_check_rslt("bme68x_get_data", rslt);
+
+ /* Check if rslt == BME68X_OK, report or handle if otherwise */
+ for (uint8_t i = 0; i < n_fields; i++)
+ {
+#ifdef BME68X_USE_FPU
+ printf("%u, %lu, %.2f, %.2f, %.2f, %.2f, 0x%x, %d, %d\n",
+ sample_count,
+ (long unsigned int)time_ms + (i * (del_period / 2000)),
+ data[i].temperature,
+ data[i].pressure,
+ data[i].humidity,
+ data[i].gas_resistance,
+ data[i].status,
+ data[i].gas_index,
+ data[i].meas_index);
+#else
+ printf("%u, %lu, %d, %lu, %lu, %lu, 0x%x, %d, %d\n",
+ sample_count,
+ (long unsigned int)time_ms + (i * (del_period / 2000)),
+ (data[i].temperature / 100),
+ (long unsigned int)data[i].pressure,
+ (long unsigned int)(data[i].humidity / 1000),
+ (long unsigned int)data[i].gas_resistance,
+ data[i].status,
+ data[i].gas_index,
+ data[i].meas_index);
+#endif
+ sample_count++;
+ }
+ }
+
+ bme68x_coines_deinit();
+
+ return 0;
+}
diff --git a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/library.properties b/lib/lib_i2c/BME68x-Sensor-API/library.properties
similarity index 50%
rename from lib/lib_i2c/BME680_driver-bme680_v3.5.9/library.properties
rename to lib/lib_i2c/BME68x-Sensor-API/library.properties
index bf0211d28..751d48ad0 100644
--- a/lib/lib_i2c/BME680_driver-bme680_v3.5.9/library.properties
+++ b/lib/lib_i2c/BME68x-Sensor-API/library.properties
@@ -1,9 +1,9 @@
-name=BME680
+name=BME68x
version=
author=
maintainer=Bosch Sensortec GmbH
-sentence=Sensor driver for BME680 sensor
-paragraph=Sensor driver for BME680 sensor
+sentence=Sensor driver for BME68x sensor
+paragraph=Sensor driver for BME68x sensor
category=Sensor
url=
architectures=esp8266,esp32
diff --git a/lib/lib_i2c/mlx90640-library/MLX90640_API.cpp b/lib/lib_i2c/mlx90640-library/MLX90640_API.cpp
index 8b1822bf4..f2a8731c3 100644
--- a/lib/lib_i2c/mlx90640-library/MLX90640_API.cpp
+++ b/lib/lib_i2c/mlx90640-library/MLX90640_API.cpp
@@ -42,7 +42,9 @@ int MLX90640_I2CRead(uint8_t addr, uint32_t reg, uint16_t len, uint16_t *reg_dat
int MLX90640_I2CWrite(uint8_t _deviceAddress, unsigned int writeAddress, uint16_t data);
// I2C
-#define I2C_BUFFER_LENGTH 128
+#ifndef I2C_BUFFER_LENGTH
+ #define I2C_BUFFER_LENGTH 128
+#endif
int MLX90640_I2CRead(uint8_t addr, uint32_t reg, uint16_t len, uint16_t *reg_data){
int bytesRemaining = len * 2;
diff --git a/lib/lib_rf/rc-switch/src/RCSwitch.cpp b/lib/lib_rf/rc-switch/src/RCSwitch.cpp
index aed787bea..69b3f37a3 100644
--- a/lib/lib_rf/rc-switch/src/RCSwitch.cpp
+++ b/lib/lib_rf/rc-switch/src/RCSwitch.cpp
@@ -149,7 +149,7 @@ static const RCSwitch::Protocol PROGMEM proto[] = {
{ 400, 0, { 0, 0 }, 1, { 1, 1 }, { 1, 2 }, { 2, 1 }, false, 43 }, // 31 (Mertik Maxitrol G6R-H4T1)
{ 365, 0, { 0, 0 }, 1, { 18, 1 }, { 3, 1 }, { 1, 3 }, true, 0 }, // 32 (1ByOne Doorbell) from @Fatbeard https://github.com/sui77/rc-switch/pull/277
{ 340, 0, { 0, 0 }, 1, { 14, 4 }, { 1, 2 }, { 2, 1 }, false, 0 }, // 33 (Dooya Control DC2708L)
- { 120, 0, { 0, 0 }, 1, { 1, 28 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 34 DIGOO SD10
+ { 120, 0, { 0, 0 }, 1, { 1, 28 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 34 DIGOO SD10 - so as to use this protocol RCSWITCH_SEPARATION_LIMIT must be set to 2600
{ 20, 0, { 0, 0 }, 1, { 239, 78 }, {20, 35 }, {35, 20}, false, 10000 } // 35 Dooya 5-Channel blinds remote DC1603
};
@@ -164,11 +164,7 @@ volatile unsigned int RCSwitch::nReceivedBitlength = 0;
volatile unsigned int RCSwitch::nReceivedDelay = 0;
volatile unsigned int RCSwitch::nReceivedProtocol = 0;
int RCSwitch::nReceiveTolerance = 60;
-const unsigned int RCSwitch::nSeparationLimit = 2600; // 4300 default
-// separationLimit: minimum microseconds between received codes, closer codes are ignored.
-// according to discussion on issue #14 it might be more suitable to set the separation
-// limit to the same time as the 'low' part of the sync signal for the current protocol.
-// should be set to the minimum value of pulselength * the sync signal
+const unsigned int RCSwitch::nSeparationLimit = RCSWITCH_SEPARATION_LIMIT;
unsigned int RCSwitch::timings[RCSWITCH_MAX_CHANGES];
unsigned int RCSwitch::buftimings[4];
#endif
diff --git a/lib/lib_rf/rc-switch/src/RCSwitch.h b/lib/lib_rf/rc-switch/src/RCSwitch.h
index 613d654d7..6d660c0db 100644
--- a/lib/lib_rf/rc-switch/src/RCSwitch.h
+++ b/lib/lib_rf/rc-switch/src/RCSwitch.h
@@ -61,6 +61,12 @@
// Для keeloq нужно увеличить RCSWITCH_MAX_CHANGES до 23+1+66*2+1=157
#define RCSWITCH_MAX_CHANGES 67 // default 67
+// separationLimit: minimum microseconds between received codes, closer codes are ignored.
+// according to discussion on issue #14 it might be more suitable to set the separation
+// limit to the same time as the 'low' part of the sync signal for the current protocol.
+// should be set to the minimum value of pulselength * the sync signal
+#define RCSWITCH_SEPARATION_LIMIT 4100
+
class RCSwitch {
public:
diff --git a/lib/lib_ssl/tls_mini/library.json b/lib/lib_ssl/tls_mini/library.json
index 0faa39688..d93dfd353 100644
--- a/lib/lib_ssl/tls_mini/library.json
+++ b/lib/lib_ssl/tls_mini/library.json
@@ -4,8 +4,8 @@
"description": "TLS mini client derived from Arduino",
"license": "MIT",
"homepage": "https://github.com/arendst/Tasmota",
- "frameworks": "*",
- "platforms": "*",
+ "frameworks": "arduino",
+ "platforms": "espressif32, espressif8266",
"authors":
{
"name": "Stephan Hadinger",
diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp
index 7be46adf0..d714c4bd0 100755
--- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp
+++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp
@@ -21,7 +21,7 @@
*/
#include "tasmota_options.h"
-#if defined(USE_TLS)
+#ifdef USE_TLS
// #define DEBUG_TLS
// #define DEBUG_ESP_SSL
@@ -418,6 +418,10 @@ size_t WiFiClientSecure_light::_write(const uint8_t *buf, size_t size, bool pmem
return sent_bytes;
}
+void WiFiClientSecure_light::setInsecure() {
+ _insecure = true;
+}
+
size_t WiFiClientSecure_light::write(const uint8_t *buf, size_t size) {
return _write(buf, size, false);
}
@@ -965,7 +969,7 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) {
_freeSSL();
clearLastError();
#ifdef ESP8266
- if (!stack_thunk_light_get_stack_bot()) break;
+ if (!stack_thunk_light_get_stack_bot()) break;
#endif // ESP8266
_ctx_present = true;
diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h
index 3736749ab..65a3544be 100755
--- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h
+++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h
@@ -124,6 +124,8 @@ class WiFiClientSecure_light : public WiFiClient {
return _max_thunkstack_use;
}
+ void setInsecure();
+
private:
void _clear();
bool _ctx_present;
@@ -152,7 +154,6 @@ class WiFiClientSecure_light : public WiFiClient {
unsigned char *_recvapp_buf;
size_t _recvapp_len;
-
bool _clientConnected(); // Is the underlying socket alive?
bool _connectSSL(const char *hostName); // Do initial SSL handshake
void _freeSSL();
diff --git a/lib/libesp32/Berry-HttpClientLight/library.json b/lib/libesp32/Berry-HttpClientLight/library.json
index 1e1479bbb..c9e5208f9 100644
--- a/lib/libesp32/Berry-HttpClientLight/library.json
+++ b/lib/libesp32/Berry-HttpClientLight/library.json
@@ -4,8 +4,8 @@
"description": "Forked version of Arduino HttpClient to support BearSSL instead of mbedTLS",
"license": "MIT",
"homepage": "https://github.com/arendst/Tasmota",
- "frameworks": "*",
- "platforms": "*",
+ "frameworks": "arduino",
+ "platforms": "espressif32",
"authors":
{
"name": "Stephan Hadinger",
diff --git a/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.cpp b/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.cpp
index 420cbfb71..1c1c6ac32 100644
--- a/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.cpp
+++ b/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.cpp
@@ -28,7 +28,6 @@
#ifdef ESP32
#include "tasmota_options.h"
-#ifdef USE_BERRY
#include
#ifdef HTTPCLIENT_1_1_COMPATIBLE
@@ -46,10 +45,10 @@
#endif // USE_WEBCLIENT_HTTPS
// #ifdef HTTPCLIENT_1_1_COMPATIBLE
-class TransportTraits
+class TransportTraitsLight
{
public:
- virtual ~TransportTraits()
+ virtual ~TransportTraitsLight()
{
}
@@ -72,7 +71,7 @@ public:
#ifdef USE_WEBCLIENT_HTTPS
static const uint8_t _fingerprint_any[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
-class BearSSLTraits : public TransportTraits
+class BearSSLTraits : public TransportTraitsLight
{
public:
BearSSLTraits(int recv, int xmit) :
@@ -221,7 +220,7 @@ bool HTTPClientLight::begin(String url, const char* CAcert)
}
_secure = true;
#ifdef USE_WEBCLIENT_HTTPS
- _transportTraits = TransportTraitsPtr(new BearSSLTraits(16384, 0));
+ _transportTraits = TransportTraitsLightPtr(new BearSSLTraits(16384, 0));
// set buffer to 16KB half duplex, so we won't lose responses bigger than 16KB
// half duplex is well suited for HTTPS: one request followed by responses
#else
@@ -251,7 +250,7 @@ bool HTTPClientLight::begin(String url)
if (!beginInternal(url, "http")) {
return begin(url, (const char*)NULL);
}
- _transportTraits = TransportTraitsPtr(new TransportTraits());
+ _transportTraits = TransportTraitsLightPtr(new TransportTraitsLight());
if(!_transportTraits) {
log_e("could not create transport traits");
return false;
@@ -328,7 +327,7 @@ bool HTTPClientLight::beginInternal(String url, const char* expectedProtocol)
// _host = host;
// _port = port;
// _uri = uri;
-// // _transportTraits = TransportTraitsPtr(new TransportTraits()); TODO
+// // _transportTraits = TransportTraitsLightPtr(new TransportTraitsLight()); TODO
// _transportTraits = nullptr;
// log_d("host: %s port: %d uri: %s", host.c_str(), port, uri.c_str());
// return true;
@@ -351,7 +350,7 @@ bool HTTPClientLight::beginInternal(String url, const char* expectedProtocol)
// return false;
// }
// _secure = true;
-// _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert));
+// _transportTraits = TransportTraitsLightPtr(new TLSTraits(CAcert));
// return true;
// }
@@ -372,7 +371,7 @@ bool HTTPClientLight::beginInternal(String url, const char* expectedProtocol)
// return false;
// }
// _secure = true;
-// _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert, cli_cert, cli_key));
+// _transportTraits = TransportTraitsLightPtr(new TLSTraits(CAcert, cli_cert, cli_key));
// return true;
// }
#endif // HTTPCLIENT_1_1_COMPATIBLE
@@ -1504,5 +1503,4 @@ const String &HTTPClientLight::getLocation(void)
{
return _location;
}
-#endif // USE_BERRY
#endif // ESP32
diff --git a/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.h b/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.h
index dc2bc0e58..a6d3be7eb 100644
--- a/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.h
+++ b/lib/libesp32/Berry-HttpClientLight/src/HttpClientLight.h
@@ -141,6 +141,11 @@
// } followRedirects_t;
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+class TransportTraitsLight;
+typedef std::unique_ptr TransportTraitsLightPtr;
+#endif
+
class HTTPClientLight
{
@@ -231,7 +236,7 @@ protected:
#ifdef HTTPCLIENT_1_1_COMPATIBLE
- TransportTraitsPtr _transportTraits;
+ TransportTraitsLightPtr _transportTraits;
std::unique_ptr _tcpDeprecated;
#endif
diff --git a/lib/libesp32/Berry/default/be_i2s_audio_lib.c b/lib/libesp32/Berry/default/be_i2s_audio_lib.c
deleted file mode 100644
index ef8720b23..000000000
--- a/lib/libesp32/Berry/default/be_i2s_audio_lib.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/********************************************************************
- * Tasmota I2S audio classes
- *
- *
- *******************************************************************/
-#include "be_constobj.h"
-
-#ifdef USE_I2S
-#ifdef USE_I2S_AUDIO_BERRY
-
-extern int i2s_output_i2s_init(bvm *vm);
-extern int i2s_output_i2s_deinit(bvm *vm);
-extern int i2s_output_i2s_stop(bvm *vm);
-
-extern int i2s_generator_wav_init(bvm *vm);
-extern int i2s_generator_wav_deinit(bvm *vm);
-extern int i2s_generator_wav_begin(bvm *vm);
-extern int i2s_generator_wav_loop(bvm *vm);
-extern int i2s_generator_wav_stop(bvm *vm);
-extern int i2s_generator_wav_isrunning(bvm *vm);
-
-extern int i2s_generator_mp3_init(bvm *vm);
-extern int i2s_generator_mp3_deinit(bvm *vm);
-extern int i2s_generator_mp3_begin(bvm *vm);
-extern int i2s_generator_mp3_loop(bvm *vm);
-extern int i2s_generator_mp3_stop(bvm *vm);
-extern int i2s_generator_mp3_isrunning(bvm *vm);
-
-#ifdef USE_UFILESYS
-extern int i2s_file_source_fs_init(bvm *vm);
-extern int i2s_file_source_fs_deinit(bvm *vm);
-#endif // USE_UFILESYS
-
-
-#include "../generate/be_fixed_be_class_audio_output.h"
-#include "../generate/be_fixed_be_class_audio_output_i2s.h"
-#include "../generate/be_fixed_be_class_audio_generator.h"
-#include "../generate/be_fixed_be_class_audio_generator_wav.h"
-#include "../generate/be_fixed_be_class_audio_generator_mp3.h"
-#include "../generate/be_fixed_be_class_audio_file_source.h"
-#include "../generate/be_fixed_be_class_audio_file_source_fs.h"
-
-void be_load_driver_audio_lib(bvm *vm) {
- be_pushntvclass(vm, &be_class_audio_output);
- be_setglobal(vm, "AudioOutput");
- be_pop(vm, 1);
-
- be_pushntvclass(vm, &be_class_audio_output_i2s);
- be_setglobal(vm, "AudioOutputI2S");
- be_pop(vm, 1);
-
- be_pushntvclass(vm, &be_class_audio_generator_wav);
- be_setglobal(vm, "AudioGeneratorWAV");
- be_pop(vm, 1);
-
- be_pushntvclass(vm, &be_class_audio_generator_mp3);
- be_setglobal(vm, "AudioGeneratorMP3");
- be_pop(vm, 1);
-
-#ifdef USE_UFILESYS
- be_pushntvclass(vm, &be_class_audio_file_source_fs);
- be_setglobal(vm, "AudioFileSourceFS");
- be_pop(vm, 1);
-#endif // USE_UFILESYS
-}
-
-/* @const_object_info_begin
-
-class be_class_audio_output (scope: global, name: AudioOutput) {
- .p, var
-}
-
-class be_class_audio_generator (scope: global, name: AudioGenerator) {
- .p, var
-}
-
-class be_class_audio_file_source (scope: global, name: AudioFileSource) {
- .p, var
-}
-
-class be_class_audio_output_i2s (scope: global, name: AudioOutputI2S, super: be_class_audio_output) {
- init, func(i2s_output_i2s_init)
- deinit, func(i2s_output_i2s_deinit)
- stop, func(i2s_output_i2s_stop)
-}
-
-class be_class_audio_generator_wav (scope: global, name: AudioGeneratorWAV, super: be_class_audio_generator) {
- init, func(i2s_generator_wav_init)
- deinit, func(i2s_generator_wav_deinit)
- begin, func(i2s_generator_wav_begin)
- loop, func(i2s_generator_wav_loop)
- stop, func(i2s_generator_wav_stop)
- isrunning, func(i2s_generator_wav_isrunning)
-}
-
-class be_class_audio_generator_mp3 (scope: global, name: AudioGeneratorMP3, super: be_class_audio_generator) {
- init, func(i2s_generator_mp3_init)
- deinit, func(i2s_generator_mp3_deinit)
- begin, func(i2s_generator_mp3_begin)
- loop, func(i2s_generator_mp3_loop)
- stop, func(i2s_generator_mp3_stop)
- isrunning, func(i2s_generator_mp3_isrunning)
-}
-
-class be_class_audio_file_source_fs (scope: global, name: AudioFileSourceFS, super: be_class_audio_file_source) {
- init, func(i2s_file_source_fs_init)
- deinit, func(i2s_file_source_fs_deinit)
-}
-
-@const_object_info_end */
-
-#endif // USE_I2S_AUDIO_BERRY
-#endif // USE_I2S
\ No newline at end of file
diff --git a/lib/libesp32/Berry/default/be_lvgl_module.c b/lib/libesp32/Berry/default/be_lvgl_module.c
deleted file mode 100644
index 890efd2ff..000000000
--- a/lib/libesp32/Berry/default/be_lvgl_module.c
+++ /dev/null
@@ -1,692 +0,0 @@
-/********************************************************************
- * Generated code, don't edit
- *******************************************************************/
-/********************************************************************
- * LVGL Module
- *******************************************************************/
-#include "be_constobj.h"
-
-#ifdef USE_LVGL
-
-#include "lvgl.h"
-#include "be_lvgl.h"
-#include "lv_theme_openhasp.h"
-
-extern int lv0_member(bvm *vm); // resolve virtual members
-
-extern int lv0_start(bvm *vm);
-
-extern int lv0_register_button_encoder(bvm *vm); // add buttons with encoder logic
-
-extern int lv0_load_montserrat_font(bvm *vm);
-extern int lv0_load_seg7_font(bvm *vm);
-extern int lv0_load_robotocondensed_latin1_font(bvm *vm);
-extern int lv0_load_font(bvm *vm);
-extern int lv0_load_freetype_font(bvm *vm);
-
-extern int lv0_screenshot(bvm *vm);
-
-static int lv_get_hor_res(void) {
- return lv_disp_get_hor_res(lv_disp_get_default());
-}
-static int lv_get_ver_res(void) {
- return lv_disp_get_ver_res(lv_disp_get_default());
-}
-
-/* `lv` methods */
-const lvbe_call_c_t lv_func[] = {
-
- { "clamp_height", (void*) &lv_clamp_height, "i", "iiii" },
- { "clamp_width", (void*) &lv_clamp_width, "i", "iiii" },
- { "color_mix", (void*) &lv_color_mix, "lv.lv_color", "(lv.lv_color)(lv.lv_color)i" },
- { "dpx", (void*) &lv_dpx, "i", "i" },
- { "draw_arc", (void*) &lv_draw_arc, "", "iiiii(lv.lv_area)(lv.lv_draw_arc_dsc)" },
- { "draw_arc_dsc_init", (void*) &lv_draw_arc_dsc_init, "", "(lv.lv_draw_arc_dsc)" },
- { "draw_arc_get_area", (void*) &lv_draw_arc_get_area, "", "iiiiiib(lv.lv_area)" },
- { "draw_img", (void*) &lv_draw_img, "", "(lv.lv_area)(lv.lv_area).(lv.lv_draw_img_dsc)" },
- { "draw_img_dsc_init", (void*) &lv_draw_img_dsc_init, "", "(lv.lv_draw_img_dsc)" },
- { "draw_label", (void*) &lv_draw_label, "", "(lv.lv_area)(lv.lv_area)(lv.lv_draw_label_dsc)s(lv.lv_draw_label_hint)" },
- { "draw_label_dsc_init", (void*) &lv_draw_label_dsc_init, "", "(lv.lv_draw_label_dsc)" },
- { "draw_letter", (void*) &lv_draw_letter, "", "(lv.lv_point)(lv.lv_area)(lv.lv_font)i(lv.lv_color)ii" },
- { "draw_line", (void*) &lv_draw_line, "", "(lv.lv_point)(lv.lv_point)(lv.lv_area)(lv.lv_draw_line_dsc)" },
- { "draw_line_dsc_init", (void*) &lv_draw_line_dsc_init, "", "(lv.lv_draw_line_dsc)" },
- { "draw_mask_add", (void*) &lv_draw_mask_add, "i", ".." },
- { "draw_mask_angle_init", (void*) &lv_draw_mask_angle_init, "", "(lv.lv_draw_mask_angle_param)iiii" },
- { "draw_mask_fade_init", (void*) &lv_draw_mask_fade_init, "", "(lv.lv_draw_mask_fade_param)(lv.lv_area)iiii" },
- { "draw_mask_get_cnt", (void*) &lv_draw_mask_get_cnt, "i", "" },
- { "draw_mask_line_angle_init", (void*) &lv_draw_mask_line_angle_init, "", "(lv.lv_draw_mask_line_param)iiii" },
- { "draw_mask_line_points_init", (void*) &lv_draw_mask_line_points_init, "", "(lv.lv_draw_mask_line_param)iiiii" },
- { "draw_mask_map_init", (void*) &lv_draw_mask_map_init, "", "(lv.lv_draw_mask_map_param)(lv.lv_area)(lv.lv_opa)" },
- { "draw_mask_radius_init", (void*) &lv_draw_mask_radius_init, "", "(lv.lv_draw_mask_radius_param)(lv.lv_area)ib" },
- { "draw_mask_remove_custom", (void*) &lv_draw_mask_remove_custom, ".", "." },
- { "draw_mask_remove_id", (void*) &lv_draw_mask_remove_id, ".", "i" },
- { "draw_polygon", (void*) &lv_draw_polygon, "", "ii(lv.lv_area)(lv.lv_draw_rect_dsc)" },
- { "draw_rect", (void*) &lv_draw_rect, "", "(lv.lv_area)(lv.lv_area)(lv.lv_draw_rect_dsc)" },
- { "draw_rect_dsc_init", (void*) &lv_draw_rect_dsc_init, "", "(lv.lv_draw_rect_dsc)" },
- { "draw_triangle", (void*) &lv_draw_triangle, "", "i(lv.lv_area)(lv.lv_draw_rect_dsc)" },
- { "event_register_id", (void*) &lv_event_register_id, "i", "" },
- { "event_send", (void*) &lv_event_send, "i", "(lv.lv_obj)i." },
- { "event_set_cover_res", (void*) &lv_event_set_cover_res, "", "(lv.lv_event)(lv.lv_cover_res)" },
- { "event_set_ext_draw_size", (void*) &lv_event_set_ext_draw_size, "", "(lv.lv_event)i" },
- { "get_hor_res", (void*) &lv_get_hor_res, "i", "" },
- { "get_ver_res", (void*) &lv_get_ver_res, "i", "" },
- { "group_get_default", (void*) &lv_group_get_default, "lv.lv_group", "" },
- { "img_src_get_type", (void*) &lv_img_src_get_type, "i", "." },
- { "indev_get_act", (void*) &lv_indev_get_act, "lv.lv_indev", "" },
- { "indev_get_obj_act", (void*) &lv_indev_get_obj_act, "lv.lv_obj", "" },
- { "indev_read_timer_cb", (void*) &lv_indev_read_timer_cb, "", "(lv.lv_timer)" },
- { "layer_sys", (void*) &lv_layer_sys, "lv.lv_obj", "" },
- { "layer_top", (void*) &lv_layer_top, "lv.lv_obj", "" },
- { "layout_register", (void*) &lv_layout_register, "i", "^lv_layout_update_cb^." },
- { "obj_class_create_obj", (void*) &lv_obj_class_create_obj, "lv.lv_obj", "(lv._lv_obj_class)(lv.lv_obj)" },
- { "obj_del_anim_ready_cb", (void*) &lv_obj_del_anim_ready_cb, "", "(lv.lv_anim)" },
- { "obj_draw_dsc_init", (void*) &lv_obj_draw_dsc_init, "", "(lv.lv_obj_draw_part_dsc)(lv.lv_area)" },
- { "obj_enable_style_refresh", (void*) &lv_obj_enable_style_refresh, "", "b" },
- { "obj_event_base", (void*) &lv_obj_event_base, "i", "(lv.lv_obj_class)(lv.lv_event)" },
- { "obj_report_style_change", (void*) &lv_obj_report_style_change, "", "(lv.lv_style)" },
- { "obj_style_get_selector_part", (void*) &lv_obj_style_get_selector_part, "i", "i" },
- { "obj_style_get_selector_state", (void*) &lv_obj_style_get_selector_state, "i", "i" },
- { "refr_now", (void*) &lv_refr_now, "", "(lv.lv_disp)" },
- { "scr_act", (void*) &lv_scr_act, "lv.lv_obj", "" },
- { "scr_load", (void*) &lv_scr_load, "", "(lv.lv_obj)" },
- { "scr_load_anim", (void*) &lv_scr_load_anim, "", "(lv.lv_obj)iiib" },
- { "theme_apply", (void*) &lv_theme_apply, "", "(lv.lv_obj)" },
- { "theme_default_init", (void*) &lv_theme_default_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" },
- { "theme_default_is_inited", (void*) &lv_theme_default_is_inited, "b", "" },
- { "theme_get_color_primary", (void*) &lv_theme_get_color_primary, "lv.lv_color", "(lv.lv_obj)" },
- { "theme_get_color_secondary", (void*) &lv_theme_get_color_secondary, "lv.lv_color", "(lv.lv_obj)" },
- { "theme_get_font_large", (void*) &lv_theme_get_font_large, "lv.lv_font", "(lv.lv_obj)" },
- { "theme_get_font_normal", (void*) &lv_theme_get_font_normal, "lv.lv_font", "(lv.lv_obj)" },
- { "theme_get_font_small", (void*) &lv_theme_get_font_small, "lv.lv_font", "(lv.lv_obj)" },
- { "theme_get_from_obj", (void*) &lv_theme_get_from_obj, "lv.lv_theme", "(lv.lv_obj)" },
- { "theme_mono_init", (void*) &lv_theme_mono_init, "lv.lv_theme", "(lv.lv_disp)b(lv.lv_font)" },
- { "theme_openhasp_init", (void*) &lv_theme_openhasp_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" },
- { "theme_openhasp_is_inited", (void*) &lv_theme_openhasp_is_inited, "b", "" },
- { "theme_set_apply_cb", (void*) &lv_theme_set_apply_cb, "", "(lv.lv_theme)^lv_theme_apply_cb^" },
- { "theme_set_parent", (void*) &lv_theme_set_parent, "", "(lv.lv_theme)(lv.lv_theme)" },
-
-};
-const size_t lv_func_size = sizeof(lv_func) / sizeof(lv_func[0]);
-
-
-
-
-typedef struct be_constint_t {
- const char * name;
- int32_t value;
-} be_constint_t;
-
-const be_constint_t lv0_constants[] = {
-
- { "ALIGN_BOTTOM_LEFT", LV_ALIGN_BOTTOM_LEFT },
- { "ALIGN_BOTTOM_MID", LV_ALIGN_BOTTOM_MID },
- { "ALIGN_BOTTOM_RIGHT", LV_ALIGN_BOTTOM_RIGHT },
- { "ALIGN_CENTER", LV_ALIGN_CENTER },
- { "ALIGN_DEFAULT", LV_ALIGN_DEFAULT },
- { "ALIGN_LEFT_MID", LV_ALIGN_LEFT_MID },
- { "ALIGN_OUT_BOTTOM_LEFT", LV_ALIGN_OUT_BOTTOM_LEFT },
- { "ALIGN_OUT_BOTTOM_MID", LV_ALIGN_OUT_BOTTOM_MID },
- { "ALIGN_OUT_BOTTOM_RIGHT", LV_ALIGN_OUT_BOTTOM_RIGHT },
- { "ALIGN_OUT_LEFT_BOTTOM", LV_ALIGN_OUT_LEFT_BOTTOM },
- { "ALIGN_OUT_LEFT_MID", LV_ALIGN_OUT_LEFT_MID },
- { "ALIGN_OUT_LEFT_TOP", LV_ALIGN_OUT_LEFT_TOP },
- { "ALIGN_OUT_RIGHT_BOTTOM", LV_ALIGN_OUT_RIGHT_BOTTOM },
- { "ALIGN_OUT_RIGHT_MID", LV_ALIGN_OUT_RIGHT_MID },
- { "ALIGN_OUT_RIGHT_TOP", LV_ALIGN_OUT_RIGHT_TOP },
- { "ALIGN_OUT_TOP_LEFT", LV_ALIGN_OUT_TOP_LEFT },
- { "ALIGN_OUT_TOP_MID", LV_ALIGN_OUT_TOP_MID },
- { "ALIGN_OUT_TOP_RIGHT", LV_ALIGN_OUT_TOP_RIGHT },
- { "ALIGN_RIGHT_MID", LV_ALIGN_RIGHT_MID },
- { "ALIGN_TOP_LEFT", LV_ALIGN_TOP_LEFT },
- { "ALIGN_TOP_MID", LV_ALIGN_TOP_MID },
- { "ALIGN_TOP_RIGHT", LV_ALIGN_TOP_RIGHT },
- { "ANIM_IMG_PART_MAIN", LV_ANIM_IMG_PART_MAIN },
- { "ANIM_OFF", LV_ANIM_OFF },
- { "ANIM_ON", LV_ANIM_ON },
- { "ARC_MODE_NORMAL", LV_ARC_MODE_NORMAL },
- { "ARC_MODE_REVERSE", LV_ARC_MODE_REVERSE },
- { "ARC_MODE_SYMMETRICAL", LV_ARC_MODE_SYMMETRICAL },
- { "BAR_MODE_NORMAL", LV_BAR_MODE_NORMAL },
- { "BAR_MODE_RANGE", LV_BAR_MODE_RANGE },
- { "BAR_MODE_SYMMETRICAL", LV_BAR_MODE_SYMMETRICAL },
- { "BASE_DIR_AUTO", LV_BASE_DIR_AUTO },
- { "BASE_DIR_LTR", LV_BASE_DIR_LTR },
- { "BASE_DIR_NEUTRAL", LV_BASE_DIR_NEUTRAL },
- { "BASE_DIR_RTL", LV_BASE_DIR_RTL },
- { "BASE_DIR_WEAK", LV_BASE_DIR_WEAK },
- { "BLEND_MODE_ADDITIVE", LV_BLEND_MODE_ADDITIVE },
- { "BLEND_MODE_NORMAL", LV_BLEND_MODE_NORMAL },
- { "BLEND_MODE_SUBTRACTIVE", LV_BLEND_MODE_SUBTRACTIVE },
- { "BORDER_SIDE_BOTTOM", LV_BORDER_SIDE_BOTTOM },
- { "BORDER_SIDE_FULL", LV_BORDER_SIDE_FULL },
- { "BORDER_SIDE_INTERNAL", LV_BORDER_SIDE_INTERNAL },
- { "BORDER_SIDE_LEFT", LV_BORDER_SIDE_LEFT },
- { "BORDER_SIDE_NONE", LV_BORDER_SIDE_NONE },
- { "BORDER_SIDE_RIGHT", LV_BORDER_SIDE_RIGHT },
- { "BORDER_SIDE_TOP", LV_BORDER_SIDE_TOP },
- { "BTNMATRIX_CTRL_CHECKABLE", LV_BTNMATRIX_CTRL_CHECKABLE },
- { "BTNMATRIX_CTRL_CHECKED", LV_BTNMATRIX_CTRL_CHECKED },
- { "BTNMATRIX_CTRL_CLICK_TRIG", LV_BTNMATRIX_CTRL_CLICK_TRIG },
- { "BTNMATRIX_CTRL_CUSTOM_1", LV_BTNMATRIX_CTRL_CUSTOM_1 },
- { "BTNMATRIX_CTRL_CUSTOM_2", LV_BTNMATRIX_CTRL_CUSTOM_2 },
- { "BTNMATRIX_CTRL_DISABLED", LV_BTNMATRIX_CTRL_DISABLED },
- { "BTNMATRIX_CTRL_HIDDEN", LV_BTNMATRIX_CTRL_HIDDEN },
- { "BTNMATRIX_CTRL_NO_REPEAT", LV_BTNMATRIX_CTRL_NO_REPEAT },
- { "BTNMATRIX_CTRL_RECOLOR", LV_BTNMATRIX_CTRL_RECOLOR },
- { "CHART_AXIS_PRIMARY_X", LV_CHART_AXIS_PRIMARY_X },
- { "CHART_AXIS_PRIMARY_Y", LV_CHART_AXIS_PRIMARY_Y },
- { "CHART_AXIS_SECONDARY_X", LV_CHART_AXIS_SECONDARY_X },
- { "CHART_AXIS_SECONDARY_Y", LV_CHART_AXIS_SECONDARY_Y },
- { "CHART_TYPE_BAR", LV_CHART_TYPE_BAR },
- { "CHART_TYPE_LINE", LV_CHART_TYPE_LINE },
- { "CHART_TYPE_NONE", LV_CHART_TYPE_NONE },
- { "CHART_TYPE_SCATTER", LV_CHART_TYPE_SCATTER },
- { "CHART_UPDATE_MODE_CIRCULAR", LV_CHART_UPDATE_MODE_CIRCULAR },
- { "CHART_UPDATE_MODE_SHIFT", LV_CHART_UPDATE_MODE_SHIFT },
- { "COLORWHEEL_MODE_HUE", LV_COLORWHEEL_MODE_HUE },
- { "COLORWHEEL_MODE_SATURATION", LV_COLORWHEEL_MODE_SATURATION },
- { "COLORWHEEL_MODE_VALUE", LV_COLORWHEEL_MODE_VALUE },
- { "COLOR_AQUA", (int32_t) 0x00FFFF },
- { "COLOR_BLACK", (int32_t) 0x000000 },
- { "COLOR_BLUE", (int32_t) 0x0000FF },
- { "COLOR_CYAN", (int32_t) 0x00FFFF },
- { "COLOR_GRAY", (int32_t) 0x808080 },
- { "COLOR_GREEN", (int32_t) 0x008000 },
- { "COLOR_LIME", (int32_t) 0x00FF00 },
- { "COLOR_MAGENTA", (int32_t) 0xFF00FF },
- { "COLOR_MAROON", (int32_t) 0x800000 },
- { "COLOR_NAVY", (int32_t) 0x000080 },
- { "COLOR_OLIVE", (int32_t) 0x808000 },
- { "COLOR_PURPLE", (int32_t) 0x800080 },
- { "COLOR_RED", (int32_t) 0xFF0000 },
- { "COLOR_SILVER", (int32_t) 0xC0C0C0 },
- { "COLOR_TEAL", (int32_t) 0x008080 },
- { "COLOR_WHITE", (int32_t) 0xFFFFFF },
- { "COLOR_YELLOW", (int32_t) 0xFFFF00 },
- { "COVER_RES_COVER", LV_COVER_RES_COVER },
- { "COVER_RES_MASKED", LV_COVER_RES_MASKED },
- { "COVER_RES_NOT_COVER", LV_COVER_RES_NOT_COVER },
- { "DIR_ALL", LV_DIR_ALL },
- { "DIR_BOTTOM", LV_DIR_BOTTOM },
- { "DIR_HOR", LV_DIR_HOR },
- { "DIR_LEFT", LV_DIR_LEFT },
- { "DIR_NONE", LV_DIR_NONE },
- { "DIR_RIGHT", LV_DIR_RIGHT },
- { "DIR_TOP", LV_DIR_TOP },
- { "DIR_VER", LV_DIR_VER },
- { "DISP_ROT_180", LV_DISP_ROT_180 },
- { "DISP_ROT_270", LV_DISP_ROT_270 },
- { "DISP_ROT_90", LV_DISP_ROT_90 },
- { "DISP_ROT_NONE", LV_DISP_ROT_NONE },
- { "DRAW_MASK_LINE_SIDE_BOTTOM", LV_DRAW_MASK_LINE_SIDE_BOTTOM },
- { "DRAW_MASK_LINE_SIDE_LEFT", LV_DRAW_MASK_LINE_SIDE_LEFT },
- { "DRAW_MASK_LINE_SIDE_RIGHT", LV_DRAW_MASK_LINE_SIDE_RIGHT },
- { "DRAW_MASK_LINE_SIDE_TOP", LV_DRAW_MASK_LINE_SIDE_TOP },
- { "DRAW_MASK_RES_CHANGED", LV_DRAW_MASK_RES_CHANGED },
- { "DRAW_MASK_RES_FULL_COVER", LV_DRAW_MASK_RES_FULL_COVER },
- { "DRAW_MASK_RES_TRANSP", LV_DRAW_MASK_RES_TRANSP },
- { "DRAW_MASK_RES_UNKNOWN", LV_DRAW_MASK_RES_UNKNOWN },
- { "DRAW_MASK_TYPE_ANGLE", LV_DRAW_MASK_TYPE_ANGLE },
- { "DRAW_MASK_TYPE_FADE", LV_DRAW_MASK_TYPE_FADE },
- { "DRAW_MASK_TYPE_LINE", LV_DRAW_MASK_TYPE_LINE },
- { "DRAW_MASK_TYPE_MAP", LV_DRAW_MASK_TYPE_MAP },
- { "DRAW_MASK_TYPE_RADIUS", LV_DRAW_MASK_TYPE_RADIUS },
- { "EVENT_ALL", LV_EVENT_ALL },
- { "EVENT_CANCEL", LV_EVENT_CANCEL },
- { "EVENT_CHILD_CHANGED", LV_EVENT_CHILD_CHANGED },
- { "EVENT_CLICKED", LV_EVENT_CLICKED },
- { "EVENT_COVER_CHECK", LV_EVENT_COVER_CHECK },
- { "EVENT_DEFOCUSED", LV_EVENT_DEFOCUSED },
- { "EVENT_DELETE", LV_EVENT_DELETE },
- { "EVENT_DRAW_MAIN", LV_EVENT_DRAW_MAIN },
- { "EVENT_DRAW_MAIN_BEGIN", LV_EVENT_DRAW_MAIN_BEGIN },
- { "EVENT_DRAW_MAIN_END", LV_EVENT_DRAW_MAIN_END },
- { "EVENT_DRAW_PART_BEGIN", LV_EVENT_DRAW_PART_BEGIN },
- { "EVENT_DRAW_PART_END", LV_EVENT_DRAW_PART_END },
- { "EVENT_DRAW_POST", LV_EVENT_DRAW_POST },
- { "EVENT_DRAW_POST_BEGIN", LV_EVENT_DRAW_POST_BEGIN },
- { "EVENT_DRAW_POST_END", LV_EVENT_DRAW_POST_END },
- { "EVENT_FOCUSED", LV_EVENT_FOCUSED },
- { "EVENT_GESTURE", LV_EVENT_GESTURE },
- { "EVENT_GET_SELF_SIZE", LV_EVENT_GET_SELF_SIZE },
- { "EVENT_HIT_TEST", LV_EVENT_HIT_TEST },
- { "EVENT_INSERT", LV_EVENT_INSERT },
- { "EVENT_KEY", LV_EVENT_KEY },
- { "EVENT_LAYOUT_CHANGED", LV_EVENT_LAYOUT_CHANGED },
- { "EVENT_LEAVE", LV_EVENT_LEAVE },
- { "EVENT_LONG_PRESSED", LV_EVENT_LONG_PRESSED },
- { "EVENT_LONG_PRESSED_REPEAT", LV_EVENT_LONG_PRESSED_REPEAT },
- { "EVENT_PRESSED", LV_EVENT_PRESSED },
- { "EVENT_PRESSING", LV_EVENT_PRESSING },
- { "EVENT_PRESS_LOST", LV_EVENT_PRESS_LOST },
- { "EVENT_READY", LV_EVENT_READY },
- { "EVENT_REFRESH", LV_EVENT_REFRESH },
- { "EVENT_REFR_EXT_DRAW_SIZE", LV_EVENT_REFR_EXT_DRAW_SIZE },
- { "EVENT_RELEASED", LV_EVENT_RELEASED },
- { "EVENT_SCROLL", LV_EVENT_SCROLL },
- { "EVENT_SCROLL_BEGIN", LV_EVENT_SCROLL_BEGIN },
- { "EVENT_SCROLL_END", LV_EVENT_SCROLL_END },
- { "EVENT_SHORT_CLICKED", LV_EVENT_SHORT_CLICKED },
- { "EVENT_SIZE_CHANGED", LV_EVENT_SIZE_CHANGED },
- { "EVENT_STYLE_CHANGED", LV_EVENT_STYLE_CHANGED },
- { "EVENT_VALUE_CHANGED", LV_EVENT_VALUE_CHANGED },
- { "FLEX_ALIGN_CENTER", LV_FLEX_ALIGN_CENTER },
- { "FLEX_ALIGN_END", LV_FLEX_ALIGN_END },
- { "FLEX_ALIGN_SPACE_AROUND", LV_FLEX_ALIGN_SPACE_AROUND },
- { "FLEX_ALIGN_SPACE_BETWEEN", LV_FLEX_ALIGN_SPACE_BETWEEN },
- { "FLEX_ALIGN_SPACE_EVENLY", LV_FLEX_ALIGN_SPACE_EVENLY },
- { "FLEX_ALIGN_START", LV_FLEX_ALIGN_START },
- { "FLEX_FLOW_COLUMN", LV_FLEX_FLOW_COLUMN },
- { "FLEX_FLOW_COLUMN_REVERSE", LV_FLEX_FLOW_COLUMN_REVERSE },
- { "FLEX_FLOW_COLUMN_WRAP", LV_FLEX_FLOW_COLUMN_WRAP },
- { "FLEX_FLOW_COLUMN_WRAP_REVERSE", LV_FLEX_FLOW_COLUMN_WRAP_REVERSE },
- { "FLEX_FLOW_ROW", LV_FLEX_FLOW_ROW },
- { "FLEX_FLOW_ROW_REVERSE", LV_FLEX_FLOW_ROW_REVERSE },
- { "FLEX_FLOW_ROW_WRAP", LV_FLEX_FLOW_ROW_WRAP },
- { "FLEX_FLOW_ROW_WRAP_REVERSE", LV_FLEX_FLOW_ROW_WRAP_REVERSE },
- { "FS_MODE_RD", LV_FS_MODE_RD },
- { "FS_MODE_WR", LV_FS_MODE_WR },
- { "FS_RES_BUSY", LV_FS_RES_BUSY },
- { "FS_RES_DENIED", LV_FS_RES_DENIED },
- { "FS_RES_FS_ERR", LV_FS_RES_FS_ERR },
- { "FS_RES_FULL", LV_FS_RES_FULL },
- { "FS_RES_HW_ERR", LV_FS_RES_HW_ERR },
- { "FS_RES_INV_PARAM", LV_FS_RES_INV_PARAM },
- { "FS_RES_LOCKED", LV_FS_RES_LOCKED },
- { "FS_RES_NOT_EX", LV_FS_RES_NOT_EX },
- { "FS_RES_NOT_IMP", LV_FS_RES_NOT_IMP },
- { "FS_RES_OK", LV_FS_RES_OK },
- { "FS_RES_OUT_OF_MEM", LV_FS_RES_OUT_OF_MEM },
- { "FS_RES_TOUT", LV_FS_RES_TOUT },
- { "FS_RES_UNKNOWN", LV_FS_RES_UNKNOWN },
- { "FS_SEEK_CUR", LV_FS_SEEK_CUR },
- { "FS_SEEK_END", LV_FS_SEEK_END },
- { "FS_SEEK_SET", LV_FS_SEEK_SET },
- { "GRAD_DIR_HOR", LV_GRAD_DIR_HOR },
- { "GRAD_DIR_NONE", LV_GRAD_DIR_NONE },
- { "GRAD_DIR_VER", LV_GRAD_DIR_VER },
- { "GRID_ALIGN_CENTER", LV_GRID_ALIGN_CENTER },
- { "GRID_ALIGN_END", LV_GRID_ALIGN_END },
- { "GRID_ALIGN_SPACE_AROUND", LV_GRID_ALIGN_SPACE_AROUND },
- { "GRID_ALIGN_SPACE_BETWEEN", LV_GRID_ALIGN_SPACE_BETWEEN },
- { "GRID_ALIGN_SPACE_EVENLY", LV_GRID_ALIGN_SPACE_EVENLY },
- { "GRID_ALIGN_START", LV_GRID_ALIGN_START },
- { "GRID_ALIGN_STRETCH", LV_GRID_ALIGN_STRETCH },
- { "GROUP_REFOCUS_POLICY_NEXT", LV_GROUP_REFOCUS_POLICY_NEXT },
- { "GROUP_REFOCUS_POLICY_PREV", LV_GROUP_REFOCUS_POLICY_PREV },
- { "IMGBTN_STATE_CHECKED_DISABLED", LV_IMGBTN_STATE_CHECKED_DISABLED },
- { "IMGBTN_STATE_CHECKED_PRESSED", LV_IMGBTN_STATE_CHECKED_PRESSED },
- { "IMGBTN_STATE_CHECKED_RELEASED", LV_IMGBTN_STATE_CHECKED_RELEASED },
- { "IMGBTN_STATE_DISABLED", LV_IMGBTN_STATE_DISABLED },
- { "IMGBTN_STATE_PRESSED", LV_IMGBTN_STATE_PRESSED },
- { "IMGBTN_STATE_RELEASED", LV_IMGBTN_STATE_RELEASED },
- { "IMG_CF_ALPHA_1BIT", LV_IMG_CF_ALPHA_1BIT },
- { "IMG_CF_ALPHA_2BIT", LV_IMG_CF_ALPHA_2BIT },
- { "IMG_CF_ALPHA_4BIT", LV_IMG_CF_ALPHA_4BIT },
- { "IMG_CF_ALPHA_8BIT", LV_IMG_CF_ALPHA_8BIT },
- { "IMG_CF_INDEXED_1BIT", LV_IMG_CF_INDEXED_1BIT },
- { "IMG_CF_INDEXED_2BIT", LV_IMG_CF_INDEXED_2BIT },
- { "IMG_CF_INDEXED_4BIT", LV_IMG_CF_INDEXED_4BIT },
- { "IMG_CF_INDEXED_8BIT", LV_IMG_CF_INDEXED_8BIT },
- { "IMG_CF_RAW", LV_IMG_CF_RAW },
- { "IMG_CF_RAW_ALPHA", LV_IMG_CF_RAW_ALPHA },
- { "IMG_CF_RAW_CHROMA_KEYED", LV_IMG_CF_RAW_CHROMA_KEYED },
- { "IMG_CF_TRUE_COLOR", LV_IMG_CF_TRUE_COLOR },
- { "IMG_CF_TRUE_COLOR_ALPHA", LV_IMG_CF_TRUE_COLOR_ALPHA },
- { "IMG_CF_TRUE_COLOR_CHROMA_KEYED", LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED },
- { "IMG_CF_UNKNOWN", LV_IMG_CF_UNKNOWN },
- { "IMG_SRC_FILE", LV_IMG_SRC_FILE },
- { "IMG_SRC_SYMBOL", LV_IMG_SRC_SYMBOL },
- { "IMG_SRC_UNKNOWN", LV_IMG_SRC_UNKNOWN },
- { "IMG_SRC_VARIABLE", LV_IMG_SRC_VARIABLE },
- { "INDEV_STATE_PRESSED", LV_INDEV_STATE_PRESSED },
- { "INDEV_STATE_RELEASED", LV_INDEV_STATE_RELEASED },
- { "INDEV_TYPE_BUTTON", LV_INDEV_TYPE_BUTTON },
- { "INDEV_TYPE_ENCODER", LV_INDEV_TYPE_ENCODER },
- { "INDEV_TYPE_KEYPAD", LV_INDEV_TYPE_KEYPAD },
- { "INDEV_TYPE_NONE", LV_INDEV_TYPE_NONE },
- { "INDEV_TYPE_POINTER", LV_INDEV_TYPE_POINTER },
- { "KEY_BACKSPACE", LV_KEY_BACKSPACE },
- { "KEY_DEL", LV_KEY_DEL },
- { "KEY_DOWN", LV_KEY_DOWN },
- { "KEY_END", LV_KEY_END },
- { "KEY_ENTER", LV_KEY_ENTER },
- { "KEY_ESC", LV_KEY_ESC },
- { "KEY_HOME", LV_KEY_HOME },
- { "KEY_LEFT", LV_KEY_LEFT },
- { "KEY_NEXT", LV_KEY_NEXT },
- { "KEY_PREV", LV_KEY_PREV },
- { "KEY_RIGHT", LV_KEY_RIGHT },
- { "KEY_UP", LV_KEY_UP },
- { "LABEL_LONG_CLIP", LV_LABEL_LONG_CLIP },
- { "LABEL_LONG_DOT", LV_LABEL_LONG_DOT },
- { "LABEL_LONG_SCROLL", LV_LABEL_LONG_SCROLL },
- { "LABEL_LONG_SCROLL_CIRCULAR", LV_LABEL_LONG_SCROLL_CIRCULAR },
- { "LABEL_LONG_WRAP", LV_LABEL_LONG_WRAP },
- { "METER_INDICATOR_TYPE_ARC", LV_METER_INDICATOR_TYPE_ARC },
- { "METER_INDICATOR_TYPE_NEEDLE_IMG", LV_METER_INDICATOR_TYPE_NEEDLE_IMG },
- { "METER_INDICATOR_TYPE_NEEDLE_LINE", LV_METER_INDICATOR_TYPE_NEEDLE_LINE },
- { "METER_INDICATOR_TYPE_SCALE_LINES", LV_METER_INDICATOR_TYPE_SCALE_LINES },
- { "OBJ_CLASS_EDITABLE_FALSE", LV_OBJ_CLASS_EDITABLE_FALSE },
- { "OBJ_CLASS_EDITABLE_INHERIT", LV_OBJ_CLASS_EDITABLE_INHERIT },
- { "OBJ_CLASS_EDITABLE_TRUE", LV_OBJ_CLASS_EDITABLE_TRUE },
- { "OBJ_CLASS_GROUP_DEF_FALSE", LV_OBJ_CLASS_GROUP_DEF_FALSE },
- { "OBJ_CLASS_GROUP_DEF_INHERIT", LV_OBJ_CLASS_GROUP_DEF_INHERIT },
- { "OBJ_CLASS_GROUP_DEF_TRUE", LV_OBJ_CLASS_GROUP_DEF_TRUE },
- { "OBJ_FLAG_ADV_HITTEST", LV_OBJ_FLAG_ADV_HITTEST },
- { "OBJ_FLAG_CHECKABLE", LV_OBJ_FLAG_CHECKABLE },
- { "OBJ_FLAG_CLICKABLE", LV_OBJ_FLAG_CLICKABLE },
- { "OBJ_FLAG_CLICK_FOCUSABLE", LV_OBJ_FLAG_CLICK_FOCUSABLE },
- { "OBJ_FLAG_EVENT_BUBBLE", LV_OBJ_FLAG_EVENT_BUBBLE },
- { "OBJ_FLAG_FLOATING", LV_OBJ_FLAG_FLOATING },
- { "OBJ_FLAG_GESTURE_BUBBLE", LV_OBJ_FLAG_GESTURE_BUBBLE },
- { "OBJ_FLAG_HIDDEN", LV_OBJ_FLAG_HIDDEN },
- { "OBJ_FLAG_IGNORE_LAYOUT", LV_OBJ_FLAG_IGNORE_LAYOUT },
- { "OBJ_FLAG_LAYOUT_1", LV_OBJ_FLAG_LAYOUT_1 },
- { "OBJ_FLAG_LAYOUT_2", LV_OBJ_FLAG_LAYOUT_2 },
- { "OBJ_FLAG_PRESS_LOCK", LV_OBJ_FLAG_PRESS_LOCK },
- { "OBJ_FLAG_SCROLLABLE", LV_OBJ_FLAG_SCROLLABLE },
- { "OBJ_FLAG_SCROLL_CHAIN", LV_OBJ_FLAG_SCROLL_CHAIN },
- { "OBJ_FLAG_SCROLL_ELASTIC", LV_OBJ_FLAG_SCROLL_ELASTIC },
- { "OBJ_FLAG_SCROLL_MOMENTUM", LV_OBJ_FLAG_SCROLL_MOMENTUM },
- { "OBJ_FLAG_SCROLL_ONE", LV_OBJ_FLAG_SCROLL_ONE },
- { "OBJ_FLAG_SCROLL_ON_FOCUS", LV_OBJ_FLAG_SCROLL_ON_FOCUS },
- { "OBJ_FLAG_SNAPABLE", LV_OBJ_FLAG_SNAPABLE },
- { "OBJ_FLAG_USER_1", LV_OBJ_FLAG_USER_1 },
- { "OBJ_FLAG_USER_2", LV_OBJ_FLAG_USER_2 },
- { "OBJ_FLAG_USER_3", LV_OBJ_FLAG_USER_3 },
- { "OBJ_FLAG_USER_4", LV_OBJ_FLAG_USER_4 },
- { "OBJ_FLAG_WIDGET_1", LV_OBJ_FLAG_WIDGET_1 },
- { "OBJ_FLAG_WIDGET_2", LV_OBJ_FLAG_WIDGET_2 },
- { "OBJ_TREE_WALK_END", LV_OBJ_TREE_WALK_END },
- { "OBJ_TREE_WALK_NEXT", LV_OBJ_TREE_WALK_NEXT },
- { "OBJ_TREE_WALK_SKIP_CHILDREN", LV_OBJ_TREE_WALK_SKIP_CHILDREN },
- { "OPA_0", LV_OPA_0 },
- { "OPA_10", LV_OPA_10 },
- { "OPA_100", LV_OPA_100 },
- { "OPA_20", LV_OPA_20 },
- { "OPA_30", LV_OPA_30 },
- { "OPA_40", LV_OPA_40 },
- { "OPA_50", LV_OPA_50 },
- { "OPA_60", LV_OPA_60 },
- { "OPA_70", LV_OPA_70 },
- { "OPA_80", LV_OPA_80 },
- { "OPA_90", LV_OPA_90 },
- { "OPA_COVER", LV_OPA_COVER },
- { "OPA_TRANSP", LV_OPA_TRANSP },
- { "PALETTE_AMBER", LV_PALETTE_AMBER },
- { "PALETTE_BLUE", LV_PALETTE_BLUE },
- { "PALETTE_BLUE_GREY", LV_PALETTE_BLUE_GREY },
- { "PALETTE_BROWN", LV_PALETTE_BROWN },
- { "PALETTE_CYAN", LV_PALETTE_CYAN },
- { "PALETTE_DEEP_ORANGE", LV_PALETTE_DEEP_ORANGE },
- { "PALETTE_DEEP_PURPLE", LV_PALETTE_DEEP_PURPLE },
- { "PALETTE_GREEN", LV_PALETTE_GREEN },
- { "PALETTE_GREY", LV_PALETTE_GREY },
- { "PALETTE_INDIGO", LV_PALETTE_INDIGO },
- { "PALETTE_LIGHT_BLUE", LV_PALETTE_LIGHT_BLUE },
- { "PALETTE_LIGHT_GREEN", LV_PALETTE_LIGHT_GREEN },
- { "PALETTE_LIME", LV_PALETTE_LIME },
- { "PALETTE_NONE", LV_PALETTE_NONE },
- { "PALETTE_ORANGE", LV_PALETTE_ORANGE },
- { "PALETTE_PINK", LV_PALETTE_PINK },
- { "PALETTE_PURPLE", LV_PALETTE_PURPLE },
- { "PALETTE_RED", LV_PALETTE_RED },
- { "PALETTE_TEAL", LV_PALETTE_TEAL },
- { "PALETTE_YELLOW", LV_PALETTE_YELLOW },
- { "PART_ANY", LV_PART_ANY },
- { "PART_CURSOR", LV_PART_CURSOR },
- { "PART_CUSTOM_FIRST", LV_PART_CUSTOM_FIRST },
- { "PART_INDICATOR", LV_PART_INDICATOR },
- { "PART_ITEMS", LV_PART_ITEMS },
- { "PART_KNOB", LV_PART_KNOB },
- { "PART_MAIN", LV_PART_MAIN },
- { "PART_SCROLLBAR", LV_PART_SCROLLBAR },
- { "PART_SELECTED", LV_PART_SELECTED },
- { "PART_TEXTAREA_PLACEHOLDER", LV_PART_TEXTAREA_PLACEHOLDER },
- { "PART_TICKS", LV_PART_TICKS },
- { "RADIUS_CIRCLE", LV_RADIUS_CIRCLE },
- { "RES_INV", LV_RES_INV },
- { "RES_OK", LV_RES_OK },
- { "ROLLER_MODE_INFINITE", LV_ROLLER_MODE_INFINITE },
- { "ROLLER_MODE_NORMAL", LV_ROLLER_MODE_NORMAL },
- { "SCROLLBAR_MODE_ACTIVE", LV_SCROLLBAR_MODE_ACTIVE },
- { "SCROLLBAR_MODE_AUTO", LV_SCROLLBAR_MODE_AUTO },
- { "SCROLLBAR_MODE_OFF", LV_SCROLLBAR_MODE_OFF },
- { "SCROLLBAR_MODE_ON", LV_SCROLLBAR_MODE_ON },
- { "SCROLL_SNAP_CENTER", LV_SCROLL_SNAP_CENTER },
- { "SCROLL_SNAP_END", LV_SCROLL_SNAP_END },
- { "SCROLL_SNAP_NONE", LV_SCROLL_SNAP_NONE },
- { "SCROLL_SNAP_START", LV_SCROLL_SNAP_START },
- { "SCR_LOAD_ANIM_FADE_ON", LV_SCR_LOAD_ANIM_FADE_ON },
- { "SCR_LOAD_ANIM_MOVE_BOTTOM", LV_SCR_LOAD_ANIM_MOVE_BOTTOM },
- { "SCR_LOAD_ANIM_MOVE_LEFT", LV_SCR_LOAD_ANIM_MOVE_LEFT },
- { "SCR_LOAD_ANIM_MOVE_RIGHT", LV_SCR_LOAD_ANIM_MOVE_RIGHT },
- { "SCR_LOAD_ANIM_MOVE_TOP", LV_SCR_LOAD_ANIM_MOVE_TOP },
- { "SCR_LOAD_ANIM_NONE", LV_SCR_LOAD_ANIM_NONE },
- { "SCR_LOAD_ANIM_OVER_BOTTOM", LV_SCR_LOAD_ANIM_OVER_BOTTOM },
- { "SCR_LOAD_ANIM_OVER_LEFT", LV_SCR_LOAD_ANIM_OVER_LEFT },
- { "SCR_LOAD_ANIM_OVER_RIGHT", LV_SCR_LOAD_ANIM_OVER_RIGHT },
- { "SCR_LOAD_ANIM_OVER_TOP", LV_SCR_LOAD_ANIM_OVER_TOP },
- { "SIZE_CONTENT", LV_SIZE_CONTENT },
- { "SLIDER_MODE_NORMAL", LV_SLIDER_MODE_NORMAL },
- { "SLIDER_MODE_RANGE", LV_SLIDER_MODE_RANGE },
- { "SLIDER_MODE_SYMMETRICAL", LV_SLIDER_MODE_SYMMETRICAL },
- { "SPAN_MODE_BREAK", LV_SPAN_MODE_BREAK },
- { "SPAN_MODE_EXPAND", LV_SPAN_MODE_EXPAND },
- { "SPAN_MODE_FIXED", LV_SPAN_MODE_FIXED },
- { "SPAN_OVERFLOW_CLIP", LV_SPAN_OVERFLOW_CLIP },
- { "SPAN_OVERFLOW_ELLIPSIS", LV_SPAN_OVERFLOW_ELLIPSIS },
- { "STATE_ANY", LV_STATE_ANY },
- { "STATE_CHECKED", LV_STATE_CHECKED },
- { "STATE_DEFAULT", LV_STATE_DEFAULT },
- { "STATE_DISABLED", LV_STATE_DISABLED },
- { "STATE_EDITED", LV_STATE_EDITED },
- { "STATE_FOCUSED", LV_STATE_FOCUSED },
- { "STATE_FOCUS_KEY", LV_STATE_FOCUS_KEY },
- { "STATE_HOVERED", LV_STATE_HOVERED },
- { "STATE_PRESSED", LV_STATE_PRESSED },
- { "STATE_SCROLLED", LV_STATE_SCROLLED },
- { "STATE_USER_1", LV_STATE_USER_1 },
- { "STATE_USER_2", LV_STATE_USER_2 },
- { "STATE_USER_3", LV_STATE_USER_3 },
- { "STATE_USER_4", LV_STATE_USER_4 },
- { "STYLE_ALIGN", LV_STYLE_ALIGN },
- { "STYLE_ANIM_SPEED", LV_STYLE_ANIM_SPEED },
- { "STYLE_ANIM_TIME", LV_STYLE_ANIM_TIME },
- { "STYLE_ARC_COLOR", LV_STYLE_ARC_COLOR },
- { "STYLE_ARC_COLOR_FILTERED", LV_STYLE_ARC_COLOR_FILTERED },
- { "STYLE_ARC_IMG_SRC", LV_STYLE_ARC_IMG_SRC },
- { "STYLE_ARC_OPA", LV_STYLE_ARC_OPA },
- { "STYLE_ARC_ROUNDED", LV_STYLE_ARC_ROUNDED },
- { "STYLE_ARC_WIDTH", LV_STYLE_ARC_WIDTH },
- { "STYLE_BASE_DIR", LV_STYLE_BASE_DIR },
- { "STYLE_BG_COLOR", LV_STYLE_BG_COLOR },
- { "STYLE_BG_COLOR_FILTERED", LV_STYLE_BG_COLOR_FILTERED },
- { "STYLE_BG_GRAD_COLOR", LV_STYLE_BG_GRAD_COLOR },
- { "STYLE_BG_GRAD_COLOR_FILTERED", LV_STYLE_BG_GRAD_COLOR_FILTERED },
- { "STYLE_BG_GRAD_DIR", LV_STYLE_BG_GRAD_DIR },
- { "STYLE_BG_GRAD_STOP", LV_STYLE_BG_GRAD_STOP },
- { "STYLE_BG_IMG_OPA", LV_STYLE_BG_IMG_OPA },
- { "STYLE_BG_IMG_RECOLOR", LV_STYLE_BG_IMG_RECOLOR },
- { "STYLE_BG_IMG_RECOLOR_FILTERED", LV_STYLE_BG_IMG_RECOLOR_FILTERED },
- { "STYLE_BG_IMG_RECOLOR_OPA", LV_STYLE_BG_IMG_RECOLOR_OPA },
- { "STYLE_BG_IMG_SRC", LV_STYLE_BG_IMG_SRC },
- { "STYLE_BG_IMG_TILED", LV_STYLE_BG_IMG_TILED },
- { "STYLE_BG_MAIN_STOP", LV_STYLE_BG_MAIN_STOP },
- { "STYLE_BG_OPA", LV_STYLE_BG_OPA },
- { "STYLE_BLEND_MODE", LV_STYLE_BLEND_MODE },
- { "STYLE_BORDER_COLOR", LV_STYLE_BORDER_COLOR },
- { "STYLE_BORDER_COLOR_FILTERED", LV_STYLE_BORDER_COLOR_FILTERED },
- { "STYLE_BORDER_OPA", LV_STYLE_BORDER_OPA },
- { "STYLE_BORDER_POST", LV_STYLE_BORDER_POST },
- { "STYLE_BORDER_SIDE", LV_STYLE_BORDER_SIDE },
- { "STYLE_BORDER_WIDTH", LV_STYLE_BORDER_WIDTH },
- { "STYLE_CLIP_CORNER", LV_STYLE_CLIP_CORNER },
- { "STYLE_COLOR_FILTER_DSC", LV_STYLE_COLOR_FILTER_DSC },
- { "STYLE_COLOR_FILTER_OPA", LV_STYLE_COLOR_FILTER_OPA },
- { "STYLE_HEIGHT", LV_STYLE_HEIGHT },
- { "STYLE_IMG_OPA", LV_STYLE_IMG_OPA },
- { "STYLE_IMG_RECOLOR", LV_STYLE_IMG_RECOLOR },
- { "STYLE_IMG_RECOLOR_FILTERED", LV_STYLE_IMG_RECOLOR_FILTERED },
- { "STYLE_IMG_RECOLOR_OPA", LV_STYLE_IMG_RECOLOR_OPA },
- { "STYLE_LAYOUT", LV_STYLE_LAYOUT },
- { "STYLE_LINE_COLOR", LV_STYLE_LINE_COLOR },
- { "STYLE_LINE_COLOR_FILTERED", LV_STYLE_LINE_COLOR_FILTERED },
- { "STYLE_LINE_DASH_GAP", LV_STYLE_LINE_DASH_GAP },
- { "STYLE_LINE_DASH_WIDTH", LV_STYLE_LINE_DASH_WIDTH },
- { "STYLE_LINE_OPA", LV_STYLE_LINE_OPA },
- { "STYLE_LINE_ROUNDED", LV_STYLE_LINE_ROUNDED },
- { "STYLE_LINE_WIDTH", LV_STYLE_LINE_WIDTH },
- { "STYLE_MAX_HEIGHT", LV_STYLE_MAX_HEIGHT },
- { "STYLE_MAX_WIDTH", LV_STYLE_MAX_WIDTH },
- { "STYLE_MIN_HEIGHT", LV_STYLE_MIN_HEIGHT },
- { "STYLE_MIN_WIDTH", LV_STYLE_MIN_WIDTH },
- { "STYLE_OPA", LV_STYLE_OPA },
- { "STYLE_OUTLINE_COLOR", LV_STYLE_OUTLINE_COLOR },
- { "STYLE_OUTLINE_COLOR_FILTERED", LV_STYLE_OUTLINE_COLOR_FILTERED },
- { "STYLE_OUTLINE_OPA", LV_STYLE_OUTLINE_OPA },
- { "STYLE_OUTLINE_PAD", LV_STYLE_OUTLINE_PAD },
- { "STYLE_OUTLINE_WIDTH", LV_STYLE_OUTLINE_WIDTH },
- { "STYLE_PAD_BOTTOM", LV_STYLE_PAD_BOTTOM },
- { "STYLE_PAD_COLUMN", LV_STYLE_PAD_COLUMN },
- { "STYLE_PAD_LEFT", LV_STYLE_PAD_LEFT },
- { "STYLE_PAD_RIGHT", LV_STYLE_PAD_RIGHT },
- { "STYLE_PAD_ROW", LV_STYLE_PAD_ROW },
- { "STYLE_PAD_TOP", LV_STYLE_PAD_TOP },
- { "STYLE_PROP_ANY", LV_STYLE_PROP_ANY },
- { "STYLE_PROP_INV", LV_STYLE_PROP_INV },
- { "STYLE_RADIUS", LV_STYLE_RADIUS },
- { "STYLE_SHADOW_COLOR", LV_STYLE_SHADOW_COLOR },
- { "STYLE_SHADOW_COLOR_FILTERED", LV_STYLE_SHADOW_COLOR_FILTERED },
- { "STYLE_SHADOW_OFS_X", LV_STYLE_SHADOW_OFS_X },
- { "STYLE_SHADOW_OFS_Y", LV_STYLE_SHADOW_OFS_Y },
- { "STYLE_SHADOW_OPA", LV_STYLE_SHADOW_OPA },
- { "STYLE_SHADOW_SPREAD", LV_STYLE_SHADOW_SPREAD },
- { "STYLE_SHADOW_WIDTH", LV_STYLE_SHADOW_WIDTH },
- { "STYLE_TEXT_ALIGN", LV_STYLE_TEXT_ALIGN },
- { "STYLE_TEXT_COLOR", LV_STYLE_TEXT_COLOR },
- { "STYLE_TEXT_COLOR_FILTERED", LV_STYLE_TEXT_COLOR_FILTERED },
- { "STYLE_TEXT_DECOR", LV_STYLE_TEXT_DECOR },
- { "STYLE_TEXT_FONT", LV_STYLE_TEXT_FONT },
- { "STYLE_TEXT_LETTER_SPACE", LV_STYLE_TEXT_LETTER_SPACE },
- { "STYLE_TEXT_LINE_SPACE", LV_STYLE_TEXT_LINE_SPACE },
- { "STYLE_TEXT_OPA", LV_STYLE_TEXT_OPA },
- { "STYLE_TRANSFORM_ANGLE", LV_STYLE_TRANSFORM_ANGLE },
- { "STYLE_TRANSFORM_HEIGHT", LV_STYLE_TRANSFORM_HEIGHT },
- { "STYLE_TRANSFORM_WIDTH", LV_STYLE_TRANSFORM_WIDTH },
- { "STYLE_TRANSFORM_ZOOM", LV_STYLE_TRANSFORM_ZOOM },
- { "STYLE_TRANSITION", LV_STYLE_TRANSITION },
- { "STYLE_TRANSLATE_X", LV_STYLE_TRANSLATE_X },
- { "STYLE_TRANSLATE_Y", LV_STYLE_TRANSLATE_Y },
- { "STYLE_WIDTH", LV_STYLE_WIDTH },
- { "STYLE_X", LV_STYLE_X },
- { "STYLE_Y", LV_STYLE_Y },
- { "$SYMBOL_AUDIO", (int32_t) "\xef\x80\x81" },
- { "$SYMBOL_BACKSPACE", (int32_t) "\xef\x95\x9A" },
- { "$SYMBOL_BATTERY_1", (int32_t) "\xef\x89\x83" },
- { "$SYMBOL_BATTERY_2", (int32_t) "\xef\x89\x82" },
- { "$SYMBOL_BATTERY_3", (int32_t) "\xef\x89\x81" },
- { "$SYMBOL_BATTERY_EMPTY", (int32_t) "\xef\x89\x84" },
- { "$SYMBOL_BATTERY_FULL", (int32_t) "\xef\x89\x80" },
- { "$SYMBOL_BELL", (int32_t) "\xef\x83\xb3" },
- { "$SYMBOL_BLUETOOTH", (int32_t) "\xef\x8a\x93" },
- { "$SYMBOL_BULLET", (int32_t) "\xE2\x80\xA2" },
- { "$SYMBOL_CALL", (int32_t) "\xef\x82\x95" },
- { "$SYMBOL_CHARGE", (int32_t) "\xef\x83\xa7" },
- { "$SYMBOL_CLOSE", (int32_t) "\xef\x80\x8d" },
- { "$SYMBOL_COPY", (int32_t) "\xef\x83\x85" },
- { "$SYMBOL_CUT", (int32_t) "\xef\x83\x84" },
- { "$SYMBOL_DIRECTORY", (int32_t) "\xef\x81\xbb" },
- { "$SYMBOL_DOWN", (int32_t) "\xef\x81\xb8" },
- { "$SYMBOL_DOWNLOAD", (int32_t) "\xef\x80\x99" },
- { "$SYMBOL_DRIVE", (int32_t) "\xef\x80\x9c" },
- { "$SYMBOL_DUMMY", (int32_t) "\xEF\xA3\xBF" },
- { "$SYMBOL_EDIT", (int32_t) "\xef\x8C\x84" },
- { "$SYMBOL_EJECT", (int32_t) "\xef\x81\x92" },
- { "$SYMBOL_EYE_CLOSE", (int32_t) "\xef\x81\xb0" },
- { "$SYMBOL_EYE_OPEN", (int32_t) "\xef\x81\xae" },
- { "$SYMBOL_FILE", (int32_t) "\xef\x85\x9b" },
- { "$SYMBOL_GPS", (int32_t) "\xef\x84\xa4" },
- { "$SYMBOL_HOME", (int32_t) "\xef\x80\x95" },
- { "$SYMBOL_IMAGE", (int32_t) "\xef\x80\xbe" },
- { "$SYMBOL_KEYBOARD", (int32_t) "\xef\x84\x9c" },
- { "$SYMBOL_LEFT", (int32_t) "\xef\x81\x93" },
- { "$SYMBOL_LIST", (int32_t) "\xef\x80\x8b" },
- { "$SYMBOL_LOOP", (int32_t) "\xef\x81\xb9" },
- { "$SYMBOL_MINUS", (int32_t) "\xef\x81\xa8" },
- { "$SYMBOL_MUTE", (int32_t) "\xef\x80\xa6" },
- { "$SYMBOL_NEW_LINE", (int32_t) "\xef\xA2\xA2" },
- { "$SYMBOL_NEXT", (int32_t) "\xef\x81\x91" },
- { "$SYMBOL_OK", (int32_t) "\xef\x80\x8c" },
- { "$SYMBOL_PASTE", (int32_t) "\xef\x83\xAA" },
- { "$SYMBOL_PAUSE", (int32_t) "\xef\x81\x8c" },
- { "$SYMBOL_PLAY", (int32_t) "\xef\x81\x8b" },
- { "$SYMBOL_PLUS", (int32_t) "\xef\x81\xa7" },
- { "$SYMBOL_POWER", (int32_t) "\xef\x80\x91" },
- { "$SYMBOL_PREV", (int32_t) "\xef\x81\x88" },
- { "$SYMBOL_REFRESH", (int32_t) "\xef\x80\xa1" },
- { "$SYMBOL_RIGHT", (int32_t) "\xef\x81\x94" },
- { "$SYMBOL_SAVE", (int32_t) "\xef\x83\x87" },
- { "$SYMBOL_SD_CARD", (int32_t) "\xef\x9F\x82" },
- { "$SYMBOL_SETTINGS", (int32_t) "\xef\x80\x93" },
- { "$SYMBOL_SHUFFLE", (int32_t) "\xef\x81\xb4" },
- { "$SYMBOL_STOP", (int32_t) "\xef\x81\x8d" },
- { "$SYMBOL_TRASH", (int32_t) "\xef\x8B\xAD" },
- { "$SYMBOL_UP", (int32_t) "\xef\x81\xb7" },
- { "$SYMBOL_UPLOAD", (int32_t) "\xef\x82\x93" },
- { "$SYMBOL_USB", (int32_t) "\xef\x8a\x87" },
- { "$SYMBOL_VIDEO", (int32_t) "\xef\x80\x88" },
- { "$SYMBOL_VOLUME_MAX", (int32_t) "\xef\x80\xa8" },
- { "$SYMBOL_VOLUME_MID", (int32_t) "\xef\x80\xa7" },
- { "$SYMBOL_WARNING", (int32_t) "\xef\x81\xb1" },
- { "$SYMBOL_WIFI", (int32_t) "\xef\x87\xab" },
- { "TABLE_CELL_CTRL_CUSTOM_1", LV_TABLE_CELL_CTRL_CUSTOM_1 },
- { "TABLE_CELL_CTRL_CUSTOM_2", LV_TABLE_CELL_CTRL_CUSTOM_2 },
- { "TABLE_CELL_CTRL_CUSTOM_3", LV_TABLE_CELL_CTRL_CUSTOM_3 },
- { "TABLE_CELL_CTRL_CUSTOM_4", LV_TABLE_CELL_CTRL_CUSTOM_4 },
- { "TABLE_CELL_CTRL_MERGE_RIGHT", LV_TABLE_CELL_CTRL_MERGE_RIGHT },
- { "TABLE_CELL_CTRL_TEXT_CROP", LV_TABLE_CELL_CTRL_TEXT_CROP },
- { "TEXTAREA_CURSOR_LAST", LV_TEXTAREA_CURSOR_LAST },
- { "TEXT_ALIGN_AUTO", LV_TEXT_ALIGN_AUTO },
- { "TEXT_ALIGN_CENTER", LV_TEXT_ALIGN_CENTER },
- { "TEXT_ALIGN_LEFT", LV_TEXT_ALIGN_LEFT },
- { "TEXT_ALIGN_RIGHT", LV_TEXT_ALIGN_RIGHT },
- { "TEXT_CMD_STATE_IN", LV_TEXT_CMD_STATE_IN },
- { "TEXT_CMD_STATE_PAR", LV_TEXT_CMD_STATE_PAR },
- { "TEXT_CMD_STATE_WAIT", LV_TEXT_CMD_STATE_WAIT },
- { "TEXT_DECOR_NONE", LV_TEXT_DECOR_NONE },
- { "TEXT_DECOR_STRIKETHROUGH", LV_TEXT_DECOR_STRIKETHROUGH },
- { "TEXT_DECOR_UNDERLINE", LV_TEXT_DECOR_UNDERLINE },
- { "TEXT_FLAG_EXPAND", LV_TEXT_FLAG_EXPAND },
- { "TEXT_FLAG_FIT", LV_TEXT_FLAG_FIT },
- { "TEXT_FLAG_NONE", LV_TEXT_FLAG_NONE },
- { "TEXT_FLAG_RECOLOR", LV_TEXT_FLAG_RECOLOR },
- { "&font_montserrat", (int32_t) &lv0_load_montserrat_font },
- { "&font_robotocondensed_latin1", (int32_t) &lv0_load_robotocondensed_latin1_font },
- { "&font_seg7", (int32_t) &lv0_load_seg7_font },
- { "&load_font", (int32_t) &lv0_load_font },
- { "&load_freetype_font", (int32_t) &lv0_load_freetype_font },
- { "&montserrat_font", (int32_t) &lv0_load_montserrat_font },
- { "®ister_button_encoder", (int32_t) &lv0_register_button_encoder },
- { "&screenshot", (int32_t) &lv0_screenshot },
- { "&seg7_font", (int32_t) &lv0_load_seg7_font },
-
-};
-
-const size_t lv0_constants_size = sizeof(lv0_constants)/sizeof(lv0_constants[0]);
-
-/* generated */
-be_local_module(lv,
- "lv",
- be_nested_map(2,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_nested_key("member", 719708611, 6, -1), be_const_func(lv0_member) },
- { be_nested_key("start", 1697318111, 5, 0), be_const_func(lv0_start) },
- }))
-);
-BE_EXPORT_VARIABLE be_define_const_native_module(lv);
-
-#endif // USE_LVGL
-
-/********************************************************************/
diff --git a/lib/libesp32/Berry/default/be_md5_lib.c b/lib/libesp32/Berry/default/be_md5_lib.c
deleted file mode 100644
index 2c8dfd77b..000000000
--- a/lib/libesp32/Berry/default/be_md5_lib.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/********************************************************************
- * Berry module `webserver`
- *
- * To use: `import webserver`
- *
- * Allows to respond to HTTP request
- *******************************************************************/
-#include "be_constobj.h"
-
-extern int m_md5_init(bvm *vm);
-extern int m_md5_update(bvm *vm);
-extern int m_md5_finish(bvm *vm);
-
-#include "../generate/be_fixed_be_class_md5.h"
-
-void be_load_md5_lib(bvm *vm) {
- be_pushntvclass(vm, &be_class_md5);
- be_setglobal(vm, "MD5");
- be_pop(vm, 1);
-}
-/* @const_object_info_begin
-
-class be_class_md5 (scope: global, name: MD5) {
- .p, var
-
- init, func(m_md5_init)
- update, func(m_md5_update)
- finish, func(m_md5_finish)
-}
-@const_object_info_end */
diff --git a/lib/libesp32/Berry/default/be_unishox_lib.c b/lib/libesp32/Berry/default/be_unishox_lib.c
deleted file mode 100644
index 971f4c9e0..000000000
--- a/lib/libesp32/Berry/default/be_unishox_lib.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/********************************************************************
- * Berry module `unishox`
- *
- * To use: `import unishox`
- *
- * Allows to respond to HTTP request
- *******************************************************************/
-#include "be_constobj.h"
-
-#ifdef USE_UNISHOX_COMPRESSION
-
-extern int be_ntv_unishox_decompress(bvm *vm);
-extern int be_ntv_unishox_compress(bvm *vm);
-
-/********************************************************************
-** Solidified module: unishox
-********************************************************************/
-be_local_module(unishox,
- "unishox",
- be_nested_map(2,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key(decompress, -1), be_const_func(be_ntv_unishox_decompress) },
- { be_const_key(compress, -1), be_const_func(be_ntv_unishox_compress) },
- }))
-);
-BE_EXPORT_VARIABLE be_define_const_native_module(unishox);
-
-#endif // USE_UNISHOX_COMPRESSION
diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output.h
deleted file mode 100644
index 192ee0677..000000000
--- a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "be_constobj.h"
-
-static be_define_const_map_slots(be_class_audio_output_map) {
- { be_const_key(_X2Ep, -1), be_const_var(0) },
-};
-
-static be_define_const_map(
- be_class_audio_output_map,
- 1
-);
-
-BE_EXPORT_VARIABLE be_define_const_class(
- be_class_audio_output,
- 1,
- NULL,
- AudioOutput
-);
diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h
deleted file mode 100644
index dc2abcca8..000000000
--- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#include "be_constobj.h"
-
-static be_define_const_map_slots(be_class_tasmota_map) {
- { be_const_key(gc, -1), be_const_closure(Tasmota_gc_closure) },
- { be_const_key(read_sensors, 7), be_const_func(l_read_sensors) },
- { be_const_key(_get_cb, -1), be_const_func(l_get_cb) },
- { be_const_key(response_append, 50), be_const_func(l_respAppend) },
- { be_const_key(try_rule, 74), be_const_closure(Tasmota_try_rule_closure) },
- { be_const_key(eth, -1), be_const_func(l_eth) },
- { be_const_key(find_key_i, -1), be_const_closure(Tasmota_find_key_i_closure) },
- { be_const_key(exec_tele, 73), be_const_closure(Tasmota_exec_tele_closure) },
- { be_const_key(remove_driver, 28), be_const_closure(Tasmota_remove_driver_closure) },
- { be_const_key(load, -1), be_const_closure(Tasmota_load_closure) },
- { be_const_key(_settings_ptr, -1), be_const_comptr(&Settings) },
- { be_const_key(cmd_res, -1), be_const_var(0) },
- { be_const_key(time_str, 43), be_const_closure(Tasmota_time_str_closure) },
- { be_const_key(set_power, -1), be_const_func(l_setpower) },
- { be_const_key(yield, 20), be_const_func(l_yield) },
- { be_const_key(set_light, -1), be_const_closure(Tasmota_set_light_closure) },
- { be_const_key(find_op, 32), be_const_closure(Tasmota_find_op_closure) },
- { be_const_key(get_power, -1), be_const_func(l_getpower) },
- { be_const_key(add_rule, -1), be_const_closure(Tasmota_add_rule_closure) },
- { be_const_key(cb_dispatch, -1), be_const_closure(Tasmota_cb_dispatch_closure) },
- { be_const_key(global, -1), be_const_var(1) },
- { be_const_key(i2c_enabled, -1), be_const_func(l_i2cenabled) },
- { be_const_key(remove_cmd, 10), be_const_closure(Tasmota_remove_cmd_closure) },
- { be_const_key(millis, 18), be_const_func(l_millis) },
- { be_const_key(publish, 69), be_const_func(l_publish) },
- { be_const_key(_drivers, -1), be_const_var(2) },
- { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) },
- { be_const_key(time_dump, -1), be_const_func(l_time_dump) },
- { be_const_key(web_send, -1), be_const_func(l_webSend) },
- { be_const_key(hs2rgb, -1), be_const_closure(Tasmota_hs2rgb_closure) },
- { be_const_key(memory, -1), be_const_func(l_memory) },
- { be_const_key(gen_cb, 0), be_const_closure(Tasmota_gen_cb_closure) },
- { be_const_key(rtc, -1), be_const_func(l_rtc) },
- { be_const_key(get_option, -1), be_const_func(l_getoption) },
- { be_const_key(add_cmd, -1), be_const_closure(Tasmota_add_cmd_closure) },
- { be_const_key(init, -1), be_const_closure(Tasmota_init_closure) },
- { be_const_key(_timers, -1), be_const_var(3) },
- { be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) },
- { be_const_key(wd, -1), be_const_var(4) },
- { be_const_key(exec_cmd, -1), be_const_closure(Tasmota_exec_cmd_closure) },
- { be_const_key(wire_scan, -1), be_const_closure(Tasmota_wire_scan_closure) },
- { be_const_key(_global_def, 61), be_const_comptr(&be_tasmota_global_struct) },
- { be_const_key(resp_cmnd_failed, 11), be_const_func(l_respCmndFailed) },
- { be_const_key(chars_in_string, -1), be_const_closure(Tasmota_chars_in_string_closure) },
- { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) },
- { be_const_key(_debug_present, 4), be_const_var(5) },
- { be_const_key(cmd, -1), be_const_closure(Tasmota_cmd_closure) },
- { be_const_key(_cb, -1), be_const_var(6) },
- { be_const_key(remove_rule, -1), be_const_closure(Tasmota_remove_rule_closure) },
- { be_const_key(run_deferred, -1), be_const_closure(Tasmota_run_deferred_closure) },
- { be_const_key(strftime, -1), be_const_func(l_strftime) },
- { be_const_key(add_driver, 3), be_const_closure(Tasmota_add_driver_closure) },
- { be_const_key(kv, 60), be_const_closure(Tasmota_kv_closure) },
- { be_const_key(set_timer, 58), be_const_closure(Tasmota_set_timer_closure) },
- { be_const_key(scale_uint, -1), be_const_func(l_scaleuint) },
- { be_const_key(remove_timer, -1), be_const_closure(Tasmota_remove_timer_closure) },
- { be_const_key(settings, 49), be_const_var(7) },
- { be_const_key(arch, -1), be_const_func(l_arch) },
- { be_const_key(_ccmd, 64), be_const_var(8) },
- { be_const_key(wire1, 46), be_const_var(9) },
- { be_const_key(exec_rules, 66), be_const_closure(Tasmota_exec_rules_closure) },
- { be_const_key(strptime, -1), be_const_func(l_strptime) },
- { be_const_key(_cmd, -1), be_const_func(l_cmd) },
- { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) },
- { be_const_key(time_reached, -1), be_const_func(l_timereached) },
- { be_const_key(_rules, -1), be_const_var(10) },
- { be_const_key(publish_result, -1), be_const_func(l_publish_result) },
- { be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) },
- { be_const_key(get_switch, -1), be_const_func(l_getswitch) },
- { be_const_key(delay, 71), be_const_func(l_delay) },
- { be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) },
- { be_const_key(wifi, -1), be_const_func(l_wifi) },
- { be_const_key(save, 15), be_const_func(l_save) },
- { be_const_key(log, 37), be_const_func(l_logInfo) },
- { be_const_key(resolvecmnd, -1), be_const_func(l_resolveCmnd) },
- { be_const_key(resp_cmnd_done, -1), be_const_func(l_respCmndDone) },
- { be_const_key(get_light, 5), be_const_closure(Tasmota_get_light_closure) },
- { be_const_key(get_free_heap, -1), be_const_func(l_getFreeHeap) },
- { be_const_key(wire2, -1), be_const_var(11) },
- { be_const_key(event, 34), be_const_closure(Tasmota_event_closure) },
-};
-
-static be_define_const_map(
- be_class_tasmota_map,
- 80
-);
-
-BE_EXPORT_VARIABLE be_define_const_class(
- be_class_tasmota,
- 12,
- NULL,
- Tasmota
-);
diff --git a/lib/libesp32/Berry/include/be_lvgl.h b/lib/libesp32/Berry/include/be_lvgl.h
deleted file mode 100644
index 52b5edc2d..000000000
--- a/lib/libesp32/Berry/include/be_lvgl.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************
- * Tasmota LVGL Headers
- *******************************************************************/
-#ifndef __BE_LVGL_H__
-#define __BE_LVGL_H__
-
-#include "be_constobj.h"
-
-#ifdef USE_LVGL
-
-#include "lvgl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- // table of functions per class
- typedef struct lvbe_call_c_t {
- const char * name;
- void * func;
- const char * return_type;
- const char * arg_type;
- } lvbe_call_c_t;
-
- // list of classes and function tables
- typedef struct lvbe_call_c_classes_t {
- const char * name;
- const bclass * cl;
- const lvbe_call_c_t * func_table;
- size_t size;
- } lvbe_call_c_classes_t;
- extern const lvbe_call_c_classes_t lv_classes[];
- extern const size_t lv_classes_size;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // USE_LVGL
-
-#endif // __BE_LVGL_H__
\ No newline at end of file
diff --git a/lib/libesp32/Berry/tests/string.be b/lib/libesp32/Berry/tests/string.be
deleted file mode 100644
index 479af1cb4..000000000
--- a/lib/libesp32/Berry/tests/string.be
+++ /dev/null
@@ -1,41 +0,0 @@
-import string as s
-
-assert(s.find('012345', '23') == 2)
-assert(s.find('012345', '23', 1) == 2)
-assert(s.find('012345', '23', 1, 3) == -1)
-assert(s.find('012345', '23', 2, 4) == 2)
-assert(s.find('012345', '23', 3) == -1)
-
-assert(s.find('012345', '') == 0)
-assert(s.find('012345', '', 0, 0) == 0)
-assert(s.find('012345', '', 1) == 1)
-assert(s.find('012345', '', 1, 1) == 1)
-assert(s.find('012345', '', 1, 0) == -1)
-assert(s.find('012345', '', 6) == 6)
-assert(s.find('012345', '', 7) == -1)
-
-assert(s.count('012345', '') == 7)
-assert(s.count('012345', '', 2) == 5)
-assert(s.count('012345', '', 6) == 1)
-
-assert(s.count('121314', '1') == 3)
-assert(s.count('121314', '1', 1) == 2)
-assert(s.count('121314', '1', 2) == 2)
-assert(s.count('121314', '1', 1, 2) == 0)
-assert(s.count('121314', '1', 1, 3) == 1)
-
-assert(s.split('a b c d e f', '1') == ['a b c d e f'])
-assert(s.split('a b c d e f', ' ') == ['a', 'b', 'c', 'd', 'e', 'f'])
-assert(s.split('a b c d e f', ' ', 2) == ['a', 'b', 'c d e f'])
-assert(s.split('a b c d e f', '') == ['a b c d e f'])
-
-assert(s.format("%%") == "%")
-assert(s.format("%i%%", 12) == "12%")
-assert(s.format("%i%%%i", 12, 13) == "12%13")
-assert(s.format("%s%%", "foo") == "foo%")
-assert(s.format("%.1f%%", 3.5) == "3.5%")
-
-s="azerty"
-assert(s[1..2] == "ze")
-assert(s[1..] == "zerty")
-assert(s[1..-1] == "zerty")
diff --git a/lib/libesp32/Berry/tools/coc/.gitignore b/lib/libesp32/Berry/tools/coc/.gitignore
deleted file mode 100644
index be1fbe796..000000000
--- a/lib/libesp32/Berry/tools/coc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-coc
diff --git a/lib/libesp32/Berry/tools/coc/Makefile b/lib/libesp32/Berry/tools/coc/Makefile
deleted file mode 100644
index 773994b3c..000000000
--- a/lib/libesp32/Berry/tools/coc/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-TARGET = coc
-CXXFLAGS = -std=c++11 -O2
-CXX = g++
-
-OBJS = coc_string.o \
- hash_map.o \
- macro_table.o \
- main.o \
- block_builder.o \
- str_build.o \
- coc_parser.o
-
-ifeq ($(OS), Windows_NT) # Windows
- TARGET := $(TARGET).exe
-endif
-
-all: $(TARGET)
-
-$(TARGET): $(OBJS)
- $(Q) $(CXX) $(OBJS) -o $@
-
-$(OBJS): %.o: %.cpp
- $(Q) $(CXX) $(CXXFLAGS) -c $< -o $@
-
-clean:
- $(Q) $(RM) $(OBJS)
diff --git a/lib/libesp32/Berry/tools/coc/REEADME.md b/lib/libesp32/Berry/tools/coc/REEADME.md
deleted file mode 100644
index 329c66d46..000000000
--- a/lib/libesp32/Berry/tools/coc/REEADME.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# The Constant Object Compiler (coc)
-
-The constant object compiler (coc) is a C preprocessor that generates the corresponding C99 code based on the constant object declaration block.
diff --git a/lib/libesp32/Berry/tools/coc/block_builder.cpp b/lib/libesp32/Berry/tools/coc/block_builder.cpp
deleted file mode 100755
index bd76cdbf5..000000000
--- a/lib/libesp32/Berry/tools/coc/block_builder.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/********************************************************************
-** Copyright (c) 2018-2020 Guan Wenliang
-** This file is part of the Berry default interpreter.
-** skiars@qq.com, https://github.com/Skiars/berry
-** See Copyright Notice in the LICENSE file or at
-** https://github.com/Skiars/berry/blob/master/LICENSE
-********************************************************************/
-#include "block_builder.h"
-#include "hash_map.h"
-#include "macro_table.h"
-#include "object_block.h"
-#include
-#include
-
-static bool depend(const object_block *object, const macro_table *macro)
-{
- auto it = object->attr.find("depend");
- if (it != object->attr.end()) {
- return macro->query(it->second);
- }
- return true;
-}
-
-block_builder::block_builder(const object_block *object, const macro_table *macro)
-{
- m_block.name = object->name;
- if (depend(object, macro)) {
- m_block.type = object->type;
- m_block.attr = object->attr;
-
- auto it = object->attr.find("name");
- if (it != object->attr.end()) {
- m_strtab.push_back(it->second);
- }
-
- for (auto key : object->data_ordered) {
- auto second = object->data.at(key);
- if (second.depend.empty() || macro->query(second.depend)) {
- m_block.data[key] = second.value;
- m_strtab.push_back(key);
- m_block.data_ordered.push_back(key); /* record insertion order */
- }
- }
- }
-}
-
-std::string block_builder::block_tostring(const block &block)
-{
- std::ostringstream ostr;
- if (block.type == "map") {
- ostr << map_tostring(block, block.name);
- } else if (block.type == "class") {
- ostr << class_tostring(block);
- } else if (block.type == "vartab") {
- ostr << vartab_tostring(block);
- } else if (block.type == "module") {
- ostr << module_tostring(block);
- }
- return ostr.str();
-}
-
-std::string block_builder::class_tostring(const block &block)
-{
- bool empty_map = block.data.empty();
- std::ostringstream ostr;
- hash_map map(block.data);
- std::string map_name(block.name + "_map");
-
- if (!empty_map) {
- ostr << map_tostring(block, map_name, true) << std::endl;
- }
- ostr << scope(block) << " be_define_const_class(\n "
- << block.name << ",\n "
- << map.var_count() << ",\n "
- << super(block) << ",\n "
- << name(block) << "\n"
- ");" << std::endl;
- return ostr.str();
-}
-
-std::string block_builder::map_tostring(const block &block, const std::string &name, bool local)
-{
- std::ostringstream ostr;
- hash_map map(block.data);
-
- hash_map::entry_table list = map.entry_list();
- ostr << "static be_define_const_map_slots(" << name << ") {\n";
- for (auto it : list) {
- ostr << " { be_const_key(" << it.key << ", "
- << it.next << "), " << it.value << " }," << std::endl;
- }
- ostr << "};\n\n";
-
- ostr << (local ? "static" : scope(block))
- << " be_define_const_map(\n "
- << name << ",\n "
- << list.size() << "\n"
- ");" << std::endl;
- return ostr.str();
-}
-
-std::string block_builder::vartab_tostring(const block &block)
-{
- std::ostringstream ostr;
- struct block idxblk;
- std::vector varvec;
- int index = 0;
-
- idxblk = block;
- idxblk.data.clear();
- for (auto key : block.data_ordered) {
- varvec.push_back(block.data.at(key));
- idxblk.data[key] = "int(" + std::to_string(index++) + ")";
- }
-
- ostr << map_tostring(idxblk, block.name + "_map", true) << std::endl;
- ostr << "static const bvalue __vlist_array[] = {\n";
- for (auto it : varvec) {
- ostr << " be_const_" << it << "," << std::endl;
- }
- ostr << "};\n\n";
-
- ostr << "static be_define_const_vector(\n "
- << block.name << "_vector,\n "
- "__vlist_array,\n "
- << varvec.size() << "\n"
- ");" << std::endl;
- return ostr.str();
-}
-
-std::string block_builder::module_tostring(const block &block)
-{
- std::ostringstream ostr;
- std::string name("m_lib" + block.name);
- std::string map_name(name + "_map");
-
- ostr << map_tostring(block, map_name, true) << std::endl
- << "static be_define_const_module(\n "
- << name << ",\n "
- "\"" << block.name << "\"\n"
- ");" << std::endl;
- std::string scp = scope(block);
- if (scp != "static") { /* extern */
- ostr << "\n" << scp
- << " be_define_const_native_module("
- << block.name << ");" << std::endl;
- }
- return ostr.str();
-}
-
-std::string block_builder::scope(const block &block)
-{
- auto it = block.attr.find("scope");
- return it != block.attr.end() && it->second == "local" ?
- "static" : "BE_EXPORT_VARIABLE";
-}
-
-std::string block_builder::super(const block &block)
-{
- auto it = block.attr.find("super");
- return it == block.attr.end() ? "NULL" : "(bclass *)&" + it->second;
-}
-
-std::string block_builder::name(const block &block)
-{
- auto it = block.attr.find("name");
- return it == block.attr.end() ? block.name : it->second;
-}
-
-void block_builder::writefile(const std::string &filename, const std::string &text)
-{
- std::string pathname(filename);
- std::string otext("#include \"be_constobj.h\"\n\n" + text);
-
- std::ostringstream buf;
- std::ifstream fin(pathname);
- buf << fin.rdbuf();
- if (buf.str() != otext) {
- std::ofstream fout;
- fout.open(pathname, std::ios::out);
- fout << otext;
- fout.close();
- }
-}
-
-void block_builder::dumpfile(const std::string &path)
-{
- std::string s = block_tostring(m_block);
- auto it = m_block.attr.find("file");
- std::string &name = it != m_block.attr.end() ? it->second : m_block.name;
- writefile(path + "/be_fixed_" + name + ".h", s);
-}
-
-const std::vector& block_builder::strtab() const
-{
- return m_strtab;
-}
diff --git a/lib/libesp32/Berry/tools/coc/block_builder.h b/lib/libesp32/Berry/tools/coc/block_builder.h
deleted file mode 100755
index 2811419eb..000000000
--- a/lib/libesp32/Berry/tools/coc/block_builder.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************
-** Copyright (c) 2018-2020 Guan Wenliang
-** This file is part of the Berry default interpreter.
-** skiars@qq.com, https://github.com/Skiars/berry
-** See Copyright Notice in the LICENSE file or at
-** https://github.com/Skiars/berry/blob/master/LICENSE
-********************************************************************/
-#ifndef __BLOCK_BUILDER_H
-#define __BLOCK_BUILDER_H
-
-#include
", 3546571739u, 0, 11, &be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback);
-be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "", 1863865923u, 0, 16, &be_const_str_rule);
-be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_set_chg_current);
-be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_find_op);
-be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, NULL);
-be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "", 2052843416u, 0, 25, NULL);
+be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "", 452285201u, 0, 120, &be_const_str_gc);
+be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "