Skip to content

Commit 3f4a9c4

Browse files
ozersafabiobaltieri
authored andcommitted
boards: arm: adi: Enable display for MAX32662EVKIT board
MAX32662EVKIT board has CFAF128128B1-0145T display which is 128x128 graphic display. This commit enable mpi dbi display support with LVGL graphic library. Pin connection of display is 3wire mode SRAM size increased to be fit with lvgl example. Signed-off-by: Sadik Ozer <[email protected]>
1 parent 98f1959 commit 3f4a9c4

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# MAX32662EVKIT boards configuration
2+
3+
# Copyright (c) 2024 Analog Devices, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_MAX32662EVKIT
7+
8+
if DISPLAY
9+
10+
config MIPI_DBI_SPI_3WIRE
11+
default y
12+
13+
if LVGL
14+
15+
config LV_Z_BITS_PER_PIXEL
16+
default 16
17+
18+
choice LV_COLOR_DEPTH
19+
default LV_COLOR_DEPTH_16 # 16 bit per pixel
20+
endchoice
21+
22+
config LV_COLOR_16_SWAP
23+
default y
24+
25+
endif # LVGL
26+
27+
endif # DISPLAY
28+
29+
endif # BOARD_MAX32662EVKIT

boards/adi/max32662evkit/max32662evkit.dts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <zephyr/dt-bindings/gpio/adi-max32-gpio.h>
1212
#include <zephyr/dt-bindings/input/input-event-codes.h>
1313
#include <zephyr/dt-bindings/dma/max32662_dma.h>
14+
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
1415

1516
/ {
1617
model = "Analog Devices MAX32662EVKIT";
@@ -21,6 +22,7 @@
2122
zephyr,shell-uart = &uart0;
2223
zephyr,sram = &sram2;
2324
zephyr,flash = &flash0;
25+
zephyr,display = &st7735;
2426
};
2527

2628
leds {
@@ -47,6 +49,40 @@
4749
sw0 = &pb1;
4850
watchdog0 = &wdt0;
4951
};
52+
53+
mipi_dbi {
54+
compatible = "zephyr,mipi-dbi-spi";
55+
spi-dev = <&spi1>;
56+
#address-cells = <1>;
57+
#size-cells = <0>;
58+
59+
status = "okay";
60+
61+
st7735: st7735@0 {
62+
compatible = "sitronix,st7735r";
63+
mipi-max-frequency = <DT_FREQ_M(6)>;
64+
mipi-mode = <MIPI_DBI_MODE_SPI_3WIRE>;
65+
66+
reg = <0>;
67+
width = <130>;
68+
height = <132>;
69+
x-offset = <0>;
70+
y-offset = <0>;
71+
madctl = <0xc0>;
72+
colmod = <0x05>;
73+
vmctr1 = <0x51>;
74+
pwctr1 = [02 02];
75+
pwctr2 = [c5];
76+
pwctr3 = [0d 00];
77+
pwctr4 = [8d 1a];
78+
pwctr5 = [8d ee];
79+
frmctr1 = [02 35 36];
80+
frmctr2 = [02 35 36];
81+
frmctr3 = [02 35 36 02 35 36];
82+
gamctrp1 = [0a 1c 0c 14 33 2b 24 28 27 25 2c 39 00 05 03 0d];
83+
gamctrn1 = [0a 1c 0c 14 33 2b 24 28 27 25 2d 3a 00 05 03 0d];
84+
};
85+
};
5086
};
5187

5288
&uart0 {
@@ -89,3 +125,18 @@
89125
pinctrl-0 = <&spi0a_copi_p0_3 &spi0a_cito_p0_2 &spi0a_sck_p0_4 &spi0a_ts0_p0_5>;
90126
pinctrl-names = "default";
91127
};
128+
129+
&spi1a_mosi_p0_8 {
130+
power-source=<MAX32_VSEL_VDDIOH>;
131+
};
132+
133+
&spi1a_sck_p0_17 {
134+
power-source=<MAX32_VSEL_VDDIOH>;
135+
};
136+
137+
&spi1 {
138+
status = "okay";
139+
pinctrl-0 = <&spi1a_mosi_p0_8 &spi1a_sck_p0_17>;
140+
pinctrl-names = "default";
141+
cs-gpios = <&gpio0 18 (GPIO_ACTIVE_LOW | MAX32_VSEL_VDDIOH)>;
142+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2024, Analog Devices, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,sram = &sram0;
10+
};
11+
};
12+
13+
/*
14+
* Concatenate SRAM0(16KB), SRAM1(16KB) and SRAM2(16KB)
15+
* to lvgl example work
16+
*/
17+
&sram0 {
18+
reg = <0x20000000 DT_SIZE_K(48)>;
19+
};

0 commit comments

Comments
 (0)