Skip to content

Commit

Permalink
rp2350 fix from @stonedev-app's (see #619)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobozo committed Oct 3, 2024
1 parent 1401c28 commit dfa3e39
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lgfx/v1/panel/.directory
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Dolphin]
PreviewsShown=false
Timestamp=2024,9,6,8,43,6.054
Version=4
ViewMode=1

[Settings]
HiddenFilesShown=true
73 changes: 73 additions & 0 deletions src/lgfx/v1/panel/Panel_ST7789P3.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*----------------------------------------------------------------------------/
* Lovyan GFX - Graphics library for embedded devices.
*
O *riginal Source:
https://github.com/lovyan03/LovyanGFX/
Licence:
[FreeBSD](https://github.com/lovyan03/LovyanGFX/blob/master/license.txt)
Author:
[lovyan03](https://twitter.com/lovyan03)
Contributors:
[ciniml](https://github.com/ciniml)
[mongonta0716](https://github.com/mongonta0716)
[tobozo](https://github.com/tobozo)
/----------------------------------------------------------------------------*/
#pragma once

#include "Panel_LCD.hpp"

namespace lgfx
{
inline namespace v1
{
//----------------------------------------------------------------------------

struct Panel_ST7789P3 : public Panel_LCD
{
Panel_ST7789P3(void)
{
_cfg.panel_height = _cfg.memory_height = 320;
_cfg.dummy_read_pixel = 16;
}

protected:

const uint8_t* getInitCommands(uint8_t listno) const override {

static constexpr uint8_t list0[] = {
0x11, 0+CMD_INIT_DELAY, 120,
0x36, 1, 0x00,
0x3A, 1, 0x05,
0xB2, 5, 0x0C, 0x0C, 0x00, 0x33, 0x33,
0xb7, 1, 0x56,
0xbb, 1, 0x1d,
0xc0, 1, 0x2c,
0xc2, 1, 0x01,
0xc3, 1, 0x0f,
0xc6, 1, 0x0f,
0xd0, 1, 0xa7,
0xd0, 2, 0xa4, 0xa1,
0xd6, 1, 0xa1,
0xe0, 14, 0xF0, 0x02, 0x07, 0x05, 0x06, 0x14, 0x2F, 0x54, 0x46, 0x38, 0x13, 0x11, 0x2E, 0x35,
0xe1, 14, 0xF0, 0x08, 0x0C, 0x0C, 0x09, 0x05, 0x2F, 0x43, 0x46, 0x36, 0x10, 0x12, 0x2C, 0x32,
0x21, 0,
0x29, 0,
0x2c, 0+CMD_INIT_DELAY, 100,
0x2a, 4, 0x00, 0x00, 0x01, 0x3f,
0x2b, 4, 0x00, 0x00, 0x00, 0xef,
0x2c, 0,
0xFF,0xFF, // end
};
switch (listno) {
case 0: return list0;
default: return nullptr;
}
}
};

//----------------------------------------------------------------------------
}
}
4 changes: 4 additions & 0 deletions src/lgfx/v1/platforms/rp2040/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ namespace lgfx
padsbank0_hw->io[pin] = temp;
volatile io_bank0_hw_t *iobank0_regs = reinterpret_cast<volatile io_bank0_hw_t *>(IO_BANK0_BASE);
iobank0_regs->io[pin].ctrl = fn << IO_BANK0_GPIO0_CTRL_FUNCSEL_LSB;
#if defined(PICO_RP2350)
// Remove pad isolation now that the correct peripheral is in control of the pad
hw_clear_bits(&padsbank0_hw->io[pin], PADS_BANK0_GPIO0_ISO_BITS);
#endif
return true;
}

Expand Down

0 comments on commit dfa3e39

Please sign in to comment.