-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for panel-controlled backlights #586
Comments
Hello, @tylercamp , @tobozo Apologies for the late reply.
|
I've updated the develop branch, so please try it out. |
@lovyan03 Nice! I didn't notice the panel had a I'm away from home and don't have a device to test with, |
Merged |
I'm not able to get this to work. I'm not instantiating an instance of the Light_PWM, but now get no response from the display. @tylercamp can you share your config? On a side note, is anyone using PLatformIO ? If I change my platformio.ini file to reference the develop branch of LGFX |
@dekesone I'm also using PlatformIO and am referencing my own fork currently, but lovyan repo should work too since it's been merged:
(I also tried changing to lovyan repo with My LGFX config: class LGFX : public lgfx::LGFX_Device
{
lgfx::Panel_SSD1963 _panel_instance;
lgfx::Bus_Parallel8 _bus_instance;
lgfx::Touch_FT5x06 _touch_instance;
public:
LGFX(void)
{
{
auto cfg = _bus_instance.config();
cfg.pin_wr = DISPLAY_SSD1963_WR;
cfg.pin_rd = DISPLAY_SSD1963_RD;
cfg.pin_rs = DISPLAY_SSD1963_RS;
cfg.pin_d0 = DISPLAY_SSD1963_D0;
cfg.pin_d1 = DISPLAY_SSD1963_D1;
cfg.pin_d2 = DISPLAY_SSD1963_D2;
cfg.pin_d3 = DISPLAY_SSD1963_D3;
cfg.pin_d4 = DISPLAY_SSD1963_D4;
cfg.pin_d5 = DISPLAY_SSD1963_D5;
cfg.pin_d6 = DISPLAY_SSD1963_D6;
cfg.pin_d7 = DISPLAY_SSD1963_D7;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}
{
auto cfg = _panel_instance.config();
cfg.pin_cs = DISPLAY_SSD1963_CS;
cfg.pin_rst = DISPLAY_SSD1963_RST;
cfg.pin_busy = 35;
cfg.panel_width = cfg.memory_width = 800;
cfg.panel_height = cfg.memory_height = 480;
cfg.offset_x = 0;
cfg.offset_y = 0;
cfg.offset_rotation = 0;
cfg.rgb_order = true;
cfg.dlen_16bit = false;
_panel_instance.config(cfg);
}
{
auto cfg = _touch_instance.config();
cfg.x_min = 0;
cfg.x_max = 839;
cfg.y_min = 0;
cfg.y_max = 479;
cfg.pin_int = TOUCH_INT;
cfg.bus_shared = true;
cfg.offset_rotation = 0;
cfg.pin_rst = TOUCH_RST;
cfg.i2c_port = 1;
cfg.i2c_addr = 0x38;
cfg.pin_sda = TOUCH_SDA;
cfg.pin_scl = TOUCH_SCL;
cfg.freq = 400000;
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
setPanel(&_panel_instance);
}
}; To change the brightness I just call display = new LGFX();
display->init();
display->clear(0);
display->setBrightness(10); (Set very low for testing just so it's easier to see diff. in brightness) |
Everything's working fine now, and I can confirm the PWM control now works as expected. Thanks! (for some reason, using the lib_deps reference to |
(Moved from #583 )
Some panels, i.e. SSD1963, come with built-in backlight control which require device-specific commands to manage.
Currently there isn't any
ILight
implementation which supports this.For SSD1963 specifically, these commands are needed for backlight control:
Since this type of backlight control is specific to the particular
Panel_LCD
, I wonder if any of these minor refactors would be appropriate:(2) seems most in line with current LGFX patterns
The text was updated successfully, but these errors were encountered: