Skip to content

Commit d48bdb8

Browse files
dariiscarlescufi
authored andcommitted
boards: shield: introduce st_b_lcd40_dsi1_mb1166
Add support for STMicroelectronics B-LCD40-DSI1 board supporting MIPI DSI display. Signed-off-by: Rico Ganahl <rico.ganahl@bytesatwork.ch>
1 parent 4695e14 commit d48bdb8

File tree

8 files changed

+228
-0
lines changed

8 files changed

+228
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2023 bytes at work AG
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SHIELD_ST_B_LCD40_DSI1_MB1166
5+
6+
config DISPLAY
7+
default y
8+
9+
config GPIO
10+
default y
11+
12+
endif # SHIELD_ST_B_LCD40_DSI1_MB1166
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2023 bytes at work AG
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ST_B_LCD40_DSI1_MB1166
5+
def_bool $(shields_list_contains,st_b_lcd40_dsi1_mb1166)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2023 bytes at work AG
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_MEMC=y
5+
CONFIG_STM32_LTDC_RGB888=y
6+
CONFIG_HEAP_MEM_POOL_SIZE=65536
7+
# Initialize after LTDC
8+
CONFIG_DISPLAY_OTM8009A_INIT_PRIORITY=86
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (c) 2023 bytes at work AG
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,display = &ltdc;
10+
};
11+
};
12+
13+
&ltdc {
14+
status = "okay";
15+
ext-sdram = <&sdram2>;
16+
17+
/* orisetech, otm8009a */
18+
width = <800>;
19+
height = <480>;
20+
hsync-pol = <STM32_LTDC_HSPOL_ACTIVE_LOW>;
21+
vsync-pol = <STM32_LTDC_VSPOL_ACTIVE_LOW>;
22+
de-pol = <STM32_LTDC_DEPOL_ACTIVE_LOW>;
23+
pclk-pol = <STM32_LTDC_PCPOL_ACTIVE_LOW>;
24+
hsync-duration = <2>;
25+
vsync-duration = <1>;
26+
hbp-duration = <34>;
27+
vbp-duration = <15>;
28+
hfp-duration = <34>;
29+
vfp-duration = <16>;
30+
31+
def-back-color-red = <0>;
32+
def-back-color-green = <0>;
33+
def-back-color-blue = <0>;
34+
};
35+
36+
/* ltdc uses pll3_r as pixel clock */
37+
&pll3 {
38+
status = "okay";
39+
clocks = <&clk_hse>;
40+
div-m = <5>;
41+
mul-n = <132>;
42+
div-p = <2>;
43+
div-q = <2>;
44+
div-r = <24>; /* 27.5 MHz */
45+
};
46+
47+
&mipi_dsi {
48+
status = "okay";
49+
50+
/* DSI HOST dedicated PLL
51+
* F_VCO = CLK_IN / pll-idf * 2 * pll-ndiv
52+
* PHI = F_VCO / 2 / (1 << pll-odf) = lane_byte_clk
53+
* = 25 MHz / 5 * 2 * 100 / 2 / (1<<0) / 8 = 62.5 MHz
54+
*/
55+
pll-ndiv = <100>;
56+
pll-idf = <5>;
57+
pll-odf = <0>;
58+
59+
vs-active-high;
60+
hs-active-high;
61+
de-active-high;
62+
};
63+
64+
&otm8009a {
65+
data-lanes = <2>;
66+
pixel-format = <MIPI_DSI_PIXFMT_RGB888>;
67+
rotation = <90>;
68+
};
12.1 KB
Loading
7.44 KB
Loading
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.. _st_b_lcd40_dsi1_mb1166_shield:
2+
3+
ST B-LCD40-DSI1
4+
###############
5+
6+
Overview
7+
********
8+
9+
The B-LCD40-DSI1 shield provides a 4-inch WVGA TFT LCD with MIPI DSI interface
10+
and capacitive touch screen.
11+
12+
13+
.. figure:: image.jpg
14+
:alt: B-LCD40-DSI1 MB1166 Image
15+
:align: center
16+
17+
B-LCD40-DSI1 MB1166 Image
18+
19+
.. figure:: connectors.jpg
20+
:alt: B-LCD40-DSI1 MB1166 Connector
21+
:align: center
22+
23+
B-LCD40-DSI1 MB1166 Connector
24+
25+
+------+--------------+------------+-------+--------------+-----------------+
26+
| CN1 | Description | Interface | CN1 | Description | Interface |
27+
| odd | | | even | | |
28+
+======+==============+============+=======+==============+=================+
29+
| 1 | GND | - | 2 | - | - |
30+
+------+--------------+------------+-------+--------------+-----------------+
31+
| 3 | DSI_CK_P | DSI | 4 | TOUCH_INT | Interrupt out |
32+
+------+--------------+------------+-------+--------------+-----------------+
33+
| 5 | DSI_CK_N | DSI | 6 | - | - |
34+
+------+--------------+------------+-------+--------------+-----------------+
35+
| 7 | GND | - | 8 | - | - |
36+
+------+--------------+------------+-------+--------------+-----------------+
37+
| 9 | DSI_D0_P | DSI | 10 | - | - |
38+
+------+--------------+------------+-------+--------------+-----------------+
39+
| 11 | DSI_D0_N | DSI | 12 | - | - |
40+
+------+--------------+------------+-------+--------------+-----------------+
41+
| 13 | GND | - | 14 | - | - |
42+
+------+--------------+------------+-------+--------------+-----------------+
43+
| 15 | DSI_D1_P | DSI | 16 | - | - |
44+
+------+--------------+------------+-------+--------------+-----------------+
45+
| 17 | DSI_D1_N | DSI | 18 | - | - |
46+
+------+--------------+------------+-------+--------------+-----------------+
47+
| 19 | GND | - | 20 | - | - |
48+
+------+--------------+------------+-------+--------------+-----------------+
49+
| 21 | BLVDD(+5V) | - | 22 | - | - |
50+
+------+--------------+------------+-------+--------------+-----------------+
51+
| 23 | BLVDD(+5V) | - | 24 | - | - |
52+
+------+--------------+------------+-------+--------------+-----------------+
53+
| 25 | - | - | 26 | - | - |
54+
+------+--------------+------------+-------+--------------+-----------------+
55+
| 27 | BLGND | - | 28 | - | - |
56+
+------+--------------+------------+-------+--------------+-----------------+
57+
| 29 | BLGND | - | 30 | - | - |
58+
+------+--------------+------------+-------+--------------+-----------------+
59+
| 31 | - | - | 32 | - | - |
60+
+------+--------------+------------+-------+--------------+-----------------+
61+
| 33 | - | - | 34 | - | - |
62+
+------+--------------+------------+-------+--------------+-----------------+
63+
| 35 | - | - | 36 | VDD | - |
64+
| | | | | (2.8V-3.3V) | |
65+
+------+--------------+------------+-------+--------------+-----------------+
66+
| 37 | - | - | 38 | - | - |
67+
+------+--------------+------------+-------+--------------+-----------------+
68+
| 39 | - | - | 40 | I2C_SDA | I2C |
69+
+------+--------------+------------+-------+--------------+-----------------+
70+
| 41 | - | - | 42 | - | - |
71+
+------+--------------+------------+-------+--------------+-----------------+
72+
| 43 | - | - | 44 | I2C_SCL | I2C |
73+
+------+--------------+------------+-------+--------------+-----------------+
74+
| 45 | - | - | 46 | - | - |
75+
+------+--------------+------------+-------+--------------+-----------------+
76+
| 47 | - | - | 48 | - | - |
77+
+------+--------------+------------+-------+--------------+-----------------+
78+
| 49 | DSI_TE | DSI | 50 | - | - |
79+
+------+--------------+------------+-------+--------------+-----------------+
80+
| 51 | - | - | 52 | - | - |
81+
+------+--------------+------------+-------+--------------+-----------------+
82+
| 53 | BL_CTRL | GPIO | 54 | - | - |
83+
+------+--------------+------------+-------+--------------+-----------------+
84+
| 55 | - | - | 56 | - | - |
85+
+------+--------------+------------+-------+--------------+-----------------+
86+
| 57 | RESET | GPIO | 58 | - | - |
87+
+------+--------------+------------+-------+--------------+-----------------+
88+
| 59 | - | - | 60 | - | - |
89+
+------+--------------+------------+-------+--------------+-----------------+
90+
91+
92+
Requirements
93+
************
94+
95+
Your board needs to have a ``mipi_dsi`` device tree label to work with this shield.
96+
97+
Usage
98+
*****
99+
100+
The shield can be used in any application by setting ``SHIELD`` to
101+
``st_b_lcd40_dsi1_mb1166`` and adding the necessary device tree properties.
102+
103+
Set ``-DSHIELD="st_b_lcd40_dsi1_mb1166"`` when you invoke ``west build``. For example:
104+
105+
.. zephyr-app-commands::
106+
:zephyr-app: samples/drivers/display
107+
:board: stm32h747i_disco_m7
108+
:shield: st_b_lcd40_dsi1_mb1166
109+
:goals: build
110+
111+
References
112+
**********
113+
114+
- `Product page <https://www.st.com/en/evaluation-tools/b-lcd40-dsi1.html>`_
115+
116+
- `Databrief <https://www.st.com/resource/en/data_brief/b-lcd40-dsi1.pdf>`_
117+
118+
- `User manual <https://www.st.com/resource/en/user_manual/um2104--4inch-wvga-tft-lcd-board-with-mipi-dsi-interface-and-capacitive-touch-screen-stmicroelectronics.pdf>`_
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2023 bytes at work AG
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&mipi_dsi {
8+
otm8009a: otm8009a@0 {
9+
status = "okay";
10+
compatible = "orisetech,otm8009a";
11+
reg = <0x0>;
12+
height = <800>;
13+
width = <480>;
14+
reset-gpios = <&dsi_lcd_qsh_030 57 GPIO_ACTIVE_HIGH>;
15+
bl-gpios = <&dsi_lcd_qsh_030 53 GPIO_ACTIVE_HIGH>;
16+
};
17+
};

0 commit comments

Comments
 (0)