Skip to content

Commit

Permalink
ST7701: Switch to using HV mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBell committed Dec 29, 2024
1 parent b4a4101 commit 44747d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions drivers/st7701/st7701.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace pimoroni {
#define TIMING_V_DISPLAY (DISPLAY_HEIGHT + TIMING_V_BACK)
#define TIMING_V_FRONT (5 + TIMING_V_DISPLAY)
#define TIMING_H_FRONT 4
#define TIMING_H_PULSE 25
#define TIMING_H_PULSE 16
#define TIMING_H_BACK 30
#define TIMING_H_DISPLAY 480

Expand Down Expand Up @@ -342,11 +342,12 @@ void ST7701::start_frame_xfer()
// TODO: Figure out what's actually display specific
command(reg::MADCTL, 1, "\x00"); // Normal scan direction and RGB pixels
command(reg::LNESET, 2, "\x3b\x00"); // (59 + 1) * 8 = 480 lines
command(reg::PORCTRL, 2, "\x0d\x05"); // 13 VBP, 5 VFP
command(reg::INVSET, 2, "\x32\x05");
command(reg::PORCTRL, 2, "\x0c\x01"); // Display porch settings: 12 VBP, 1 VFP
command(reg::INVSET, 2, "\x32\x01");
command(reg::COLCTRL, 1, "\x08"); // LED polarity reversed
command(reg::PVGAMCTRL, 16, "\x00\x11\x18\x0e\x11\x06\x07\x08\x07\x22\x04\x12\x0f\xaa\x31\x18");
command(reg::NVGAMCTRL, 16, "\x00\x11\x19\x0e\x12\x07\x08\x08\x08\x22\x04\x11\x11\xa9\x32\x18");
command(reg::RGBCTRL, 3, "\x80\x2e\x0d"); // HV mode, H and V back porch + sync
}

// Command 2 BK1 - Voltages and power and stuff
Expand Down
4 changes: 2 additions & 2 deletions drivers/st7701/st7701_parallel.pio
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
.side_set 1

.wrap_target
mov x, y side 0 ; y needs to be set to (width/2)-1 at init time
wait 1 irq 4 side 0 ; wait for the irq from the timing SM
mov x, y side 1 ; y needs to be set to (width/2)-1 at init time
wait 1 irq 4 side 1 ; wait for the irq from the timing SM
loop:
out isr, 32 side 1
mov pins, ::isr side 1 [1]
Expand Down

0 comments on commit 44747d8

Please sign in to comment.