mirror of
https://github.com/meshtastic/firmware.git
synced 2026-02-05 21:21:03 -05:00
rgb led support for unPhone
This commit is contained in:
20
src/main.cpp
20
src/main.cpp
@@ -494,11 +494,15 @@ void setup()
|
||||
* "found".
|
||||
*/
|
||||
|
||||
// Only one supported RGB LED currently
|
||||
// Only one supported I2C RGB LED currently (plus common anode RGB LED used by the unPhone)
|
||||
#ifdef HAS_NCP5623
|
||||
rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623);
|
||||
#endif
|
||||
|
||||
#ifdef UNPHONE
|
||||
rgb_found.type = ScanI2C::DeviceType::RGBLED_CA;
|
||||
#endif
|
||||
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||
auto acc_info = i2cScanner->firstAccelerometer();
|
||||
accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found;
|
||||
@@ -590,6 +594,20 @@ void setup()
|
||||
if (config.display.oled != meshtastic_Config_DisplayConfig_OledType_OLED_AUTO)
|
||||
screen_model = config.display.oled;
|
||||
|
||||
#ifdef UNPHONE
|
||||
// initialise IO expander with pinmodes
|
||||
Wire.beginTransmission(0x26);
|
||||
Wire.write(0x06);
|
||||
Wire.write(0x7A);
|
||||
Wire.write(0xDD);
|
||||
Wire.endTransmission();
|
||||
Wire.beginTransmission(0x26);
|
||||
Wire.write(0x02);
|
||||
Wire.write(0x04); // Backlight on
|
||||
Wire.write(0x22); // G&B LEDs off
|
||||
Wire.endTransmission();
|
||||
#endif
|
||||
|
||||
#if defined(USE_SH1107)
|
||||
screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // set dimension of 128x128
|
||||
display_geometry = GEOMETRY_128_128;
|
||||
|
||||
Reference in New Issue
Block a user