Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port ltdc from f7xx-hal #731

Merged
merged 1 commit into from
Jun 10, 2024
Merged

port ltdc from f7xx-hal #731

merged 1 commit into from
Jun 10, 2024

Conversation

burrbull
Copy link
Member

@burrbull burrbull commented Jan 15, 2024

Closes #256

cc @jonasdn @ierturk

@burrbull burrbull marked this pull request as ready for review January 15, 2024 09:12
Copy link
Contributor

@ierturk ierturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @burrbull,
Thanks for the work. I don't have a stm32f469i-discovery board to check it. May be @jonasdn check it.

@Amperstrand
Copy link

Amperstrand commented Apr 5, 2024

examples/ltdc-screen/main.rs comes with a pin configuration for the STM32F746 DISCO (pinout on page 28):

let ltdc_r0 = gpioi.pi15; // LTDC_R0
let ltdc_r1 = gpioj.pj0;  // LTDC_R1
let ltdc_r2 = gpioj.pj1;  // LTDC_R2
let ltdc_r3 = gpioj.pj2;  // LTDC_R3
let ltdc_r4 = gpioj.pj3;  // LTDC_R4
let ltdc_r5 = gpioj.pj4;  // LTDC_R5
let ltdc_r6 = gpioj.pj5;  // LTDC_R6
let ltdc_r7 = gpioj.pj6;  // LTDC_R7

let ltdc_g0 = gpioj.pj7;  // LTDC_G0
let ltdc_g1 = gpioj.pj8;  // LTDC_G1
let ltdc_g2 = gpioj.pj9;  // LTDC_G2
let ltdc_g3 = gpioj.pj10; // LTDC_G3
let ltdc_g4 = gpioj.pj11; // LTDC_G4
let ltdc_g5 = gpiok.pk0;  // LTDC_G5
let ltdc_g6 = gpiok.pk1;  // LTDC_G6
let ltdc_g7 = gpiok.pk2;  // LTDC_G7

let ltdc_b0 = gpioe.pe4;  // LTDC_B0
let ltdc_b1 = gpioj.pj13; // LTDC_B1
let ltdc_b2 = gpioj.pj14; // LTDC_B2
let ltdc_b3 = gpioj.pj15; // LTDC_B3
let ltdc_b4 = gpiog.pg12; // LTDC_B4
let ltdc_b5 = gpiok.pk4;  // LTDC_B5
let ltdc_b6 = gpiok.pk5;  // LTDC_B6
let ltdc_b7 = gpiok.pk6;  // LTDC_B7

let ltdc_hsync = gpioi.pi10; // LTDC_HSYNC
let ltdc_vsync = gpioi.pi9;  // LTDC_VSYNC
let ltdc_de = gpiok.pk7;     // LTDC_DE
let ltdc_clk = gpioi.pi14;   // LTDC_CLK

// Use the named pins in the LtdcPins::new constructor
let pins = LtdcPins::new(
    RedPins::new(ltdc_r0, ltdc_r1, ltdc_r2, ltdc_r3, ltdc_r4, ltdc_r5, ltdc_r6, ltdc_r7),
    GreenPins::new(ltdc_g0, ltdc_g1, ltdc_g2, ltdc_g3, ltdc_g4, ltdc_g5, ltdc_g6, ltdc_g7),
    BluePins::new(ltdc_b0, ltdc_b1, ltdc_b2, ltdc_b3, ltdc_b4, ltdc_b5, ltdc_b6, ltdc_b7),
    ltdc_hsync,
    ltdc_vsync,
    ltdc_de,
    ltdc_clk,
);

I am trying to get the example running on the stm32f469 disco, but it needs to use the DSI. From the docs:

4.14 DSI LCD
The LCD module is a 4-inch 800x480 TFT color LCD with capacitive touch panel. The LCD
is connected to the MIPI DSI® interface of the microcontroller STM32F469NIH6 via the
connector CN10. The DSI (Display Serial Interface) is a specification of the MIPI Alliance
standard and defines the physical interface and the protocol used by the STM32F469NIH6
microcontroller to communicate with such LCD module.
The following ports of the microcontroller STM32F469NIH6 are dedicated to the DSI
interface: DSI_D0_N, DSI_D0_P, DSI_CK_N, DSI_CK_P, DSI_D1_N, DSI_D1_P.
In addition to the DSI dedicated ports, the port PH7 of the microcontroller is used to reset
both the DSI LCD module and the capacitive touchscreen controller.
The port PJ2, connected to the LCD signal TE (Tearing Effect) is an input of the
microcontroller to synchronize the write access from the microcontroller with the LCD scan
refresh, to avoid visible artefacts on the display.
LEDK and LEDA signals of the LCD module are the cathode and anode of the backlight
LEDs.
This backlight requires a power supply voltage of typically 25 V generated from the +5 V by
a switching mode boost converter.
By controlling the EN pin of the converter by a low-frequency PWM signal, it is possible to
switch on/off or to dim the backlight intensity of the LCD module. The control of EN can be
done by software or by hardware:
• By default, the EN pin of the converter is controlled by the microcontroller software
through DSI commands and CABC signal generated by the LCD module. For such
default configuration the resistor R117 is soldered, R119 is not soldered.
• The 32F469IDISCOVERY Discovery board offers the option to control the EN pin by
HW through port PA3. In such case, R117 must be removed and R119 soldered.

Table 7. DSI LCD module connector (CN10)
CN10
pin
Signal
name
Description MCU pins
involved
1 ID Not connect -
2 GND Ground -
3 CABC Content Adaptive Brightness Control -
4 GND Ground -
5 RESX Reset, active low PH7
6 IOVCC Digital supply voltage +3V3
7 GND Ground -
8 HSSI_D0_N MIPI-DSI data lane 0 negative-end I/O DSI_D0_N
9 NC Not connect -
10 HSSI_D0_P MIPI-DSI data lane 0 positive-end I/O DSI_D0_P
11 GND Ground -
12 HSSI_CLK_N MIPI-DSI clock lane negative-end input DSI_CK_N
13 NC Not connect -4.14 DSI LCD

Leaving this here for anyone the next person trying to get this to work

Amperstrand pushed a commit to Amperstrand/stm32f4xx-hal that referenced this pull request Apr 5, 2024
@burrbull burrbull force-pushed the ltdc branch 4 times, most recently from 25f8bca to a77ce77 Compare June 10, 2024 02:24
Copy link
Member

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@therealprof therealprof added this pull request to the merge queue Jun 10, 2024
Merged via the queue into master with commit bcd601e Jun 10, 2024
22 checks passed
@burrbull burrbull deleted the ltdc branch June 12, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ltdc in a similar way as stm32f7xx-hal
4 participants