Skip to content

Commit

Permalink
Add support for PCA9557
Browse files Browse the repository at this point in the history
Add support for PCA9557 8-bit I/O expander (#18632)
  • Loading branch information
arendst committed May 14, 2023
1 parent 26508e5 commit f1a9a0b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions BUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Note: `minimal` variant is not listed as it shouldn't be used outside of the [up
| USE_LOX_O2 | - | - / x | - | x | - | - |
| USE_GDK101 | - | - / - | - | - | - | - |
| USE_TC74 | - | - / - | - | - | - | - |
| USE_PCA9557 | - | - / - | - | - | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_HIH6 | - | - / x | - | x | - | - |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
- Berry `tcpclientasync` class for non-blocking TCP client
- Support for GM861 1D and 2D bar code reader (#18399)
- Berry `re` (regex) add `match2` and optional offset
- Support for PCA9557 8-bit I/O expander (#18632)

### Breaking Changed
- Change command ``FileUpload`` index binary data detection from >199 to >299
Expand Down
2 changes: 1 addition & 1 deletion I2CDEVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ Index | Define | Driver | Device | Address(es) | Description
78 | USE_PMSA003I | xsns_104 | PMSA003I | 0x12 | PM2.5 Air Quality Sensor with I2C Interface
79 | USE_GDK101 | xsns_106 | GDK101 | 0x18 - 0x1B | Gamma Radiation Sensor
80 | USE_TC74 | xsns_108 | TC74 | 0x48 - 0x4F | Temperature sensor
81 | USE_PCA95XX_DRV | xdrv_69 | PCA95xx | 0x18 - 0x1F | 8-bit I/O expander as virtual relay
81 | USE_PCA9557 | xdrv_69 | PCA95xx | 0x18 - 0x1F | 8-bit I/O expander as virtual button/switch/relay
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Command ``SetOption152 0/1`` to select two (0 = default) pin bistable or one (1) pin latching relay control [#18386](https://github.com/arendst/Tasmota/issues/18386)
- Support for TC74 temperature sensor by Michael Loftis [#18042](https://github.com/arendst/Tasmota/issues/18042)
- Support for GM861 1D and 2D bar code reader [#18399](https://github.com/arendst/Tasmota/issues/18399)
- Support for PCA9557 8-bit I/O expander [#18632](https://github.com/arendst/Tasmota/issues/18632)
- Matter sensors Humidity, Pressure, Illuminance [#18441](https://github.com/arendst/Tasmota/issues/18441)
- Matter allow `Matter#Initialized` rule once the device is configured [#18451](https://github.com/arendst/Tasmota/issues/18451)
- Matter UI to change endpoints configuration [#18498](https://github.com/arendst/Tasmota/issues/18498)
Expand Down
1 change: 1 addition & 0 deletions tasmota/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@
// #define TC74_MAX_SENSORS 8 // Support non-default/multiple I2C addresses
// #define TC74_I2C_PROBE_ADDRESSES { 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F } // Addresses to probe/support
// #define TC74_MAX_FAILCOUNT 8 // Maximum failed polls before it's marked inactive until reprobing later
// #define USE_PCA9557 // [I2cDriver81] Enable PCA9557 8-bit I/O Expander (I2C addresses 0x18 - 0x1F) (+2k5 code)

// #define USE_RTC_CHIPS // Enable RTC chip support and NTP server - Select only one
// #define USE_DS3231 // [I2cDriver26] Enable DS3231 RTC (I2C address 0x68) (+1k2 code)
Expand Down
4 changes: 3 additions & 1 deletion tasmota/tasmota_support/support_features.ino
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,9 @@ void ResponseAppendFeatures(void)
#if defined(USE_I2C) && defined(USE_TC74)
feature9 |= 0x00400000; // xsns_108_tc74.ino
#endif
// feature9 |= 0x00800000;
#if defined(USE_I2C) && defined(USE_PCA9557)
feature9 |= 0x00800000; // xdrv_69_pca9557.ino
#endif

// feature9 |= 0x01000000;
// feature9 |= 0x02000000;
Expand Down
6 changes: 3 additions & 3 deletions tasmota/tasmota_xdrv_driver/xdrv_69_pca9557.ino
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
xdrv_69_pca95xx.ino - PCA9557 GPIO Expander support for Tasmota
xdrv_69_pca9557.ino - PCA9557 GPIO Expander support for Tasmota
SPDX-FileCopyrightText: 2023 Theo Arends
SPDX-License-Identifier: GPL-3.0-only
*/

#if defined(USE_I2C)
#ifdef USE_PCA9557_DRV
#ifdef USE_I2C
#ifdef USE_PCA9557
/*********************************************************************************************\
* 8-bit PCA9557 I2C GPIO Expander to be used as virtual relay
*
Expand Down
4 changes: 2 additions & 2 deletions tools/decode-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
"USE_DINGTIAN_RELAY","USE_HMC5883L","USE_LD2410","USE_ME007",
"USE_DISPLAY_TM1650","USE_PCA9632","USE_TUYAMCUBR","USE_SEN5X",
"USE_BIOPDU","USE_MCP23XXX_DRV","USE_PMSA003I","USE_LOX_O2",
"USE_GDK101","USE_GM861","USE_TC74","",
"USE_GDK101","USE_GM861","USE_TC74","USE_PCA9557",
"","","","",
"","","",""
]]
Expand Down Expand Up @@ -325,7 +325,7 @@
obj = json.load(fp)

def StartDecode():
print ("\n*** decode-status.py v12.5.0.1 by Theo Arends and Jacek Ziolkowski ***")
print ("\n*** decode-status.py v12.5.0.2 by Theo Arends and Jacek Ziolkowski ***")

# print("Decoding\n{}".format(obj))

Expand Down

0 comments on commit f1a9a0b

Please sign in to comment.