Skip to content

Commit 67dd680

Browse files
author
Elliot Williams
committed
seems to be working
minor cleanup in files not 100% sure about the MADCTL table, but our display is correctly rotated 90°
1 parent 4bc51e2 commit 67dd680

File tree

3 files changed

+2
-37
lines changed

3 files changed

+2
-37
lines changed

api_drivers/common_api_drivers/display/nv3007/_nv3007_init.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2024 - 2025 Kevin G. Schlosser
2+
# NV3007 version (c) 2025 Elliot Williams who just ported init code taken from the internets
23

34
import time
45
from micropython import const # NOQA
@@ -43,13 +44,10 @@
4344
_CMD_PIXSET = const(0x3A)
4445
_CMD_GETSCANLINE= const(0x45)
4546

46-
4747
def init(self):
4848
param_buf = bytearray(12)
4949
param_mv = memoryview(param_buf)
5050

51-
## Begin translation
52-
5351
param_buf[0] = 0xa5
5452
self.set_params(0xFF, param_mv[:1])
5553

@@ -264,7 +262,7 @@ def init(self):
264262
self.set_params(0xc6, param_mv[:1])
265263

266264
param_buf[:2] = bytearray([0x33, 0x33]) #/ CLKCTRL16
267-
self.set_paramw(0xC8, param_mv[:2])
265+
self.set_params(0xC8, param_mv[:2])
268266

269267
param_buf[0] = 0x68 #/ CLKCTRL17
270268
self.set_params(0xC9, param_mv[:1])

api_drivers/common_api_drivers/display/nv3007/nv3007.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import lcd_bus # NOQA
77
import display_driver_framework
88

9-
### begin straight-up copy from GC9A01 driver
109
STATE_HIGH = display_driver_framework.STATE_HIGH
1110
STATE_LOW = display_driver_framework.STATE_LOW
1211
STATE_PWM = display_driver_framework.STATE_PWM
@@ -23,38 +22,10 @@
2322

2423
class NV3007(display_driver_framework.DisplayDriver):
2524

26-
## this is probably wrong!
2725
_ORIENTATION_TABLE = (
2826
0,
2927
_MADCTL_MX | _MADCTL_MV,
3028
_MADCTL_MY | _MADCTL_MX,
3129
_MADCTL_MY | _MADCTL_MV
3230
)
3331

34-
# virtual uint8_t getMadCtl(uint8_t r) const
35-
# {
36-
# static constexpr uint8_t madctl_table[] =
37-
# {
38-
# 0,
39-
# MAD_MV|MAD_MX|MAD_MH ,
40-
# MAD_MX|MAD_MH|MAD_MY|MAD_ML,
41-
# MAD_MV| MAD_MY|MAD_ML,
42-
# MAD_MY|MAD_ML,
43-
# MAD_MV ,
44-
# MAD_MX|MAD_MH ,
45-
# MAD_MV|MAD_MX|MAD_MY|MAD_MH|MAD_ML,
46-
# };
47-
# return madctl_table[r];
48-
# }
49-
50-
51-
## end straight-up copy
52-
53-
54-
## other bits to implement:
55-
# uint8_t getColMod(uint8_t bpp) const override { return 0x05; }
56-
# uint8_t getMadCtl(uint8_t r) const override { return MAD_MV | MAD_MY; }
57-
# _cfg.offset_y = 12;
58-
59-
## src/lgfx/v1/panel/Panel_NV3007.hpp
60-
## _cfg.offset_y = 12;

api_drivers/common_api_drivers/display/nv3007/portme

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)