mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 02:36:35 +00:00
Merge pull request #1 from arendst/development
Pull to match arendst/Tasmota
This commit is contained in:
commit
04af1050e7
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -6,6 +6,8 @@
|
||||
- [ ] The pull request is done against the latest dev branch
|
||||
- [ ] Only relevant files were touched
|
||||
- [ ] Only one feature/fix was added per PR.
|
||||
- [ ] The code change is tested and works on core Tasmota_core_stage
|
||||
- [ ] The code change pass travis tests. **Your PR cannot be merged unless tests pass**
|
||||
- [ ] The code change is tested and works on core ESP8266 V.2.7.2
|
||||
- [ ] The code change is tested and works on core ESP32 V.1.12.2
|
||||
- [ ] 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**_
|
||||
|
442
.github/workflows/CI_github.yml
vendored
Normal file
442
.github/workflows/CI_github.yml
vendored
Normal file
@ -0,0 +1,442 @@
|
||||
name: Tasmota CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
tasmota:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota
|
||||
|
||||
tasmota-minimal:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-minimal
|
||||
|
||||
tasmota-lite:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-lite
|
||||
|
||||
tasmota-knx:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-knx
|
||||
|
||||
tasmota-sensors:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-sensors
|
||||
|
||||
|
||||
tasmota-display:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-display
|
||||
|
||||
tasmota-ir:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-ir
|
||||
|
||||
tasmota-BG:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-BG
|
||||
|
||||
tasmota-BR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-BR
|
||||
|
||||
tasmota-CN:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-CN
|
||||
|
||||
tasmota-CZ:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-CZ
|
||||
|
||||
tasmota-DE:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-DE
|
||||
|
||||
tasmota-ES:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-ES
|
||||
|
||||
|
||||
tasmota-FR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-FR
|
||||
|
||||
tasmota-GR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-GR
|
||||
|
||||
tasmota-HE:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-HE
|
||||
|
||||
tasmota-HU:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-HU
|
||||
|
||||
tasmota-IT:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-IT
|
||||
|
||||
tasmota-KO:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-KO
|
||||
|
||||
tasmota-NL:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-NL
|
||||
|
||||
tasmota-PL:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-PL
|
||||
|
||||
tasmota-PT:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-PT
|
||||
|
||||
tasmota-RO:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-RO
|
||||
|
||||
tasmota-RU:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-RU
|
||||
|
||||
tasmota-SE:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-SE
|
||||
|
||||
tasmota-SK:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-SK
|
||||
|
||||
tasmota-TR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-TR
|
||||
|
||||
tasmota-TW:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-TW
|
||||
|
||||
tasmota-UK:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e tasmota-UK
|
517
.github/workflows/CI_github_ESP32.yml
vendored
Normal file
517
.github/workflows/CI_github_ESP32.yml
vendored
Normal file
@ -0,0 +1,517 @@
|
||||
name: Tasmota ESP32 CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
tasmota32:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32
|
||||
|
||||
|
||||
tasmota32-webcam:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-webcam
|
||||
|
||||
tasmota32-minimal:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-minimal
|
||||
|
||||
tasmota32-lite:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-lite
|
||||
|
||||
tasmota32-knx:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-knx
|
||||
|
||||
tasmota32-sensors:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-sensors
|
||||
|
||||
tasmota32-display:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-display
|
||||
|
||||
tasmota32-ir:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-ir
|
||||
|
||||
tasmota32-BG:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-BG
|
||||
|
||||
tasmota32-BR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-BR
|
||||
|
||||
tasmota32-CN:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-CN
|
||||
|
||||
tasmota32-CZ:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-CZ
|
||||
|
||||
tasmota32-DE:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-DE
|
||||
|
||||
tasmota32-ES:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-ES
|
||||
|
||||
|
||||
tasmota32-FR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-FR
|
||||
|
||||
tasmota32-GR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-GR
|
||||
|
||||
tasmota32-HE:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-HE
|
||||
|
||||
tasmota32-HU:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-HU
|
||||
|
||||
tasmota32-IT:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-IT
|
||||
|
||||
tasmota32-KO:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-KO
|
||||
|
||||
tasmota32-NL:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-NL
|
||||
|
||||
tasmota32-PL:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-PL
|
||||
|
||||
tasmota32-PT:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-PT
|
||||
|
||||
tasmota32-RO:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-RO
|
||||
|
||||
tasmota32-RU:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-RU
|
||||
|
||||
tasmota32-SE:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-SE
|
||||
|
||||
tasmota32-SK:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-SK
|
||||
|
||||
tasmota32-TR:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-TR
|
||||
|
||||
tasmota32-TW:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-TW
|
||||
|
||||
tasmota32-UK:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
platformio upgrade --dev
|
||||
platformio update
|
||||
- name: Run PlatformIO
|
||||
run: |
|
||||
cp platformio_override_sample.ini platformio_override.ini
|
||||
platformio run -e tasmota32-UK
|
1509
.github/workflows/Tasmota_build.yml
vendored
Normal file
1509
.github/workflows/Tasmota_build.yml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
## OS specific ########
|
||||
.DS_Store
|
||||
.fuse_hidden*
|
||||
*.pyc
|
||||
|
||||
## Project files ######
|
||||
.pioenvs
|
||||
@ -17,6 +18,7 @@ tasmota*.bin
|
||||
tasmota*.bin.gz
|
||||
tasmota*.map
|
||||
platformio_override.ini
|
||||
platformio_tasmota_cenv.ini
|
||||
|
||||
## Visual Studio Code specific ######
|
||||
.vscode
|
||||
@ -24,3 +26,4 @@ platformio_override.ini
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
*.bak
|
||||
*.code-workspace
|
||||
|
32
BUILDS.md
32
BUILDS.md
@ -2,7 +2,7 @@
|
||||
|
||||
| Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | Remarks
|
||||
|-----------------------|---------|-------|--------|-----|---------|----|---------|--------
|
||||
| MY_LANGUAGE en-GB | x | x | x | x | x | x | x |
|
||||
| MY_LANGUAGE en_GB | x | x | x | x | x | x | x |
|
||||
| USE_ARDUINO_OTA | - | - | - | - | - | - | - |
|
||||
| USE_DOMOTICZ | - | - | x | x | x | x | - |
|
||||
| USE_HOME_ASSISTANT | - | - | x | x | x | x | - |
|
||||
@ -29,7 +29,7 @@
|
||||
| USE_HOTPLUG | - | - | - | - | - | - | - |
|
||||
| | | | | | | | |
|
||||
| Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | Remarks
|
||||
| ROTARY_V1 | - | - | - | - | - | - | - |
|
||||
| ROTARY_V1 | - | - | x | - | x | - | - |
|
||||
| USE_SONOFF_RF | - | - | x | x | x | - | - |
|
||||
| USE_RF_FLASH | - | - | x | x | x | - | - |
|
||||
| USE_SONOFF_SC | - | - | x | x | x | - | - |
|
||||
@ -68,13 +68,16 @@
|
||||
| USE_DDSU666 | - | - | - | - | x | - | - |
|
||||
| USE_SOLAX_X1 | - | - | - | - | - | - | - |
|
||||
| USE_LE01MR | - | - | - | - | - | - | - |
|
||||
| USE_TELEINFO | - | - | - | - | - | - | - |
|
||||
| | | | | | | | |
|
||||
| USE_ADC_VCC | x | x | - | - | - | - | - |
|
||||
| USE_COUNTER | - | - | x | x | x | x | x |
|
||||
| USE_DS18x20 | - | - | x | x | x | x | x |
|
||||
| USE_DHT | - | - | x | x | x | x | x |
|
||||
| USE_ADC_VCC | x | x | - | - | - | x | - |
|
||||
| USE_COUNTER | - | - | x | x | x | - | x |
|
||||
| USE_DS18x20 | - | - | x | x | x | - | x |
|
||||
| USE_DHT | - | - | x | x | x | - | x |
|
||||
| USE_MAX31855 | - | - | - | - | x | - | - |
|
||||
| USE_MAX31865 | - | - | - | - | - | - | - |
|
||||
| USE_THERMOSTAT | - | - | - | - | - | - | - |
|
||||
| USE_LMT01 | - | - | - | - | x | - | - |
|
||||
| | | | | | | | |
|
||||
| Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | Remarks
|
||||
| USE_I2C | - | - | x | x | x | - | x |
|
||||
@ -117,6 +120,11 @@
|
||||
| USE_AHT1x | - | - | - | - | - | - | - |
|
||||
| USE_HDC1080 | - | - | - | - | - | - | - |
|
||||
| USE_WEMOS_MOTOR_V1 | - | - | - | - | x | - | - |
|
||||
| USE_IAQ | - | - | - | - | x | - | - |
|
||||
| USE_AS3935 | - | - | - | - | x | - | - |
|
||||
| USE_VEML6075 | - | - | - | - | - | - | - |
|
||||
| USE_VEML7700 | - | - | - | - | - | - | - |
|
||||
| USE_MCP9808 | - | - | - | - | - | - | - |
|
||||
| | | | | | | | |
|
||||
| Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | Remarks
|
||||
| USE_SPI | - | - | - | - | - | - | x |
|
||||
@ -134,6 +142,8 @@
|
||||
| USE_GPS | - | - | - | - | - | - | - |
|
||||
| USE_HM10 | - | - | - | - | x | - | - |
|
||||
| USE_HRXL | - | - | - | - | x | - | - |
|
||||
| USE_TASMOTA_SLAVE | - | - | - | - | - | - | - |
|
||||
| USE_OPENTHERM | - | - | - | - | - | - | - |
|
||||
| | | | | | | | |
|
||||
| USE_NRF24 | - | - | - | - | - | - | - |
|
||||
| USE_MIBLE | - | - | - | - | - | - | - |
|
||||
@ -147,11 +157,11 @@
|
||||
| USE_TM1638 | - | - | - | - | x | - | - |
|
||||
| USE_HX711 | - | - | - | - | x | - | - |
|
||||
| USE_TX2x_WIND_SENSOR | - | - | - | - | - | - | - |
|
||||
| USE_WINDMETER | - | - | - | - | - | - | - |
|
||||
| USE_RC_SWITCH | - | - | - | - | x | - | - |
|
||||
| USE_RF_SENSOR | - | - | - | - | x | - | - | AlectoV2 only
|
||||
| USE_HRE | - | - | - | - | x | - | - |
|
||||
| USE_A4988_STEPPER | - | - | - | - | - | - | - |
|
||||
| USE_TASMOTA_SLAVE | - | - | - | - | - | - | - | Experimental
|
||||
| | | | | | | | |
|
||||
| Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | Remarks
|
||||
| USE_DISPLAY | - | - | - | - | - | - | x |
|
||||
@ -165,3 +175,11 @@
|
||||
| USE_DISPLAY_ILI9488 | - | - | - | - | - | - | - |
|
||||
| USE_DISPLAY_SSD1351 | - | - | - | - | - | - | - |
|
||||
| USE_DISPLAY_RA8876 | - | - | - | - | - | - | - |
|
||||
|
||||
## Additional Features and Sensors on ESP32
|
||||
|
||||
| Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | webcam | Remarks
|
||||
|-----------------------|---------|-------|--------|-----|---------|----|---------|--------|--------
|
||||
| USE_MI_ESP32 | - | - | - | - | - | - | - | - |
|
||||
| USE_WEBCAM | - | - | - | - | - | - | - | x |
|
||||
| USE_ETHERNET | - | - | - | - | - | - | - | - |
|
||||
|
@ -53,7 +53,7 @@ The process is straight-forward.
|
||||
2. Only relevant files should be touched (Also beware if your editor has auto-formatting feature enabled).
|
||||
3. Only one feature/fix should be added per PR.
|
||||
4. If adding a new functionality (new hardware, new library support) not related to an existing component move it to it's own modules (.ino file).
|
||||
5. PRs that don't compile (break Travis) or cause coding errors will not be merged. Please fix the issue. Same goes for PRs that are raised against older commit in dev - you might need to rebase and resolve conflicts.
|
||||
5. PRs that don't compile (fail in CI Tests) or cause coding errors will not be merged. Please fix the issue. Same goes for PRs that are raised against older commit in dev - you might need to rebase and resolve conflicts.
|
||||
6. All pull requests should undergo peer review by at least one contributor other than the creator, excepts for the owner.
|
||||
7. All pull requests should consider updates to the documentation.
|
||||
8. Pull requests that address an outstanding issue, particularly an issue deemed to be severe, should be given priority.
|
||||
|
44
FIRMWARE.md
Normal file
44
FIRMWARE.md
Normal file
@ -0,0 +1,44 @@
|
||||

