forked from OpenStickCommunity/GP2040-CE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I2C Autodetection (OpenStickCommunity#1072)
* Added beginning of webconfig-side I2C bus scanning. Added experimental wrapper class for ADS1219 to handle device auto-detection. * Added scanner to webconfig. * Case sensitivity fix * All current I2C addons except Display updated to do auto device detection rather than rely on I2C block options. Added address range to ADS1219 addon to allow scanning across full range. * Fixed I2C/USB peripheral configuration check to reject negative pin values. * Added autodetection of I2C displays. This currently does not disable the usage of other devices on the same block. * Deprecating I2C addon block and address fields. * Remove deprecated Block and Address fields from Display and several Addons. * Added exclusive mode for I2C peripherals to allow data-hungry devices like Display to take full control of the bus. * Revert deprecatedi2cBlock to i2cBlock * Reinstated deprecatedI2cBlock * Reinstated usage of deprecatedI2cBlock
- Loading branch information
1 parent
9858d77
commit 3826b1b
Showing
36 changed files
with
365 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef _ADS1219DEVICE_H_ | ||
#define _ADS1219DEVICE_H_ | ||
|
||
#include <vector> | ||
|
||
#include "i2cdevicebase.h" | ||
#include "ADS1219.h" | ||
|
||
class ADS1219Device : public ADS1219, public I2CDeviceBase { | ||
public: | ||
// Constructor | ||
ADS1219Device() {} | ||
ADS1219Device(PeripheralI2C *i2cController, uint8_t addr = 0x40) : ADS1219(i2cController, addr) {} | ||
|
||
std::vector<uint8_t> getDeviceAddresses() const override { | ||
return {0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F}; | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef _WIIEXTDEVICE_H_ | ||
#define _WIIEXTDEVICE_H_ | ||
|
||
#include <vector> | ||
|
||
#include "i2cdevicebase.h" | ||
#include <WiiExtension.h> | ||
|
||
class WiiExtensionDevice : public WiiExtension, public I2CDeviceBase { | ||
public: | ||
// Constructor | ||
WiiExtensionDevice() {} | ||
WiiExtensionDevice(PeripheralI2C *i2cController, uint8_t addr = WII_EXTENSION_I2C_ADDR) : WiiExtension(i2cController, addr) {} | ||
|
||
std::vector<uint8_t> getDeviceAddresses() const override { | ||
return {WII_EXTENSION_I2C_ADDR}; | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.