Skip to main content

rlvgl_platform/
lib.rs

1//! Hardware and simulator backends for `rlvgl`.
2#![no_std]
3#![deny(missing_docs)]
4
5extern crate alloc;
6
7#[cfg(any(feature = "simulator", feature = "fatfs", feature = "linux_fbdev"))]
8extern crate std;
9
10#[cfg(feature = "simulator")]
11pub mod app_loader;
12#[cfg(all(
13    feature = "audio",
14    feature = "stm32h747i_disco",
15    any(target_arch = "arm", target_os = "none")
16))]
17/// Audio player state machine with DMA double-buffering.
18pub mod audio_player;
19#[cfg(all(
20    feature = "audio",
21    feature = "stm32h747i_disco",
22    any(target_arch = "arm", target_os = "none")
23))]
24/// BDMA driver for SAI4 PDM capture (D3 domain, SRAM4 buffers).
25pub mod bdma;
26/// Blitter traits and helpers.
27pub mod blit;
28/// Dirty-region compositor for framebuffer restoration.
29pub mod compositor;
30/// CPU fallback blitter.
31pub mod cpu_blitter;
32/// Display driver traits and implementations.
33pub mod display;
34#[cfg(all(
35    feature = "stm32h747i_disco",
36    any(target_arch = "arm", target_os = "none")
37))]
38/// Full DSI + LTDC init sequence (raw register, no PAC dependency).
39pub mod display_init;
40#[cfg(all(feature = "dma2d", any(target_arch = "arm", target_os = "none")))]
41pub mod dma2d;
42#[cfg(all(feature = "dma2d", any(target_arch = "arm", target_os = "none")))]
43/// DMA2D-accelerated drawing with rotation for overlay rendering.
44pub mod dma2d_draw;
45#[cfg(all(
46    feature = "audio",
47    feature = "stm32h747i_disco",
48    any(target_arch = "arm", target_os = "none")
49))]
50/// DMA1 driver for SAI1 sub-block A transmit streaming.
51pub mod dma_sai;
52#[cfg(all(
53    feature = "stm32h747i_disco",
54    any(target_arch = "arm", target_os = "none")
55))]
56/// Shared DSI adapted command mode register configuration.
57pub mod dsi_cmd_mode;
58/// Platform-level visual effect primitives ([`Effect`] trait,
59/// [`CrawlParams`] struct).
60pub mod effect;
61/// Frame synchronization traits for ERIF-based scheduling.
62pub mod frame_sync;
63#[cfg(all(
64    feature = "stm32h747i_disco",
65    any(target_arch = "arm", target_os = "none")
66))]
67pub mod ft5336;
68/// Gesture recognition (debounced tap, press-down/release).
69pub mod gesture;
70/// Hardware-abstraction substrate (address newtypes, framebuffer ownership,
71/// ISR channels, typed register blocks). See the "Register-Mashing
72/// Discipline" section of `CLAUDE.md`.
73pub mod hwcore;
74/// Input device abstractions.
75pub mod input;
76#[cfg(feature = "linux_fbdev")]
77pub mod linux_evdev;
78#[cfg(feature = "linux_fbdev")]
79pub mod linux_fbdev;
80#[cfg(all(
81    feature = "audio",
82    feature = "stm32h747i_disco",
83    any(target_arch = "arm", target_os = "none")
84))]
85/// High-level microphone capture API (SAI4 PDM + BDMA + CIC filter).
86pub mod mic_capture;
87#[cfg(all(
88    feature = "stm32h747i_disco",
89    any(target_arch = "arm", target_os = "none")
90))]
91/// NT35510 MIPI-DSI panel driver for MB1166 Rev A-09.
92pub mod nt35510;
93#[cfg(all(
94    feature = "audio",
95    feature = "stm32h747i_disco",
96    any(target_arch = "arm", target_os = "none")
97))]
98/// CIC decimation filter for PDM-to-PCM conversion.
99pub mod pdm_filter;
100#[cfg(feature = "simulator")]
101pub mod pixels_renderer;
102#[cfg(all(
103    feature = "stm32h747i_disco",
104    any(target_arch = "arm", target_os = "none")
105))]
106/// QSPI flash driver for MT25TL01G (indirect + memory-mapped modes).
107pub mod qspi_flash;
108#[cfg(all(
109    feature = "audio",
110    feature = "stm32h747i_disco",
111    any(target_arch = "arm", target_os = "none")
112))]
113/// SAI1 serial audio interface driver for I2S playback/recording.
114#[allow(dead_code)]
115pub mod sai;
116#[cfg(all(
117    feature = "audio",
118    feature = "stm32h747i_disco",
119    any(target_arch = "arm", target_os = "none")
120))]
121/// SAI4 PDM interface driver for onboard MP34DT05-A MEMS digital microphone.
122pub mod sai4_pdm;
123/// Display geometry abstraction: logical dimensions + scan rotation.
124pub mod screen;
125#[cfg(all(
126    feature = "stm32h747i_disco",
127    feature = "sd_storage",
128    any(target_arch = "arm", target_os = "none")
129))]
130/// SD card adapter for `embedded-sdmmc` filesystem access.
131pub mod sd_emmc_adapter;
132#[cfg(all(
133    feature = "stm32h747i_disco",
134    feature = "fatfs_nostd",
135    any(target_arch = "arm", target_os = "none")
136))]
137/// No-std FATFS adapter to mount and list assets on SDMMC-backed block devices.
138pub mod sd_fatfs_adapter;
139#[cfg(feature = "simulator")]
140pub mod simulator;
141#[cfg(feature = "ssd1306")]
142pub mod ssd1306;
143#[cfg(feature = "st7789")]
144pub mod st7789;
145#[cfg(all(
146    feature = "stm32h747i_disco",
147    any(target_arch = "arm", target_os = "none")
148))]
149pub mod stm32h747i_disco;
150#[cfg(all(
151    feature = "stm32h747i_disco",
152    any(target_arch = "arm", target_os = "none")
153))]
154pub mod stm32h747i_disco_sd;
155#[cfg(feature = "uefi")]
156pub mod uefi;
157#[cfg(feature = "uefi")]
158/// PlayitTransport implementation over UEFI Serial I/O protocol.
159pub mod uefi_serial_transport;
160#[cfg(all(
161    feature = "audio",
162    feature = "stm32h747i_disco",
163    any(target_arch = "arm", target_os = "none")
164))]
165/// WAV (RIFF) header parser for embedded audio playback.
166pub mod wav;
167#[cfg(feature = "simulator")]
168pub mod wgpu_blitter;
169#[cfg(all(
170    feature = "audio",
171    feature = "stm32h747i_disco",
172    any(target_arch = "arm", target_os = "none")
173))]
174/// WM8994 audio codec driver (I2C control, headphone/speaker output).
175#[allow(dead_code)]
176pub mod wm8994;
177
178#[cfg(feature = "simulator")]
179pub use app_loader::LoadedApp;
180#[cfg(all(
181    feature = "audio",
182    feature = "stm32h747i_disco",
183    any(target_arch = "arm", target_os = "none")
184))]
185pub use audio_player::AudioPlayer;
186pub use blit::{
187    BlitCaps, BlitPlanner, Blitter, BlitterRenderer, PixelFmt, Rect as BlitRect, Surface,
188};
189pub use cpu_blitter::CpuBlitter;
190pub use display::DisplayDriver;
191#[cfg(all(feature = "dma2d", any(target_arch = "arm", target_os = "none")))]
192pub use dma2d::Dma2dBlitter;
193pub use effect::{BlitterSink, CrawlParams, Effect, EffectExt, EffectSink, SubSink};
194#[cfg(all(
195    feature = "stm32h747i_disco",
196    any(target_arch = "arm", target_os = "none")
197))]
198pub use ft5336::Ft5336;
199pub use hwcore::addr::{AddrError, DmaAddr, MmioAddr, PhysAddr};
200pub use hwcore::isr::{IsrChannel, IsrCounter, IsrFlag};
201#[cfg(any(test, feature = "mock_blitter"))]
202pub use hwcore::mock::{MockBlitter, MockOp};
203pub use hwcore::surface::{
204    BackBuffer, BankCollision, BorrowedForDma, FrameBuffer, FrontBuffer, InFlight, Scanout,
205};
206pub use input::{InputDevice, InputEvent};
207#[cfg(feature = "linux_fbdev")]
208pub use linux_evdev::LinuxEvdevInput;
209#[cfg(feature = "linux_fbdev")]
210pub use linux_fbdev::LinuxFbdevDisplay;
211#[cfg(feature = "simulator")]
212pub use pixels_renderer::PixelsRenderer;
213#[cfg(all(
214    feature = "stm32h747i_disco",
215    any(target_arch = "arm", target_os = "none")
216))]
217pub use qspi_flash::{Mt25tlFlash, QspiMemoryMapped};
218pub use rlvgl_core::event::Key;
219#[cfg(all(
220    feature = "audio",
221    feature = "stm32h747i_disco",
222    any(target_arch = "arm", target_os = "none")
223))]
224pub use sai::Sai1Audio;
225pub use screen::{ColorFormat, Rotation, Screen};
226#[cfg(all(
227    feature = "stm32h747i_disco",
228    feature = "sd_storage",
229    any(target_arch = "arm", target_os = "none")
230))]
231pub use sd_emmc_adapter::{DummyTimeSource, SdMmcBlockDev};
232#[cfg(all(
233    feature = "stm32h747i_disco",
234    feature = "fatfs_nostd",
235    any(target_arch = "arm", target_os = "none")
236))]
237pub use sd_fatfs_adapter::{FatfsBlockStream, mount_and_list_assets};
238#[cfg(feature = "simulator")]
239pub use simulator::WgpuDisplay;
240#[cfg(feature = "ssd1306")]
241pub use ssd1306::Ssd1306Display;
242#[cfg(feature = "st7789")]
243pub use st7789::St7789Display;
244#[cfg(all(
245    feature = "stm32h747i_disco",
246    any(target_arch = "arm", target_os = "none")
247))]
248pub use stm32h747i_disco::{Stm32h747iDiscoDisplay, Stm32h747iDiscoInput};
249#[cfg(all(
250    feature = "stm32h747i_disco",
251    any(target_arch = "arm", target_os = "none")
252))]
253pub use stm32h747i_disco_sd::DiscoSdBlockDevice;
254#[cfg(feature = "uefi")]
255pub use uefi::{SyntheticKeyRelease, UefiDisplay, UefiInput};
256#[cfg(feature = "uefi")]
257pub use uefi_serial_transport::UefiSerialTransport;
258#[cfg(all(
259    feature = "audio",
260    feature = "stm32h747i_disco",
261    any(target_arch = "arm", target_os = "none")
262))]
263pub use wav::parse_wav_header;
264#[cfg(feature = "simulator")]
265pub use wgpu_blitter::WgpuBlitter;
266#[cfg(all(
267    feature = "audio",
268    feature = "stm32h747i_disco",
269    any(target_arch = "arm", target_os = "none")
270))]
271pub use wm8994::Wm8994;