-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Flexible static memory controller (FSMC) | ||
|
||
This component of STM32F40x/41x processors allows for the management | ||
of static memory, flash memory, and PC Cards. Unlike the FMC in more | ||
advanced MCU models, dynamic memory is not supported. Each type of | ||
memory has its address bank. The controller offers flexible settings | ||
for various operating modes. For instance, extended modes can have | ||
different delays set for read and write operations. It is recommended | ||
to refer to the STM32 Reference Manual (RM0090) for a detailed description | ||
of possible modes and corresponding settings. | ||
|
||
* [Datasheet](https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf) - STM32 Reference Manual (RM0090), FSMC chapter. | ||
|
||
* [Configuration example](../../../../../boards/stm32_f4ve/src/display_ili9341.adb) - display_ili9341.adb: | ||
|
||
## Example | ||
|
||
Configuring Bank_1 for ILI9341 LCD controller: | ||
|
||
* half word (16 bit access) | ||
* with write enabled | ||
* distinct read and write timings | ||
|
||
```ada | ||
STM32.FSMC.Configure | ||
(Bank_1 => | ||
(1 => -- TFT is connected to sub-bank 1 | ||
(Is_Set => True, | ||
Value => | ||
(Write_Enable => True, | ||
Bus_Width => STM32.FSMC.Half_Word, | ||
Memory_Type => STM32.FSMC.SRAM, | ||
Bus_Turn => 15, -- 90ns | ||
Data_Setup => 57, -- 342ns | ||
Address_Setup => 0, | ||
Extended => | ||
(STM32.FSMC.Mode_A, | ||
Write_Bus_Turn => 3, -- 18ns | ||
Write_Data_Setup => 2, -- 12ns | ||
Write_Address_Setup => 0), | ||
others => <>)), | ||
others => <>)); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# ILI9341 | ||
|
||
TFT LCD Single Chip Driver 240RGBx320 Resolution and 262K color. | ||
It has parallel and serial interfaces for MCU. It's also able to | ||
receive data over RGB interface. | ||
|
||
The STM32F429 Discovery board utilizes an RGB interface and stores | ||
graphic data in the main memory. The STM32 F4VE board uses a parallel | ||
interface and employs ILI9341 memory, which significantly slows down | ||
drawing but conserves main memory. When using the parallel interface, | ||
ILI9341 registers are mapped to the MCU's address space through the | ||
memory controller (FSMC), simplifying and speeding up the drawing. | ||
|
||
* [Datasheet](http://www.datasheet-pdf.info/attach/1/3707537954.pdf) | ||
* [Example for RGB interface](../../../../examples/STM32F429_Discovery/draw_stm32f429disco.gpr) for STM32F429 Discovery | ||
* [Example for parallel interface](../../../../examples/stm32_f4ve/lcd) for STM32 F4VE board |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# XPT2046 | ||
|
||
The XPT2046 is a 4-wire resistive touch screen controller that incorporates | ||
a 12-bit 125 kHz sampling SAR type A/D converter. Many cheap LCD displays | ||
contain this controller. Typically, it is connected via SPI. | ||
|
||
To align the touch point with the display coordinates, it might be | ||
necessary to calibrate the touch screen. The XPT2046 sensor provides | ||
raw values within the range of 0 to 4095. If you identify the raw | ||
values associated with the screen edges, you can perform touch | ||
panel calibration by invoking the Calibrate procedure. | ||
|
||
```ada | ||
subtype Sensor_Value is HAL.UInt16 range 0 .. 2 ** 12 - 1; | ||
procedure Calibrate | ||
(This : in out XPT2046_Device'Class; | ||
Min_X : Sensor_Value; | ||
Max_X : Sensor_Value; | ||
Min_Y : Sensor_Value; | ||
Max_Y : Sensor_Value); | ||
``` | ||
|
||
* [Datasheet](https://www.datasheet-pdf.info/attach/1/3898350023.pdf) | ||
* [Example for STM32 F4VE board](../../../../examples/stm32_f4ve/lcd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Draw on the screen | ||
|
||
This example is a modified version of the draw example for | ||
STM32F429 Discovery. Unlike the original, it does not use | ||
the Framebuffer interface. Touch the screen to draw. The | ||
thickness of points and lines during drawing depends on | ||
the pressure applied and what you touch on the screen. | ||
|
||
Press the K-UP button for a demo of drawing primitives. | ||
|
||
For this demo, you need an LCD with a touch panel, which | ||
is usually sold as part of the STM32 F4VE board kit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# LCD demo | ||
|
||
This example demonstrates working with the LCD using the | ||
HAL.Bitmap.Bitmap_Buffer interface. | ||
Colorful rectangles are displayed on the screen, and their | ||
colors change based on the X and Y coordinates. | ||
|
||
For this demo, you need an LCD, which is usually sold as | ||
part of the STM32 F4VE board kit. |