|
||||
|
||||
Alternative firmware for [ESP8266](https://en.wikipedia.org/wiki/ESP8266) based devices with **easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX**.
|
||||
_Written for Arduino IDE and PlatformIO._
|
||||
|
||||
[](https://github.com/arendst/Tasmota/releases/latest)
|
||||
[](https://github.com/arendst/Tasmota/releases/latest)
|
||||
[](LICENSE.txt)
|
||||
[](https://discord.gg/Ks2Kzd4)
|
||||
|
||||
If you like **Tasmota**, give it a star, or fork it and contribute!
|
||||
|
||||
[](https://github.com/arendst/Tasmota/stargazers)
|
||||
[](https://github.com/arendst/Tasmota/network)
|
||||
[](https://paypal.me/tasmota)
|
||||
|
||||
See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/CHANGELOG.md) for changes since last release.
|
||||
|
||||
## Development
|
||||
|
||||
[](https://github.com/arendst/Tasmota)
|
||||
[](http://thehackbox.org/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)
|
||||
|
||||
|
||||
Unless your Tasmota powered device exhibits a problem or you need to make use of a feature that is not available in the Tasmota version currently installed on your device, leave your device alone - it works so don't make unnecessary changes! If the release version (i.e., the master branch) exhibits unexpected behaviour for your device and configuration, you should upgrade to the latest development version instead to see if your problem is resolved as some bugs in previous releases or development builds may already have been resolved.
|
||||
|
||||
If new commits have been merged and they compile successfuly, new binary files for every variant will be placed here https://github.com/arendst/Tasmota/tree/firmware/firmware (this URL address can NOT be used for OTA updates) It is important to note that these binaries are based on the current development codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted.
|
||||
|
||||
Note that there is a chance, as with any upgrade, that the device may not function as expected. You must always account for the possibility that you may need to flash the device via the serial programming interface if the OTA upgrade fails. Even with the master release, you should always attempt to test the device or a similar prototype before upgrading a device which is in production or is hard to reach. And, as always, make a backup of the device configuration before beginning any firmware update.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
:warning: **DANGER OF ELECTROCUTION** :warning:
|
||||
|
||||
If your device connects to mains electricity (AC power) there is danger of electrocution if not installed properly. If you don't know how to install it, please call an electrician (***Beware:*** certain countries prohibit installation without a licensed electrician present). Remember: _**SAFETY FIRST**_. It is not worth the risk to yourself, your family and your home if you don't know exactly what you are doing. Never tinker or try to flash a device using the serial programming interface while it is connected to MAINS ELECTRICITY (AC power).
|
||||
|
||||
We don't take any responsibility nor liability for using this software nor for the installation or any tips, advice, videos, etc. given by any member of this site or any related site.
|
||||
|
||||
## Quick Install
|
||||
Download one of the binaries https://github.com/arendst/Tasmota/tree/firmware/firmware and flash it to your hardware [using our installation guide](https://tasmota.github.io/docs/Getting-Started).
|
||||
|
@ -69,3 +69,8 @@ Index | Define | Driver | Device | Address(es) | Description
|
||||
45 | USE_HDC1080 | xsns_65 | HDC1080 | 0x40 | Temperature and Humidity sensor
|
||||
46 | USE_IAQ | xsns_66 | IAQ | 0x5a | Air quality sensor
|
||||
47 | USE_DISPLAY_SEVENSEG| xdsp_11 | HT16K33 | 0x70 - 0x77 | Seven segment LED
|
||||
48 | USE_AS3935 | xsns_67 | AS3935 | 0x03 | Franklin Lightning Sensor
|
||||
49 | USE_VEML6075 | xsns_70 | VEML6075 | 0x10 | UVA/UVB/UVINDEX Sensor
|
||||
50 | USE_VEML7700 | xsns_71 | VEML7700 | 0x10 | Ambient light intensity sensor
|
||||
51 | USE_MCP9808 | xsns_72 | MCP9808 | 0x18 - 0x1F | Temperature sensor
|
||||
52 | USE_HP303B | xsns_73 | HP303B | 0x76 - 0x77 | Pressure and temperature sensor
|
12
README.md
12
README.md
@ -8,7 +8,7 @@ _Written for Arduino IDE and PlatformIO._
|
||||
[](LICENSE.txt)
|
||||
[](https://discord.gg/Ks2Kzd4)
|
||||
|
||||
If you like **Tasmota**, give it a star, or fork it and contribute!
|
||||
If you like **Tasmota**, give it a star, or fork it and contribute!
|
||||
|
||||
[](https://github.com/arendst/Tasmota/stargazers)
|
||||
[](https://github.com/arendst/Tasmota/network)
|
||||
@ -20,9 +20,11 @@ In addition to the [release webpage](https://github.com/arendst/Tasmota/releases
|
||||
|
||||
## Development
|
||||
|
||||
[](https://github.com/arendst/Tasmota)
|
||||
[](https://github.com/arendst/Tasmota)
|
||||
[](http://thehackbox.org/tasmota/)
|
||||
[](https://travis-ci.org/arendst/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)
|
||||
|
||||
See [tasmota/CHANGELOG.md](tasmota/CHANGELOG.md) for detailed change information.
|
||||
|
||||
@ -144,7 +146,9 @@ People helping to keep the show on the road:
|
||||
- Stefan Bode for his Shutter and Deep sleep drivers
|
||||
- Jacek Ziółkowski for his [TDM](https://github.com/jziolkowski/tdm) management tool and [Tasmotizer](https://github.com/tasmota/tasmotizer) flashing tool
|
||||
- Christian Staars for NRF24L01 and HM-10 Bluetooth sensor support
|
||||
- Pail Diem for UDP Group communication support
|
||||
- Paul Diem for UDP Group communication support
|
||||
- Jörg Schüler-Maroldt for his initial ESP32 port
|
||||
- Javier Arigita for his thermostat driver
|
||||
- Many more providing Tips, Wips, Pocs, PRs and Donations
|
||||
|
||||
## License
|
||||
|
@ -21,7 +21,7 @@ While fallback or downgrading is common practice it was never supported due to S
|
||||
|
||||
## Supported Core versions
|
||||
|
||||
This release will be supported from ESP8266/Arduino library Core version **2.6.3 + e64cb61** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
|
||||
This release will be supported from ESP8266/Arduino library Core version **2.7.1** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
|
||||
|
||||
Although it might still compile on previous Core versions all support will be removed in the near future.
|
||||
|
||||
@ -35,7 +35,7 @@ For initial configuration this release supports Webserver based **WifiManager**
|
||||
|
||||
## Provided Binary Downloads
|
||||
|
||||
The following binary downloads have been compiled with ESP8266/Arduino library core version **2.6.3 + e64cb61**.
|
||||
The following binary downloads have been compiled with ESP8266/Arduino library core version **2.7.1**.
|
||||
|
||||
- **tasmota.bin** = The Tasmota version with most drivers. **RECOMMENDED RELEASE BINARY**
|
||||
- **tasmota-BG.bin** to **tasmota-TW.bin** = The Tasmota version in different languages.
|
||||
@ -52,34 +52,46 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
|
||||
|
||||
## Changelog
|
||||
|
||||
### Version 8.2.0.3
|
||||
### Version 8.4.0 George
|
||||
|
||||
- Change HM-10 sensor type detection and add features (#7962)
|
||||
- Change light scheme 2,3,4 cycle time speed from 24,48,72,... seconds to 4,6,12,24,36,48,... seconds (#8034)
|
||||
- Change remove floating point libs from IRAM
|
||||
- Change remove MQTT Info messages on restart for DeepSleep Wake (#8044)
|
||||
- Change IRremoteESP8266 library updated to v2.7.5
|
||||
- Fix possible Relay toggle on (OTA) restart
|
||||
- Fix PWM flickering during wifi connection (#8046)
|
||||
- Fix Zigbee sending wrong Sat value with Hue emulation
|
||||
- Fix Zigbee crash with Occupancy sensor (#8089)
|
||||
- Add Zigbee command ``ZbRestore`` to restore device configuration dumped with ``ZbStatus 2``
|
||||
- Add Zigbee command ``ZbUnbind``
|
||||
- Add Zigbee command ``ZbBindState`` and ``manuf``attribute
|
||||
- Add commands ``CounterDebounceLow`` and ``CounterDebounceHigh`` to control debouncing (#8021)
|
||||
- Add commands ``NrfPage``, ``NrfIgnore``, ``NrfScan`` and ``NrfBeacon`` to NRF24 Bluetooth driver (#8075)
|
||||
- Add command ``SetOption41 <x>`` to force sending gratuitous ARP every <x> seconds
|
||||
- Add command ``SetOption90 1`` to disable non-json MQTT messages (#8044)
|
||||
- Add command ``SetOption91 1`` to enable fading at startup / power on
|
||||
- Add command ``Sensor10 0/1/2`` to control BH1750 resolution - 0 = High (default), 1 = High2, 2 = Low (#8016)
|
||||
- Add command ``Sensor10 31..254`` to control BH1750 measurement time which defaults to 69 (#8016)
|
||||
- Add command ``DevGroupName`` to specify up to four Device Group Names (#8087)
|
||||
- Add command ``DevGroupSend`` to send an update to a Device Group (#8093)
|
||||
- Add support for unreachable (unplugged) Zigbee devices in Philips Hue emulation and Alexa
|
||||
- Add support for 64x48 SSD1306 OLED (#6740)
|
||||
- Add support for up to four MQTT GroupTopics (#8014)
|
||||
- Add support for longer template names
|
||||
- Add support for an iAQ sensor (#8107)
|
||||
- Add console command history (#7483, #8015)
|
||||
- Add quick wifi reconnect using saved AP parameters when ``SetOption56 0`` (#3189)
|
||||
- Add more accuracy to GPS NTP server (#8088)
|
||||
- Change IRremoteESP8266 library updated to v2.7.7
|
||||
- Change Adafruit_SGP30 library from v1.0.3 to v1.2.0 (#8519)
|
||||
- Change Energy JSON Total field from ``"Total":[33.736,11.717,16.978]`` to ``"Total":33.736,"TotalTariff":[11.717,16.978]``
|
||||
- Change Energy JSON ExportActive field from ``"ExportActive":[33.736,11.717,16.978]`` to ``"ExportActive":33.736,"ExportTariff":[11.717,16.978]``
|
||||
- Change ESP32 USER GPIO template representation decreasing template message size
|
||||
- Change define USE_TASMOTA_SLAVE into USE_TASMOTA_CLIENT
|
||||
- Change commands ``SlaveSend`` and ``SlaveReset`` into ``ClientSend`` and ``ClientReset``
|
||||
- Fix escape of non-JSON received serial data (#8329)
|
||||
- Fix exception or watchdog on rule re-entry (#8757)
|
||||
- Add command ``Rule0`` to change global rule parameters
|
||||
- Add command ``Time 4`` to display timestamp using milliseconds (#8537)
|
||||
- Add command ``SetOption94 0/1`` to select MAX31855 or MAX6675 thermocouple support (#8616)
|
||||
- Add command ``SetOption97 0/1`` to switch between Tuya serial speeds 9600 bps (0) or 115200 bps (1)
|
||||
- Add command ``SetOption98 0/1`` to provide rotary rule triggers (1) instead of controlling light (0)
|
||||
- Add command ``Module2`` to configure fallback module on fast reboot (#8464)
|
||||
- Add commands ``LedPwmOn 0..255``, ``LedPwmOff 0..255`` and ``LedPwmMode1 0/1`` to control led brightness by George (#8491)
|
||||
- Add ESP32 ethernet commands ``EthType 0/1``, ``EthAddress 0..31`` and ``EthClockMode 0..3``
|
||||
- Add support for unique MQTTClient (and inherited fallback topic) by full Mac address using ``mqttclient DVES_%12X`` (#8300)
|
||||
- Add more functionality to ``Switchmode`` 11 and 12 (#8450)
|
||||
- Add wildcard pattern ``?`` for JSON matching in rules
|
||||
- Add support for VEML6075 UVA/UVB/UVINDEX Sensor by device111 (#8432)
|
||||
- Add support for VEML7700 Ambient light intensity Sensor by device111 (#8432)
|
||||
- Add Three Phase Export Active Energy to SDM630 driver
|
||||
- Add Zigbee options to ``ZbSend`` to write and report attributes
|
||||
- Add Zigbee auto-responder for common attributes
|
||||
- Add ``CpuFrequency`` to ``status 2``
|
||||
- Add ``FlashFrequency`` to ``status 4``
|
||||
- Add support for up to two BH1750 sensors controlled by commands ``BH1750Resolution`` and ``BH1750MTime`` (#8139)
|
||||
- Add support for up to eight MCP9808 temperature sensors by device111 (#8594)
|
||||
- Add support for BL0940 energy monitor as used in Blitzwolf BW-SHP10 (#8175)
|
||||
- Add initial support for Telegram bot (#8619)
|
||||
- Add support for HP303B Temperature and Pressure sensor by Robert Jaakke (#8638)
|
||||
- Add rule trigger ``System#Init`` to allow early rule execution without wifi and mqtt initialized yet
|
||||
- Add support for Energy sensor (Denky) for French Smart Metering meter provided by global Energy Providers, need a adaptater. See dedicated full [blog](http://hallard.me/category/tinfo/) about French teleinformation stuff
|
||||
- Add Library to be used for decoding Teleinfo (French Metering Smart Meter)
|
||||
- Add basic support for ESP32 ethernet adding commands ``Wifi 0/1`` and ``Ethernet 0/1`` both default ON
|
||||
- Add support for single wire LMT01 temperature Sensor by justifiably (#8713)
|
||||
- Add compile time interlock parameters (#8759)
|
||||
- Add compile time user template (#8766)
|
||||
- Add rotary encoder support for light dimmer and optional color temperature if button1 still pressed (#8670)
|
||||
- Add support for switches/relays using an AC detection circuitry e.g. MOES MS-104B / BlitzWolf SS5 / etc. (#8606)
|
||||
|
907
TEMPLATES.md
907
TEMPLATES.md
File diff suppressed because it is too large
Load Diff
@ -6,10 +6,10 @@
|
||||
|
||||
menu.BoardModel=Model
|
||||
menu.ESPModule=Module
|
||||
menu.led=Builtin Led
|
||||
|
||||
menu.UploadTool=Upload Using
|
||||
|
||||
menu.led=Builtin Led
|
||||
menu.baud=Upload Speed
|
||||
menu.xtal=CPU Frequency
|
||||
menu.CrystalFreq=Crystal Frequency
|
||||
@ -635,6 +635,63 @@ esp8285.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld
|
||||
esp8285.menu.eesz.1M.build.spiffs_pagesize=256
|
||||
esp8285.menu.eesz.1M.upload.maximum_size=1023984
|
||||
esp8285.menu.eesz.1M.build.rfcal_addr=0xFC000
|
||||
esp8285.menu.eesz.2M64=2MB (FS:64KB OTA:~992KB)
|
||||
esp8285.menu.eesz.2M64.build.flash_size=2M
|
||||
esp8285.menu.eesz.2M64.build.flash_size_bytes=0x200000
|
||||
esp8285.menu.eesz.2M64.build.flash_ld=eagle.flash.2m64.ld
|
||||
esp8285.menu.eesz.2M64.build.spiffs_pagesize=256
|
||||
esp8285.menu.eesz.2M64.upload.maximum_size=1044464
|
||||
esp8285.menu.eesz.2M64.build.rfcal_addr=0x1FC000
|
||||
esp8285.menu.eesz.2M64.build.spiffs_start=0x1F0000
|
||||
esp8285.menu.eesz.2M64.build.spiffs_end=0x1FB000
|
||||
esp8285.menu.eesz.2M64.build.spiffs_blocksize=4096
|
||||
esp8285.menu.eesz.2M128=2MB (FS:128KB OTA:~960KB)
|
||||
esp8285.menu.eesz.2M128.build.flash_size=2M
|
||||
esp8285.menu.eesz.2M128.build.flash_size_bytes=0x200000
|
||||
esp8285.menu.eesz.2M128.build.flash_ld=eagle.flash.2m128.ld
|
||||
esp8285.menu.eesz.2M128.build.spiffs_pagesize=256
|
||||
esp8285.menu.eesz.2M128.upload.maximum_size=1044464
|
||||
esp8285.menu.eesz.2M128.build.rfcal_addr=0x1FC000
|
||||
esp8285.menu.eesz.2M128.build.spiffs_start=0x1E0000
|
||||
esp8285.menu.eesz.2M128.build.spiffs_end=0x1FB000
|
||||
esp8285.menu.eesz.2M128.build.spiffs_blocksize=4096
|
||||
esp8285.menu.eesz.2M256=2MB (FS:256KB OTA:~896KB)
|
||||
esp8285.menu.eesz.2M256.build.flash_size=2M
|
||||
esp8285.menu.eesz.2M256.build.flash_size_bytes=0x200000
|
||||
esp8285.menu.eesz.2M256.build.flash_ld=eagle.flash.2m256.ld
|
||||
esp8285.menu.eesz.2M256.build.spiffs_pagesize=256
|
||||
esp8285.menu.eesz.2M256.upload.maximum_size=1044464
|
||||
esp8285.menu.eesz.2M256.build.rfcal_addr=0x1FC000
|
||||
esp8285.menu.eesz.2M256.build.spiffs_start=0x1C0000
|
||||
esp8285.menu.eesz.2M256.build.spiffs_end=0x1FB000
|
||||
esp8285.menu.eesz.2M256.build.spiffs_blocksize=4096
|
||||
esp8285.menu.eesz.2M512=2MB (FS:512KB OTA:~768KB)
|
||||
esp8285.menu.eesz.2M512.build.flash_size=2M
|
||||
esp8285.menu.eesz.2M512.build.flash_size_bytes=0x200000
|
||||
esp8285.menu.eesz.2M512.build.flash_ld=eagle.flash.2m512.ld
|
||||
esp8285.menu.eesz.2M512.build.spiffs_pagesize=256
|
||||
esp8285.menu.eesz.2M512.upload.maximum_size=1044464
|
||||
esp8285.menu.eesz.2M512.build.rfcal_addr=0x1FC000
|
||||
esp8285.menu.eesz.2M512.build.spiffs_start=0x180000
|
||||
esp8285.menu.eesz.2M512.build.spiffs_end=0x1FA000
|
||||
esp8285.menu.eesz.2M512.build.spiffs_blocksize=8192
|
||||
esp8285.menu.eesz.2M1M=2MB (FS:1MB OTA:~512KB)
|
||||
esp8285.menu.eesz.2M1M.build.flash_size=2M
|
||||
esp8285.menu.eesz.2M1M.build.flash_size_bytes=0x200000
|
||||
esp8285.menu.eesz.2M1M.build.flash_ld=eagle.flash.2m1m.ld
|
||||
esp8285.menu.eesz.2M1M.build.spiffs_pagesize=256
|
||||
esp8285.menu.eesz.2M1M.upload.maximum_size=1044464
|
||||
esp8285.menu.eesz.2M1M.build.rfcal_addr=0x1FC000
|
||||
esp8285.menu.eesz.2M1M.build.spiffs_start=0x100000
|
||||
esp8285.menu.eesz.2M1M.build.spiffs_end=0x1FA000
|
||||
esp8285.menu.eesz.2M1M.build.spiffs_blocksize=8192
|
||||
esp8285.menu.eesz.2M=2MB (FS:none OTA:~1019KB)
|
||||
esp8285.menu.eesz.2M.build.flash_size=2M
|
||||
esp8285.menu.eesz.2M.build.flash_size_bytes=0x200000
|
||||
esp8285.menu.eesz.2M.build.flash_ld=eagle.flash.2m.ld
|
||||
esp8285.menu.eesz.2M.build.spiffs_pagesize=256
|
||||
esp8285.menu.eesz.2M.upload.maximum_size=1044464
|
||||
esp8285.menu.eesz.2M.build.rfcal_addr=0x1FC000
|
||||
esp8285.menu.led.2=2
|
||||
esp8285.menu.led.2.build.led=-DLED_BUILTIN=2
|
||||
esp8285.menu.led.0=0
|
||||
@ -4913,7 +4970,7 @@ espinotee.menu.baud.3000000.upload.speed=3000000
|
||||
wifinfo.name=WifInfo
|
||||
wifinfo.build.board=WIFINFO
|
||||
wifinfo.build.variant=wifinfo
|
||||
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
|
||||
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K FS)
|
||||
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
|
||||
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
|
||||
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
|
||||
@ -4921,7 +4978,7 @@ wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
|
||||
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
|
||||
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
|
||||
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
|
||||
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
|
||||
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M FS)
|
||||
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
|
||||
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
|
||||
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
|
||||
@ -6645,20 +6702,213 @@ espectro.menu.baud.921600.upload.speed=921600
|
||||
espectro.menu.baud.3000000=3000000
|
||||
espectro.menu.baud.3000000.upload.speed=3000000
|
||||
|
||||
##############################################################
|
||||
eduinowifi.name=Schirmilabs Eduino WiFi
|
||||
eduinowifi.build.board=ESP8266_SCHIRMILABS_EDUINO_WIFI
|
||||
eduinowifi.build.variant=eduinowifi
|
||||
eduinowifi.upload.tool=esptool
|
||||
eduinowifi.upload.maximum_data_size=81920
|
||||
eduinowifi.upload.wait_for_upload_port=true
|
||||
eduinowifi.upload.erase_cmd=
|
||||
eduinowifi.serial.disableDTR=true
|
||||
eduinowifi.serial.disableRTS=true
|
||||
eduinowifi.build.mcu=esp8266
|
||||
eduinowifi.build.core=esp8266
|
||||
eduinowifi.build.spiffs_pagesize=256
|
||||
eduinowifi.build.debug_port=
|
||||
eduinowifi.build.debug_level=
|
||||
eduinowifi.menu.xtal.80=80 MHz
|
||||
eduinowifi.menu.xtal.80.build.f_cpu=80000000L
|
||||
eduinowifi.menu.xtal.160=160 MHz
|
||||
eduinowifi.menu.xtal.160.build.f_cpu=160000000L
|
||||
eduinowifi.menu.vt.flash=Flash
|
||||
eduinowifi.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH
|
||||
eduinowifi.menu.vt.heap=Heap
|
||||
eduinowifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM
|
||||
eduinowifi.menu.vt.iram=IRAM
|
||||
eduinowifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM
|
||||
eduinowifi.menu.exception.legacy=Legacy (new can return nullptr)
|
||||
eduinowifi.menu.exception.legacy.build.exception_flags=-fno-exceptions
|
||||
eduinowifi.menu.exception.legacy.build.stdcpp_lib=-lstdc++
|
||||
eduinowifi.menu.exception.disabled=Disabled (new can abort)
|
||||
eduinowifi.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT
|
||||
eduinowifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++
|
||||
eduinowifi.menu.exception.enabled=Enabled
|
||||
eduinowifi.menu.exception.enabled.build.exception_flags=-fexceptions
|
||||
eduinowifi.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc
|
||||
eduinowifi.menu.ssl.all=All SSL ciphers (most compatible)
|
||||
eduinowifi.menu.ssl.all.build.sslflags=
|
||||
eduinowifi.menu.ssl.basic=Basic SSL ciphers (lower ROM use)
|
||||
eduinowifi.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC
|
||||
eduinowifi.upload.resetmethod=--before default_reset --after hard_reset
|
||||
eduinowifi.build.flash_mode=dio
|
||||
eduinowifi.build.flash_flags=-DFLASHMODE_DIO
|
||||
eduinowifi.build.flash_freq=40
|
||||
eduinowifi.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB)
|
||||
eduinowifi.menu.eesz.4M2M.build.flash_size=4M
|
||||
eduinowifi.menu.eesz.4M2M.build.flash_size_bytes=0x400000
|
||||
eduinowifi.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld
|
||||
eduinowifi.menu.eesz.4M2M.build.spiffs_pagesize=256
|
||||
eduinowifi.menu.eesz.4M2M.upload.maximum_size=1044464
|
||||
eduinowifi.menu.eesz.4M2M.build.rfcal_addr=0x3FC000
|
||||
eduinowifi.menu.eesz.4M2M.build.spiffs_start=0x200000
|
||||
eduinowifi.menu.eesz.4M2M.build.spiffs_end=0x3FA000
|
||||
eduinowifi.menu.eesz.4M2M.build.spiffs_blocksize=8192
|
||||
eduinowifi.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB)
|
||||
eduinowifi.menu.eesz.4M3M.build.flash_size=4M
|
||||
eduinowifi.menu.eesz.4M3M.build.flash_size_bytes=0x400000
|
||||
eduinowifi.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld
|
||||
eduinowifi.menu.eesz.4M3M.build.spiffs_pagesize=256
|
||||
eduinowifi.menu.eesz.4M3M.upload.maximum_size=1044464
|
||||
eduinowifi.menu.eesz.4M3M.build.rfcal_addr=0x3FC000
|
||||
eduinowifi.menu.eesz.4M3M.build.spiffs_start=0x100000
|
||||
eduinowifi.menu.eesz.4M3M.build.spiffs_end=0x3FA000
|
||||
eduinowifi.menu.eesz.4M3M.build.spiffs_blocksize=8192
|
||||
eduinowifi.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB)
|
||||
eduinowifi.menu.eesz.4M1M.build.flash_size=4M
|
||||
eduinowifi.menu.eesz.4M1M.build.flash_size_bytes=0x400000
|
||||
eduinowifi.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld
|
||||
eduinowifi.menu.eesz.4M1M.build.spiffs_pagesize=256
|
||||
eduinowifi.menu.eesz.4M1M.upload.maximum_size=1044464
|
||||
eduinowifi.menu.eesz.4M1M.build.rfcal_addr=0x3FC000
|
||||
eduinowifi.menu.eesz.4M1M.build.spiffs_start=0x300000
|
||||
eduinowifi.menu.eesz.4M1M.build.spiffs_end=0x3FA000
|
||||
eduinowifi.menu.eesz.4M1M.build.spiffs_blocksize=8192
|
||||
eduinowifi.menu.eesz.4M=4MB (FS:none OTA:~1019KB)
|
||||
eduinowifi.menu.eesz.4M.build.flash_size=4M
|
||||
eduinowifi.menu.eesz.4M.build.flash_size_bytes=0x400000
|
||||
eduinowifi.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld
|
||||
eduinowifi.menu.eesz.4M.build.spiffs_pagesize=256
|
||||
eduinowifi.menu.eesz.4M.upload.maximum_size=1044464
|
||||
eduinowifi.menu.eesz.4M.build.rfcal_addr=0x3FC000
|
||||
eduinowifi.menu.ip.lm2f=v2 Lower Memory
|
||||
eduinowifi.menu.ip.lm2f.build.lwip_include=lwip2/include
|
||||
eduinowifi.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat
|
||||
eduinowifi.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0
|
||||
eduinowifi.menu.ip.hb2f=v2 Higher Bandwidth
|
||||
eduinowifi.menu.ip.hb2f.build.lwip_include=lwip2/include
|
||||
eduinowifi.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat
|
||||
eduinowifi.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0
|
||||
eduinowifi.menu.ip.lm2n=v2 Lower Memory (no features)
|
||||
eduinowifi.menu.ip.lm2n.build.lwip_include=lwip2/include
|
||||
eduinowifi.menu.ip.lm2n.build.lwip_lib=-llwip2-536
|
||||
eduinowifi.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0
|
||||
eduinowifi.menu.ip.hb2n=v2 Higher Bandwidth (no features)
|
||||
eduinowifi.menu.ip.hb2n.build.lwip_include=lwip2/include
|
||||
eduinowifi.menu.ip.hb2n.build.lwip_lib=-llwip2-1460
|
||||
eduinowifi.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0
|
||||
eduinowifi.menu.ip.lm6f=v2 IPv6 Lower Memory
|
||||
eduinowifi.menu.ip.lm6f.build.lwip_include=lwip2/include
|
||||
eduinowifi.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat
|
||||
eduinowifi.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1
|
||||
eduinowifi.menu.ip.hb6f=v2 IPv6 Higher Bandwidth
|
||||
eduinowifi.menu.ip.hb6f.build.lwip_include=lwip2/include
|
||||
eduinowifi.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat
|
||||
eduinowifi.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1
|
||||
eduinowifi.menu.ip.hb1=v1.4 Higher Bandwidth
|
||||
eduinowifi.menu.ip.hb1.build.lwip_lib=-llwip_gcc
|
||||
eduinowifi.menu.ip.hb1.build.lwip_flags=-DLWIP_OPEN_SRC
|
||||
eduinowifi.menu.ip.src=v1.4 Compile from source
|
||||
eduinowifi.menu.ip.src.build.lwip_lib=-llwip_src
|
||||
eduinowifi.menu.ip.src.build.lwip_flags=-DLWIP_OPEN_SRC
|
||||
eduinowifi.menu.ip.src.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
|
||||
eduinowifi.menu.dbg.Disabled=Disabled
|
||||
eduinowifi.menu.dbg.Disabled.build.debug_port=
|
||||
eduinowifi.menu.dbg.Serial=Serial
|
||||
eduinowifi.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
|
||||
eduinowifi.menu.dbg.Serial1=Serial1
|
||||
eduinowifi.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
|
||||
eduinowifi.menu.lvl.None____=None
|
||||
eduinowifi.menu.lvl.None____.build.debug_level=
|
||||
eduinowifi.menu.lvl.SSL=SSL
|
||||
eduinowifi.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL
|
||||
eduinowifi.menu.lvl.TLS_MEM=TLS_MEM
|
||||
eduinowifi.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
|
||||
eduinowifi.menu.lvl.HTTP_CLIENT=HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.HTTP_SERVER=HTTP_SERVER
|
||||
eduinowifi.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM
|
||||
eduinowifi.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
|
||||
eduinowifi.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
|
||||
eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
|
||||
eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
|
||||
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
|
||||
eduinowifi.menu.lvl.CORE=CORE
|
||||
eduinowifi.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE
|
||||
eduinowifi.menu.lvl.WIFI=WIFI
|
||||
eduinowifi.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
|
||||
eduinowifi.menu.lvl.HTTP_UPDATE=HTTP_UPDATE
|
||||
eduinowifi.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
|
||||
eduinowifi.menu.lvl.UPDATER=UPDATER
|
||||
eduinowifi.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
|
||||
eduinowifi.menu.lvl.OTA=OTA
|
||||
eduinowifi.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA
|
||||
eduinowifi.menu.lvl.OOM=OOM
|
||||
eduinowifi.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM
|
||||
eduinowifi.menu.lvl.MDNS=MDNS
|
||||
eduinowifi.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS
|
||||
eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS
|
||||
eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS
|
||||
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS
|
||||
eduinowifi.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG
|
||||
eduinowifi.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
|
||||
eduinowifi.menu.wipe.none=Only Sketch
|
||||
eduinowifi.menu.wipe.none.upload.erase_cmd=
|
||||
eduinowifi.menu.wipe.sdk=Sketch + WiFi Settings
|
||||
eduinowifi.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000
|
||||
eduinowifi.menu.wipe.all=All Flash Contents
|
||||
eduinowifi.menu.wipe.all.upload.erase_cmd=erase_flash
|
||||
eduinowifi.menu.baud.512000.windows=512000
|
||||
eduinowifi.menu.baud.512000.upload.speed=512000
|
||||
eduinowifi.menu.baud.57600=57600
|
||||
eduinowifi.menu.baud.57600.upload.speed=57600
|
||||
eduinowifi.menu.baud.115200=115200
|
||||
eduinowifi.menu.baud.115200.upload.speed=115200
|
||||
eduinowifi.menu.baud.230400.linux=230400
|
||||
eduinowifi.menu.baud.230400.macosx=230400
|
||||
eduinowifi.menu.baud.230400.upload.speed=230400
|
||||
eduinowifi.menu.baud.256000.windows=256000
|
||||
eduinowifi.menu.baud.256000.upload.speed=256000
|
||||
eduinowifi.menu.baud.460800.linux=460800
|
||||
eduinowifi.menu.baud.460800.macosx=460800
|
||||
eduinowifi.menu.baud.460800.upload.speed=460800
|
||||
eduinowifi.menu.baud.921600=921600
|
||||
eduinowifi.menu.baud.921600.upload.speed=921600
|
||||
eduinowifi.menu.baud.3000000=3000000
|
||||
eduinowifi.menu.baud.3000000.upload.speed=3000000
|
||||
|
||||
##############################################################
|
||||
sonoff.name=ITEAD Sonoff
|
||||
sonoff.build.board=SONOFF_SV
|
||||
sonoff.build.board=ESP8266_SONOFF_SV
|
||||
sonoff.build.extra_flags=-DESP8266
|
||||
sonoff.build.flash_size=1M
|
||||
sonoff.build.variant=itead
|
||||
sonoff.menu.BoardModel.sonoffBasic=ITEAD Sonoff Basic
|
||||
sonoff.menu.BoardModel.sonoffBasic.build.board=SONOFF_BASIC
|
||||
sonoff.menu.BoardModel.sonoffBasic.build.board=ESP8266_SONOFF_BASIC
|
||||
sonoff.menu.BoardModel.sonoffS20=ITEAD Sonoff S20
|
||||
sonoff.menu.BoardModel.sonoffS20.build.board=SONOFF_S20
|
||||
sonoff.menu.BoardModel.sonoffS20.build.board=ESP8266_SONOFF_S20
|
||||
sonoff.menu.BoardModel.sonoffSV=ITEAD Sonoff SV
|
||||
sonoff.menu.BoardModel.sonoffSV.build.board=SONOFF_SV
|
||||
sonoff.menu.BoardModel.sonoffSV.build.board=ESP8266_SONOFF_SV
|
||||
sonoff.menu.BoardModel.sonoffTH=ITEAD Sonoff TH
|
||||
sonoff.menu.BoardModel.sonoffTH.build.board=SONOFF_TH
|
||||
sonoff.menu.BoardModel.sonoffTH.build.board=ESP8266_SONOFF_TH
|
||||
sonoff.upload.tool=esptool
|
||||
sonoff.upload.maximum_data_size=81920
|
||||
sonoff.upload.wait_for_upload_port=true
|
@ -5,8 +5,8 @@
|
||||
# For more info:
|
||||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
|
||||
|
||||
name=ESP8266 Boards (2.6.3)
|
||||
version=2.6.3
|
||||
name=ESP8266 Boards (2.7.1)
|
||||
version=2.7.1
|
||||
|
||||
# These will be removed by the packager script when doing a JSON release
|
||||
|
||||
@ -37,7 +37,7 @@ build.exception_flags=-fno-exceptions
|
||||
build.stdcpp_lib=-lstdc++
|
||||
build.stdcpp_level=-std=gnu++11
|
||||
|
||||
#build.float=-u _printf_float -u _scanf_float
|
||||
# build.float=-u _printf_float -u _scanf_float
|
||||
build.float=
|
||||
build.led=
|
||||
|
8
esp32_partition_app1984k_spiffs60k.csv
Normal file
8
esp32_partition_app1984k_spiffs60k.csv
Normal file
@ -0,0 +1,8 @@
|
||||
# ESP-IDF Partition Table
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs,data,nvs,0x9000,20K,
|
||||
otadata,data,ota,0xe000,8K,
|
||||
app0,app,ota_0,0x10000,1984K,
|
||||
app1,app,ota_1,0x200000,1984K,
|
||||
spiffs,data,spiffs,0x3f0000,60K,
|
||||
eeprom,data,nvs,0x3ff000,4K,
|
|
6
esp32_partition_app1984k_spiffs64k.csv
Normal file
6
esp32_partition_app1984k_spiffs64k.csv
Normal file
@ -0,0 +1,6 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, 0x9000, 0x5000,
|
||||
otadata, data, ota, 0xe000, 0x2000,
|
||||
app0, app, ota_0, 0x10000, 0x1F0000,
|
||||
app1, app, ota_1, 0x200000, 0x1F0000,
|
||||
spiffs, data, spiffs, 0x3F0000,0x10000,
|
|
0
lib/A4988_Stepper/README.adoc
Executable file → Normal file
0
lib/A4988_Stepper/README.adoc
Executable file → Normal file
0
lib/A4988_Stepper/library.properties
Executable file → Normal file
0
lib/A4988_Stepper/library.properties
Executable file → Normal file
0
lib/AT24C256/Eeprom24C128_256.cpp
Executable file → Normal file
0
lib/AT24C256/Eeprom24C128_256.cpp
Executable file → Normal file
0
lib/AT24C256/Eeprom24C128_256.h
Executable file → Normal file
0
lib/AT24C256/Eeprom24C128_256.h
Executable file → Normal file
23
lib/Adafruit_BusIO/.travis.yml
Normal file
23
lib/Adafruit_BusIO/.travis.yml
Normal file
@ -0,0 +1,23 @@
|
||||
language: c
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- ~/arduino_ide
|
||||
- ~/.arduino15/packages/
|
||||
git:
|
||||
depth: false
|
||||
quiet: true
|
||||
env:
|
||||
global:
|
||||
- PRETTYNAME="Adafruit BusIO Library"
|
||||
|
||||
before_install:
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
|
||||
|
||||
script:
|
||||
- build_main_platforms
|
||||
|
||||
# Generate and deploy documentation
|
||||
after_success:
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/library_check.sh)
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/doxy_gen_and_deploy.sh)
|
258
lib/Adafruit_BusIO/Adafruit_BusIO_Register.cpp
Normal file
258
lib/Adafruit_BusIO/Adafruit_BusIO_Register.cpp
Normal file
@ -0,0 +1,258 @@
|
||||
#include <Adafruit_BusIO_Register.h>
|
||||
|
||||
/*!
|
||||
* @brief Create a register we access over an I2C Device (which defines the bus and address)
|
||||
* @param i2cdevice The I2CDevice to use for underlying I2C access
|
||||
* @param reg_addr The address pointer value for the I2C/SMBus register, can be 8 or 16 bits
|
||||
* @param width The width of the register data itself, defaults to 1 byte
|
||||
* @param bitorder The bit order of the register (used when width is > 1), defaults to LSBFIRST
|
||||
* @param address_width The width of the register address itself, defaults to 1 byte
|
||||
*/
|
||||
Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr,
|
||||
uint8_t width, uint8_t bitorder, uint8_t address_width) {
|
||||
_i2cdevice = i2cdevice;
|
||||
_spidevice = NULL;
|
||||
_addrwidth = address_width;
|
||||
_address = reg_addr;
|
||||
_bitorder = bitorder;
|
||||
_width = width;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Create a register we access over an SPI Device (which defines the bus and CS pin)
|
||||
* @param spidevice The SPIDevice to use for underlying I2C access
|
||||
* @param reg_addr The address pointer value for the I2C/SMBus register, can be 8 or 16 bits
|
||||
* @param type The method we use to read/write data to SPI (which is not as well defined as I2C)
|
||||
* @param width The width of the register data itself, defaults to 1 byte
|
||||
* @param bitorder The bit order of the register (used when width is > 1), defaults to LSBFIRST
|
||||
* @param address_width The width of the register address itself, defaults to 1 byte
|
||||
*/
|
||||
Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr,
|
||||
Adafruit_BusIO_SPIRegType type,
|
||||
uint8_t width, uint8_t bitorder, uint8_t address_width) {
|
||||
_spidevice = spidevice;
|
||||
_spiregtype = type;
|
||||
_i2cdevice = NULL;
|
||||
_addrwidth = address_width;
|
||||
_address = reg_addr;
|
||||
_bitorder = bitorder;
|
||||
_width = width;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Create a register we access over an I2C or SPI Device. This is a handy function because we
|
||||
* can pass in NULL for the unused interface, allowing libraries to mass-define all the registers
|
||||
* @param i2cdevice The I2CDevice to use for underlying I2C access, if NULL we use SPI
|
||||
* @param spidevice The SPIDevice to use for underlying I2C access, if NULL we use I2C
|
||||
* @param reg_addr The address pointer value for the I2C/SMBus register, can be 8 or 16 bits
|
||||
* @param type The method we use to read/write data to SPI (which is not as well defined as I2C)
|
||||
* @param width The width of the register data itself, defaults to 1 byte
|
||||
* @param bitorder The bit order of the register (used when width is > 1), defaults to LSBFIRST
|
||||
* @param address_width The width of the register address itself, defaults to 1 byte
|
||||
*/
|
||||
Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, Adafruit_SPIDevice *spidevice,
|
||||
Adafruit_BusIO_SPIRegType type, uint16_t reg_addr,
|
||||
uint8_t width, uint8_t bitorder, uint8_t address_width) {
|
||||
_spidevice = spidevice;
|
||||
_i2cdevice = i2cdevice;
|
||||
_spiregtype = type;
|
||||
_addrwidth = address_width;
|
||||
_address = reg_addr;
|
||||
_bitorder = bitorder;
|
||||
_width = width;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Write a buffer of data to the register location
|
||||
* @param buffer Pointer to data to write
|
||||
* @param len Number of bytes to write
|
||||
* @return True on successful write (only really useful for I2C as SPI is uncheckable)
|
||||
*/
|
||||
bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) {
|
||||
|
||||
uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), (uint8_t)(_address>>8)};
|
||||
|
||||
if (_i2cdevice) {
|
||||
return _i2cdevice->write(buffer, len, true, addrbuffer, _addrwidth);
|
||||
}
|
||||
if (_spidevice) {
|
||||
if (_spiregtype == ADDRBIT8_HIGH_TOREAD) {
|
||||
addrbuffer[0] &= ~0x80;
|
||||
}
|
||||
return _spidevice->write( buffer, len, addrbuffer, _addrwidth);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Write up to 4 bytes of data to the register location
|
||||
* @param value Data to write
|
||||
* @param numbytes How many bytes from 'value' to write
|
||||
* @return True on successful write (only really useful for I2C as SPI is uncheckable)
|
||||
*/
|
||||
bool Adafruit_BusIO_Register::write(uint32_t value, uint8_t numbytes) {
|
||||
if (numbytes == 0) {
|
||||
numbytes = _width;
|
||||
}
|
||||
if (numbytes > 4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i=0; i<numbytes; i++) {
|
||||
if (_bitorder == LSBFIRST) {
|
||||
_buffer[i] = value & 0xFF;
|
||||
} else {
|
||||
_buffer[numbytes-i-1] = value & 0xFF;
|
||||
}
|
||||
value >>= 8;
|
||||
}
|
||||
return write(_buffer, numbytes);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read data from the register location. This does not do any error checking!
|
||||
* @return Returns 0xFFFFFFFF on failure, value otherwise
|
||||
*/
|
||||
uint32_t Adafruit_BusIO_Register::read(void) {
|
||||
if (! read(_buffer, _width)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint32_t value = 0;
|
||||
|
||||
for (int i=0; i < _width; i++) {
|
||||
value <<= 8;
|
||||
if (_bitorder == LSBFIRST) {
|
||||
value |= _buffer[_width-i-1];
|
||||
} else {
|
||||
value |= _buffer[i];
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Read a buffer of data from the register location
|
||||
* @param buffer Pointer to data to read into
|
||||
* @param len Number of bytes to read
|
||||
* @return True on successful write (only really useful for I2C as SPI is uncheckable)
|
||||
*/
|
||||
bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) {
|
||||
uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), (uint8_t)(_address>>8)};
|
||||
|
||||
if (_i2cdevice) {
|
||||
return _i2cdevice->write_then_read(addrbuffer, _addrwidth, buffer, len);
|
||||
}
|
||||
if (_spidevice) {
|
||||
if (_spiregtype == ADDRBIT8_HIGH_TOREAD) {
|
||||
addrbuffer[0] |= 0x80;
|
||||
}
|
||||
return _spidevice->write_then_read(addrbuffer, _addrwidth, buffer, len);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read 2 bytes of data from the register location
|
||||
* @param value Pointer to uint16_t variable to read into
|
||||
* @return True on successful write (only really useful for I2C as SPI is uncheckable)
|
||||
*/
|
||||
bool Adafruit_BusIO_Register::read(uint16_t *value) {
|
||||
if (! read(_buffer, 2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_bitorder == LSBFIRST) {
|
||||
*value = _buffer[1];
|
||||
*value <<= 8;
|
||||
*value |= _buffer[0];
|
||||
} else {
|
||||
*value = _buffer[0];
|
||||
*value <<= 8;
|
||||
*value |= _buffer[1];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read 1 byte of data from the register location
|
||||
* @param value Pointer to uint8_t variable to read into
|
||||
* @return True on successful write (only really useful for I2C as SPI is uncheckable)
|
||||
*/
|
||||
bool Adafruit_BusIO_Register::read(uint8_t *value) {
|
||||
if (! read(_buffer, 1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*value = _buffer[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Pretty printer for this register
|
||||
* @param s The Stream to print to, defaults to &Serial
|
||||
*/
|
||||
void Adafruit_BusIO_Register::print(Stream *s) {
|
||||
uint32_t val = read();
|
||||
s->print("0x"); s->print(val, HEX);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Pretty printer for this register
|
||||
* @param s The Stream to print to, defaults to &Serial
|
||||
*/
|
||||
void Adafruit_BusIO_Register::println(Stream *s) {
|
||||
print(s);
|
||||
s->println();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Create a slice of the register that we can address without touching other bits
|
||||
* @param reg The Adafruit_BusIO_Register which defines the bus/register
|
||||
* @param bits The number of bits wide we are slicing
|
||||
* @param shift The number of bits that our bit-slice is shifted from LSB
|
||||
*/
|
||||
Adafruit_BusIO_RegisterBits::Adafruit_BusIO_RegisterBits(Adafruit_BusIO_Register *reg, uint8_t bits, uint8_t shift) {
|
||||
_register = reg;
|
||||
_bits = bits;
|
||||
_shift = shift;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read 4 bytes of data from the register
|
||||
* @return data The 4 bytes to read
|
||||
*/
|
||||
uint32_t Adafruit_BusIO_RegisterBits::read(void) {
|
||||
uint32_t val = _register->read();
|
||||
val >>= _shift;
|
||||
return val & ((1 << (_bits)) - 1);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Write 4 bytes of data to the register
|
||||
* @param data The 4 bytes to write
|
||||
*/
|
||||
void Adafruit_BusIO_RegisterBits::write(uint32_t data) {
|
||||
uint32_t val = _register->read();
|
||||
|
||||
// mask off the data before writing
|
||||
uint32_t mask = (1 << (_bits)) - 1;
|
||||
data &= mask;
|
||||
|
||||
mask <<= _shift;
|
||||
val &= ~mask; // remove the current data at that spot
|
||||
val |= data << _shift; // and add in the new data
|
||||
|
||||
_register->write(val, _register->width());
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief The width of the register data, helpful for doing calculations
|
||||
* @returns The data width used when initializing the register
|
||||
*/
|
||||
uint8_t Adafruit_BusIO_Register::width(void) { return _width; }
|
69
lib/Adafruit_BusIO/Adafruit_BusIO_Register.h
Normal file
69
lib/Adafruit_BusIO/Adafruit_BusIO_Register.h
Normal file
@ -0,0 +1,69 @@
|
||||
#include <Adafruit_I2CDevice.h>
|
||||
#include <Adafruit_SPIDevice.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
|
||||
#ifndef Adafruit_BusIO_Register_h
|
||||
#define Adafruit_BusIO_Register_h
|
||||
|
||||
typedef enum _Adafruit_BusIO_SPIRegType {
|
||||
ADDRBIT8_HIGH_TOREAD = 0,
|
||||
} Adafruit_BusIO_SPIRegType;
|
||||
|
||||
/*!
|
||||
* @brief The class which defines a device register (a location to read/write data from)
|
||||
*/
|
||||
class Adafruit_BusIO_Register {
|
||||
public:
|
||||
Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr,
|
||||
uint8_t width=1, uint8_t bitorder=LSBFIRST,
|
||||
uint8_t address_width=1);
|
||||
Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr,
|
||||
Adafruit_BusIO_SPIRegType type,
|
||||
uint8_t width=1, uint8_t bitorder=LSBFIRST,
|
||||
uint8_t address_width=1);
|
||||
|
||||
Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice,
|
||||
Adafruit_SPIDevice *spidevice,
|
||||
Adafruit_BusIO_SPIRegType type,
|
||||
uint16_t reg_addr,
|
||||
uint8_t width=1, uint8_t bitorder=LSBFIRST,
|
||||
uint8_t address_width=1);
|
||||
|
||||
bool read(uint8_t *buffer, uint8_t len);
|
||||
bool read(uint8_t *value);
|
||||
bool read(uint16_t *value);
|
||||
uint32_t read(void);
|
||||
bool write(uint8_t *buffer, uint8_t len);
|
||||
bool write(uint32_t value, uint8_t numbytes=0);
|
||||
|
||||
uint8_t width(void);
|
||||
|
||||
void print(Stream *s=&Serial);
|
||||
void println(Stream *s=&Serial);
|
||||
|
||||
private:
|
||||
Adafruit_I2CDevice *_i2cdevice;
|
||||
Adafruit_SPIDevice *_spidevice;
|
||||
Adafruit_BusIO_SPIRegType _spiregtype;
|
||||
uint16_t _address;
|
||||
uint8_t _width, _addrwidth, _bitorder;
|
||||
uint8_t _buffer[4]; // we wont support anything larger than uint32 for non-buffered read
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
* @brief The class which defines a slice of bits from within a device register (a location to read/write data from)
|
||||
*/
|
||||
class Adafruit_BusIO_RegisterBits {
|
||||
public:
|
||||
Adafruit_BusIO_RegisterBits(Adafruit_BusIO_Register *reg, uint8_t bits, uint8_t shift);
|
||||
void write(uint32_t value);
|
||||
uint32_t read(void);
|
||||
private:
|
||||
Adafruit_BusIO_Register *_register;
|
||||
uint8_t _bits, _shift;
|
||||
};
|
||||
|
||||
|
||||
#endif //BusIO_Register_h
|
213
lib/Adafruit_BusIO/Adafruit_I2CDevice.cpp
Normal file
213
lib/Adafruit_BusIO/Adafruit_I2CDevice.cpp
Normal file
@ -0,0 +1,213 @@
|
||||
#include <Adafruit_I2CDevice.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
//#define DEBUG_SERIAL Serial
|
||||
|
||||
/*!
|
||||
* @brief Create an I2C device at a given address
|
||||
* @param addr The 7-bit I2C address for the device
|
||||
* @param theWire The I2C bus to use, defaults to &Wire
|
||||
*/
|
||||
Adafruit_I2CDevice::Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire) {
|
||||
_addr = addr;
|
||||
_wire = theWire;
|
||||
_begun = false;
|
||||
#ifdef ARDUINO_ARCH_SAMD
|
||||
_maxBufferSize = 250; // as defined in Wire.h's RingBuffer
|
||||
#else
|
||||
_maxBufferSize = 32;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Initializes and does basic address detection
|
||||
* @param addr_detect Whether we should attempt to detect the I2C address with a scan.
|
||||
* 99% of sensors/devices don't mind but once in a while, they spaz on a scan!
|
||||
* @return True if I2C initialized and a device with the addr found
|
||||
*/
|
||||
bool Adafruit_I2CDevice::begin(bool addr_detect) {
|
||||
_wire->begin();
|
||||
_begun = true;
|
||||
|
||||
if (addr_detect) {
|
||||
return detected();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Scans I2C for the address - note will give a false-positive
|
||||
* if there's no pullups on I2C
|
||||
* @return True if I2C initialized and a device with the addr found
|
||||
*/
|
||||
bool Adafruit_I2CDevice::detected(void) {
|
||||
// Init I2C if not done yet
|
||||
if (!_begun && !begin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// A basic scanner, see if it ACK's
|
||||
_wire->beginTransmission(_addr);
|
||||
if (_wire->endTransmission () == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Write a buffer or two to the I2C device. Cannot be more than maxBufferSize() bytes.
|
||||
* @param buffer Pointer to buffer of data to write
|
||||
* @param len Number of bytes from buffer to write
|
||||
* @param prefix_buffer Pointer to optional array of data to write before buffer.
|
||||
* Cannot be more than maxBufferSize() bytes.
|
||||
* @param prefix_len Number of bytes from prefix buffer to write
|
||||
* @param stop Whether to send an I2C STOP signal on write
|
||||
* @return True if write was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_I2CDevice::write(uint8_t *buffer, size_t len, bool stop, uint8_t *prefix_buffer, size_t prefix_len) {
|
||||
if ((len+prefix_len) > maxBufferSize()) {
|
||||
// currently not guaranteed to work if more than 32 bytes!
|
||||
// we will need to find out if some platforms have larger
|
||||
// I2C buffer sizes :/
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.println(F("\tI2CDevice could not write such a large buffer"));
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
_wire->beginTransmission(_addr);
|
||||
|
||||
// Write the prefix data (usually an address)
|
||||
if ((prefix_len != 0) && (prefix_buffer != NULL)) {
|
||||
if (_wire->write(prefix_buffer, prefix_len) != prefix_len) {
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.println(F("\tI2CDevice failed to write"));
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Write the data itself
|
||||
if (_wire->write(buffer, len) != len) {
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.println(F("\tI2CDevice failed to write"));
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print(F("\tI2CDevice Wrote: "));
|
||||
if ((prefix_len != 0) && (prefix_buffer != NULL)) {
|
||||
for (uint16_t i=0; i<prefix_len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(prefix_buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
}
|
||||
}
|
||||
for (uint16_t i=0; i<len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
if (len % 32 == 31) {
|
||||
DEBUG_SERIAL.println();
|
||||
}
|
||||
}
|
||||
DEBUG_SERIAL.println();
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print("Stop: "); DEBUG_SERIAL.println(stop);
|
||||
#endif
|
||||
|
||||
if (_wire->endTransmission(stop) == 0) {
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.println("Sent!");
|
||||
#endif
|
||||
return true;
|
||||
} else {
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.println("Failed to send!");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Read from I2C into a buffer from the I2C device.
|
||||
* Cannot be more than maxBufferSize() bytes.
|
||||
* @param buffer Pointer to buffer of data to read into
|
||||
* @param len Number of bytes from buffer to read.
|
||||
* @param stop Whether to send an I2C STOP signal on read
|
||||
* @return True if read was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_I2CDevice::read(uint8_t *buffer, size_t len, bool stop) {
|
||||
if (len > maxBufferSize()) {
|
||||
// currently not guaranteed to work if more than 32 bytes!
|
||||
// we will need to find out if some platforms have larger
|
||||
// I2C buffer sizes :/
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.println(F("\tI2CDevice could not read such a large buffer"));
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t recv = _wire->requestFrom((uint8_t)_addr, (uint8_t)len, (uint8_t)stop);
|
||||
if (recv != len) {
|
||||
// Not enough data available to fulfill our obligation!
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print(F("\tI2CDevice did not receive enough data: "));
|
||||
DEBUG_SERIAL.println(recv);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint16_t i=0; i<len; i++) {
|
||||
buffer[i] = _wire->read();
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print(F("\tI2CDevice Read: "));
|
||||
for (uint16_t i=0; i<len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
if (len % 32 == 31) {
|
||||
DEBUG_SERIAL.println();
|
||||
}
|
||||
}
|
||||
DEBUG_SERIAL.println();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Write some data, then read some data from I2C into another buffer.
|
||||
* Cannot be more than maxBufferSize() bytes. The buffers can point to
|
||||
* same/overlapping locations.
|
||||
* @param write_buffer Pointer to buffer of data to write from
|
||||
* @param write_len Number of bytes from buffer to write.
|
||||
* @param read_buffer Pointer to buffer of data to read into.
|
||||
* @param read_len Number of bytes from buffer to read.
|
||||
* @param stop Whether to send an I2C STOP signal between the write and read
|
||||
* @return True if write & read was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_I2CDevice::write_then_read(uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len, bool stop) {
|
||||
if (! write(write_buffer, write_len, stop)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return read(read_buffer, read_len);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Returns the 7-bit address of this device
|
||||
* @return The 7-bit address of this device
|
||||
*/
|
||||
uint8_t Adafruit_I2CDevice::address(void) {
|
||||
return _addr;
|
||||
}
|
29
lib/Adafruit_BusIO/Adafruit_I2CDevice.h
Normal file
29
lib/Adafruit_BusIO/Adafruit_I2CDevice.h
Normal file
@ -0,0 +1,29 @@
|
||||
#include <Wire.h>
|
||||
|
||||
#ifndef Adafruit_I2CDevice_h
|
||||
#define Adafruit_I2CDevice_h
|
||||
|
||||
///< The class which defines how we will talk to this device over I2C
|
||||
class Adafruit_I2CDevice {
|
||||
public:
|
||||
Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire=&Wire);
|
||||
uint8_t address(void);
|
||||
bool begin(bool addr_detect=true);
|
||||
bool detected(void);
|
||||
|
||||
bool read(uint8_t *buffer, size_t len, bool stop=true);
|
||||
bool write(uint8_t *buffer, size_t len, bool stop=true, uint8_t *prefix_buffer=NULL, size_t prefix_len=0);
|
||||
bool write_then_read(uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len, bool stop=false);
|
||||
|
||||
/*! @brief How many bytes we can read in a transaction
|
||||
* @return The size of the Wire receive/transmit buffer */
|
||||
uint16_t maxBufferSize() { return _maxBufferSize; }
|
||||
|
||||
private:
|
||||
uint8_t _addr;
|
||||
TwoWire *_wire;
|
||||
bool _begun;
|
||||
uint16_t _maxBufferSize;
|
||||
};
|
||||
|
||||
#endif // Adafruit_I2CDevice_h
|
8
lib/Adafruit_BusIO/Adafruit_I2CRegister.h
Normal file
8
lib/Adafruit_BusIO/Adafruit_I2CRegister.h
Normal file
@ -0,0 +1,8 @@
|
||||
#include "Adafruit_BusIO_Register.h"
|
||||
#ifndef _ADAFRUIT_I2C_REGISTER_H_
|
||||
#define _ADAFRUIT_I2C_REGISTER_H_
|
||||
|
||||
typedef Adafruit_BusIO_Register Adafruit_I2CRegister;
|
||||
typedef Adafruit_BusIO_RegisterBits Adafruit_I2CRegisterBits;
|
||||
|
||||
#endif
|
301
lib/Adafruit_BusIO/Adafruit_SPIDevice.cpp
Normal file
301
lib/Adafruit_BusIO/Adafruit_SPIDevice.cpp
Normal file
@ -0,0 +1,301 @@
|
||||
#include <Adafruit_SPIDevice.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
//#define DEBUG_SERIAL Serial
|
||||
|
||||
/*!
|
||||
* @brief Create an SPI device with the given CS pin and settins
|
||||
* @param cspin The arduino pin number to use for chip select
|
||||
* @param freq The SPI clock frequency to use, defaults to 1MHz
|
||||
* @param dataOrder The SPI data order to use for bits within each byte, defaults to SPI_BITORDER_MSBFIRST
|
||||
* @param dataMode The SPI mode to use, defaults to SPI_MODE0
|
||||
* @param theSPI The SPI bus to use, defaults to &theSPI
|
||||
*/
|
||||
Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, uint32_t freq, BitOrder dataOrder, uint8_t dataMode, SPIClass *theSPI) {
|
||||
_cs = cspin;
|
||||
_sck = _mosi = _miso = -1;
|
||||
_spi = theSPI;
|
||||
_begun = false;
|
||||
_spiSetting = new SPISettings(freq, dataOrder, dataMode);
|
||||
_freq = freq;
|
||||
_dataOrder = dataOrder;
|
||||
_dataMode = dataMode;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Create an SPI device with the given CS pin and settins
|
||||
* @param cspin The arduino pin number to use for chip select
|
||||
* @param sckpin The arduino pin number to use for SCK
|
||||
* @param misopin The arduino pin number to use for MISO, set to -1 if not used
|
||||
* @param mosipin The arduino pin number to use for MOSI, set to -1 if not used
|
||||
* @param freq The SPI clock frequency to use, defaults to 1MHz
|
||||
* @param dataOrder The SPI data order to use for bits within each byte, defaults to SPI_BITORDER_MSBFIRST
|
||||
* @param dataMode The SPI mode to use, defaults to SPI_MODE0
|
||||
*/
|
||||
Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, int8_t sckpin, int8_t misopin, int8_t mosipin,
|
||||
uint32_t freq, BitOrder dataOrder, uint8_t dataMode) {
|
||||
_cs = cspin;
|
||||
_sck = sckpin;
|
||||
_miso = misopin;
|
||||
_mosi = mosipin;
|
||||
_freq = freq;
|
||||
_dataOrder = dataOrder;
|
||||
_dataMode = dataMode;
|
||||
_begun = false;
|
||||
_spiSetting = new SPISettings(freq, dataOrder, dataMode);
|
||||
_spi = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Initializes SPI bus and sets CS pin high
|
||||
* @return Always returns true because there's no way to test success of SPI init
|
||||
*/
|
||||
bool Adafruit_SPIDevice::begin(void) {
|
||||
pinMode(_cs, OUTPUT);
|
||||
digitalWrite(_cs, HIGH);
|
||||
|
||||
if (_spi) { // hardware SPI
|
||||
_spi->begin();
|
||||
} else {
|
||||
pinMode(_sck, OUTPUT);
|
||||
|
||||
if (_dataMode==SPI_MODE0) {
|
||||
digitalWrite(_sck, HIGH);
|
||||
} else {
|
||||
digitalWrite(_sck, LOW);
|
||||
}
|
||||
if (_mosi != -1) {
|
||||
pinMode(_mosi, OUTPUT);
|
||||
digitalWrite(_mosi, HIGH);
|
||||
}
|
||||
if (_miso != -1) {
|
||||
pinMode(_miso, INPUT);
|
||||
}
|
||||
}
|
||||
|
||||
_begun = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Transfer (send/receive) one byte over hard/soft SPI
|
||||
* @param buffer The buffer to send and receive at the same time
|
||||
* @param len The number of bytes to transfer
|
||||
*/
|
||||
void Adafruit_SPIDevice::transfer(uint8_t *buffer, size_t len) {
|
||||
if (_spi) {
|
||||
// hardware SPI is easy
|
||||
_spi->transfer(buffer, len);
|
||||
return;
|
||||
}
|
||||
|
||||
// for softSPI we'll do it by hand
|
||||
for (size_t i=0; i<len; i++) {
|
||||
// software SPI
|
||||
uint8_t reply = 0;
|
||||
uint8_t send = buffer[i];
|
||||
|
||||
if (_dataOrder == SPI_BITORDER_LSBFIRST) {
|
||||
// LSB is rare, if it happens we'll just flip the bits around for them
|
||||
uint8_t temp = 0;
|
||||
for (uint8_t b=0; b<8; b++) {
|
||||
temp |= ((send >> b) & 0x1) << (7-b);
|
||||
}
|
||||
send = temp;
|
||||
}
|
||||
for (int b=7; b>=0; b--) {
|
||||
reply <<= 1;
|
||||
if (_dataMode == SPI_MODE0) {
|
||||
digitalWrite(_sck, LOW);
|
||||
digitalWrite(_mosi, send & (1<<b));
|
||||
digitalWrite(_sck, HIGH);
|
||||
if ((_miso != -1) && digitalRead(_miso)) {
|
||||
reply |= 1;
|
||||
}
|
||||
}
|
||||
if (_dataMode == SPI_MODE1) {
|
||||
digitalWrite(_sck, HIGH);
|
||||
digitalWrite(_mosi, send & (1<<b));
|
||||
digitalWrite(_sck, LOW);
|
||||
if ((_miso != -1) && digitalRead(_miso)) {
|
||||
reply |= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_dataOrder == SPI_BITORDER_LSBFIRST) {
|
||||
// LSB is rare, if it happens we'll just flip the bits around for them
|
||||
uint8_t temp = 0;
|
||||
for (uint8_t b=0; b<8; b++) {
|
||||
temp |= ((reply >> b) & 0x1) << (7-b);
|
||||
}
|
||||
reply = temp;
|
||||
}
|
||||
|
||||
buffer[i] = reply;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Transfer (send/receive) one byte over hard/soft SPI
|
||||
* @param send The byte to send
|
||||
* @return The byte received while transmitting
|
||||
*/
|
||||
uint8_t Adafruit_SPIDevice::transfer(uint8_t send) {
|
||||
uint8_t data = send;
|
||||
transfer(&data, 1);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Write a buffer or two to the SPI device.
|
||||
* @param buffer Pointer to buffer of data to write
|
||||
* @param len Number of bytes from buffer to write
|
||||
* @param prefix_buffer Pointer to optional array of data to write before buffer.
|
||||
* @param prefix_len Number of bytes from prefix buffer to write
|
||||
* @return Always returns true because there's no way to test success of SPI writes
|
||||
*/
|
||||
bool Adafruit_SPIDevice::write(uint8_t *buffer, size_t len, uint8_t *prefix_buffer, size_t prefix_len) {
|
||||
if (_spi) {
|
||||
_spi->beginTransaction(*_spiSetting);
|
||||
}
|
||||
|
||||
digitalWrite(_cs, LOW);
|
||||
// do the writing
|
||||
for (size_t i=0; i<prefix_len; i++) {
|
||||
transfer(prefix_buffer[i]);
|
||||
}
|
||||
for (size_t i=0; i<len; i++) {
|
||||
transfer(buffer[i]);
|
||||
}
|
||||
digitalWrite(_cs, HIGH);
|
||||
|
||||
if (_spi) {
|
||||
_spi->endTransaction();
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print(F("\tSPIDevice Wrote: "));
|
||||
if ((prefix_len != 0) && (prefix_buffer != NULL)) {
|
||||
for (uint16_t i=0; i<prefix_len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(prefix_buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
}
|
||||
}
|
||||
for (uint16_t i=0; i<len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
if (len % 32 == 31) {
|
||||
DEBUG_SERIAL.println();
|
||||
}
|
||||
}
|
||||
DEBUG_SERIAL.println();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read from SPI into a buffer from the SPI device.
|
||||
* @param buffer Pointer to buffer of data to read into
|
||||
* @param len Number of bytes from buffer to read.
|
||||
* @param sendvalue The 8-bits of data to write when doing the data read, defaults to 0xFF
|
||||
* @return Always returns true because there's no way to test success of SPI writes
|
||||
*/
|
||||
bool Adafruit_SPIDevice::read(uint8_t *buffer, size_t len, uint8_t sendvalue) {
|
||||
memset(buffer, sendvalue, len); // clear out existing buffer
|
||||
if (_spi) {
|
||||
_spi->beginTransaction(*_spiSetting);
|
||||
}
|
||||
digitalWrite(_cs, LOW);
|
||||
transfer(buffer, len);
|
||||
digitalWrite(_cs, HIGH);
|
||||
|
||||
if (_spi) {
|
||||
_spi->endTransaction();
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print(F("\tSPIDevice Read: "));
|
||||
for (uint16_t i=0; i<len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
if (len % 32 == 31) {
|
||||
DEBUG_SERIAL.println();
|
||||
}
|
||||
}
|
||||
DEBUG_SERIAL.println();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Write some data, then read some data from SPI into another buffer. The buffers can point to same/overlapping locations. This does not transmit-receive at the same time!
|
||||
* @param write_buffer Pointer to buffer of data to write from
|
||||
* @param write_len Number of bytes from buffer to write.
|
||||
* @param read_buffer Pointer to buffer of data to read into.
|
||||
* @param read_len Number of bytes from buffer to read.
|
||||
* @param sendvalue The 8-bits of data to write when doing the data read, defaults to 0xFF
|
||||
* @return Always returns true because there's no way to test success of SPI writes
|
||||
*/
|
||||
bool Adafruit_SPIDevice::write_then_read(uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len, uint8_t sendvalue) {
|
||||
if (_spi) {
|
||||
_spi->beginTransaction(*_spiSetting);
|
||||
}
|
||||
|
||||
digitalWrite(_cs, LOW);
|
||||
// do the writing
|
||||
for (size_t i=0; i<write_len; i++) {
|
||||
transfer(write_buffer[i]);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print(F("\tSPIDevice Wrote: "));
|
||||
for (uint16_t i=0; i<write_len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(write_buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
if (write_len % 32 == 31) {
|
||||
DEBUG_SERIAL.println();
|
||||
}
|
||||
}
|
||||
DEBUG_SERIAL.println();
|
||||
#endif
|
||||
|
||||
// do the reading
|
||||
for (size_t i=0; i<read_len; i++) {
|
||||
read_buffer[i] = transfer(sendvalue);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
DEBUG_SERIAL.print(F("\tSPIDevice Read: "));
|
||||
for (uint16_t i=0; i<read_len; i++) {
|
||||
DEBUG_SERIAL.print(F("0x"));
|
||||
DEBUG_SERIAL.print(read_buffer[i], HEX);
|
||||
DEBUG_SERIAL.print(F(", "));
|
||||
if (read_len % 32 == 31) {
|
||||
DEBUG_SERIAL.println();
|
||||
}
|
||||
}
|
||||
DEBUG_SERIAL.println();
|
||||
#endif
|
||||
|
||||
digitalWrite(_cs, HIGH);
|
||||
|
||||
if (_spi) {
|
||||
_spi->endTransaction();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
62
lib/Adafruit_BusIO/Adafruit_SPIDevice.h
Normal file
62
lib/Adafruit_BusIO/Adafruit_SPIDevice.h
Normal file
@ -0,0 +1,62 @@
|
||||
#include <SPI.h>
|
||||
|
||||
#ifndef Adafruit_SPIDevice_h
|
||||
#define Adafruit_SPIDevice_h
|
||||
|
||||
// some modern SPI definitions don't have BitOrder enum
|
||||
#if (defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)) || defined(ESP8266) || defined(TEENSYDUINO)
|
||||
typedef enum _BitOrder {
|
||||
SPI_BITORDER_MSBFIRST = MSBFIRST,
|
||||
SPI_BITORDER_LSBFIRST = LSBFIRST,
|
||||
} BitOrder;
|
||||
#endif
|
||||
|
||||
// some modern SPI definitions don't have BitOrder enum and have different SPI mode defines
|
||||
#if defined(ESP32)
|
||||
typedef enum _BitOrder {
|
||||
SPI_BITORDER_MSBFIRST = SPI_MSBFIRST,
|
||||
SPI_BITORDER_LSBFIRST = SPI_LSBFIRST,
|
||||
} BitOrder;
|
||||
#endif
|
||||
|
||||
// Some platforms have a BitOrder enum but its named MSBFIRST/LSBFIRST
|
||||
#if defined(ARDUINO_ARCH_SAMD) || defined(__SAM3X8E__) || defined(NRF52_SERIES) || defined(ARDUINO_ARCH_ARDUINO_CORE_STM32) || defined(ARDUINO_ARCH_MEGAAVR) || defined(_STM32_DEF_)
|
||||
#define SPI_BITORDER_MSBFIRST MSBFIRST
|
||||
#define SPI_BITORDER_LSBFIRST LSBFIRST
|
||||
#endif
|
||||
|
||||
///< The class which defines how we will talk to this device over SPI
|
||||
class Adafruit_SPIDevice {
|
||||
public:
|
||||
Adafruit_SPIDevice(int8_t cspin,
|
||||
uint32_t freq=1000000,
|
||||
BitOrder dataOrder=SPI_BITORDER_MSBFIRST,
|
||||
uint8_t dataMode=SPI_MODE0,
|
||||
SPIClass *theSPI=&SPI);
|
||||
|
||||
Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi,
|
||||
uint32_t freq=1000000,
|
||||
BitOrder dataOrder=SPI_BITORDER_MSBFIRST,
|
||||
uint8_t dataMode=SPI_MODE0);
|
||||
|
||||
bool begin(void);
|
||||
bool read(uint8_t *buffer, size_t len, uint8_t sendvalue=0xFF);
|
||||
bool write(uint8_t *buffer, size_t len, uint8_t *prefix_buffer=NULL, size_t prefix_len=0);
|
||||
bool write_then_read(uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len, uint8_t sendvalue=0xFF);
|
||||
|
||||
uint8_t transfer(uint8_t send);
|
||||
void transfer(uint8_t *buffer, size_t len);
|
||||
|
||||
private:
|
||||
|
||||
SPIClass *_spi;
|
||||
SPISettings *_spiSetting;
|
||||
uint32_t _freq;
|
||||
BitOrder _dataOrder;
|
||||
uint8_t _dataMode;
|
||||
|
||||
int8_t _cs, _sck, _mosi, _miso;
|
||||
bool _begun;
|
||||
};
|
||||
|
||||
#endif // Adafruit_SPIDevice_h
|
21
lib/Adafruit_BusIO/LICENSE
Normal file
21
lib/Adafruit_BusIO/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 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.
|
7
lib/Adafruit_BusIO/README.md
Normal file
7
lib/Adafruit_BusIO/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Adafruit Bus IO Library [](https://travis-ci.com/adafruit/Adafruit_BusIO)
|
||||
|
||||
This is a helper libary to abstract away I2C & SPI transactions and registers
|
||||
|
||||
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
|
||||
|
||||
MIT license, all text above must be included in any redistribution
|
@ -0,0 +1,21 @@
|
||||
#include <Adafruit_I2CDevice.h>
|
||||
|
||||
Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(0x10);
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("I2C address detection test");
|
||||
|
||||
if (!i2c_dev.begin()) {
|
||||
Serial.print("Did not find device at 0x");
|
||||
Serial.println(i2c_dev.address(), HEX);
|
||||
while (1);
|
||||
}
|
||||
Serial.print("Device found on address 0x");
|
||||
Serial.println(i2c_dev.address(), HEX);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
41
lib/Adafruit_BusIO/examples/i2c_readwrite/i2c_readwrite.ino
Normal file
41
lib/Adafruit_BusIO/examples/i2c_readwrite/i2c_readwrite.ino
Normal file
@ -0,0 +1,41 @@
|
||||
#include <Adafruit_I2CDevice.h>
|
||||
|
||||
#define I2C_ADDRESS 0x60
|
||||
Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS);
|
||||
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("I2C device read and write test");
|
||||
|
||||
if (!i2c_dev.begin()) {
|
||||
Serial.print("Did not find device at 0x");
|
||||
Serial.println(i2c_dev.address(), HEX);
|
||||
while (1);
|
||||
}
|
||||
Serial.print("Device found on address 0x");
|
||||
Serial.println(i2c_dev.address(), HEX);
|
||||
|
||||
uint8_t buffer[32];
|
||||
// Try to read 32 bytes
|
||||
i2c_dev.read(buffer, 32);
|
||||
Serial.print("Read: ");
|
||||
for (uint8_t i=0; i<32; i++) {
|
||||
Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", ");
|
||||
}
|
||||
Serial.println();
|
||||
|
||||
// read a register by writing first, then reading
|
||||
buffer[0] = 0x0C; // we'll reuse the same buffer
|
||||
i2c_dev.write_then_read(buffer, 1, buffer, 2, false);
|
||||
Serial.print("Write then Read: ");
|
||||
for (uint8_t i=0; i<2; i++) {
|
||||
Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", ");
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
38
lib/Adafruit_BusIO/examples/i2c_registers/i2c_registers.ino
Normal file
38
lib/Adafruit_BusIO/examples/i2c_registers/i2c_registers.ino
Normal file
@ -0,0 +1,38 @@
|
||||
#include <Adafruit_I2CDevice.h>
|
||||
#include <Adafruit_BusIO_Register.h>
|
||||
|
||||
#define I2C_ADDRESS 0x60
|
||||
Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS);
|
||||
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("I2C device register test");
|
||||
|
||||
if (!i2c_dev.begin()) {
|
||||
Serial.print("Did not find device at 0x");
|
||||
Serial.println(i2c_dev.address(), HEX);
|
||||
while (1);
|
||||
}
|
||||
Serial.print("Device found on address 0x");
|
||||
Serial.println(i2c_dev.address(), HEX);
|
||||
|
||||
Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&i2c_dev, 0x0C, 2, LSBFIRST);
|
||||
uint16_t id;
|
||||
id_reg.read(&id);
|
||||
Serial.print("ID register = 0x"); Serial.println(id, HEX);
|
||||
|
||||
Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&i2c_dev, 0x01, 2, LSBFIRST);
|
||||
uint16_t thresh;
|
||||
thresh_reg.read(&thresh);
|
||||
Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX);
|
||||
|
||||
thresh_reg.write(~thresh);
|
||||
|
||||
Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
#include <Adafruit_BusIO_Register.h>
|
||||
|
||||
// Define which interface to use by setting the unused interface to NULL!
|
||||
|
||||
#define SPIDEVICE_CS 10
|
||||
Adafruit_SPIDevice *spi_dev = NULL; // new Adafruit_SPIDevice(SPIDEVICE_CS);
|
||||
|
||||
#define I2C_ADDRESS 0x5D
|
||||
Adafruit_I2CDevice *i2c_dev = new Adafruit_I2CDevice(I2C_ADDRESS);
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("I2C or SPI device register test");
|
||||
|
||||
if (spi_dev && !spi_dev->begin()) {
|
||||
Serial.println("Could not initialize SPI device");
|
||||
}
|
||||
|
||||
if (i2c_dev) {
|
||||
if (i2c_dev->begin()) {
|
||||
Serial.print("Device found on I2C address 0x");
|
||||
Serial.println(i2c_dev->address(), HEX);
|
||||
} else {
|
||||
Serial.print("Did not find I2C device at 0x");
|
||||
Serial.println(i2c_dev->address(), HEX);
|
||||
}
|
||||
}
|
||||
|
||||
Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, 0x0F);
|
||||
uint8_t id;
|
||||
id_reg.read(&id);
|
||||
Serial.print("ID register = 0x"); Serial.println(id, HEX);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
29
lib/Adafruit_BusIO/examples/spi_modetest/spi_modetest.ino
Normal file
29
lib/Adafruit_BusIO/examples/spi_modetest/spi_modetest.ino
Normal file
@ -0,0 +1,29 @@
|
||||
#include <Adafruit_SPIDevice.h>
|
||||
|
||||
#define SPIDEVICE_CS 10
|
||||
Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1);
|
||||
//Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 13, 12, 11, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1);
|
||||
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("SPI device mode test");
|
||||
|
||||
if (!spi_dev.begin()) {
|
||||
Serial.println("Could not initialize SPI device");
|
||||
while (1);
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println("\n\nTransfer test");
|
||||
for (uint16_t x=0; x<=0xFF; x++) {
|
||||
uint8_t i = x;
|
||||
Serial.print("0x"); Serial.print(i, HEX);
|
||||
spi_dev.read(&i, 1, i);
|
||||
Serial.print("/"); Serial.print(i, HEX);
|
||||
Serial.print(", ");
|
||||
delay(25);
|
||||
}
|
||||
}
|
39
lib/Adafruit_BusIO/examples/spi_readwrite/spi_readwrite.ino
Normal file
39
lib/Adafruit_BusIO/examples/spi_readwrite/spi_readwrite.ino
Normal file
@ -0,0 +1,39 @@
|
||||
#include <Adafruit_SPIDevice.h>
|
||||
|
||||
#define SPIDEVICE_CS 10
|
||||
Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS);
|
||||
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("SPI device read and write test");
|
||||
|
||||
if (!spi_dev.begin()) {
|
||||
Serial.println("Could not initialize SPI device");
|
||||
while (1);
|
||||
}
|
||||
|
||||
uint8_t buffer[32];
|
||||
|
||||
// Try to read 32 bytes
|
||||
spi_dev.read(buffer, 32);
|
||||
Serial.print("Read: ");
|
||||
for (uint8_t i=0; i<32; i++) {
|
||||
Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", ");
|
||||
}
|
||||
Serial.println();
|
||||
|
||||
// read a register by writing first, then reading
|
||||
buffer[0] = 0x8F; // we'll reuse the same buffer
|
||||
spi_dev.write_then_read(buffer, 1, buffer, 2, false);
|
||||
Serial.print("Write then Read: ");
|
||||
for (uint8_t i=0; i<2; i++) {
|
||||
Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", ");
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
34
lib/Adafruit_BusIO/examples/spi_registers/spi_registers.ino
Normal file
34
lib/Adafruit_BusIO/examples/spi_registers/spi_registers.ino
Normal file
@ -0,0 +1,34 @@
|
||||
#include <Adafruit_BusIO_Register.h>
|
||||
#include <Adafruit_SPIDevice.h>
|
||||
|
||||
#define SPIDEVICE_CS 10
|
||||
Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS);
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("SPI device register test");
|
||||
|
||||
if (!spi_dev.begin()) {
|
||||
Serial.println("Could not initialize SPI device");
|
||||
while (1);
|
||||
}
|
||||
|
||||
Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&spi_dev, 0x0F, ADDRBIT8_HIGH_TOREAD);
|
||||
uint8_t id;
|
||||
id_reg.read(&id);
|
||||
Serial.print("ID register = 0x"); Serial.println(id, HEX);
|
||||
|
||||
Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&spi_dev, 0x0C, ADDRBIT8_HIGH_TOREAD, 2, LSBFIRST);
|
||||
uint16_t thresh;
|
||||
thresh_reg.read(&thresh);
|
||||
Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX);
|
||||
|
||||
thresh_reg.write(~thresh);
|
||||
|
||||
Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
9
lib/Adafruit_BusIO/library.properties
Normal file
9
lib/Adafruit_BusIO/library.properties
Normal file
@ -0,0 +1,9 @@
|
||||
name=Adafruit BusIO
|
||||
version=1.0.10
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=This is a library for abstracting away UART, I2C and SPI interfacing
|
||||
paragraph=This is a library for abstracting away UART, I2C and SPI interfacing
|
||||
category=Signal Input/Output
|
||||
url=https://github.com/adafruit/Adafruit_BusIO
|
||||
architectures=*
|
0
lib/Adafruit_SGP30-1.0.3/.github/ISSUE_TEMPLATE.md → lib/Adafruit_MCP9808_Tasmota/.github/ISSUE_TEMPLATE.md
vendored
Executable file → Normal file
0
lib/Adafruit_SGP30-1.0.3/.github/ISSUE_TEMPLATE.md → lib/Adafruit_MCP9808_Tasmota/.github/ISSUE_TEMPLATE.md
vendored
Executable file → Normal file
0
lib/Adafruit_SGP30-1.0.3/.github/PULL_REQUEST_TEMPLATE.md → lib/Adafruit_MCP9808_Tasmota/.github/PULL_REQUEST_TEMPLATE.md
vendored
Executable file → Normal file
0
lib/Adafruit_SGP30-1.0.3/.github/PULL_REQUEST_TEMPLATE.md → lib/Adafruit_MCP9808_Tasmota/.github/PULL_REQUEST_TEMPLATE.md
vendored
Executable file → Normal file
32
lib/Adafruit_MCP9808_Tasmota/.github/workflows/githubci.yml
vendored
Normal file
32
lib/Adafruit_MCP9808_Tasmota/.github/workflows/githubci.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Arduino Library CI
|
||||
|
||||
on: [pull_request, push, repository_dispatch]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: adafruit/ci-arduino
|
||||
path: ci
|
||||
|
||||
- name: pre-install
|
||||
run: bash ci/actions_install.sh
|
||||
|
||||
- name: test platforms
|
||||
run: python3 ci/build_platform.py main_platforms
|
||||
|
||||
- name: clang
|
||||
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
|
||||
|
||||
- name: doxygen
|
||||
env:
|
||||
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
|
||||
PRETTYNAME : "Adafruit MCP9808 Arduino Library"
|
||||
run: bash ci/doxy_gen_and_deploy.sh
|
8
lib/Adafruit_MCP9808_Tasmota/.gitignore
vendored
Normal file
8
lib/Adafruit_MCP9808_Tasmota/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# osx
|
||||
.DS_Store
|
||||
|
||||
# doxygen
|
||||
Doxyfile*
|
||||
doxygen_sqlite3.db
|
||||
html
|
||||
*.tmp
|
273
lib/Adafruit_MCP9808_Tasmota/Adafruit_MCP9808.cpp
Normal file
273
lib/Adafruit_MCP9808_Tasmota/Adafruit_MCP9808.cpp
Normal file
@ -0,0 +1,273 @@
|
||||
/*!
|
||||
* @file Adafruit_MCP9808.cpp
|
||||
*
|
||||
* @mainpage Adafruit MCP9808 I2C Temp Sensor
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* I2C Driver for Microchip's MCP9808 I2C Temp sensor
|
||||
*
|
||||
* This is a library for the Adafruit MCP9808 breakout:
|
||||
* http://www.adafruit.com/products/1782
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing products from
|
||||
* Adafruit!
|
||||
*
|
||||
* @section author Author
|
||||
*
|
||||
* K.Townsend (Adafruit Industries)
|
||||
*
|
||||
* @section license License
|
||||
*
|
||||
* BSD (see license.txt)
|
||||
*
|
||||
* @section HISTORY
|
||||
*
|
||||
* v1.0 - First release
|
||||
*
|
||||
* changes by Martin Wagner for tasmota project:
|
||||
*
|
||||
* - the libary supports variabel I2C address
|
||||
*
|
||||
*/
|
||||
|
||||
#if ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
|
||||
#ifdef __AVR_ATtiny85__
|
||||
#include "TinyWireM.h"
|
||||
#define Wire TinyWireM
|
||||
#else
|
||||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
#include "Adafruit_MCP9808.h"
|
||||
|
||||
/*!
|
||||
* @brief Instantiates a new MCP9808 class
|
||||
*/
|
||||
Adafruit_MCP9808::Adafruit_MCP9808() {}
|
||||
|
||||
/*!
|
||||
* @brief Setups the HW
|
||||
* @param *theWire
|
||||
* @return True if initialization was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_MCP9808::begin(TwoWire *theWire) {
|
||||
_wire = theWire;
|
||||
_i2caddr = MCP9808_I2CADDR_DEFAULT;
|
||||
return init();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Setups the HW
|
||||
* @param addr
|
||||
* @return True if initialization was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_MCP9808::begin(uint8_t addr) {
|
||||
_i2caddr = addr;
|
||||
_wire = &Wire;
|
||||
return init();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Setups the HW
|
||||
* @param addr
|
||||
* @param *theWire
|
||||
* @return True if initialization was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_MCP9808::begin(uint8_t addr, TwoWire *theWire) {
|
||||
_i2caddr = addr;
|
||||
_wire = theWire;
|
||||
return init();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Setups the HW with default address
|
||||
* @return True if initialization was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_MCP9808::begin() {
|
||||
_i2caddr = MCP9808_I2CADDR_DEFAULT;
|
||||
_wire = &Wire;
|
||||
return init();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief init function
|
||||
* @return True if initialization was successful, otherwise false.
|
||||
*/
|
||||
bool Adafruit_MCP9808::init() {
|
||||
_wire->begin();
|
||||
|
||||
if (read16(MCP9808_REG_MANUF_ID) != 0x0054)
|
||||
return false;
|
||||
if (read16(MCP9808_REG_DEVICE_ID) != 0x0400)
|
||||
return false;
|
||||
|
||||
write16(MCP9808_REG_CONFIG, 0x0);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Reads the 16-bit temperature register and returns the Centigrade
|
||||
* temperature as a float.
|
||||
* @return Temperature in Centigrade.
|
||||
*/
|
||||
float Adafruit_MCP9808::readTempC(uint8_t addr) {
|
||||
_i2caddr = addr;
|
||||
float temp = NAN;
|
||||
uint16_t t = read16(MCP9808_REG_AMBIENT_TEMP);
|
||||
|
||||
if (t != 0xFFFF) {
|
||||
temp = t & 0x0FFF;
|
||||
temp /= 16.0;
|
||||
if (t & 0x1000)
|
||||
temp -= 256;
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Reads the 16-bit temperature register and returns the Fahrenheit
|
||||
* temperature as a float.
|
||||
* @return Temperature in Fahrenheit.
|
||||
*/
|
||||
float Adafruit_MCP9808::readTempF(uint8_t addr) {
|
||||
_i2caddr = addr;
|
||||
float temp = NAN;
|
||||
uint16_t t = read16(MCP9808_REG_AMBIENT_TEMP);
|
||||
|
||||
if (t != 0xFFFF) {
|
||||
temp = t & 0x0FFF;
|
||||
temp /= 16.0;
|
||||
if (t & 0x1000)
|
||||
temp -= 256;
|
||||
|
||||
temp = temp * 9.0 / 5.0 + 32;
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Set Sensor to Shutdown-State or wake up (Conf_Register BIT8)
|
||||
* @param sw true = shutdown / false = wakeup
|
||||
*/
|
||||
void Adafruit_MCP9808::shutdown_wake(uint8_t addr, boolean sw) {
|
||||
_i2caddr = addr;
|
||||
uint16_t conf_shutdown;
|
||||
uint16_t conf_register = read16(MCP9808_REG_CONFIG);
|
||||
if (sw == true) {
|
||||
conf_shutdown = conf_register | MCP9808_REG_CONFIG_SHUTDOWN;
|
||||
write16(MCP9808_REG_CONFIG, conf_shutdown);
|
||||
}
|
||||
if (sw == false) {
|
||||
conf_shutdown = conf_register & ~MCP9808_REG_CONFIG_SHUTDOWN;
|
||||
write16(MCP9808_REG_CONFIG, conf_shutdown);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Shutdown MCP9808
|
||||
*/
|
||||
void Adafruit_MCP9808::shutdown(uint8_t addr) { shutdown_wake(addr, true); }
|
||||
|
||||
/*!
|
||||
* @brief Wake up MCP9808
|
||||
*/
|
||||
void Adafruit_MCP9808::wake(uint8_t addr) {
|
||||
shutdown_wake(addr, false);
|
||||
delay(250);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Get Resolution Value
|
||||
* @return Resolution value
|
||||
*/
|
||||
uint8_t Adafruit_MCP9808::getResolution(uint8_t addr) {
|
||||
_i2caddr = addr;
|
||||
return read8(MCP9808_REG_RESOLUTION);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Set Resolution Value
|
||||
* @param value
|
||||
*/
|
||||
void Adafruit_MCP9808::setResolution(uint8_t addr, uint8_t value) {
|
||||
_i2caddr = addr;
|
||||
write8(MCP9808_REG_RESOLUTION, value & 0x03);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Low level 16 bit write procedures
|
||||
* @param reg
|
||||
* @param value
|
||||
*/
|
||||
void Adafruit_MCP9808::write16(uint8_t reg, uint16_t value) {
|
||||
_wire->beginTransmission(_i2caddr);
|
||||
_wire->write((uint8_t)reg);
|
||||
_wire->write(value >> 8);
|
||||
_wire->write(value & 0xFF);
|
||||
_wire->endTransmission();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Low level 16 bit read procedure
|
||||
* @param reg
|
||||
* @return value
|
||||
*/
|
||||
uint16_t Adafruit_MCP9808::read16(uint8_t reg) {
|
||||
uint16_t val = 0xFFFF;
|
||||
uint8_t state;
|
||||
|
||||
_wire->beginTransmission(_i2caddr);
|
||||
_wire->write((uint8_t)reg);
|
||||
state = _wire->endTransmission();
|
||||
|
||||
if (state == 0) {
|
||||
_wire->requestFrom((uint8_t)_i2caddr, (uint8_t)2);
|
||||
val = _wire->read();
|
||||
val <<= 8;
|
||||
val |= _wire->read();
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Low level 8 bit write procedure
|
||||
* @param reg
|
||||
* @param value
|
||||
*/
|
||||
void Adafruit_MCP9808::write8(uint8_t reg, uint8_t value) {
|
||||
_wire->beginTransmission(_i2caddr);
|
||||
_wire->write((uint8_t)reg);
|
||||
_wire->write(value);
|
||||
_wire->endTransmission();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Low level 8 bit read procedure
|
||||
* @param reg
|
||||
* @return value
|
||||
*/
|
||||
uint8_t Adafruit_MCP9808::read8(uint8_t reg) {
|
||||
uint8_t val = 0xFF;
|
||||
uint8_t state;
|
||||
|
||||
_wire->beginTransmission(_i2caddr);
|
||||
_wire->write((uint8_t)reg);
|
||||
state = _wire->endTransmission();
|
||||
|
||||
if (state == 0) {
|
||||
_wire->requestFrom((uint8_t)_i2caddr, (uint8_t)1);
|
||||
val = _wire->read();
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
87
lib/Adafruit_MCP9808_Tasmota/Adafruit_MCP9808.h
Normal file
87
lib/Adafruit_MCP9808_Tasmota/Adafruit_MCP9808.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*!
|
||||
* @file Adafruit_MCP9808.h
|
||||
*
|
||||
* I2C Driver for Microchip's MCP9808 I2C Temp sensor
|
||||
*
|
||||
* This is a library for the Adafruit MCP9808 breakout:
|
||||
* http://www.adafruit.com/products/1782
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
*please support Adafruit and open-source hardware by purchasing products from
|
||||
* Adafruit!
|
||||
*
|
||||
*
|
||||
* BSD license (see license.txt)
|
||||
*
|
||||
* changes by Martin Wagner for tasmota project:
|
||||
*
|
||||
* - the libary supports variabel I2C address
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ADAFRUIT_MCP9808_H
|
||||
#define _ADAFRUIT_MCP9808_H
|
||||
|
||||
#if ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
|
||||
#include <Wire.h>
|
||||
|
||||
#define MCP9808_I2CADDR_DEFAULT 0x18 ///< I2C address
|
||||
#define MCP9808_REG_CONFIG 0x01 ///< MCP9808 config register
|
||||
|
||||
#define MCP9808_REG_CONFIG_SHUTDOWN 0x0100 ///< shutdown config
|
||||
#define MCP9808_REG_CONFIG_CRITLOCKED 0x0080 ///< critical trip lock
|
||||
#define MCP9808_REG_CONFIG_WINLOCKED 0x0040 ///< alarm window lock
|
||||
#define MCP9808_REG_CONFIG_INTCLR 0x0020 ///< interrupt clear
|
||||
#define MCP9808_REG_CONFIG_ALERTSTAT 0x0010 ///< alert output status
|
||||
#define MCP9808_REG_CONFIG_ALERTCTRL 0x0008 ///< alert output control
|
||||
#define MCP9808_REG_CONFIG_ALERTSEL 0x0004 ///< alert output select
|
||||
#define MCP9808_REG_CONFIG_ALERTPOL 0x0002 ///< alert output polarity
|
||||
#define MCP9808_REG_CONFIG_ALERTMODE 0x0001 ///< alert output mode
|
||||
|
||||
#define MCP9808_REG_UPPER_TEMP 0x02 ///< upper alert boundary
|
||||
#define MCP9808_REG_LOWER_TEMP 0x03 ///< lower alert boundery
|
||||
#define MCP9808_REG_CRIT_TEMP 0x04 ///< critical temperature
|
||||
#define MCP9808_REG_AMBIENT_TEMP 0x05 ///< ambient temperature
|
||||
#define MCP9808_REG_MANUF_ID 0x06 ///< manufacture ID
|
||||
#define MCP9808_REG_DEVICE_ID 0x07 ///< device ID
|
||||
#define MCP9808_REG_RESOLUTION 0x08 ///< resolutin
|
||||
|
||||
/*!
|
||||
* @brief Class that stores state and functions for interacting with
|
||||
* MCP9808 Temp Sensor
|
||||
*/
|
||||
class Adafruit_MCP9808 {
|
||||
public:
|
||||
Adafruit_MCP9808();
|
||||
bool begin();
|
||||
bool begin(TwoWire *theWire);
|
||||
bool begin(uint8_t addr);
|
||||
bool begin(uint8_t addr, TwoWire *theWire);
|
||||
|
||||
bool init();
|
||||
float readTempC(uint8_t addr);
|
||||
float readTempF(uint8_t addr);
|
||||
uint8_t getResolution(uint8_t addr);
|
||||
void setResolution(uint8_t addr, uint8_t value);
|
||||
|
||||
void shutdown_wake(uint8_t addr, boolean sw);
|
||||
void shutdown(uint8_t addr);
|
||||
void wake(uint8_t addr);
|
||||
|
||||
void write16(uint8_t reg, uint16_t val);
|
||||
uint16_t read16(uint8_t reg);
|
||||
|
||||
void write8(uint8_t reg, uint8_t val);
|
||||
uint8_t read8(uint8_t reg);
|
||||
|
||||
private:
|
||||
TwoWire *_wire;
|
||||
uint8_t _i2caddr;
|
||||
};
|
||||
|
||||
#endif
|
18
lib/Adafruit_MCP9808_Tasmota/README.md
Normal file
18
lib/Adafruit_MCP9808_Tasmota/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Adafruit MCP9808 Library [](https://github.com/adafruit/Adafruit_MCP9808_Library/actions)[](http://adafruit.github.io/Adafruit_MCP9808_Library/html/index.html)
|
||||
|
||||
<a href="https://www.adafruit.com/product/1782"><img src="assets/board.jpg?raw=true" width="500px"></a>
|
||||
|
||||
This is the Adafruit MCP9808 Precision I2C Temperature sensor library
|
||||
|
||||
Tested and works great with the Adafruit MCP9808 Breakout Board
|
||||
* http://www.adafruit.com/products/1782
|
||||
|
||||
This chip uses I2C to communicate, 2 pins are required to interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
|
||||
|
||||
Written by Kevin Townsend/Limor Fried for Adafruit Industries.
|
||||
BSD 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 "Adafruit MCP9808" and install the library.
|
BIN
lib/Adafruit_MCP9808_Tasmota/assets/board.jpg
Normal file
BIN
lib/Adafruit_MCP9808_Tasmota/assets/board.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 132 KiB |
127
lib/Adafruit_MCP9808_Tasmota/code-of-conduct.md
Normal file
127
lib/Adafruit_MCP9808_Tasmota/code-of-conduct.md
Normal file
@ -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 <support@adafruit.com>.
|
||||
|
||||
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
|
||||
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
|
||||
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.
|
@ -0,0 +1,69 @@
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
This is a demo for the Adafruit MCP9808 breakout
|
||||
----> http://www.adafruit.com/products/1782
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
#include <Wire.h>
|
||||
#include "Adafruit_MCP9808.h"
|
||||
|
||||
// Create the MCP9808 temperature sensor object
|
||||
Adafruit_MCP9808 tempsensor = Adafruit_MCP9808();
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
while (!Serial); //waits for serial terminal to be open, necessary in newer arduino boards.
|
||||
Serial.println("MCP9808 demo");
|
||||
|
||||
// Make sure the sensor is found, you can also pass in a different i2c
|
||||
// address with tempsensor.begin(0x19) for example, also can be left in blank for default address use
|
||||
// Also there is a table with all addres possible for this sensor, you can connect multiple sensors
|
||||
// to the same i2c bus, just configure each sensor with a different address and define multiple objects for that
|
||||
// A2 A1 A0 address
|
||||
// 0 0 0 0x18 this is the default address
|
||||
// 0 0 1 0x19
|
||||
// 0 1 0 0x1A
|
||||
// 0 1 1 0x1B
|
||||
// 1 0 0 0x1C
|
||||
// 1 0 1 0x1D
|
||||
// 1 1 0 0x1E
|
||||
// 1 1 1 0x1F
|
||||
if (!tempsensor.begin(0x18)) {
|
||||
Serial.println("Couldn't find MCP9808! Check your connections and verify the address is correct.");
|
||||
while (1);
|
||||
}
|
||||
|
||||
Serial.println("Found MCP9808!");
|
||||
|
||||
tempsensor.setResolution(3); // sets the resolution mode of reading, the modes are defined in the table bellow:
|
||||
// Mode Resolution SampleTime
|
||||
// 0 0.5°C 30 ms
|
||||
// 1 0.25°C 65 ms
|
||||
// 2 0.125°C 130 ms
|
||||
// 3 0.0625°C 250 ms
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println("wake up MCP9808.... "); // wake up MCP9808 - power consumption ~200 mikro Ampere
|
||||
tempsensor.wake(); // wake up, ready to read!
|
||||
|
||||
// Read and print out the temperature, also shows the resolution mode used for reading.
|
||||
Serial.print("Resolution in mode: ");
|
||||
Serial.println (tempsensor.getResolution());
|
||||
float c = tempsensor.readTempC();
|
||||
float f = tempsensor.readTempF();
|
||||
Serial.print("Temp: ");
|
||||
Serial.print(c, 4); Serial.print("*C\t and ");
|
||||
Serial.print(f, 4); Serial.println("*F.");
|
||||
|
||||
delay(2000);
|
||||
Serial.println("Shutdown MCP9808.... ");
|
||||
tempsensor.shutdown_wake(1); // shutdown MSP9808 - power consumption ~0.1 mikro Ampere, stops temperature sampling
|
||||
Serial.println("");
|
||||
delay(200);
|
||||
}
|
10
lib/Adafruit_MCP9808_Tasmota/library.properties
Normal file
10
lib/Adafruit_MCP9808_Tasmota/library.properties
Normal file
@ -0,0 +1,10 @@
|
||||
name=Adafruit MCP9808 Library
|
||||
version=1.1.2
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=Arduino library for the MCP9808 sensors in the Adafruit shop
|
||||
paragraph=Arduino library for the MCP9808 sensors in the Adafruit shop
|
||||
category=Sensors
|
||||
url=https://github.com/adafruit/Adafruit_MCP9808_Library
|
||||
architectures=*
|
||||
depends=Adafruit Unified Sensor
|
0
lib/Adafruit_SGP30-1.0.3/license.txt → lib/Adafruit_MCP9808_Tasmota/license.txt
Executable file → Normal file
0
lib/Adafruit_SGP30-1.0.3/license.txt → lib/Adafruit_MCP9808_Tasmota/license.txt
Executable file → Normal file
4
lib/Adafruit_SGP30-1.0.3/.gitignore
vendored
4
lib/Adafruit_SGP30-1.0.3/.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
*~
|
||||
Doxyfile*
|
||||
doxygen_sqlite3.db
|
||||
html
|
@ -1,267 +0,0 @@
|
||||
/*!
|
||||
* @file Adafruit_SGP30.cpp
|
||||
*
|
||||
* @mainpage Adafruit SGP30 gas sensor driver
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* This is the documentation for Adafruit's SGP30 driver for the
|
||||
* Arduino platform. It is designed specifically to work with the
|
||||
* Adafruit SGP30 breakout: http://www.adafruit.com/products/3709
|
||||
*
|
||||
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
|
||||
* to interface with the breakout.
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
*
|
||||
* @section author Author
|
||||
* Written by Ladyada for Adafruit Industries.
|
||||
*
|
||||
* @section license License
|
||||
* BSD license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
|
||||
#include "Adafruit_SGP30.h"
|
||||
|
||||
//#define I2C_DEBUG
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Instantiates a new SGP30 class
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SGP30::Adafruit_SGP30() {
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Setups the hardware and detects a valid SGP30. Initializes I2C
|
||||
then reads the serialnumber and checks that we are talking to an SGP30
|
||||
@param theWire Optional pointer to I2C interface, otherwise use Wire
|
||||
@returns True if SGP30 found on I2C, False if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::begin(TwoWire *theWire) {
|
||||
_i2caddr = SGP30_I2CADDR_DEFAULT;
|
||||
if (theWire == NULL) {
|
||||
_i2c = &Wire;
|
||||
} else {
|
||||
_i2c = theWire;
|
||||
}
|
||||
|
||||
// assume i2c initialized already to avoid resetting clock stretching
|
||||
// _i2c->begin();
|
||||
|
||||
|
||||
uint8_t command[2];
|
||||
command[0] = 0x36;
|
||||
command[1] = 0x82;
|
||||
if (! readWordFromCommand(command, 2, 10, serialnumber, 3))
|
||||
return false;
|
||||
|
||||
uint16_t featureset;
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x2F;
|
||||
if (! readWordFromCommand(command, 2, 10, &featureset, 1))
|
||||
return false;
|
||||
//Serial.print("Featureset 0x"); Serial.println(featureset, HEX);
|
||||
if (featureset != SGP30_FEATURESET)
|
||||
return false;
|
||||
if (! IAQinit())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Commands the sensor to begin the IAQ algorithm. Must be called after startup.
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::IAQinit(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x03;
|
||||
return readWordFromCommand(command, 2, 10);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Commands the sensor to take a single eCO2/VOC measurement. Places results in {@link TVOC} and {@link eCO2}
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::IAQmeasure(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x08;
|
||||
uint16_t reply[2];
|
||||
if (! readWordFromCommand(command, 2, 12, reply, 2))
|
||||
return false;
|
||||
TVOC = reply[1];
|
||||
eCO2 = reply[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Request baseline calibration values for both CO2 and TVOC IAQ calculations. Places results in parameter memory locaitons.
|
||||
@param eco2_base A pointer to a uint16_t which we will save the calibration value to
|
||||
@param tvoc_base A pointer to a uint16_t which we will save the calibration value to
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::getIAQBaseline(uint16_t *eco2_base, uint16_t *tvoc_base) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x15;
|
||||
uint16_t reply[2];
|
||||
if (! readWordFromCommand(command, 2, 10, reply, 2))
|
||||
return false;
|
||||
*eco2_base = reply[0];
|
||||
*tvoc_base = reply[1];
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Assign baseline calibration values for both CO2 and TVOC IAQ calculations.
|
||||
@param eco2_base A uint16_t which we will save the calibration value from
|
||||
@param tvoc_base A uint16_t which we will save the calibration value from
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base) {
|
||||
uint8_t command[8];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x1e;
|
||||
command[2] = tvoc_base >> 8;
|
||||
command[3] = tvoc_base & 0xFF;
|
||||
command[4] = generateCRC(command+2, 2);
|
||||
command[5] = eco2_base >> 8;
|
||||
command[6] = eco2_base & 0xFF;
|
||||
command[7] = generateCRC(command+5, 2);
|
||||
|
||||
return readWordFromCommand(command, 8, 10);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Set the absolute humidity value [mg/m^3] for compensation to increase precision of TVOC and eCO2.
|
||||
@param absolute_humidity A uint32_t [mg/m^3] which we will be used for compensation. If the absolute humidity is set to zero, humidity compensation will be disabled.
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::setHumidity(uint32_t absolute_humidity) {
|
||||
if (absolute_humidity > 256000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t ah_scaled = (uint16_t)(((uint64_t)absolute_humidity * 256 * 16777) >> 24);
|
||||
uint8_t command[5];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x61;
|
||||
command[2] = ah_scaled >> 8;
|
||||
command[3] = ah_scaled & 0xFF;
|
||||
command[4] = generateCRC(command+2, 2);
|
||||
|
||||
return readWordFromCommand(command, 5, 10);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief I2C low level interfacing
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
boolean Adafruit_SGP30::readWordFromCommand(uint8_t command[], uint8_t commandLength, uint16_t delayms, uint16_t *readdata, uint8_t readlen)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
_i2c->beginTransmission(_i2caddr);
|
||||
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\t-> ");
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<commandLength; i++) {
|
||||
_i2c->write(command[i]);
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("0x"); Serial.print(command[i], HEX); Serial.print(", ");
|
||||
#endif
|
||||
}
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.println();
|
||||
#endif
|
||||
_i2c->endTransmission();
|
||||
|
||||
delay(delayms);
|
||||
|
||||
if (readlen == 0)
|
||||
return true;
|
||||
|
||||
uint8_t replylen = readlen * (SGP30_WORD_LEN +1);
|
||||
if (_i2c->requestFrom(_i2caddr, replylen) != replylen)
|
||||
return false;
|
||||
uint8_t replybuffer[replylen];
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\t<- ");
|
||||
#endif
|
||||
for (uint8_t i=0; i<replylen; i++) {
|
||||
replybuffer[i] = _i2c->read();
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("0x"); Serial.print(replybuffer[i], HEX); Serial.print(", ");
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.println();
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<readlen; i++) {
|
||||
uint8_t crc = generateCRC(replybuffer+i*3, 2);
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\tCRC calced: 0x"); Serial.print(crc, HEX);
|
||||
Serial.print(" vs. 0x"); Serial.println(replybuffer[i * 3 + 2], HEX);
|
||||
#endif
|
||||
if (crc != replybuffer[i * 3 + 2])
|
||||
return false;
|
||||
// success! store it
|
||||
readdata[i] = replybuffer[i*3];
|
||||
readdata[i] <<= 8;
|
||||
readdata[i] |= replybuffer[i*3 + 1];
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\tRead: 0x"); Serial.println(readdata[i], HEX);
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t Adafruit_SGP30::generateCRC(uint8_t *data, uint8_t datalen) {
|
||||
// calculates 8-Bit checksum with given polynomial
|
||||
uint8_t crc = SGP30_CRC8_INIT;
|
||||
|
||||
for (uint8_t i=0; i<datalen; i++) {
|
||||
crc ^= data[i];
|
||||
for (uint8_t b=0; b<8; b++) {
|
||||
if (crc & 0x80)
|
||||
crc = (crc << 1) ^ SGP30_CRC8_POLYNOMIAL;
|
||||
else
|
||||
crc <<= 1;
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
/*!
|
||||
* @file Adafruit_SGP30.h
|
||||
*
|
||||
* This is the documentation for Adafruit's SGP30 driver for the
|
||||
* Arduino platform. It is designed specifically to work with the
|
||||
* Adafruit SGP30 breakout: http://www.adafruit.com/products/3709
|
||||
*
|
||||
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
|
||||
* to interface with the breakout.
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* Written by Ladyada for Adafruit Industries.
|
||||
*
|
||||
* BSD license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <Wire.h>
|
||||
|
||||
// the i2c address
|
||||
#define SGP30_I2CADDR_DEFAULT 0x58 ///< SGP30 has only one I2C address
|
||||
|
||||
// commands and constants
|
||||
#define SGP30_FEATURESET 0x0020 ///< The required set for this library
|
||||
#define SGP30_CRC8_POLYNOMIAL 0x31 ///< Seed for SGP30's CRC polynomial
|
||||
#define SGP30_CRC8_INIT 0xFF ///< Init value for CRC
|
||||
#define SGP30_WORD_LEN 2 ///< 2 bytes per word
|
||||
|
||||
/**************************************************************************/
|
||||
/*! Class that stores state and functions for interacting with SGP30 Gas Sensor */
|
||||
/**************************************************************************/
|
||||
class Adafruit_SGP30 {
|
||||
public:
|
||||
Adafruit_SGP30();
|
||||
boolean begin(TwoWire *theWire = NULL);
|
||||
boolean IAQinit(void);
|
||||
boolean IAQmeasure(void);
|
||||
|
||||
boolean getIAQBaseline(uint16_t *eco2_base, uint16_t *tvoc_base);
|
||||
boolean setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base);
|
||||
boolean setHumidity(uint32_t absolute_humidity);
|
||||
|
||||
/**
|
||||
* The last measurement of the IAQ-calculated Total Volatile Organic Compounds in ppb. This value is set when you call {@link IAQmeasure()}
|
||||
*/
|
||||
uint16_t TVOC;
|
||||
|
||||
/**
|
||||
* The last measurement of the IAQ-calculated equivalent CO2 in ppm. This value is set when you call {@link IAQmeasure()}
|
||||
*/
|
||||
uint16_t eCO2;
|
||||
|
||||
/**
|
||||
* The 48-bit serial number, this value is set when you call {@link begin()}
|
||||
*/
|
||||
uint16_t serialnumber[3];
|
||||
private:
|
||||
TwoWire *_i2c;
|
||||
uint8_t _i2caddr;
|
||||
|
||||
void write(uint8_t address, uint8_t *data, uint8_t n);
|
||||
void read(uint8_t address, uint8_t *data, uint8_t n);
|
||||
boolean readWordFromCommand(uint8_t command[], uint8_t commandLength, uint16_t delay, uint16_t *readdata = NULL, uint8_t readlen = 0);
|
||||
uint8_t generateCRC(uint8_t data[], uint8_t datalen);
|
||||
};
|
@ -1,18 +0,0 @@
|
||||
Adafruit_SGP30
|
||||
================
|
||||
|
||||
This is the Adafruit SGP30 Gas / Air Quality I2C sensor library
|
||||
|
||||
Tested and works great with the Aadafruit SGP30 Breakout Board
|
||||
* http://www.adafruit.com/products/3709
|
||||
|
||||
This chip uses I2C to communicate, 2 pins are required to interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
||||
|
306
lib/Adafruit_SGP30-1.2.0/Adafruit_SGP30.cpp
Normal file
306
lib/Adafruit_SGP30-1.2.0/Adafruit_SGP30.cpp
Normal file
@ -0,0 +1,306 @@
|
||||
/*!
|
||||
* @file Adafruit_SGP30.cpp
|
||||
*
|
||||
* @mainpage Adafruit SGP30 gas sensor driver
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* This is the documentation for Adafruit's SGP30 driver for the
|
||||
* Arduino platform. It is designed specifically to work with the
|
||||
* Adafruit SGP30 breakout: http://www.adafruit.com/products/3709
|
||||
*
|
||||
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
|
||||
* to interface with the breakout.
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
*
|
||||
* @section author Author
|
||||
* Written by Ladyada for Adafruit Industries.
|
||||
*
|
||||
* @section license License
|
||||
* BSD license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#include "Adafruit_SGP30.h"
|
||||
//#define I2C_DEBUG
|
||||
|
||||
/*!
|
||||
* @brief Instantiates a new SGP30 class
|
||||
*/
|
||||
Adafruit_SGP30::Adafruit_SGP30() {}
|
||||
|
||||
/*!
|
||||
* @brief Setups the hardware and detects a valid SGP30. Initializes I2C
|
||||
* then reads the serialnumber and checks that we are talking to an
|
||||
* SGP30
|
||||
* @param theWire
|
||||
* Optional pointer to I2C interface, otherwise use Wire
|
||||
* @param initSensor
|
||||
* Optional pointer to prevent IAQinit to be called. Used for Deep
|
||||
* Sleep.
|
||||
* @return True if SGP30 found on I2C, False if something went wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::begin(TwoWire *theWire, boolean initSensor) {
|
||||
_i2caddr = SGP30_I2CADDR_DEFAULT;
|
||||
_i2c = theWire;
|
||||
|
||||
_i2c->begin();
|
||||
|
||||
uint8_t command[2];
|
||||
command[0] = 0x36;
|
||||
command[1] = 0x82;
|
||||
if (!readWordFromCommand(command, 2, 10, serialnumber, 3))
|
||||
return false;
|
||||
|
||||
uint16_t featureset;
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x2F;
|
||||
if (!readWordFromCommand(command, 2, 10, &featureset, 1))
|
||||
return false;
|
||||
// Serial.print("Featureset 0x"); Serial.println(featureset, HEX);
|
||||
if ((featureset & 0xF0) != SGP30_FEATURESET)
|
||||
return false;
|
||||
if (initSensor) {
|
||||
if (!IAQinit())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Commands the sensor to perform a soft reset using the "General
|
||||
* Call" mode. Take note that this is not sensor specific and all devices that
|
||||
* support the General Call mode on the on the same I2C bus will perform this.
|
||||
*
|
||||
* @return True if command completed successfully, false if something went
|
||||
* wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::softReset(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x00;
|
||||
command[1] = 0x06;
|
||||
return readWordFromCommand(command, 2, 10);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Commands the sensor to begin the IAQ algorithm. Must be called
|
||||
* after startup.
|
||||
* @returns True if command completed successfully, false if something went
|
||||
* wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::IAQinit(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x03;
|
||||
return readWordFromCommand(command, 2, 10);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Commands the sensor to take a single eCO2/VOC measurement. Places
|
||||
* results in {@link TVOC} and {@link eCO2}
|
||||
* @return True if command completed successfully, false if something went
|
||||
* wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::IAQmeasure(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x08;
|
||||
uint16_t reply[2];
|
||||
if (!readWordFromCommand(command, 2, 12, reply, 2))
|
||||
return false;
|
||||
TVOC = reply[1];
|
||||
eCO2 = reply[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Commands the sensor to take a single H2/ethanol raw measurement.
|
||||
* Places results in {@link rawH2} and {@link rawEthanol}
|
||||
* @returns True if command completed successfully, false if something went
|
||||
* wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::IAQmeasureRaw(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x50;
|
||||
uint16_t reply[2];
|
||||
if (!readWordFromCommand(command, 2, 25, reply, 2))
|
||||
return false;
|
||||
rawEthanol = reply[1];
|
||||
rawH2 = reply[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Request baseline calibration values for both CO2 and TVOC IAQ
|
||||
* calculations. Places results in parameter memory locaitons.
|
||||
* @param eco2_base
|
||||
* A pointer to a uint16_t which we will save the calibration
|
||||
* value to
|
||||
* @param tvoc_base
|
||||
* A pointer to a uint16_t which we will save the calibration value to
|
||||
* @return True if command completed successfully, false if something went
|
||||
* wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::getIAQBaseline(uint16_t *eco2_base,
|
||||
uint16_t *tvoc_base) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x15;
|
||||
uint16_t reply[2];
|
||||
if (!readWordFromCommand(command, 2, 10, reply, 2))
|
||||
return false;
|
||||
*eco2_base = reply[0];
|
||||
*tvoc_base = reply[1];
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Assign baseline calibration values for both CO2 and TVOC IAQ
|
||||
* calculations.
|
||||
* @param eco2_base
|
||||
* A uint16_t which we will save the calibration value from
|
||||
* @param tvoc_base
|
||||
* A uint16_t which we will save the calibration value from
|
||||
* @return True if command completed successfully, false if something went
|
||||
* wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base) {
|
||||
uint8_t command[8];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x1e;
|
||||
command[2] = tvoc_base >> 8;
|
||||
command[3] = tvoc_base & 0xFF;
|
||||
command[4] = generateCRC(command + 2, 2);
|
||||
command[5] = eco2_base >> 8;
|
||||
command[6] = eco2_base & 0xFF;
|
||||
command[7] = generateCRC(command + 5, 2);
|
||||
|
||||
return readWordFromCommand(command, 8, 10);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Set the absolute humidity value [mg/m^3] for compensation to
|
||||
* increase precision of TVOC and eCO2.
|
||||
* @param absolute_humidity
|
||||
* A uint32_t [mg/m^3] which we will be used for compensation.
|
||||
* If the absolute humidity is set to zero, humidity compensation
|
||||
* will be disabled.
|
||||
* @return True if command completed successfully, false if something went
|
||||
* wrong!
|
||||
*/
|
||||
boolean Adafruit_SGP30::setHumidity(uint32_t absolute_humidity) {
|
||||
if (absolute_humidity > 256000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t ah_scaled =
|
||||
(uint16_t)(((uint64_t)absolute_humidity * 256 * 16777) >> 24);
|
||||
uint8_t command[5];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x61;
|
||||
command[2] = ah_scaled >> 8;
|
||||
command[3] = ah_scaled & 0xFF;
|
||||
command[4] = generateCRC(command + 2, 2);
|
||||
|
||||
return readWordFromCommand(command, 5, 10);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief I2C low level interfacing
|
||||
*/
|
||||
|
||||
boolean Adafruit_SGP30::readWordFromCommand(uint8_t command[],
|
||||
uint8_t commandLength,
|
||||
uint16_t delayms,
|
||||
uint16_t *readdata,
|
||||
uint8_t readlen) {
|
||||
|
||||
_i2c->beginTransmission(_i2caddr);
|
||||
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\t-> ");
|
||||
#endif
|
||||
|
||||
for (uint8_t i = 0; i < commandLength; i++) {
|
||||
_i2c->write(command[i]);
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("0x");
|
||||
Serial.print(command[i], HEX);
|
||||
Serial.print(", ");
|
||||
#endif
|
||||
}
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.println();
|
||||
#endif
|
||||
_i2c->endTransmission();
|
||||
|
||||
delay(delayms);
|
||||
|
||||
if (readlen == 0)
|
||||
return true;
|
||||
|
||||
uint8_t replylen = readlen * (SGP30_WORD_LEN + 1);
|
||||
if (_i2c->requestFrom(_i2caddr, replylen) != replylen)
|
||||
return false;
|
||||
uint8_t replybuffer[replylen];
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\t<- ");
|
||||
#endif
|
||||
for (uint8_t i = 0; i < replylen; i++) {
|
||||
replybuffer[i] = _i2c->read();
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("0x");
|
||||
Serial.print(replybuffer[i], HEX);
|
||||
Serial.print(", ");
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.println();
|
||||
#endif
|
||||
|
||||
for (uint8_t i = 0; i < readlen; i++) {
|
||||
uint8_t crc = generateCRC(replybuffer + i * 3, 2);
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\tCRC calced: 0x");
|
||||
Serial.print(crc, HEX);
|
||||
Serial.print(" vs. 0x");
|
||||
Serial.println(replybuffer[i * 3 + 2], HEX);
|
||||
#endif
|
||||
if (crc != replybuffer[i * 3 + 2])
|
||||
return false;
|
||||
// success! store it
|
||||
readdata[i] = replybuffer[i * 3];
|
||||
readdata[i] <<= 8;
|
||||
readdata[i] |= replybuffer[i * 3 + 1];
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\tRead: 0x");
|
||||
Serial.println(readdata[i], HEX);
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t Adafruit_SGP30::generateCRC(uint8_t *data, uint8_t datalen) {
|
||||
// calculates 8-Bit checksum with given polynomial
|
||||
uint8_t crc = SGP30_CRC8_INIT;
|
||||
|
||||
for (uint8_t i = 0; i < datalen; i++) {
|
||||
crc ^= data[i];
|
||||
for (uint8_t b = 0; b < 8; b++) {
|
||||
if (crc & 0x80)
|
||||
crc = (crc << 1) ^ SGP30_CRC8_POLYNOMIAL;
|
||||
else
|
||||
crc <<= 1;
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
}
|
80
lib/Adafruit_SGP30-1.2.0/Adafruit_SGP30.h
Normal file
80
lib/Adafruit_SGP30-1.2.0/Adafruit_SGP30.h
Normal file
@ -0,0 +1,80 @@
|
||||
/*!
|
||||
* @file Adafruit_SGP30.h
|
||||
*
|
||||
* This is the documentation for Adafruit's SGP30 driver for the
|
||||
* Arduino platform. It is designed specifically to work with the
|
||||
* Adafruit SGP30 breakout: http://www.adafruit.com/products/3709
|
||||
*
|
||||
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
|
||||
* to interface with the breakout.
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* Written by Ladyada for Adafruit Industries.
|
||||
*
|
||||
* BSD license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <Wire.h>
|
||||
|
||||
// the i2c address
|
||||
#define SGP30_I2CADDR_DEFAULT 0x58 ///< SGP30 has only one I2C address
|
||||
|
||||
// commands and constants
|
||||
#define SGP30_FEATURESET 0x0020 ///< The required set for this library
|
||||
#define SGP30_CRC8_POLYNOMIAL 0x31 ///< Seed for SGP30's CRC polynomial
|
||||
#define SGP30_CRC8_INIT 0xFF ///< Init value for CRC
|
||||
#define SGP30_WORD_LEN 2 ///< 2 bytes per word
|
||||
|
||||
/*!
|
||||
* @brief Class that stores state and functions for interacting with
|
||||
* SGP30 Gas Sensor
|
||||
*/
|
||||
class Adafruit_SGP30 {
|
||||
public:
|
||||
Adafruit_SGP30();
|
||||
boolean begin(TwoWire *theWire = &Wire, boolean initSensor = true);
|
||||
boolean softReset();
|
||||
boolean IAQinit();
|
||||
boolean IAQmeasure();
|
||||
boolean IAQmeasureRaw();
|
||||
|
||||
boolean getIAQBaseline(uint16_t *eco2_base, uint16_t *tvoc_base);
|
||||
boolean setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base);
|
||||
boolean setHumidity(uint32_t absolute_humidity);
|
||||
|
||||
/** The last measurement of the IAQ-calculated Total Volatile Organic
|
||||
* Compounds in ppb. This value is set when you call {@link IAQmeasure()} **/
|
||||
uint16_t TVOC;
|
||||
|
||||
/** The last measurement of the IAQ-calculated equivalent CO2 in ppm. This
|
||||
* value is set when you call {@link IAQmeasure()} **/
|
||||
uint16_t eCO2;
|
||||
|
||||
/** The last measurement of the IAQ-calculated equivalent CO2 in ppm. This
|
||||
* value is set when you call {@link IAQmeasureRaw()} **/
|
||||
uint16_t rawH2;
|
||||
|
||||
/** The last measurement of the IAQ-calculated equivalent CO2 in ppm. This
|
||||
* value is set when you call {@link IAQmeasureRaw()} **/
|
||||
uint16_t rawEthanol;
|
||||
|
||||
/** The 48-bit serial number, this value is set when you call {@link begin()}
|
||||
* **/
|
||||
uint16_t serialnumber[3];
|
||||
|
||||
private:
|
||||
TwoWire *_i2c;
|
||||
uint8_t _i2caddr;
|
||||
|
||||
void write(uint8_t address, uint8_t *data, uint8_t n);
|
||||
void read(uint8_t address, uint8_t *data, uint8_t n);
|
||||
boolean readWordFromCommand(uint8_t command[], uint8_t commandLength,
|
||||
uint16_t delay, uint16_t *readdata = NULL,
|
||||
uint8_t readlen = 0);
|
||||
uint8_t generateCRC(uint8_t data[], uint8_t datalen);
|
||||
};
|
54
lib/Adafruit_SGP30-1.2.0/README.md
Normal file
54
lib/Adafruit_SGP30-1.2.0/README.md
Normal file
@ -0,0 +1,54 @@
|
||||
# Adafruit SGP30 Gas / Air Quality I2C sensor [[](https://github.com/adafruit/Adafruit_SGP30/actions)[](http://adafruit.github.io/Adafruit_SGP30/html/index.html)
|
||||
|
||||
<a href="https://www.adafruit.com/product/3709"><img src="assets/board.jpg?raw=true" width="500px"></a>
|
||||
|
||||
This is the Adafruit SGP30 Gas / Air Quality I2C sensor library
|
||||
|
||||
Tested and works great with the Aadafruit SGP30 Breakout Board
|
||||
* http://www.adafruit.com/products/3709
|
||||
|
||||
This chip uses I2C to communicate, 2 pins are required to interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
|
||||
|
||||
# Installation
|
||||
To install, use the Arduino Library Manager and search for "Adafruit SGP30" and install the library.
|
||||
|
||||
## Dependencies
|
||||
* [Adafruit ILI9341](https://github.com/adafruit/Adafruit_ILI9341)
|
||||
* [Adafruit GFX Library](https://github.com/adafruit/Adafruit-GFX-Library)
|
||||
|
||||
# Contributing
|
||||
|
||||
Contributions are welcome! Please read our [Code of Conduct](https://github.com/adafruit/Adafruit_SGP30/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
|
||||
|
||||
## Formatting and clang-format
|
||||
This library uses [`clang-format`](https://releases.llvm.org/download.html) to standardize the formatting of `.cpp` and `.h` files.
|
||||
Contributions should be formatted using `clang-format`:
|
||||
|
||||
The `-i` flag will make the changes to the file.
|
||||
```bash
|
||||
clang-format -i *.cpp *.h
|
||||
```
|
||||
If you prefer to make the changes yourself, running `clang-format` without the `-i` flag will print out a formatted version of the file. You can save this to a file and diff it against the original to see the changes.
|
||||
|
||||
Note that the formatting output by `clang-format` is what the automated formatting checker will expect. Any diffs from this formatting will result in a failed build until they are addressed. Using the `-i` flag is highly recommended.
|
||||
|
||||
### clang-format resources
|
||||
* [Binary builds and source available on the LLVM downloads page](https://releases.llvm.org/download.html)
|
||||
* [Documentation and IDE integration](https://clang.llvm.org/docs/ClangFormat.html)
|
||||
|
||||
## About this Driver
|
||||
Written by Limor Fried for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
10
lib/Adafruit_SGP30-1.0.3/examples/sgp30test/sgp30test.ino → lib/Adafruit_SGP30-1.2.0/examples/sgp30test/sgp30test.ino
Executable file → Normal file
10
lib/Adafruit_SGP30-1.0.3/examples/sgp30test/sgp30test.ino → lib/Adafruit_SGP30-1.2.0/examples/sgp30test/sgp30test.ino
Executable file → Normal file
@ -44,6 +44,14 @@ void loop() {
|
||||
}
|
||||
Serial.print("TVOC "); Serial.print(sgp.TVOC); Serial.print(" ppb\t");
|
||||
Serial.print("eCO2 "); Serial.print(sgp.eCO2); Serial.println(" ppm");
|
||||
|
||||
if (! sgp.IAQmeasureRaw()) {
|
||||
Serial.println("Raw Measurement failed");
|
||||
return;
|
||||
}
|
||||
Serial.print("Raw H2 "); Serial.print(sgp.rawH2); Serial.print(" \t");
|
||||
Serial.print("Raw Ethanol "); Serial.print(sgp.rawEthanol); Serial.println("");
|
||||
|
||||
delay(1000);
|
||||
|
||||
counter++;
|
||||
@ -58,4 +66,4 @@ void loop() {
|
||||
Serial.print("****Baseline values: eCO2: 0x"); Serial.print(eCO2_base, HEX);
|
||||
Serial.print(" & TVOC: 0x"); Serial.println(TVOC_base, HEX);
|
||||
}
|
||||
}
|
||||
}
|
3
lib/Adafruit_SGP30-1.0.3/library.properties → lib/Adafruit_SGP30-1.2.0/library.properties
Executable file → Normal file
3
lib/Adafruit_SGP30-1.0.3/library.properties → lib/Adafruit_SGP30-1.2.0/library.properties
Executable file → Normal file
@ -1,5 +1,5 @@
|
||||
name=Adafruit SGP30 Sensor
|
||||
version=1.0.3
|
||||
version=1.2.0
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=This is an Arduino library for the Adafruit SGP30 Gas / Air Quality Sensor
|
||||
@ -7,3 +7,4 @@ paragraph=This is an Arduino library for the Adafruit SGP30 Gas / Air Quality Se
|
||||
category=Sensors
|
||||
url=https://github.com/adafruit/Adafruit_SGP30
|
||||
architectures=*
|
||||
depends=Adafruit ILI9341, Adafruit GFX Library
|
26
lib/Adafruit_SGP30-1.2.0/license.txt
Normal file
26
lib/Adafruit_SGP30-1.2.0/license.txt
Normal file
@ -0,0 +1,26 @@
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2012, Adafruit Industries
|
||||
All rights reserved.
|
||||
|
||||
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 holders 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 ''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 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.
|
0
lib/Adafruit_SGP30-1.0.3/.travis.yml → lib/Adafruit_SGP30-1.2.0/travis.yml
Executable file → Normal file
0
lib/Adafruit_SGP30-1.0.3/.travis.yml → lib/Adafruit_SGP30-1.2.0/travis.yml
Executable file → Normal file
@ -29,6 +29,8 @@ SSD1351::SSD1351(int8_t cs,int8_t mosi,int8_t sclk) : Renderer(SSD1351_WIDTH, SS
|
||||
_hwspi = 0;
|
||||
}
|
||||
|
||||
#ifndef ESP32
|
||||
|
||||
#include "spi_register.h"
|
||||
|
||||
/* CPU Clock = 80 Mhz
|
||||
@ -189,84 +191,81 @@ void SSD1351::writedata(uint8_t d) {
|
||||
}
|
||||
|
||||
|
||||
uint16_t SSD1351::GetColorFromIndex(uint8_t index) {
|
||||
if (index>=sizeof(ssd1351_colors)/2) index=0;
|
||||
return ssd1351_colors[index];
|
||||
}
|
||||
void ICACHE_RAM_ATTR SSD1351::fastSPIwrite(uint8_t d,uint8_t dc) {
|
||||
|
||||
void SSD1351::DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font) {
|
||||
setRotation(rot);
|
||||
invertDisplay(false);
|
||||
setTextWrap(false); // Allow text to run off edges
|
||||
cp437(true);
|
||||
setTextFont(font&3);
|
||||
setTextSize(size&7);
|
||||
setTextColor(SSD1351_WHITE,SSD1351_BLACK);
|
||||
setCursor(0,0);
|
||||
fillScreen(SSD1351_BLACK);
|
||||
stop();
|
||||
}
|
||||
WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_cs);
|
||||
WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_sclk);
|
||||
if(dc) WRITE_PERI_REG( PIN_OUT_SET, 1<<_mosi);
|
||||
else WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_mosi);
|
||||
WRITE_PERI_REG( PIN_OUT_SET, 1<<_sclk);
|
||||
|
||||
void SSD1351::DisplayOnff(int8_t on) {
|
||||
if (on) {
|
||||
writecommand(SSD1351_CMD_DISPLAYON); //Display on
|
||||
} else {
|
||||
writecommand(SSD1351_CMD_DISPLAYOFF);
|
||||
for(uint8_t bit = 0x80; bit; bit >>= 1) {
|
||||
WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_sclk);
|
||||
if(d&bit) WRITE_PERI_REG( PIN_OUT_SET, 1<<_mosi);
|
||||
else WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_mosi);
|
||||
WRITE_PERI_REG( PIN_OUT_SET, 1<<_sclk);
|
||||
}
|
||||
stop();
|
||||
WRITE_PERI_REG( PIN_OUT_SET, 1<<_cs);
|
||||
}
|
||||
|
||||
// dimmer 0-100
|
||||
void SSD1351::dim(uint8_t contrast) {
|
||||
writecommand(SSD1351_CMD_CONTRASTMASTER);
|
||||
if (contrast>15) contrast=15;
|
||||
writedata(contrast);
|
||||
stop();
|
||||
|
||||
#else
|
||||
// ESP32 section
|
||||
uint8_t ssd131_start;
|
||||
|
||||
void SSD1351::writedata(uint8_t d) {
|
||||
fastSPIwrite(d,1);
|
||||
}
|
||||
|
||||
/*
|
||||
if (SSD_COMSPLIT == 1){
|
||||
_remapReg |= ((1 << 5));
|
||||
} else {
|
||||
_remapReg |= ((0 << 5));
|
||||
}
|
||||
setRegister_cont(CMD_CMDLOCK,SSD_COMMANDLOCK1);
|
||||
setRegister_cont(CMD_CMDLOCK,SSD_COMMANDLOCK2);
|
||||
writecommand_cont(CMD_DISPLAYOFF);
|
||||
setRegister_cont(CMD_CLOCKDIV,SSD_CLOCKDIV);
|
||||
setRegister_cont(CMD_MUXRATIO,SSD_MUXRATIO);
|
||||
setRegister_cont(CMD_STARTLINE,SSD_STARTLINE); >>>
|
||||
setRegister_cont(CMD_DISPLAYOFFSET,SSD_DISPLAYOFFSET);
|
||||
setRegister_cont(CMD_SETGPIO,SSD_SETGPIO);
|
||||
setRegister_cont(CMD_FUNCTIONSELECT,SSD_FUNCTIONSELECT);
|
||||
writecommand_cont(CMD_SETVSL);
|
||||
writedata8_cont(SSD_SETVSL_A);writedata8_cont(SSD_SETVSL_B);writedata8_cont(SSD_SETVSL_C);
|
||||
writecommand_cont(CMD_CONTRASTABC);
|
||||
writedata8_cont(SSD_CONTRAST_A);writedata8_cont(SSD_CONTRAST_B);writedata8_cont(SSD_CONTRAST_C);
|
||||
setRegister_cont(CMD_MASTERCURRENT,SSD_MASTERCURRENT); >>>
|
||||
writecommand_cont(CMD_DISPLAYENHANCE); >>
|
||||
if (SSD_ENHANCE){
|
||||
writedata8_cont(0xA4);
|
||||
} else {
|
||||
writedata8_cont(0x00);
|
||||
}
|
||||
writedata8_cont(0x00);
|
||||
writedata8_cont(0x00);
|
||||
#if defined(SSD_GAMMASET)
|
||||
//writecommand_cont(CMD_GRAYSCALE); for (uint8_t i =0;i<32;i++){writedata8_cont(SSD_GRAYTABLE[i]);}
|
||||
#else
|
||||
writecommand_cont(CMD_USELUT);
|
||||
#endif
|
||||
// phase here
|
||||
setRegister_cont(CMD_PRECHARGE,SSD_PRECHARGE); >>
|
||||
setRegister_cont(CMD_PRECHARGE2,SSD_PRECHARGE2);
|
||||
setRegister_cont(CMD_VCOMH,SSD_VCOMH);
|
||||
#endif
|
||||
//setAddrWindow_cont(0,0,SSD_WIDTH-1,SSD_HEIGHT-1,false);// ???
|
||||
//_pushColors_cont(_defaultBgColor, SSD_CGRAM);//???
|
||||
//Normal Display and turn ON
|
||||
writecommand_cont(CMD_NORMALDISPLAY);
|
||||
*/
|
||||
void SSD1351::writecommand(uint8_t c) {
|
||||
fastSPIwrite(c,0);
|
||||
}
|
||||
|
||||
#include "soc/spi_reg.h"
|
||||
#include "soc/spi_struct.h"
|
||||
#include "esp32-hal-spi.h"
|
||||
#include "esp32-hal.h"
|
||||
#include "soc/spi_struct.h"
|
||||
|
||||
SPISettings oled_spiSettings;
|
||||
|
||||
// diconnect from spi
|
||||
void SSD1351::start(void) {
|
||||
if (ssd131_start) return;
|
||||
SPI.beginTransaction(oled_spiSettings);
|
||||
ssd131_start = 1;
|
||||
}
|
||||
|
||||
// reconnect to spi
|
||||
void SSD1351::stop(void) {
|
||||
if (!ssd131_start) return;
|
||||
SPI.endTransaction();
|
||||
ssd131_start = 0;
|
||||
}
|
||||
|
||||
// since ardunio transferBits ia completely disfunctional
|
||||
// we use our own hardware driver for 9 bit spi
|
||||
void SSD1351::fastSPIwrite(uint8_t d,uint8_t dc) {
|
||||
digitalWrite( _cs, LOW);
|
||||
|
||||
uint32_t regvalue=d>>1;
|
||||
if (dc) regvalue|=0x80;
|
||||
else regvalue&=0x7f;
|
||||
if (d&1) regvalue|=0x8000;
|
||||
|
||||
REG_SET_BIT(SPI_USER_REG(3), SPI_USR_MOSI);
|
||||
REG_WRITE(SPI_MOSI_DLEN_REG(3), 9 - 1);
|
||||
uint32_t *dp=(uint32_t*)SPI_W0_REG(3);
|
||||
*dp=regvalue;
|
||||
REG_SET_BIT(SPI_CMD_REG(3), SPI_USR);
|
||||
while (REG_GET_FIELD(SPI_CMD_REG(3), SPI_USR));
|
||||
|
||||
digitalWrite( _cs, HIGH);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static const uint8_t PROGMEM initList[] = {
|
||||
SSD1351_CMD_COMMANDLOCK, 1, // Set command lock, 1 arg
|
||||
0x12,
|
||||
@ -305,34 +304,30 @@ static const uint8_t PROGMEM initList[] = {
|
||||
0 }; // END OF COMMAND LIST
|
||||
|
||||
|
||||
void SSD1351::sendcommand(uint8_t commandByte, const uint8_t *dataBytes, uint8_t numDataBytes) {
|
||||
writecommand(commandByte);
|
||||
for (int i=0; i<numDataBytes; i++) {
|
||||
writedata(pgm_read_byte(dataBytes++)); // Send the data bytes
|
||||
}
|
||||
}
|
||||
|
||||
void SSD1351::sendcommand(uint8_t commandByte,uint8_t *dataBytes, uint8_t numDataBytes) {
|
||||
writecommand(commandByte);
|
||||
for (int i=0; i<numDataBytes; i++) {
|
||||
writedata(*dataBytes++); // Send the data bytes
|
||||
}
|
||||
}
|
||||
|
||||
void SSD1351::begin(void) {
|
||||
pinMode(_cs, OUTPUT);
|
||||
digitalWrite(_cs,HIGH);
|
||||
pinMode(_sclk, OUTPUT);
|
||||
digitalWrite(_sclk, LOW);
|
||||
pinMode(_mosi, OUTPUT);
|
||||
digitalWrite(_mosi, LOW);
|
||||
|
||||
|
||||
#ifndef ESP32
|
||||
if ((_sclk==14) && (_mosi==13) && (_cs==15)) {
|
||||
// we use hardware spi
|
||||
_hwspi=1;
|
||||
SPI.begin();
|
||||
spi_lcd_mode_init();
|
||||
} else {
|
||||
// we must use software spi
|
||||
_hwspi=0;
|
||||
}
|
||||
|
||||
#else
|
||||
_hwspi=1;
|
||||
SPI.begin(_sclk,-1,_mosi, -1);
|
||||
oled_spiSettings = SPISettings(4500000, MSBFIRST, SPI_MODE3);
|
||||
#endif
|
||||
|
||||
const uint8_t *addr = (const uint8_t *)initList;
|
||||
uint8_t cmd, x, numArgs;
|
||||
@ -351,8 +346,56 @@ void SSD1351::begin(void) {
|
||||
}
|
||||
|
||||
|
||||
#define ssd1351_swap(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) ///< No-temp-var swap operation
|
||||
void SSD1351::sendcommand(uint8_t commandByte, const uint8_t *dataBytes, uint8_t numDataBytes) {
|
||||
writecommand(commandByte);
|
||||
for (int i=0; i<numDataBytes; i++) {
|
||||
writedata(pgm_read_byte(dataBytes++)); // Send the data bytes
|
||||
}
|
||||
}
|
||||
|
||||
void SSD1351::sendcommand(uint8_t commandByte,uint8_t *dataBytes, uint8_t numDataBytes) {
|
||||
writecommand(commandByte);
|
||||
for (int i=0; i<numDataBytes; i++) {
|
||||
writedata(*dataBytes++); // Send the data bytes
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t SSD1351::GetColorFromIndex(uint8_t index) {
|
||||
if (index>=sizeof(ssd1351_colors)/2) index=0;
|
||||
return ssd1351_colors[index];
|
||||
}
|
||||
|
||||
void SSD1351::DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font) {
|
||||
setRotation(rot);
|
||||
invertDisplay(false);
|
||||
setTextWrap(false); // Allow text to run off edges
|
||||
cp437(true);
|
||||
setTextFont(font&3);
|
||||
setTextSize(size&7);
|
||||
setTextColor(SSD1351_WHITE,SSD1351_BLACK);
|
||||
setCursor(0,0);
|
||||
fillScreen(SSD1351_BLACK);
|
||||
stop();
|
||||
}
|
||||
|
||||
void SSD1351::DisplayOnff(int8_t on) {
|
||||
if (on) {
|
||||
writecommand(SSD1351_CMD_DISPLAYON); //Display on
|
||||
} else {
|
||||
writecommand(SSD1351_CMD_DISPLAYOFF);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
||||
// dimmer 0-100
|
||||
void SSD1351::dim(uint8_t contrast) {
|
||||
writecommand(SSD1351_CMD_CONTRASTMASTER);
|
||||
if (contrast>15) contrast=15;
|
||||
writedata(contrast);
|
||||
stop();
|
||||
}
|
||||
|
||||
#define ssd1351_swap(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) ///< No-temp-var swap operation
|
||||
|
||||
|
||||
void SSD1351::setAddrWindow_i(uint16_t x1, uint16_t y1, uint16_t w, uint16_t h) {
|
||||
@ -501,20 +544,3 @@ void SSD1351::drawFastHLine(int16_t x,int16_t y,int16_t w,uint16_t color) {
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
||||
void ICACHE_RAM_ATTR SSD1351::fastSPIwrite(uint8_t d,uint8_t dc) {
|
||||
|
||||
WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_cs);
|
||||
WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_sclk);
|
||||
if(dc) WRITE_PERI_REG( PIN_OUT_SET, 1<<_mosi);
|
||||
else WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_mosi);
|
||||
WRITE_PERI_REG( PIN_OUT_SET, 1<<_sclk);
|
||||
|
||||
for(uint8_t bit = 0x80; bit; bit >>= 1) {
|
||||
WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_sclk);
|
||||
if(d&bit) WRITE_PERI_REG( PIN_OUT_SET, 1<<_mosi);
|
||||
else WRITE_PERI_REG( PIN_OUT_CLEAR, 1<<_mosi);
|
||||
WRITE_PERI_REG( PIN_OUT_SET, 1<<_sclk);
|
||||
}
|
||||
WRITE_PERI_REG( PIN_OUT_SET, 1<<_cs);
|
||||
}
|
||||
|
46
lib/Adafruit_VEML7700/.github/ISSUE_TEMPLATE.md
vendored
Normal file
46
lib/Adafruit_VEML7700/.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
Thank you for opening an issue on an Adafruit Arduino library repository. To
|
||||
improve the speed of resolution please review the following guidelines and
|
||||
common troubleshooting steps below before creating the issue:
|
||||
|
||||
- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use
|
||||
the forums at http://forums.adafruit.com to ask questions and troubleshoot why
|
||||
something isn't working as expected. In many cases the problem is a common issue
|
||||
that you will more quickly receive help from the forum community. GitHub issues
|
||||
are meant for known defects in the code. If you don't know if there is a defect
|
||||
in the code then start with troubleshooting on the forum first.
|
||||
|
||||
- **If following a tutorial or guide be sure you didn't miss a step.** Carefully
|
||||
check all of the steps and commands to run have been followed. Consult the
|
||||
forum if you're unsure or have questions about steps in a guide/tutorial.
|
||||
|
||||
- **For Arduino projects check these very common issues to ensure they don't apply**:
|
||||
|
||||
- For uploading sketches or communicating with the board make sure you're using
|
||||
a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes
|
||||
very hard to tell the difference between a data and charge cable! Try using the
|
||||
cable with other devices or swapping to another cable to confirm it is not
|
||||
the problem.
|
||||
|
||||
- **Be sure you are supplying adequate power to the board.** Check the specs of
|
||||
your board and plug in an external power supply. In many cases just
|
||||
plugging a board into your computer is not enough to power it and other
|
||||
peripherals.
|
||||
|
||||
- **Double check all soldering joints and connections.** Flakey connections
|
||||
cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints.
|
||||
|
||||
- **Ensure you are using an official Arduino or Adafruit board.** We can't
|
||||
guarantee a clone board will have the same functionality and work as expected
|
||||
with this code and don't support them.
|
||||
|
||||
If you're sure this issue is a defect in the code and checked the steps above
|
||||
please fill in the following fields to provide enough troubleshooting information.
|
||||
You may delete the guideline and text above to just leave the following details:
|
||||
|
||||
- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE**
|
||||
|
||||
- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO
|
||||
VERSION HERE**
|
||||
|
||||
- List the steps to reproduce the problem below (if possible attach a sketch or
|
||||
copy the sketch code in too): **LIST REPRO STEPS BELOW**
|
26
lib/Adafruit_VEML7700/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
26
lib/Adafruit_VEML7700/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
Thank you for creating a pull request to contribute to Adafruit's GitHub code!
|
||||
Before you open the request please review the following guidelines and tips to
|
||||
help it be more easily integrated:
|
||||
|
||||
- **Describe the scope of your change--i.e. what the change does and what parts
|
||||
of the code were modified.** This will help us understand any risks of integrating
|
||||
the code.
|
||||
|
||||
- **Describe any known limitations with your change.** For example if the change
|
||||
doesn't apply to a supported platform of the library please mention it.
|
||||
|
||||
- **Please run any tests or examples that can exercise your modified code.** We
|
||||
strive to not break users of the code and running tests/examples helps with this
|
||||
process.
|
||||
|
||||
Thank you again for contributing! We will try to test and integrate the change
|
||||
as soon as we can, but be aware we have many GitHub repositories to manage and
|
||||
can't immediately respond to every request. There is no need to bump or check in
|
||||
on a pull request (it will clutter the discussion of the request).
|
||||
|
||||
Also don't be worried if the request is closed or not integrated--sometimes the
|
||||
priorities of Adafruit's GitHub code (education, ease of use) might not match the
|
||||
priorities of the pull request. Don't fret, the open source community thrives on
|
||||
forks and GitHub makes it easy to keep your changes in a forked repo.
|
||||
|
||||
After reviewing the guidelines above you can delete this text from the pull request.
|
8
lib/Adafruit_VEML7700/.gitignore
vendored
Normal file
8
lib/Adafruit_VEML7700/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# osx
|
||||
.DS_Store
|
||||
|
||||
# doxygen
|
||||
Doxyfile*
|
||||
doxygen_sqlite3.db
|
||||
html
|
||||
*.tmp
|
26
lib/Adafruit_VEML7700/.travis.yml
Normal file
26
lib/Adafruit_VEML7700/.travis.yml
Normal file
@ -0,0 +1,26 @@
|
||||
language: c
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- ~/arduino_ide
|
||||
- ~/.arduino15/packages/
|
||||
git:
|
||||
depth: false
|
||||
quiet: true
|
||||
env:
|
||||
global:
|
||||
- PRETTYNAME="Adafruit VEML7700 Arduino Library"
|
||||
|
||||
before_install:
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
|
||||
|
||||
install:
|
||||
- arduino --install-library "Adafruit BusIO"
|
||||
|
||||
script:
|
||||
- build_main_platforms
|
||||
|
||||
# Generate and deploy documentation
|
||||
after_success:
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/library_check.sh)
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/doxy_gen_and_deploy.sh)
|
321
lib/Adafruit_VEML7700/Adafruit_VEML7700.cpp
Normal file
321
lib/Adafruit_VEML7700/Adafruit_VEML7700.cpp
Normal file
@ -0,0 +1,321 @@
|
||||
/*!
|
||||
* @file Adafruit_VEML7700.cpp
|
||||
*
|
||||
* @mainpage Adafruit VEML7700 I2C Lux Sensor
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* I2C Driver for the VEML7700 I2C Lux sensor
|
||||
*
|
||||
* This is a library for the Adafruit VEML7700 breakout:
|
||||
* http://www.adafruit.com/
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing products from
|
||||
* Adafruit!
|
||||
*
|
||||
* @section author Author
|
||||
*
|
||||
* Limor Fried (Adafruit Industries)
|
||||
*
|
||||
* @section license License
|
||||
*
|
||||
* BSD (see license.txt)
|
||||
*
|
||||
* @section HISTORY
|
||||
*
|
||||
* v1.0 - First release
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <Wire.h>
|
||||
|
||||
#include "Adafruit_VEML7700.h"
|
||||
|
||||
/*!
|
||||
* @brief Instantiates a new VEML7700 class
|
||||
*/
|
||||
Adafruit_VEML7700::Adafruit_VEML7700(void) {}
|
||||
|
||||
/*!
|
||||
* @brief Setups the hardware for talking to the VEML7700
|
||||
* @param theWire An optional pointer to an I2C interface
|
||||
* @return True if initialization was successful, otherwise false.
|
||||
*/
|
||||
boolean Adafruit_VEML7700::begin(TwoWire *theWire) {
|
||||
i2c_dev = new Adafruit_I2CDevice(VEML7700_I2CADDR_DEFAULT, theWire);
|
||||
|
||||
if (!i2c_dev->begin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ALS_Config = new Adafruit_I2CRegister(i2c_dev, VEML7700_ALS_CONFIG, 2, LSBFIRST);
|
||||
ALS_HighThreshold = new Adafruit_I2CRegister(i2c_dev, VEML7700_ALS_THREHOLD_HIGH, 2, LSBFIRST);
|
||||
ALS_LowThreshold = new Adafruit_I2CRegister(i2c_dev, VEML7700_ALS_THREHOLD_LOW, 2, LSBFIRST);
|
||||
Power_Saving = new Adafruit_I2CRegister(i2c_dev, VEML7700_ALS_POWER_SAVE, 2, LSBFIRST);
|
||||
ALS_Data = new Adafruit_I2CRegister(i2c_dev, VEML7700_ALS_DATA, 2, LSBFIRST);
|
||||
White_Data = new Adafruit_I2CRegister(i2c_dev, VEML7700_WHITE_DATA, 2, LSBFIRST);
|
||||
Interrupt_Status = new Adafruit_I2CRegister(i2c_dev, VEML7700_INTERRUPTSTATUS, 2, LSBFIRST);
|
||||
|
||||
ALS_Shutdown = new Adafruit_I2CRegisterBits(ALS_Config, 1, 0); // # bits, bit_shift
|
||||
ALS_Interrupt_Enable = new Adafruit_I2CRegisterBits(ALS_Config, 1, 1);
|
||||
ALS_Persistence = new Adafruit_I2CRegisterBits(ALS_Config, 2, 4);
|
||||
ALS_Integration_Time = new Adafruit_I2CRegisterBits(ALS_Config, 4, 6);
|
||||
ALS_Gain = new Adafruit_I2CRegisterBits(ALS_Config, 2, 11);
|
||||
PowerSave_Enable = new Adafruit_I2CRegisterBits(Power_Saving, 1, 0);
|
||||
PowerSave_Mode = new Adafruit_I2CRegisterBits(Power_Saving, 2, 1);
|
||||
|
||||
enable(false);
|
||||
interruptEnable(false);
|
||||
setPersistence(VEML7700_PERS_1);
|
||||
setGain(VEML7700_GAIN_1);
|
||||
setIntegrationTime(VEML7700_IT_100MS);
|
||||
powerSaveEnable(false);
|
||||
enable(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
float Adafruit_VEML7700::normalize_resolution(float value) {
|
||||
// adjust for gain (1x is normalized)
|
||||
switch (getGain()) {
|
||||
case VEML7700_GAIN_2:
|
||||
value /= 2.0; break;
|
||||
case VEML7700_GAIN_1_4:
|
||||
value *= 4; break;
|
||||
case VEML7700_GAIN_1_8:
|
||||
value *= 8; break;
|
||||
}
|
||||
|
||||
// adjust for integrationtime (100ms is normalized)
|
||||
switch (getIntegrationTime()) {
|
||||
case VEML7700_IT_25MS:
|
||||
value *= 4; break;
|
||||
case VEML7700_IT_50MS:
|
||||
value *= 2; break;
|
||||
case VEML7700_IT_200MS:
|
||||
value /= 2.0; break;
|
||||
case VEML7700_IT_400MS:
|
||||
value /= 4.0; break;
|
||||
case VEML7700_IT_800MS:
|
||||
value /= 8.0; break;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read the calibrated lux value. See app note lux table on page 5
|
||||
* @returns Floating point Lux data (ALS multiplied by 0.0576)
|
||||
*/
|
||||
float Adafruit_VEML7700::readLux() {
|
||||
return ( normalize_resolution(ALS_Data->read()) * 0.0576f); // see app note lux table on page 5
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read the lux value with correction for non-linearity at high-lux settings
|
||||
* @returns Floating point Lux data (ALS multiplied by 0.0576 and corrected for high-lux settings)
|
||||
*/
|
||||
float Adafruit_VEML7700::readLuxNormalized() {
|
||||
float lux = readLux();
|
||||
|
||||
// user-provided correction for non-linearities at high lux/white values:
|
||||
// https://forums.adafruit.com/viewtopic.php?f=19&t=152997&p=758582#p759346
|
||||
if ((getGain() == VEML7700_GAIN_1_8) && (getIntegrationTime() == VEML7700_IT_25MS)){
|
||||
lux = 6.0135e-13f * pow(lux,4) - 9.3924e-9f * pow(lux,3) + 8.1488e-5f * pow(lux,2) + 1.0023f * lux;
|
||||
}
|
||||
|
||||
return lux;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read the raw ALS data
|
||||
* @returns 16-bit data value from the ALS register
|
||||
*/
|
||||
uint16_t Adafruit_VEML7700::readALS() {
|
||||
return ALS_Data->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read the white light data
|
||||
* @returns Floating point 'white light' data multiplied by 0.0576
|
||||
*/
|
||||
float Adafruit_VEML7700::readWhite() {
|
||||
// white_corrected= 2E-15*pow(VEML_white,4) + 4E-12*pow(VEML_white,3) + 9E-06*pow(VEML_white,)2 + 1.0179*VEML_white - 11.052;
|
||||
return normalize_resolution(White_Data->read()) * 0.0576f; // Unclear if this is the right multiplier
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Read the 'white light' value with correction for non-linearity at high-lux settings
|
||||
* @returns Floating point 'white light' data multiplied by 0.0576 and corrected for high-lux settings
|
||||
*/
|
||||
float Adafruit_VEML7700::readWhiteNormalized() {
|
||||
float white = readWhite();
|
||||
|
||||
// user-provided correction for non-linearities at high lux values:
|
||||
// https://forums.adafruit.com/viewtopic.php?f=19&t=152997&p=758582#p759346
|
||||
if ((getGain() == VEML7700_GAIN_1_8) && (getIntegrationTime() == VEML7700_IT_25MS)){
|
||||
white = 2E-15f * pow(white,4) + 4E-12f * pow(white,3) + 9E-06f * pow(white,2) + 1.0179f * white - 11.052f;
|
||||
}
|
||||
|
||||
return white;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Enable or disable the sensor
|
||||
* @param enable The flag to enable/disable
|
||||
*/
|
||||
void Adafruit_VEML7700::enable(bool enable) {
|
||||
ALS_Shutdown->write(!enable);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Ask if the interrupt is enabled
|
||||
* @returns True if enabled, false otherwise
|
||||
*/
|
||||
bool Adafruit_VEML7700::enabled(void) {
|
||||
return !ALS_Shutdown->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Enable or disable the interrupt
|
||||
* @param enable The flag to enable/disable
|
||||
*/
|
||||
void Adafruit_VEML7700::interruptEnable(bool enable) {
|
||||
ALS_Interrupt_Enable->write(enable);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Ask if the interrupt is enabled
|
||||
* @returns True if enabled, false otherwise
|
||||
*/
|
||||
bool Adafruit_VEML7700::interruptEnabled(void) {
|
||||
return ALS_Interrupt_Enable->read();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Set the ALS IRQ persistance setting
|
||||
* @param pers Persistance constant, can be VEML7700_PERS_1, VEML7700_PERS_2,
|
||||
* VEML7700_PERS_4 or VEML7700_PERS_8
|
||||
*/
|
||||
void Adafruit_VEML7700::setPersistence(uint8_t pers) {
|
||||
ALS_Persistence->write(pers);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Get the ALS IRQ persistance setting
|
||||
* @returns Persistance constant, can be VEML7700_PERS_1, VEML7700_PERS_2,
|
||||
* VEML7700_PERS_4 or VEML7700_PERS_8
|
||||
*/
|
||||
uint8_t Adafruit_VEML7700::getPersistence(void) {
|
||||
return ALS_Persistence->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Set ALS integration time
|
||||
* @param it Can be VEML7700_IT_100MS, VEML7700_IT_200MS, VEML7700_IT_400MS,
|
||||
* VEML7700_IT_800MS, VEML7700_IT_50MS or VEML7700_IT_25MS
|
||||
*/
|
||||
void Adafruit_VEML7700::setIntegrationTime(uint8_t it) {
|
||||
ALS_Integration_Time->write(it);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Get ALS integration time
|
||||
* @returns IT index, can be VEML7700_IT_100MS, VEML7700_IT_200MS, VEML7700_IT_400MS,
|
||||
* VEML7700_IT_800MS, VEML7700_IT_50MS or VEML7700_IT_25MS
|
||||
*/
|
||||
uint8_t Adafruit_VEML7700::getIntegrationTime(void) {
|
||||
return ALS_Integration_Time->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Set ALS gain
|
||||
* @param gain Can be VEML7700_GAIN_1, VEML7700_GAIN_2, VEML7700_GAIN_1_8 or VEML7700_GAIN_1_4
|
||||
*/
|
||||
void Adafruit_VEML7700::setGain(uint8_t gain) {
|
||||
ALS_Gain->write(gain);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Get ALS gain
|
||||
* @returns Gain index, can be VEML7700_GAIN_1, VEML7700_GAIN_2, VEML7700_GAIN_1_8 or VEML7700_GAIN_1_4
|
||||
*/
|
||||
uint8_t Adafruit_VEML7700::getGain(void) {
|
||||
return ALS_Gain->read();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Enable power save mode
|
||||
* @param enable True if power save should be enabled
|
||||
*/
|
||||
void Adafruit_VEML7700::powerSaveEnable(bool enable) {
|
||||
PowerSave_Enable->write(enable);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Check if power save mode is enabled
|
||||
* @returns True if power save is enabled
|
||||
*/
|
||||
bool Adafruit_VEML7700::powerSaveEnabled(void) {
|
||||
return PowerSave_Enable->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Assign the power save register data
|
||||
* @param mode The 16-bit data to write to VEML7700_ALS_POWER_SAVE
|
||||
*/
|
||||
void Adafruit_VEML7700::setPowerSaveMode(uint8_t mode) {
|
||||
PowerSave_Mode->write(mode);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Retrieve the power save register data
|
||||
* @return 16-bit data from VEML7700_ALS_POWER_SAVE
|
||||
*/
|
||||
uint8_t Adafruit_VEML7700::getPowerSaveMode(void) {
|
||||
return PowerSave_Mode->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Assign the low threshold register data
|
||||
* @param value The 16-bit data to write to VEML7700_ALS_THREHOLD_LOW
|
||||
*/
|
||||
void Adafruit_VEML7700::setLowThreshold(uint16_t value) {
|
||||
ALS_LowThreshold->write(value);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Retrieve the low threshold register data
|
||||
* @return 16-bit data from VEML7700_ALS_THREHOLD_LOW
|
||||
*/
|
||||
uint16_t Adafruit_VEML7700::getLowThreshold(void) {
|
||||
return ALS_LowThreshold->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Assign the high threshold register data
|
||||
* @param value The 16-bit data to write to VEML7700_ALS_THREHOLD_HIGH
|
||||
*/
|
||||
void Adafruit_VEML7700::setHighThreshold(uint16_t value) {
|
||||
ALS_HighThreshold->write(value);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Retrieve the high threshold register data
|
||||
* @return 16-bit data from VEML7700_ALS_THREHOLD_HIGH
|
||||
*/
|
||||
uint16_t Adafruit_VEML7700::getHighThreshold(void) {
|
||||
return ALS_HighThreshold->read();
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Retrieve the interrupt status register data
|
||||
* @return 16-bit data from VEML7700_INTERRUPTSTATUS
|
||||
*/
|
||||
uint16_t Adafruit_VEML7700::interruptStatus(void) {
|
||||
return Interrupt_Status->read();
|
||||
}
|
121
lib/Adafruit_VEML7700/Adafruit_VEML7700.h
Normal file
121
lib/Adafruit_VEML7700/Adafruit_VEML7700.h
Normal file
@ -0,0 +1,121 @@
|
||||
/*!
|
||||
* @file Adafruit_VEML7700.h
|
||||
*
|
||||
* I2C Driver for VEML7700 Lux sensor
|
||||
*
|
||||
* This is a library for the Adafruit VEML7700 breakout:
|
||||
* http://www.adafruit.com/
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
*please support Adafruit and open-source hardware by purchasing products from
|
||||
* Adafruit!
|
||||
*
|
||||
*
|
||||
* BSD license (see license.txt)
|
||||
*/
|
||||
|
||||
/*
|
||||
* change from device111 for Tasmota
|
||||
* Add alternativ Pow function for readLuxNormalized() and readWhiteNormalized()
|
||||
*/
|
||||
|
||||
#ifndef _ADAFRUIT_VEML7700_H
|
||||
#define _ADAFRUIT_VEML7700_H
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <Wire.h>
|
||||
#include <Adafruit_I2CDevice.h>
|
||||
#include <Adafruit_I2CRegister.h>
|
||||
|
||||
#define VEML7700_I2CADDR_DEFAULT 0x10 ///< I2C address
|
||||
|
||||
#define VEML7700_ALS_CONFIG 0x00 ///< Light configuration register
|
||||
#define VEML7700_ALS_THREHOLD_HIGH 0x01 ///< Light high threshold for irq
|
||||
#define VEML7700_ALS_THREHOLD_LOW 0x02 ///< Light low threshold for irq
|
||||
#define VEML7700_ALS_POWER_SAVE 0x03 ///< Power save regiester
|
||||
#define VEML7700_ALS_DATA 0x04 ///< The light data output
|
||||
#define VEML7700_WHITE_DATA 0x05 ///< The white light data output
|
||||
#define VEML7700_INTERRUPTSTATUS 0x06 ///< What IRQ (if any)
|
||||
|
||||
#define VEML7700_INTERRUPT_HIGH 0x4000 ///< Interrupt status for high threshold
|
||||
#define VEML7700_INTERRUPT_LOW 0x8000 ///< Interrupt status for low threshold
|
||||
|
||||
#define VEML7700_GAIN_1 0x00 ///< ALS gain 1x
|
||||
#define VEML7700_GAIN_2 0x01 ///< ALS gain 2x
|
||||
#define VEML7700_GAIN_1_8 0x02 ///< ALS gain 1/8x
|
||||
#define VEML7700_GAIN_1_4 0x03 ///< ALS gain 1/4x
|
||||
|
||||
#define VEML7700_IT_100MS 0x00 ///< ALS intetgration time 100ms
|
||||
#define VEML7700_IT_200MS 0x01 ///< ALS intetgration time 200ms
|
||||
#define VEML7700_IT_400MS 0x02 ///< ALS intetgration time 400ms
|
||||
#define VEML7700_IT_800MS 0x03 ///< ALS intetgration time 800ms
|
||||
#define VEML7700_IT_50MS 0x08 ///< ALS intetgration time 50ms
|
||||
#define VEML7700_IT_25MS 0x0C ///< ALS intetgration time 25ms
|
||||
|
||||
#define VEML7700_PERS_1 0x00 ///< ALS irq persisance 1 sample
|
||||
#define VEML7700_PERS_2 0x01 ///< ALS irq persisance 2 samples
|
||||
#define VEML7700_PERS_4 0x02 ///< ALS irq persisance 4 samples
|
||||
#define VEML7700_PERS_8 0x03 ///< ALS irq persisance 8 samples
|
||||
|
||||
#define VEML7700_POWERSAVE_MODE1 0x00 ///< Power saving mode 1
|
||||
#define VEML7700_POWERSAVE_MODE2 0x01 ///< Power saving mode 2
|
||||
#define VEML7700_POWERSAVE_MODE3 0x02 ///< Power saving mode 3
|
||||
#define VEML7700_POWERSAVE_MODE4 0x03 ///< Power saving mode 4
|
||||
|
||||
// FastPrecisePowf from tasmota/support_float.ino
|
||||
extern float FastPrecisePowf(const float x, const float y);
|
||||
|
||||
/*!
|
||||
* @brief Class that stores state and functions for interacting with
|
||||
* VEML7700 Temp Sensor
|
||||
*/
|
||||
class Adafruit_VEML7700 {
|
||||
public:
|
||||
Adafruit_VEML7700();
|
||||
boolean begin(TwoWire *theWire = &Wire);
|
||||
|
||||
void enable(bool enable);
|
||||
bool enabled(void);
|
||||
|
||||
void interruptEnable(bool enable);
|
||||
bool interruptEnabled(void);
|
||||
void setPersistence(uint8_t pers);
|
||||
uint8_t getPersistence(void);
|
||||
void setIntegrationTime(uint8_t it);
|
||||
uint8_t getIntegrationTime(void);
|
||||
void setGain(uint8_t gain);
|
||||
uint8_t getGain(void);
|
||||
void powerSaveEnable(bool enable);
|
||||
bool powerSaveEnabled(void);
|
||||
void setPowerSaveMode(uint8_t mode);
|
||||
uint8_t getPowerSaveMode(void);
|
||||
|
||||
void setLowThreshold(uint16_t value);
|
||||
uint16_t getLowThreshold(void);
|
||||
void setHighThreshold(uint16_t value);
|
||||
uint16_t getHighThreshold(void);
|
||||
uint16_t interruptStatus(void);
|
||||
|
||||
|
||||
float readLux();
|
||||
float readLuxNormalized();
|
||||
|
||||
uint16_t readALS();
|
||||
float readWhite();
|
||||
float readWhiteNormalized();
|
||||
|
||||
private:
|
||||
Adafruit_I2CRegister *ALS_Config, *ALS_Data, *White_Data,
|
||||
*ALS_HighThreshold, *ALS_LowThreshold, *Power_Saving, *Interrupt_Status;
|
||||
Adafruit_I2CRegisterBits *ALS_Shutdown, *ALS_Interrupt_Enable,
|
||||
*ALS_Persistence, *ALS_Integration_Time, *ALS_Gain,
|
||||
*PowerSave_Enable, *PowerSave_Mode;
|
||||
|
||||
float normalize_resolution(float value);
|
||||
static inline float pow(float a, float b) { return FastPrecisePowf(a, b); }
|
||||
|
||||
Adafruit_I2CDevice *i2c_dev;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
16
lib/Adafruit_VEML7700/README.md
Normal file
16
lib/Adafruit_VEML7700/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
Adafruit_VEML7700 [](https://travis-ci.com/adafruit/Adafruit_VEML7700)
|
||||
================
|
||||
|
||||
This is the Adafruit VEML7700 Lux sensor library
|
||||
|
||||
Tested and works great with the [Adafruit VEML7700 Breakout Board](http://www.adafruit.com/)
|
||||
|
||||
This chip uses I2C to communicate, 2 pins are required to interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Kevin Townsend/Limor Fried for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
@ -0,0 +1,58 @@
|
||||
#include "Adafruit_VEML7700.h"
|
||||
|
||||
Adafruit_VEML7700 veml = Adafruit_VEML7700();
|
||||
|
||||
void setup() {
|
||||
while (!Serial) { delay(10); }
|
||||
Serial.begin(115200);
|
||||
Serial.println("Adafruit VEML7700 Test");
|
||||
|
||||
if (!veml.begin()) {
|
||||
Serial.println("Sensor not found");
|
||||
while (1);
|
||||
}
|
||||
Serial.println("Sensor found");
|
||||
|
||||
veml.setGain(VEML7700_GAIN_1);
|
||||
veml.setIntegrationTime(VEML7700_IT_800MS);
|
||||
|
||||
Serial.print(F("Gain: "));
|
||||
switch (veml.getGain()) {
|
||||
case VEML7700_GAIN_1: Serial.println("1"); break;
|
||||
case VEML7700_GAIN_2: Serial.println("2"); break;
|
||||
case VEML7700_GAIN_1_4: Serial.println("1/4"); break;
|
||||
case VEML7700_GAIN_1_8: Serial.println("1/8"); break;
|
||||
}
|
||||
|
||||
Serial.print(F("Integration Time (ms): "));
|
||||
switch (veml.getIntegrationTime()) {
|
||||
case VEML7700_IT_25MS: Serial.println("25"); break;
|
||||
case VEML7700_IT_50MS: Serial.println("50"); break;
|
||||
case VEML7700_IT_100MS: Serial.println("100"); break;
|
||||
case VEML7700_IT_200MS: Serial.println("200"); break;
|
||||
case VEML7700_IT_400MS: Serial.println("400"); break;
|
||||
case VEML7700_IT_800MS: Serial.println("800"); break;
|
||||
}
|
||||
|
||||
//veml.powerSaveEnable(true);
|
||||
//veml.setPowerSaveMode(VEML7700_POWERSAVE_MODE4);
|
||||
|
||||
veml.setLowThreshold(10000);
|
||||
veml.setHighThreshold(20000);
|
||||
veml.interruptEnable(true);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.print("Lux: "); Serial.println(veml.readLux());
|
||||
Serial.print("White: "); Serial.println(veml.readWhite());
|
||||
Serial.print("Raw ALS: "); Serial.println(veml.readALS());
|
||||
|
||||
uint16_t irq = veml.interruptStatus();
|
||||
if (irq & VEML7700_INTERRUPT_LOW) {
|
||||
Serial.println("** Low threshold");
|
||||
}
|
||||
if (irq & VEML7700_INTERRUPT_HIGH) {
|
||||
Serial.println("** High threshold");
|
||||
}
|
||||
delay(500);
|
||||
}
|
9
lib/Adafruit_VEML7700/library.properties
Normal file
9
lib/Adafruit_VEML7700/library.properties
Normal file
@ -0,0 +1,9 @@
|
||||
name=Adafruit VEML7700 Library
|
||||
version=1.0.0
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=Arduino library for the VEML7700 sensors in the Adafruit shop
|
||||
paragraph=Arduino library for the VEML7700 sensors in the Adafruit shop
|
||||
category=Sensors
|
||||
url=https://github.com/adafruit/Adafruit_VEML7700
|
||||
architectures=*
|
26
lib/Adafruit_VEML7700/license.txt
Normal file
26
lib/Adafruit_VEML7700/license.txt
Normal file
@ -0,0 +1,26 @@
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2012, Adafruit Industries
|
||||
All rights reserved.
|
||||
|
||||
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 holders 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 ''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 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.
|
@ -87,7 +87,7 @@ bool NtpServer::processOneRequest(uint32_t utc, uint32_t millisecs)
|
||||
packet.swapEndian();
|
||||
|
||||
timeServerPort_.beginPacket(timeServerPort_.remoteIP(), timeServerPort_.remotePort());
|
||||
timeServerPort_.write(packet.packet(), NtpPacket::PACKET_SIZE);
|
||||
timeServerPort_.write((const uint8_t *)packet.packet(), NtpPacket::PACKET_SIZE);
|
||||
timeServerPort_.endPacket();
|
||||
|
||||
processed = true;
|
||||
|
@ -58,7 +58,9 @@ void FrogmoreScd30::begin(TwoWire *pWire, uint8_t i2cAddress)
|
||||
}
|
||||
|
||||
co2NewDataLocation = -1; // indicates there is no data, so the 1st data point needs to fill up the median filter
|
||||
#ifdef ESP8266
|
||||
this->pWire->setClockStretchLimit(200000);
|
||||
#endif
|
||||
this->ambientPressure = 0;
|
||||
}
|
||||
|
||||
@ -106,7 +108,11 @@ int FrogmoreScd30::clearI2CBus(void)
|
||||
snprintf_P(scd30log_data, sizeof(scd30log_data), "clearI2CBus");
|
||||
AddLog(LOG_LEVEL_DEBUG_MORE);
|
||||
#endif
|
||||
#ifdef ESP8266
|
||||
return (twi_status());
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SCD30_DEBUG
|
||||
@ -253,7 +259,7 @@ int FrogmoreScd30::get16BitRegCheckCRC(void* pInput, uint16_t *pData)
|
||||
}
|
||||
|
||||
// gets 32 bits, (2) 16-bit chunks, and validates the CRCs
|
||||
//
|
||||
//
|
||||
int FrogmoreScd30::get32BitRegCheckCRC(void *pInput, float *pData)
|
||||
{
|
||||
uint16_t tempU16High;
|
||||
@ -458,7 +464,7 @@ int FrogmoreScd30::setTemperatureOffset(float offset_degC)
|
||||
{
|
||||
return (ERROR_SCD30_INVALID_VALUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int FrogmoreScd30::setTemperatureOffset(uint16_t offset_centiDegC)
|
||||
@ -568,7 +574,7 @@ int FrogmoreScd30::readMeasurement(
|
||||
return (error);
|
||||
}
|
||||
|
||||
error = get32BitRegCheckCRC(&bytes[12], &tempHumidity);
|
||||
error = get32BitRegCheckCRC(&bytes[12], &tempHumidity);
|
||||
if (error)
|
||||
{
|
||||
#ifdef SCD30_DEBUG
|
||||
@ -650,4 +656,3 @@ int FrogmoreScd30::stopMeasuring(void)
|
||||
{
|
||||
return (sendCommand(COMMAND_SCD30_STOP_MEASUREMENT));
|
||||
}
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,46 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
; Default platform
|
||||
platform = espressif8266
|
||||
; Default board
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
board = nodemcuv2
|
||||
; build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
; build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:de-CH]
|
||||
build_flags = -D_IR_LOCALE_=de-CH
|
||||
|
||||
[env:de-DE]
|
||||
build_flags = -D_IR_LOCALE_=de-DE
|
||||
|
||||
[env:en-AU]
|
||||
build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:en-IE]
|
||||
build_flags = -D_IR_LOCALE_=en-IE
|
||||
|
||||
[env:en-UK]
|
||||
build_flags = -D_IR_LOCALE_=en-UK
|
||||
|
||||
[env:en-US]
|
||||
build_flags = -D_IR_LOCALE_=en-US
|
||||
|
||||
[env:es-ES]
|
||||
build_flags = -D_IR_LOCALE_=es-ES
|
||||
|
||||
[env:fr-FR]
|
||||
build_flags = -D_IR_LOCALE_=fr-FR
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,17 +0,0 @@
|
||||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
@ -1,165 +0,0 @@
|
||||
// Copyright 2019 - David Conran (@crankyoldgit)
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
#include <Arduino.h>
|
||||
#endif // UNIT_TEST
|
||||
#include "IRremoteESP8266.h"
|
||||
#include "i18n.h"
|
||||
|
||||
#ifndef PROGMEM
|
||||
#define PROGMEM // Pretend we have the PROGMEM macro even if we really don't.
|
||||
#endif
|
||||
|
||||
// Common
|
||||
|
||||
const PROGMEM char* kUnknownStr = D_STR_UNKNOWN;
|
||||
const PROGMEM char* kProtocolStr = D_STR_PROTOCOL;
|
||||
const PROGMEM char* kPowerStr = D_STR_POWER;
|
||||
const PROGMEM char* kOnStr = D_STR_ON;
|
||||
const PROGMEM char* kOffStr = D_STR_OFF;
|
||||
const PROGMEM char* kModeStr = D_STR_MODE;
|
||||
const PROGMEM char* kToggleStr = D_STR_TOGGLE;
|
||||
const PROGMEM char* kTurboStr = D_STR_TURBO;
|
||||
const PROGMEM char* kSuperStr = D_STR_SUPER;
|
||||
const PROGMEM char* kSleepStr = D_STR_SLEEP;
|
||||
const PROGMEM char* kLightStr = D_STR_LIGHT;
|
||||
const PROGMEM char* kPowerfulStr = D_STR_POWERFUL;
|
||||
const PROGMEM char* kQuietStr = D_STR_QUIET;
|
||||
const PROGMEM char* kEconoStr = D_STR_ECONO;
|
||||
const PROGMEM char* kSwingStr = D_STR_SWING;
|
||||
const PROGMEM char* kSwingHStr = D_STR_SWINGH;
|
||||
const PROGMEM char* kSwingVStr = D_STR_SWINGV;
|
||||
const PROGMEM char* kBeepStr = D_STR_BEEP;
|
||||
const PROGMEM char* kZoneFollowStr = D_STR_ZONEFOLLOW;
|
||||
const PROGMEM char* kFixedStr = D_STR_FIXED;
|
||||
const PROGMEM char* kMouldStr = D_STR_MOULD;
|
||||
const PROGMEM char* kCleanStr = D_STR_CLEAN;
|
||||
const PROGMEM char* kPurifyStr = D_STR_PURIFY;
|
||||
const PROGMEM char* kTimerStr = D_STR_TIMER;
|
||||
const PROGMEM char* kOnTimerStr = D_STR_ONTIMER;
|
||||
const PROGMEM char* kOffTimerStr = D_STR_OFFTIMER;
|
||||
const PROGMEM char* kClockStr = D_STR_CLOCK;
|
||||
const PROGMEM char* kCommandStr = D_STR_COMMAND;
|
||||
const PROGMEM char* kXFanStr = D_STR_XFAN;
|
||||
const PROGMEM char* kHealthStr = D_STR_HEALTH;
|
||||
const PROGMEM char* kModelStr = D_STR_MODEL;
|
||||
const PROGMEM char* kTempStr = D_STR_TEMP;
|
||||
const PROGMEM char* kIFeelStr = D_STR_IFEEL;
|
||||
const PROGMEM char* kHumidStr = D_STR_HUMID;
|
||||
const PROGMEM char* kSaveStr = D_STR_SAVE;
|
||||
const PROGMEM char* kEyeStr = D_STR_EYE;
|
||||
const PROGMEM char* kFollowStr = D_STR_FOLLOW;
|
||||
const PROGMEM char* kIonStr = D_STR_ION;
|
||||
const PROGMEM char* kFreshStr = D_STR_FRESH;
|
||||
const PROGMEM char* kHoldStr = D_STR_HOLD;
|
||||
const PROGMEM char* kButtonStr = D_STR_BUTTON;
|
||||
const PROGMEM char* k8CHeatStr = D_STR_8C_HEAT;
|
||||
const PROGMEM char* kNightStr = D_STR_NIGHT;
|
||||
const PROGMEM char* kSilentStr = D_STR_SILENT;
|
||||
const PROGMEM char* kFilterStr = D_STR_FILTER;
|
||||
const PROGMEM char* k3DStr = D_STR_3D;
|
||||
const PROGMEM char* kCelsiusStr = D_STR_CELSIUS;
|
||||
const PROGMEM char* kTempUpStr = D_STR_TEMPUP;
|
||||
const PROGMEM char* kTempDownStr = D_STR_TEMPDOWN;
|
||||
const PROGMEM char* kStartStr = D_STR_START;
|
||||
const PROGMEM char* kStopStr = D_STR_STOP;
|
||||
const PROGMEM char* kMoveStr = D_STR_MOVE;
|
||||
const PROGMEM char* kSetStr = D_STR_SET;
|
||||
const PROGMEM char* kCancelStr = D_STR_CANCEL;
|
||||
const PROGMEM char* kUpStr = D_STR_UP;
|
||||
const PROGMEM char* kDownStr = D_STR_DOWN;
|
||||
const PROGMEM char* kChangeStr = D_STR_CHANGE;
|
||||
const PROGMEM char* kComfortStr = D_STR_COMFORT;
|
||||
const PROGMEM char* kSensorStr = D_STR_SENSOR;
|
||||
const PROGMEM char* kWeeklyTimerStr = D_STR_WEEKLYTIMER;
|
||||
const PROGMEM char* kWifiStr = D_STR_WIFI;
|
||||
const PROGMEM char* kLastStr = D_STR_LAST;
|
||||
const PROGMEM char* kFastStr = D_STR_FAST;
|
||||
const PROGMEM char* kSlowStr = D_STR_SLOW;
|
||||
const PROGMEM char* kAirFlowStr = D_STR_AIRFLOW;
|
||||
const PROGMEM char* kStepStr = D_STR_STEP;
|
||||
const PROGMEM char* kNAStr = D_STR_NA;
|
||||
const PROGMEM char* kOutsideStr = D_STR_OUTSIDE;
|
||||
const PROGMEM char* kLoudStr = D_STR_LOUD;
|
||||
const PROGMEM char* kLowerStr = D_STR_LOWER;
|
||||
const PROGMEM char* kUpperStr = D_STR_UPPER;
|
||||
const PROGMEM char* kBreezeStr = D_STR_BREEZE;
|
||||
const PROGMEM char* kCirculateStr = D_STR_CIRCULATE;
|
||||
const PROGMEM char* kCeilingStr = D_STR_CEILING;
|
||||
const PROGMEM char* kWallStr = D_STR_WALL;
|
||||
const PROGMEM char* kRoomStr = D_STR_ROOM;
|
||||
const PROGMEM char* k6thSenseStr = D_STR_6THSENSE;
|
||||
|
||||
const PROGMEM char* kAutoStr = D_STR_AUTO;
|
||||
const PROGMEM char* kAutomaticStr = D_STR_AUTOMATIC;
|
||||
const PROGMEM char* kManualStr = D_STR_MANUAL;
|
||||
const PROGMEM char* kCoolStr = D_STR_COOL;
|
||||
const PROGMEM char* kHeatStr = D_STR_HEAT;
|
||||
const PROGMEM char* kFanStr = D_STR_FAN;
|
||||
const PROGMEM char* kDryStr = D_STR_DRY;
|
||||
const PROGMEM char* kFanOnlyStr = D_STR_FANONLY;
|
||||
|
||||
const PROGMEM char* kMaxStr = D_STR_MAX;
|
||||
const PROGMEM char* kMaximumStr = D_STR_MAXIMUM;
|
||||
const PROGMEM char* kMinStr = D_STR_MIN;
|
||||
const PROGMEM char* kMinimumStr = D_STR_MINIMUM;
|
||||
const PROGMEM char* kMedStr = D_STR_MED;
|
||||
const PROGMEM char* kMediumStr = D_STR_MEDIUM;
|
||||
|
||||
const PROGMEM char* kHighestStr = D_STR_HIGHEST;
|
||||
const PROGMEM char* kHighStr = D_STR_HIGH;
|
||||
const PROGMEM char* kHiStr = D_STR_HI;
|
||||
const PROGMEM char* kMidStr = D_STR_MID;
|
||||
const PROGMEM char* kMiddleStr = D_STR_MIDDLE;
|
||||
const PROGMEM char* kLowStr = D_STR_LOW;
|
||||
const PROGMEM char* kLoStr = D_STR_LO;
|
||||
const PROGMEM char* kLowestStr = D_STR_LOWEST;
|
||||
const PROGMEM char* kMaxRightStr = D_STR_MAXRIGHT;
|
||||
const PROGMEM char* kRightMaxStr = D_STR_RIGHTMAX_NOSPACE;
|
||||
const PROGMEM char* kRightStr = D_STR_RIGHT;
|
||||
const PROGMEM char* kLeftStr = D_STR_LEFT;
|
||||
const PROGMEM char* kMaxLeftStr = D_STR_MAXLEFT;
|
||||
const PROGMEM char* kLeftMaxStr = D_STR_LEFTMAX_NOSPACE;
|
||||
const PROGMEM char* kWideStr = D_STR_WIDE;
|
||||
const PROGMEM char* kCentreStr = D_STR_CENTRE;
|
||||
const PROGMEM char* kTopStr = D_STR_TOP;
|
||||
const PROGMEM char* kBottomStr = D_STR_BOTTOM;
|
||||
|
||||
// Compound words/phrases/descriptions from pre-defined words.
|
||||
const PROGMEM char* kEyeAutoStr = D_STR_EYEAUTO;
|
||||
const PROGMEM char* kLightToggleStr = D_STR_LIGHTTOGGLE;
|
||||
const PROGMEM char* kOutsideQuietStr = D_STR_OUTSIDEQUIET;
|
||||
const PROGMEM char* kPowerToggleStr = D_STR_POWERTOGGLE;
|
||||
const PROGMEM char* kPreviousPowerStr = D_STR_PREVIOUSPOWER;
|
||||
const PROGMEM char* kSensorTempStr = D_STR_SENSORTEMP;
|
||||
const PROGMEM char* kSleepTimerStr = D_STR_SLEEP_TIMER;
|
||||
const PROGMEM char* kSwingVModeStr = D_STR_SWINGVMODE;
|
||||
const PROGMEM char* kSwingVToggleStr = D_STR_SWINGVTOGGLE;
|
||||
|
||||
// Separators
|
||||
char kTimeSep = D_CHR_TIME_SEP;
|
||||
const PROGMEM char* kSpaceLBraceStr = D_STR_SPACELBRACE;
|
||||
const PROGMEM char* kCommaSpaceStr = D_STR_COMMASPACE;
|
||||
const PROGMEM char* kColonSpaceStr = D_STR_COLONSPACE;
|
||||
|
||||
// IRutils
|
||||
// - Time
|
||||
const PROGMEM char* kDayStr = D_STR_DAY;
|
||||
const PROGMEM char* kDaysStr = D_STR_DAYS;
|
||||
const PROGMEM char* kHourStr = D_STR_HOUR;
|
||||
const PROGMEM char* kHoursStr = D_STR_HOURS;
|
||||
const PROGMEM char* kMinuteStr = D_STR_MINUTE;
|
||||
const PROGMEM char* kMinutesStr = D_STR_MINUTES;
|
||||
const PROGMEM char* kSecondStr = D_STR_SECOND;
|
||||
const PROGMEM char* kSecondsStr = D_STR_SECONDS;
|
||||
const PROGMEM char* kNowStr = D_STR_NOW;
|
||||
const PROGMEM char* kThreeLetterDayOfWeekStr = D_STR_THREELETTERDAYS;
|
||||
|
||||
const PROGMEM char* kYesStr = D_STR_YES;
|
||||
const PROGMEM char* kNoStr = D_STR_NO;
|
||||
const PROGMEM char* kTrueStr = D_STR_TRUE;
|
||||
const PROGMEM char* kFalseStr = D_STR_FALSE;
|
||||
|
||||
const PROGMEM char* kRepeatStr = D_STR_REPEAT;
|
||||
const PROGMEM char* kCodeStr = D_STR_CODE;
|
||||
const PROGMEM char* kBitsStr = D_STR_BITS;
|
@ -1,103 +0,0 @@
|
||||
// Copyright 2018 David Conran
|
||||
|
||||
// Supports:
|
||||
// Brand: Carrier/Surrey, Model: 42QG5A55970 remote
|
||||
// Brand: Carrier/Surrey, Model: 619EGX0090E0 A/C
|
||||
// Brand: Carrier/Surrey, Model: 619EGX0120E0 A/C
|
||||
// Brand: Carrier/Surrey, Model: 619EGX0180E0 A/C
|
||||
// Brand: Carrier/Surrey, Model: 619EGX0220E0 A/C
|
||||
// Brand: Carrier/Surrey, Model: 53NGK009/012 Inverter
|
||||
|
||||
#include "IRrecv.h"
|
||||
#include "IRsend.h"
|
||||
#include "IRutils.h"
|
||||
|
||||
// Constants
|
||||
// Ref:
|
||||
// https://github.com/crankyoldgit/IRremoteESP8266/issues/385
|
||||
const uint16_t kCarrierAcHdrMark = 8532;
|
||||
const uint16_t kCarrierAcHdrSpace = 4228;
|
||||
const uint16_t kCarrierAcBitMark = 628;
|
||||
const uint16_t kCarrierAcOneSpace = 1320;
|
||||
const uint16_t kCarrierAcZeroSpace = 532;
|
||||
const uint16_t kCarrierAcGap = 20000;
|
||||
|
||||
#if SEND_CARRIER_AC
|
||||
// Send a Carrier HVAC formatted message.
|
||||
//
|
||||
// Args:
|
||||
// data: The message to be sent.
|
||||
// nbits: The bit size of the message being sent. typically kCarrierAcBits.
|
||||
// repeat: The number of times the message is to be repeated.
|
||||
//
|
||||
// Status: STABLE / Work on real devices.
|
||||
//
|
||||
void IRsend::sendCarrierAC(uint64_t data, uint16_t nbits, uint16_t repeat) {
|
||||
for (uint16_t r = 0; r <= repeat; r++) {
|
||||
uint64_t temp_data = data;
|
||||
// Carrier sends the data block three times. normal + inverted + normal.
|
||||
for (uint16_t i = 0; i < 3; i++) {
|
||||
sendGeneric(kCarrierAcHdrMark, kCarrierAcHdrSpace, kCarrierAcBitMark,
|
||||
kCarrierAcOneSpace, kCarrierAcBitMark, kCarrierAcZeroSpace,
|
||||
kCarrierAcBitMark, kCarrierAcGap, temp_data, nbits, 38, true,
|
||||
0, kDutyDefault);
|
||||
temp_data = invertBits(temp_data, nbits);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DECODE_CARRIER_AC
|
||||
// Decode the supplied Carrier HVAC message.
|
||||
// Carrier HVAC messages contain only 32 bits, but it is sent three(3) times.
|
||||
// i.e. normal + inverted + normal
|
||||
// Args:
|
||||
// results: Ptr to the data to decode and where to store the decode result.
|
||||
// offset: The starting index to use when attempting to decode the raw data.
|
||||
// Typically/Defaults to kStartOffset.
|
||||
// nbits: Nr. of bits to expect in the data portion.
|
||||
// Typically kCarrierAcBits.
|
||||
// strict: Flag to indicate if we strictly adhere to the specification.
|
||||
// Returns:
|
||||
// boolean: True if it can decode it, false if it can't.
|
||||
//
|
||||
// Status: BETA / Probably works.
|
||||
//
|
||||
bool IRrecv::decodeCarrierAC(decode_results *results, uint16_t offset,
|
||||
const uint16_t nbits, const bool strict) {
|
||||
if (results->rawlen < ((2 * nbits + kHeader + kFooter) * 3) - 1 + offset)
|
||||
return false; // Can't possibly be a valid Carrier message.
|
||||
if (strict && nbits != kCarrierAcBits)
|
||||
return false; // We expect Carrier to be 32 bits of message.
|
||||
|
||||
uint64_t data = 0;
|
||||
uint64_t prev_data = 0;
|
||||
|
||||
for (uint8_t i = 0; i < 3; i++) {
|
||||
prev_data = data;
|
||||
// Match Header + Data + Footer
|
||||
uint16_t used;
|
||||
used = matchGeneric(results->rawbuf + offset, &data,
|
||||
results->rawlen - offset, nbits,
|
||||
kCarrierAcHdrMark, kCarrierAcHdrSpace,
|
||||
kCarrierAcBitMark, kCarrierAcOneSpace,
|
||||
kCarrierAcBitMark, kCarrierAcZeroSpace,
|
||||
kCarrierAcBitMark, kCarrierAcGap, true);
|
||||
if (!used) return false;
|
||||
offset += used;
|
||||
// Compliance.
|
||||
if (strict) {
|
||||
// Check if the data is an inverted copy of the previous data.
|
||||
if (i > 0 && prev_data != invertBits(data, nbits)) return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Success
|
||||
results->bits = nbits;
|
||||
results->value = data;
|
||||
results->decode_type = CARRIER_AC;
|
||||
results->address = data >> 16;
|
||||
results->command = data & 0xFFFF;
|
||||
return true;
|
||||
}
|
||||
#endif
|
@ -1,104 +0,0 @@
|
||||
// Copyright 2017 David Conran
|
||||
|
||||
// Pronto code message generation
|
||||
|
||||
#include <algorithm>
|
||||
#include "IRsend.h"
|
||||
|
||||
// Constants
|
||||
const float kProntoFreqFactor = 0.241246;
|
||||
const uint16_t kProntoTypeOffset = 0;
|
||||
const uint16_t kProntoFreqOffset = 1;
|
||||
const uint16_t kProntoSeq1LenOffset = 2;
|
||||
const uint16_t kProntoSeq2LenOffset = 3;
|
||||
const uint16_t kProntoDataOffset = 4;
|
||||
|
||||
#if SEND_PRONTO
|
||||
// Send a Pronto Code formatted message.
|
||||
//
|
||||
// Args:
|
||||
// data: An array of uint16_t containing the pronto codes.
|
||||
// len: Nr. of entries in the data[] array.
|
||||
// repeat: Nr. of times to repeat the message.
|
||||
//
|
||||
// Status: STABLE / Known working.
|
||||
//
|
||||
// Note:
|
||||
// Pronto codes are typically represented in hexadecimal.
|
||||
// You will need to convert the code to an array of integers, and calculate
|
||||
// it's length.
|
||||
// e.g.
|
||||
// A Sony 20 bit DVD remote command.
|
||||
// "0000 0067 0000 0015 0060 0018 0018 0018 0030 0018 0030 0018 0030 0018
|
||||
// 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0030 0018
|
||||
// 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018
|
||||
// 0030 0018 0018 03f6"
|
||||
//
|
||||
// converts to:
|
||||
//
|
||||
// uint16_t prontoCode[46] = {
|
||||
// 0x0000, 0x0067, 0x0000, 0x0015,
|
||||
// 0x0060, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018, 0x0030, 0x0018,
|
||||
// 0x0030, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018, 0x0018, 0x0018,
|
||||
// 0x0018, 0x0018, 0x0030, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018,
|
||||
// 0x0030, 0x0018, 0x0030, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
|
||||
// 0x0030, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018,
|
||||
// 0x0018, 0x03f6};
|
||||
// // Send the Pronto(Sony) code. Repeat twice as Sony's require that.
|
||||
// sendPronto(prontoCode, 46, kSonyMinRepeat);
|
||||
//
|
||||
// Ref:
|
||||
// http://www.etcwiki.org/wiki/Pronto_Infrared_Format
|
||||
// http://www.remotecentral.com/features/irdisp2.htm
|
||||
void IRsend::sendPronto(uint16_t data[], uint16_t len, uint16_t repeat) {
|
||||
// Check we have enough data to work out what to send.
|
||||
if (len < kProntoMinLength) return;
|
||||
|
||||
// We only know how to deal with 'raw' pronto codes types. Reject all others.
|
||||
if (data[kProntoTypeOffset] != 0) return;
|
||||
|
||||
// Pronto frequency is in Hz.
|
||||
uint16_t hz =
|
||||
(uint16_t)(1000000U / (data[kProntoFreqOffset] * kProntoFreqFactor));
|
||||
enableIROut(hz);
|
||||
|
||||
// Grab the length of the two sequences.
|
||||
uint16_t seq_1_len = data[kProntoSeq1LenOffset] * 2;
|
||||
uint16_t seq_2_len = data[kProntoSeq2LenOffset] * 2;
|
||||
// Calculate where each sequence starts in the buffer.
|
||||
uint16_t seq_1_start = kProntoDataOffset;
|
||||
uint16_t seq_2_start = kProntoDataOffset + seq_1_len;
|
||||
|
||||
uint32_t periodic_time = calcUSecPeriod(hz, false);
|
||||
|
||||
// Normal (1st sequence) case.
|
||||
// Is there a first (normal) sequence to send?
|
||||
if (seq_1_len > 0) {
|
||||
// Check we have enough data to send the complete first sequence.
|
||||
if (seq_1_len + seq_1_start > len) return;
|
||||
// Send the contents of the 1st sequence.
|
||||
for (uint16_t i = seq_1_start; i < seq_1_start + seq_1_len; i += 2) {
|
||||
mark(data[i] * periodic_time);
|
||||
space(data[i + 1] * periodic_time);
|
||||
}
|
||||
} else {
|
||||
// There was no first sequence to send, it is implied that we have to send
|
||||
// the 2nd/repeat sequence an additional time. i.e. At least once.
|
||||
repeat++;
|
||||
}
|
||||
|
||||
// Repeat (2nd sequence) case.
|
||||
// Is there a second (repeat) sequence to be sent?
|
||||
if (seq_2_len > 0) {
|
||||
// Check we have enough data to send the complete second sequence.
|
||||
if (seq_2_len + seq_2_start > len) return;
|
||||
|
||||
// Send the contents of the 2nd sequence.
|
||||
for (uint16_t r = 0; r < repeat; r++)
|
||||
for (uint16_t i = seq_2_start; i < seq_2_start + seq_2_len; i += 2) {
|
||||
mark(data[i] * periodic_time);
|
||||
space(data[i + 1] * periodic_time);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,576 +0,0 @@
|
||||
// Copyright 2009 Ken Shirriff
|
||||
// Copyright 2017, 2019 David Conran
|
||||
|
||||
// Sharp remote emulation
|
||||
|
||||
#include "ir_Sharp.h"
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#ifndef ARDUINO
|
||||
#include <string>
|
||||
#endif
|
||||
#include "IRrecv.h"
|
||||
#include "IRsend.h"
|
||||
#include "IRtext.h"
|
||||
#include "IRutils.h"
|
||||
|
||||
// Equipment it seems compatible with:
|
||||
// * Sharp LC-52D62U
|
||||
// * Sharp AH-AxSAY A/C (Remote CRMC-A907 JBEZ)
|
||||
// * <Add models (devices & remotes) you've gotten it working with here>
|
||||
//
|
||||
|
||||
// Constants
|
||||
// period time = 1/38000Hz = 26.316 microseconds.
|
||||
// Ref:
|
||||
// GlobalCache's IR Control Tower data.
|
||||
// http://www.sbprojects.com/knowledge/ir/sharp.php
|
||||
const uint16_t kSharpTick = 26;
|
||||
const uint16_t kSharpBitMarkTicks = 10;
|
||||
const uint16_t kSharpBitMark = kSharpBitMarkTicks * kSharpTick;
|
||||
const uint16_t kSharpOneSpaceTicks = 70;
|
||||
const uint16_t kSharpOneSpace = kSharpOneSpaceTicks * kSharpTick;
|
||||
const uint16_t kSharpZeroSpaceTicks = 30;
|
||||
const uint16_t kSharpZeroSpace = kSharpZeroSpaceTicks * kSharpTick;
|
||||
const uint16_t kSharpGapTicks = 1677;
|
||||
const uint16_t kSharpGap = kSharpGapTicks * kSharpTick;
|
||||
// Address(5) + Command(8) + Expansion(1) + Check(1)
|
||||
const uint64_t kSharpToggleMask =
|
||||
((uint64_t)1 << (kSharpBits - kSharpAddressBits)) - 1;
|
||||
const uint64_t kSharpAddressMask = ((uint64_t)1 << kSharpAddressBits) - 1;
|
||||
const uint64_t kSharpCommandMask = ((uint64_t)1 << kSharpCommandBits) - 1;
|
||||
|
||||
using irutils::addBoolToString;
|
||||
using irutils::addFanToString;
|
||||
using irutils::addIntToString;
|
||||
using irutils::addLabeledString;
|
||||
using irutils::addModeToString;
|
||||
using irutils::addTempToString;
|
||||
using irutils::setBit;
|
||||
using irutils::setBits;
|
||||
|
||||
#if (SEND_SHARP || SEND_DENON)
|
||||
// Send a (raw) Sharp message
|
||||
//
|
||||
// Args:
|
||||
// data: Contents of the message to be sent.
|
||||
// nbits: Nr. of bits of data to be sent. Typically kSharpBits.
|
||||
// repeat: Nr. of additional times the message is to be sent.
|
||||
//
|
||||
// Status: STABLE / Working fine.
|
||||
//
|
||||
// Notes:
|
||||
// This procedure handles the inversion of bits required per protocol.
|
||||
// The protocol spec says to send the LSB first, but legacy code & usage
|
||||
// has us sending the MSB first. Grrrr. Normal invocation of encodeSharp()
|
||||
// handles this for you, assuming you are using the correct/standard values.
|
||||
// e.g. sendSharpRaw(encodeSharp(address, command));
|
||||
//
|
||||
// Ref:
|
||||
// http://www.sbprojects.com/knowledge/ir/sharp.htm
|
||||
// http://lirc.sourceforge.net/remotes/sharp/GA538WJSA
|
||||
// http://www.mwftr.com/ucF08/LEC14%20PIC%20IR.pdf
|
||||
// http://www.hifi-remote.com/johnsfine/DecodeIR.html#Sharp
|
||||
void IRsend::sendSharpRaw(const uint64_t data, const uint16_t nbits,
|
||||
const uint16_t repeat) {
|
||||
uint64_t tempdata = data;
|
||||
for (uint16_t i = 0; i <= repeat; i++) {
|
||||
// Protocol demands that the data be sent twice; once normally,
|
||||
// then with all but the address bits inverted.
|
||||
// Note: Previously this used to be performed 3 times (normal, inverted,
|
||||
// normal), however all data points to that being incorrect.
|
||||
for (uint8_t n = 0; n < 2; n++) {
|
||||
sendGeneric(0, 0, // No Header
|
||||
kSharpBitMark, kSharpOneSpace, kSharpBitMark, kSharpZeroSpace,
|
||||
kSharpBitMark, kSharpGap, tempdata, nbits, 38, true,
|
||||
0, // Repeats are handled already.
|
||||
33);
|
||||
// Invert the data per protocol. This is always called twice, so it's
|
||||
// retured to original upon exiting the inner loop.
|
||||
tempdata ^= kSharpToggleMask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Encode a (raw) Sharp message from it's components.
|
||||
//
|
||||
// Args:
|
||||
// address: The value of the address to be sent.
|
||||
// command: The value of the address to be sent. (8 bits)
|
||||
// expansion: The value of the expansion bit to use. (0 or 1, typically 1)
|
||||
// check: The value of the check bit to use. (0 or 1, typically 0)
|
||||
// MSBfirst: Flag indicating MSB first or LSB first order. (Default: false)
|
||||
// Returns:
|
||||
// An uint32_t containing the raw Sharp message for sendSharpRaw().
|
||||
//
|
||||
// Status: STABLE / Works okay.
|
||||
//
|
||||
// Notes:
|
||||
// Assumes the standard Sharp bit sizes.
|
||||
// Historically sendSharp() sends address & command in
|
||||
// MSB first order. This is actually incorrect. It should be sent in LSB
|
||||
// order. The behaviour of sendSharp() hasn't been changed to maintain
|
||||
// backward compatibility.
|
||||
//
|
||||
// Ref:
|
||||
// http://www.sbprojects.com/knowledge/ir/sharp.htm
|
||||
// http://lirc.sourceforge.net/remotes/sharp/GA538WJSA
|
||||
// http://www.mwftr.com/ucF08/LEC14%20PIC%20IR.pdf
|
||||
uint32_t IRsend::encodeSharp(const uint16_t address, const uint16_t command,
|
||||
const uint16_t expansion, const uint16_t check,
|
||||
const bool MSBfirst) {
|
||||
// Mask any unexpected bits.
|
||||
uint16_t tempaddress = GETBITS16(address, 0, kSharpAddressBits);
|
||||
uint16_t tempcommand = GETBITS16(command, 0, kSharpCommandBits);
|
||||
uint16_t tempexpansion = GETBITS16(expansion, 0, 1);
|
||||
uint16_t tempcheck = GETBITS16(check, 0, 1);
|
||||
|
||||
if (!MSBfirst) { // Correct bit order if needed.
|
||||
tempaddress = reverseBits(tempaddress, kSharpAddressBits);
|
||||
tempcommand = reverseBits(tempcommand, kSharpCommandBits);
|
||||
}
|
||||
// Concatinate all the bits.
|
||||
return (tempaddress << (kSharpCommandBits + 2)) | (tempcommand << 2) |
|
||||
(tempexpansion << 1) | tempcheck;
|
||||
}
|
||||
|
||||
// Send a Sharp message
|
||||
//
|
||||
// Args:
|
||||
// address: Address value to be sent.
|
||||
// command: Command value to be sent.
|
||||
// nbits: Nr. of bits of data to be sent. Typically kSharpBits.
|
||||
// repeat: Nr. of additional times the message is to be sent.
|
||||
//
|
||||
// Status: DEPRICATED / Previously working fine.
|
||||
//
|
||||
// Notes:
|
||||
// This procedure has a non-standard invocation style compared to similar
|
||||
// sendProtocol() routines. This is due to legacy, compatibility, & historic
|
||||
// reasons. Normally the calling syntax version is like sendSharpRaw().
|
||||
// This procedure transmits the address & command in MSB first order, which is
|
||||
// incorrect. This behaviour is left as-is to maintain backward
|
||||
// compatibility with legacy code.
|
||||
// In short, you should use sendSharpRaw(), encodeSharp(), and the correct
|
||||
// values of address & command instead of using this, & the wrong values.
|
||||
//
|
||||
// Ref:
|
||||
// http://www.sbprojects.com/knowledge/ir/sharp.htm
|
||||
// http://lirc.sourceforge.net/remotes/sharp/GA538WJSA
|
||||
// http://www.mwftr.com/ucF08/LEC14%20PIC%20IR.pdf
|
||||
void IRsend::sendSharp(const uint16_t address, uint16_t const command,
|
||||
const uint16_t nbits, const uint16_t repeat) {
|
||||
sendSharpRaw(encodeSharp(address, command, 1, 0, true), nbits, repeat);
|
||||
}
|
||||
#endif // (SEND_SHARP || SEND_DENON)
|
||||
|
||||
#if (DECODE_SHARP || DECODE_DENON)
|
||||
// Decode the supplied Sharp message.
|
||||
//
|
||||
// Args:
|
||||
// results: Ptr to the data to decode and where to store the decode result.
|
||||
// offset: The starting index to use when attempting to decode the raw data
|
||||
// Typically/Defaults to kStartOffset.
|
||||
// nbits: Nr. of data bits to expect. Typically kSharpBits.
|
||||
// strict: Flag indicating if we should perform strict matching.
|
||||
// expansion: Should we expect the expansion bit to be set. Default is true.
|
||||
// Returns:
|
||||
// boolean: True if it can decode it, false if it can't.
|
||||
//
|
||||
// Status: STABLE / Working fine.
|
||||
//
|
||||
// Note:
|
||||
// This procedure returns a value suitable for use in sendSharpRaw().
|
||||
// TODO(crankyoldgit): Need to ensure capture of the inverted message as it can
|
||||
// be missed due to the interrupt timeout used to detect an end of message.
|
||||
// Several compliance checks are disabled until that is resolved.
|
||||
// Ref:
|
||||
// http://www.sbprojects.com/knowledge/ir/sharp.php
|
||||
// http://www.mwftr.com/ucF08/LEC14%20PIC%20IR.pdf
|
||||
// http://www.hifi-remote.com/johnsfine/DecodeIR.html#Sharp
|
||||
bool IRrecv::decodeSharp(decode_results *results, uint16_t offset,
|
||||
const uint16_t nbits, const bool strict,
|
||||
const bool expansion) {
|
||||
if (results->rawlen <= 2 * nbits + kFooter - 1 + offset)
|
||||
return false; // Not enough entries to be a Sharp message.
|
||||
// Compliance
|
||||
if (strict) {
|
||||
if (nbits != kSharpBits) return false; // Request is out of spec.
|
||||
// DISABLED - See TODO
|
||||
#ifdef UNIT_TEST
|
||||
// An in spec message has the data sent normally, then inverted. So we
|
||||
// expect twice as many entries than to just get the results.
|
||||
if (results->rawlen <= (2 * (2 * nbits + kFooter)) - 1 + offset)
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t data = 0;
|
||||
|
||||
// Match Data + Footer
|
||||
uint16_t used;
|
||||
used = matchGeneric(results->rawbuf + offset, &data,
|
||||
results->rawlen - offset, nbits,
|
||||
0, 0, // No Header
|
||||
kSharpBitMark, kSharpOneSpace,
|
||||
kSharpBitMark, kSharpZeroSpace,
|
||||
kSharpBitMark, kSharpGap, true, 35);
|
||||
if (!used) return false;
|
||||
offset += used;
|
||||
// Compliance
|
||||
if (strict) {
|
||||
// Check the state of the expansion bit is what we expect.
|
||||
if ((data & 0b10) >> 1 != expansion) return false;
|
||||
// The check bit should be cleared in a normal message.
|
||||
if (data & 0b1) return false;
|
||||
// DISABLED - See TODO
|
||||
#ifdef UNIT_TEST
|
||||
// Grab the second copy of the data (i.e. inverted)
|
||||
uint64_t second_data = 0;
|
||||
// Match Data + Footer
|
||||
if (!matchGeneric(results->rawbuf + offset, &second_data,
|
||||
results->rawlen - offset, nbits,
|
||||
0, 0,
|
||||
kSharpBitMark, kSharpOneSpace,
|
||||
kSharpBitMark, kSharpZeroSpace,
|
||||
kSharpBitMark, kSharpGap, true, 35)) return false;
|
||||
// Check that second_data has been inverted correctly.
|
||||
if (data != (second_data ^ kSharpToggleMask)) return false;
|
||||
#endif // UNIT_TEST
|
||||
}
|
||||
|
||||
// Success
|
||||
results->decode_type = SHARP;
|
||||
results->bits = nbits;
|
||||
results->value = data;
|
||||
// Address & command are actually transmitted in LSB first order.
|
||||
results->address = reverseBits(data, nbits) & kSharpAddressMask;
|
||||
results->command =
|
||||
reverseBits((data >> 2) & kSharpCommandMask, kSharpCommandBits);
|
||||
return true;
|
||||
}
|
||||
#endif // (DECODE_SHARP || DECODE_DENON)
|
||||
|
||||
#if SEND_SHARP_AC
|
||||
// Send a Sharp A/C message.
|
||||
//
|
||||
// Args:
|
||||
// data: An array of kSharpAcStateLength bytes containing the IR command.
|
||||
// nbytes: Nr. of bytes of data to send. i.e. length of `data`.
|
||||
// repeat: Nr. of times the message should be repeated.
|
||||
//
|
||||
// Status: Alpha / Untested.
|
||||
//
|
||||
// Ref:
|
||||
// https://github.com/crankyoldgit/IRremoteESP8266/issues/638
|
||||
// https://github.com/ToniA/arduino-heatpumpir/blob/master/SharpHeatpumpIR.cpp
|
||||
void IRsend::sendSharpAc(const unsigned char data[], const uint16_t nbytes,
|
||||
const uint16_t repeat) {
|
||||
if (nbytes < kSharpAcStateLength)
|
||||
return; // Not enough bytes to send a proper message.
|
||||
|
||||
sendGeneric(kSharpAcHdrMark, kSharpAcHdrSpace,
|
||||
kSharpAcBitMark, kSharpAcOneSpace,
|
||||
kSharpAcBitMark, kSharpAcZeroSpace,
|
||||
kSharpAcBitMark, kSharpAcGap,
|
||||
data, nbytes, 38000, false, repeat, 50);
|
||||
}
|
||||
#endif // SEND_SHARP_AC
|
||||
|
||||
IRSharpAc::IRSharpAc(const uint16_t pin, const bool inverted,
|
||||
const bool use_modulation)
|
||||
: _irsend(pin, inverted, use_modulation) { this->stateReset(); }
|
||||
|
||||
void IRSharpAc::begin(void) { _irsend.begin(); }
|
||||
|
||||
#if SEND_SHARP_AC
|
||||
void IRSharpAc::send(const uint16_t repeat) {
|
||||
_irsend.sendSharpAc(getRaw(), kSharpAcStateLength, repeat);
|
||||
}
|
||||
#endif // SEND_SHARP_AC
|
||||
|
||||
// Calculate the checksum for a given state.
|
||||
// Args:
|
||||
// state: The array to verify the checksums of.
|
||||
// length: The size of the state.
|
||||
// Returns:
|
||||
// The 4 bit checksum.
|
||||
uint8_t IRSharpAc::calcChecksum(uint8_t state[], const uint16_t length) {
|
||||
uint8_t xorsum = xorBytes(state, length - 1);
|
||||
xorsum ^= GETBITS8(state[length - 1], kLowNibble, kNibbleSize);
|
||||
xorsum ^= GETBITS8(xorsum, kHighNibble, kNibbleSize);
|
||||
return GETBITS8(xorsum, kLowNibble, kNibbleSize);
|
||||
}
|
||||
|
||||
// Verify the checksums are valid for a given state.
|
||||
// Args:
|
||||
// state: The array to verify the checksums of.
|
||||
// length: The size of the state.
|
||||
// Returns:
|
||||
// A boolean.
|
||||
bool IRSharpAc::validChecksum(uint8_t state[], const uint16_t length) {
|
||||
return GETBITS8(state[length - 1], kHighNibble, kNibbleSize) ==
|
||||
IRSharpAc::calcChecksum(state, length);
|
||||
}
|
||||
|
||||
// Calculate and set the checksum values for the internal state.
|
||||
void IRSharpAc::checksum(void) {
|
||||
setBits(&remote[kSharpAcStateLength - 1], kHighNibble, kNibbleSize,
|
||||
this->calcChecksum(remote));
|
||||
}
|
||||
|
||||
void IRSharpAc::stateReset(void) {
|
||||
static const uint8_t reset[kSharpAcStateLength] = {
|
||||
0xAA, 0x5A, 0xCF, 0x10, 0x00, 0x01, 0x00, 0x00, 0x08, 0x80, 0x00, 0xE0,
|
||||
0x01};
|
||||
memcpy(remote, reset, kSharpAcStateLength);
|
||||
}
|
||||
|
||||
uint8_t *IRSharpAc::getRaw(void) {
|
||||
this->checksum(); // Ensure correct settings before sending.
|
||||
return remote;
|
||||
}
|
||||
|
||||
void IRSharpAc::setRaw(const uint8_t new_code[], const uint16_t length) {
|
||||
memcpy(remote, new_code, std::min(length, kSharpAcStateLength));
|
||||
}
|
||||
|
||||
void IRSharpAc::setPreviousPower(const bool on) {
|
||||
setBit(&remote[kSharpAcBytePower], kSharpAcBitPreviousPowerOffset, on);
|
||||
}
|
||||
|
||||
bool IRSharpAc::getPreviousPower(void) {
|
||||
return GETBIT8(remote[kSharpAcBytePower], kSharpAcBitPreviousPowerOffset);
|
||||
}
|
||||
|
||||
void IRSharpAc::on(void) { setPower(true); }
|
||||
|
||||
void IRSharpAc::off(void) { setPower(false); }
|
||||
|
||||
void IRSharpAc::setPower(const bool on) {
|
||||
setPreviousPower(getPower());
|
||||
setBit(&remote[kSharpAcBytePower], kSharpAcBitPowerOffset, on);
|
||||
setButton(kSharpAcButtonPowerMode);
|
||||
}
|
||||
|
||||
void IRSharpAc::setPower(const bool on, const bool prev) {
|
||||
setPower(on);
|
||||
setPreviousPower(prev);
|
||||
}
|
||||
|
||||
bool IRSharpAc::getPower(void) {
|
||||
return GETBIT8(remote[kSharpAcBytePower], kSharpAcBitPowerOffset);
|
||||
}
|
||||
|
||||
void IRSharpAc::setButton(const uint8_t button) {
|
||||
switch (button) {
|
||||
case kSharpAcButtonPowerMode:
|
||||
case kSharpAcButtonTemp:
|
||||
case kSharpAcButtonFan:
|
||||
setBits(&remote[kSharpAcByteButton], kSharpAcButtonOffset,
|
||||
kSharpAcButtonSize, button);
|
||||
break;
|
||||
default:
|
||||
setButton(kSharpAcButtonPowerMode);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t IRSharpAc::getButton(void) {
|
||||
return GETBITS8(remote[kSharpAcByteButton], kSharpAcButtonOffset,
|
||||
kSharpAcButtonSize);
|
||||
}
|
||||
|
||||
// Set the temp in deg C
|
||||
void IRSharpAc::setTemp(const uint8_t temp) {
|
||||
switch (this->getMode()) {
|
||||
// Auto & Dry don't allow temp changes and have a special temp.
|
||||
case kSharpAcAuto:
|
||||
case kSharpAcDry:
|
||||
remote[kSharpAcByteTemp] = 0;
|
||||
return;
|
||||
default:
|
||||
remote[kSharpAcByteTemp] = 0xC0;
|
||||
}
|
||||
uint8_t degrees = std::max(temp, kSharpAcMinTemp);
|
||||
degrees = std::min(degrees, kSharpAcMaxTemp);
|
||||
setBits(&remote[kSharpAcByteTemp], kLowNibble, kNibbleSize,
|
||||
degrees - kSharpAcMinTemp);
|
||||
setButton(kSharpAcButtonTemp);
|
||||
}
|
||||
|
||||
uint8_t IRSharpAc::getTemp(void) {
|
||||
return GETBITS8(remote[kSharpAcByteTemp], kLowNibble, kNibbleSize) +
|
||||
kSharpAcMinTemp;
|
||||
}
|
||||
|
||||
uint8_t IRSharpAc::getMode(void) {
|
||||
return GETBITS8(remote[kSharpAcByteMode], kLowNibble, kSharpAcModeSize);
|
||||
}
|
||||
|
||||
void IRSharpAc::setMode(const uint8_t mode) {
|
||||
switch (mode) {
|
||||
case kSharpAcAuto:
|
||||
case kSharpAcDry:
|
||||
this->setFan(2); // When Dry or Auto, Fan always 2(Auto)
|
||||
this->setTemp(0); // Dry/Auto have no temp setting.
|
||||
// FALLTHRU
|
||||
case kSharpAcCool:
|
||||
case kSharpAcHeat:
|
||||
setBits(&remote[kSharpAcByteMode], kLowNibble, kSharpAcModeSize, mode);
|
||||
break;
|
||||
default:
|
||||
this->setMode(kSharpAcAuto);
|
||||
}
|
||||
setButton(kSharpAcButtonPowerMode);
|
||||
}
|
||||
|
||||
// Set the speed of the fan
|
||||
void IRSharpAc::setFan(const uint8_t speed) {
|
||||
switch (speed) {
|
||||
case kSharpAcFanAuto:
|
||||
case kSharpAcFanMin:
|
||||
case kSharpAcFanMed:
|
||||
case kSharpAcFanHigh:
|
||||
case kSharpAcFanMax:
|
||||
setBits(&remote[kSharpAcByteFan], kSharpAcFanOffset, kSharpAcFanSize,
|
||||
speed);
|
||||
break;
|
||||
default:
|
||||
this->setFan(kSharpAcFanAuto);
|
||||
}
|
||||
setButton(kSharpAcButtonFan);
|
||||
}
|
||||
|
||||
uint8_t IRSharpAc::getFan(void) {
|
||||
return GETBITS8(remote[kSharpAcByteFan], kSharpAcFanOffset, kSharpAcFanSize);
|
||||
}
|
||||
|
||||
// Convert a standard A/C mode into its native mode.
|
||||
uint8_t IRSharpAc::convertMode(const stdAc::opmode_t mode) {
|
||||
switch (mode) {
|
||||
case stdAc::opmode_t::kCool: return kSharpAcCool;
|
||||
case stdAc::opmode_t::kHeat: return kSharpAcHeat;
|
||||
case stdAc::opmode_t::kDry: return kSharpAcDry;
|
||||
// No Fan mode.
|
||||
default: return kSharpAcAuto;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a standard A/C Fan speed into its native fan speed.
|
||||
uint8_t IRSharpAc::convertFan(const stdAc::fanspeed_t speed) {
|
||||
switch (speed) {
|
||||
case stdAc::fanspeed_t::kMin:
|
||||
case stdAc::fanspeed_t::kLow: return kSharpAcFanMin;
|
||||
case stdAc::fanspeed_t::kMedium: return kSharpAcFanMed;
|
||||
case stdAc::fanspeed_t::kHigh: return kSharpAcFanHigh;
|
||||
case stdAc::fanspeed_t::kMax: return kSharpAcFanMax;
|
||||
default: return kSharpAcFanAuto;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a native mode to it's common equivalent.
|
||||
stdAc::opmode_t IRSharpAc::toCommonMode(const uint8_t mode) {
|
||||
switch (mode) {
|
||||
case kSharpAcCool: return stdAc::opmode_t::kCool;
|
||||
case kSharpAcHeat: return stdAc::opmode_t::kHeat;
|
||||
case kSharpAcDry: return stdAc::opmode_t::kDry;
|
||||
default: return stdAc::opmode_t::kAuto;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a native fan speed to it's common equivalent.
|
||||
stdAc::fanspeed_t IRSharpAc::toCommonFanSpeed(const uint8_t speed) {
|
||||
switch (speed) {
|
||||
case kSharpAcFanMax: return stdAc::fanspeed_t::kMax;
|
||||
case kSharpAcFanHigh: return stdAc::fanspeed_t::kHigh;
|
||||
case kSharpAcFanMed: return stdAc::fanspeed_t::kMedium;
|
||||
case kSharpAcFanMin: return stdAc::fanspeed_t::kMin;
|
||||
default: return stdAc::fanspeed_t::kAuto;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert the A/C state to it's common equivalent.
|
||||
stdAc::state_t IRSharpAc::toCommon(void) {
|
||||
stdAc::state_t result;
|
||||
result.protocol = decode_type_t::SHARP_AC;
|
||||
result.model = -1; // Not supported.
|
||||
result.power = this->getPower();
|
||||
result.mode = this->toCommonMode(this->getMode());
|
||||
result.celsius = true;
|
||||
result.degrees = this->getTemp();
|
||||
result.fanspeed = this->toCommonFanSpeed(this->getFan());
|
||||
// Not supported.
|
||||
result.swingv = stdAc::swingv_t::kOff;
|
||||
result.swingh = stdAc::swingh_t::kOff;
|
||||
result.quiet = false;
|
||||
result.turbo = false;
|
||||
result.clean = false;
|
||||
result.beep = false;
|
||||
result.econo = false;
|
||||
result.filter = false;
|
||||
result.light = false;
|
||||
result.sleep = -1;
|
||||
result.clock = -1;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Convert the internal state into a human readable string.
|
||||
String IRSharpAc::toString(void) {
|
||||
String result = "";
|
||||
result.reserve(80); // Reserve some heap for the string to reduce fragging.
|
||||
result += addBoolToString(getPower(), kPowerStr, false);
|
||||
result += addBoolToString(getPreviousPower(), kPreviousPowerStr);
|
||||
result += addModeToString(getMode(), kSharpAcAuto, kSharpAcCool, kSharpAcHeat,
|
||||
kSharpAcDry, kSharpAcAuto);
|
||||
result += addTempToString(getTemp());
|
||||
result += addFanToString(getFan(), kSharpAcFanMax, kSharpAcFanMin,
|
||||
kSharpAcFanAuto, kSharpAcFanAuto, kSharpAcFanMed);
|
||||
return result;
|
||||
}
|
||||
|
||||
#if DECODE_SHARP_AC
|
||||
// Decode the supplied Sharp A/C message.
|
||||
// Args:
|
||||
// results: Ptr to the data to decode and where to store the decode result.
|
||||
// offset: The starting index to use when attempting to decode the raw data.
|
||||
// Typically/Defaults to kStartOffset.
|
||||
// nbits: Nr. of bits to expect in the data portion. (kSharpAcBits)
|
||||
// strict: Flag to indicate if we strictly adhere to the specification.
|
||||
// Returns:
|
||||
// boolean: True if it can decode it, false if it can't.
|
||||
//
|
||||
// Status: STABLE / Known working.
|
||||
//
|
||||
// Ref:
|
||||
// https://github.com/crankyoldgit/IRremoteESP8266/issues/638
|
||||
// https://github.com/ToniA/arduino-heatpumpir/blob/master/SharpHeatpumpIR.cpp
|
||||
bool IRrecv::decodeSharpAc(decode_results *results, uint16_t offset,
|
||||
const uint16_t nbits, const bool strict) {
|
||||
// Compliance
|
||||
if (strict && nbits != kSharpAcBits) return false;
|
||||
|
||||
// Match Header + Data + Footer
|
||||
uint16_t used;
|
||||
used = matchGeneric(results->rawbuf + offset, results->state,
|
||||
results->rawlen - offset, nbits,
|
||||
kSharpAcHdrMark, kSharpAcHdrSpace,
|
||||
kSharpAcBitMark, kSharpAcOneSpace,
|
||||
kSharpAcBitMark, kSharpAcZeroSpace,
|
||||
kSharpAcBitMark, kSharpAcGap, true,
|
||||
_tolerance, kMarkExcess, false);
|
||||
if (used == 0) return false;
|
||||
offset += used;
|
||||
// Compliance
|
||||
if (strict) {
|
||||
if (!IRSharpAc::validChecksum(results->state)) return false;
|
||||
}
|
||||
|
||||
// Success
|
||||
results->decode_type = SHARP_AC;
|
||||
results->bits = nbits;
|
||||
// No need to record the state as we stored it as we decoded it.
|
||||
// As we use result->state, we don't record value, address, or command as it
|
||||
// is a union data type.
|
||||
return true;
|
||||
}
|
||||
#endif // DECODE_SHARP_AC
|
@ -1,107 +0,0 @@
|
||||
// Copyright 2019 crankyoldgit
|
||||
|
||||
// Supports:
|
||||
// Brand: Sharp, Model: LC-52D62U TV
|
||||
// Brand: Sharp, Model: AY-ZP40KR A/C
|
||||
// Brand: Sharp, Model: AH-AxSAY A/C
|
||||
|
||||
#ifndef IR_SHARP_H_
|
||||
#define IR_SHARP_H_
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
#include <Arduino.h>
|
||||
#endif
|
||||
#include "IRrecv.h"
|
||||
#include "IRremoteESP8266.h"
|
||||
#include "IRsend.h"
|
||||
#ifdef UNIT_TEST
|
||||
#include "IRsend_test.h"
|
||||
#endif
|
||||
|
||||
// Constants
|
||||
const uint16_t kSharpAcHdrMark = 3800;
|
||||
const uint16_t kSharpAcHdrSpace = 1900;
|
||||
const uint16_t kSharpAcBitMark = 470;
|
||||
const uint16_t kSharpAcZeroSpace = 500;
|
||||
const uint16_t kSharpAcOneSpace = 1400;
|
||||
const uint32_t kSharpAcGap = kDefaultMessageGap;
|
||||
|
||||
const uint8_t kSharpAcAuto = 0b000;
|
||||
const uint8_t kSharpAcDry = 0b011;
|
||||
const uint8_t kSharpAcCool = 0b010;
|
||||
const uint8_t kSharpAcHeat = 0b001;
|
||||
const uint8_t kSharpAcMinTemp = 15; // Celsius
|
||||
const uint8_t kSharpAcMaxTemp = 30; // Celsius
|
||||
const uint8_t kSharpAcFanAuto = 0b010; // 2
|
||||
const uint8_t kSharpAcFanMin = 0b100; // 4 (FAN1)
|
||||
const uint8_t kSharpAcFanMed = 0b011; // 3 (FAN2)
|
||||
const uint8_t kSharpAcFanHigh = 0b101; // 5 (FAN3)
|
||||
const uint8_t kSharpAcFanMax = 0b111; // 7 (FAN4)
|
||||
const uint8_t kSharpAcByteTemp = 4;
|
||||
const uint8_t kSharpAcBytePower = 5;
|
||||
const uint8_t kSharpAcBitPowerOffset = 4; // 0b000x0000
|
||||
const uint8_t kSharpAcBitPreviousPowerOffset = 5; // 0b00x00000
|
||||
const uint8_t kSharpAcByteMode = 6;
|
||||
const uint8_t kSharpAcModeSize = 2; // Mask 0b00000011;
|
||||
const uint8_t kSharpAcByteFan = kSharpAcByteMode;
|
||||
const uint8_t kSharpAcFanOffset = 4; // Mask 0b01110000
|
||||
const uint8_t kSharpAcFanSize = 3; // Nr. of Bits
|
||||
const uint8_t kSharpAcByteButton = 10;
|
||||
const uint8_t kSharpAcButtonOffset = 0;
|
||||
const uint8_t kSharpAcButtonSize = 3; // Mask 0b00000xxx
|
||||
const uint8_t kSharpAcButtonPowerMode = 0b000; // 0
|
||||
const uint8_t kSharpAcButtonTemp = 0b100; // 4
|
||||
const uint8_t kSharpAcButtonFan = 0b101; // 5
|
||||
|
||||
class IRSharpAc {
|
||||
public:
|
||||
explicit IRSharpAc(const uint16_t pin, const bool inverted = false,
|
||||
const bool use_modulation = true);
|
||||
|
||||
#if SEND_SHARP_AC
|
||||
void send(const uint16_t repeat = kSharpAcDefaultRepeat);
|
||||
uint8_t calibrate(void) { return _irsend.calibrate(); }
|
||||
#endif // SEND_SHARP_AC
|
||||
void begin(void);
|
||||
void on(void);
|
||||
void off(void);
|
||||
void setPower(const bool on);
|
||||
void setPower(const bool on, const bool prev);
|
||||
bool getPower(void);
|
||||
void setPreviousPower(const bool on);
|
||||
bool getPreviousPower(void);
|
||||
void setTemp(const uint8_t temp);
|
||||
uint8_t getTemp(void);
|
||||
void setFan(const uint8_t fan);
|
||||
uint8_t getFan(void);
|
||||
void setMode(const uint8_t mode);
|
||||
uint8_t getMode(void);
|
||||
void setButton(const uint8_t button);
|
||||
uint8_t getButton(void);
|
||||
uint8_t* getRaw(void);
|
||||
void setRaw(const uint8_t new_code[],
|
||||
const uint16_t length = kSharpAcStateLength);
|
||||
static bool validChecksum(uint8_t state[],
|
||||
const uint16_t length = kSharpAcStateLength);
|
||||
static uint8_t convertMode(const stdAc::opmode_t mode);
|
||||
static uint8_t convertFan(const stdAc::fanspeed_t speed);
|
||||
static stdAc::opmode_t toCommonMode(const uint8_t mode);
|
||||
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
|
||||
stdAc::state_t toCommon(void);
|
||||
String toString(void);
|
||||
#ifndef UNIT_TEST
|
||||
|
||||
private:
|
||||
IRsend _irsend;
|
||||
#else
|
||||
IRsendTest _irsend;
|
||||
#endif
|
||||
// # of bytes per command
|
||||
uint8_t remote[kSharpAcStateLength];
|
||||
void stateReset(void);
|
||||
void checksum(void);
|
||||
static uint8_t calcChecksum(uint8_t state[],
|
||||
const uint16_t length = kSharpAcStateLength);
|
||||
};
|
||||
|
||||
#endif // IR_SHARP_H_
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user