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/// LPAR-04 §8 input-device adapters (Pointer, Keypad, Encoder, Button).
77pub mod input_device;
78#[cfg(feature = "linux_fbdev")]
79pub mod linux_evdev;
80#[cfg(feature = "linux_fbdev")]
81pub mod linux_fbdev;
82#[cfg(all(
83    feature = "audio",
84    feature = "stm32h747i_disco",
85    any(target_arch = "arm", target_os = "none")
86))]
87/// High-level microphone capture API (SAI4 PDM + BDMA + CIC filter).
88pub mod mic_capture;
89#[cfg(all(
90    feature = "stm32h747i_disco",
91    any(target_arch = "arm", target_os = "none")
92))]
93/// NT35510 MIPI-DSI panel driver for MB1166 Rev A-09.
94pub mod nt35510;
95#[cfg(all(
96    feature = "audio",
97    feature = "stm32h747i_disco",
98    any(target_arch = "arm", target_os = "none")
99))]
100/// CIC decimation filter for PDM-to-PCM conversion.
101pub mod pdm_filter;
102#[cfg(feature = "simulator")]
103pub mod pixels_renderer;
104/// LPAR-03 display presenter: resolves a [`PresentPlan`] into flush calls.
105pub mod present;
106#[cfg(all(
107    feature = "stm32h747i_disco",
108    any(target_arch = "arm", target_os = "none")
109))]
110/// QSPI flash driver for MT25TL01G (indirect + memory-mapped modes).
111pub mod qspi_flash;
112#[cfg(all(
113    feature = "audio",
114    feature = "stm32h747i_disco",
115    any(target_arch = "arm", target_os = "none")
116))]
117/// SAI1 serial audio interface driver for I2S playback/recording.
118#[allow(dead_code)]
119pub mod sai;
120#[cfg(all(
121    feature = "audio",
122    feature = "stm32h747i_disco",
123    any(target_arch = "arm", target_os = "none")
124))]
125/// SAI4 PDM interface driver for onboard MP34DT05-A MEMS digital microphone.
126pub mod sai4_pdm;
127/// Display geometry abstraction: logical dimensions + scan rotation.
128pub mod screen;
129#[cfg(all(
130    feature = "stm32h747i_disco",
131    feature = "sd_storage",
132    any(target_arch = "arm", target_os = "none")
133))]
134/// SD card adapter for `embedded-sdmmc` filesystem access.
135pub mod sd_emmc_adapter;
136#[cfg(all(
137    feature = "stm32h747i_disco",
138    feature = "fatfs_nostd",
139    any(target_arch = "arm", target_os = "none")
140))]
141/// No-std FATFS adapter to mount and list assets on SDMMC-backed block devices.
142pub mod sd_fatfs_adapter;
143/// AIF1ADC serializer arm-phase detector (AUDIO-01-d §3 / R3.3): host-testable
144/// classification of a captured SAI RX buffer to gate the re-arm calibration.
145pub mod serializer_arm;
146#[cfg(feature = "simulator")]
147pub mod simulator;
148#[cfg(feature = "ssd1306")]
149pub mod ssd1306;
150#[cfg(feature = "st7789")]
151pub mod st7789;
152#[cfg(all(
153    feature = "stm32h747i_disco",
154    any(target_arch = "arm", target_os = "none")
155))]
156pub mod stm32h747i_disco;
157#[cfg(all(
158    feature = "stm32h747i_disco",
159    any(target_arch = "arm", target_os = "none")
160))]
161pub mod stm32h747i_disco_sd;
162#[cfg(feature = "uefi")]
163pub mod uefi;
164#[cfg(feature = "uefi")]
165/// PlayitTransport implementation over UEFI Serial I/O protocol.
166pub mod uefi_serial_transport;
167#[cfg(all(
168    feature = "audio",
169    feature = "stm32h747i_disco",
170    any(target_arch = "arm", target_os = "none")
171))]
172/// WAV (RIFF) header parser for embedded audio playback.
173pub mod wav;
174#[cfg(feature = "simulator")]
175pub mod wgpu_blitter;
176#[cfg(all(
177    feature = "audio",
178    feature = "stm32h747i_disco",
179    any(target_arch = "arm", target_os = "none")
180))]
181/// WM8994 audio codec driver (I2C control, headphone/speaker output).
182#[allow(dead_code)]
183pub mod wm8994;
184
185#[cfg(feature = "simulator")]
186pub use app_loader::LoadedApp;
187#[cfg(all(
188    feature = "audio",
189    feature = "stm32h747i_disco",
190    any(target_arch = "arm", target_os = "none")
191))]
192pub use audio_player::AudioPlayer;
193pub use blit::{
194    BlitCaps, BlitPlanner, Blitter, BlitterRenderer, PixelFmt, Rect as BlitRect, Surface,
195};
196pub use cpu_blitter::CpuBlitter;
197pub use display::DisplayDriver;
198#[cfg(all(feature = "dma2d", any(target_arch = "arm", target_os = "none")))]
199pub use dma2d::Dma2dBlitter;
200pub use effect::{BlitterSink, CrawlParams, Effect, EffectExt, EffectSink, SubSink};
201#[cfg(all(
202    feature = "stm32h747i_disco",
203    any(target_arch = "arm", target_os = "none")
204))]
205pub use ft5336::Ft5336;
206pub use hwcore::addr::{AddrError, DmaAddr, MmioAddr, PhysAddr};
207pub use hwcore::isr::{IsrChannel, IsrCounter, IsrFlag};
208#[cfg(any(test, feature = "mock_blitter"))]
209pub use hwcore::mock::{MockBlitter, MockOp};
210pub use hwcore::surface::{
211    BackBuffer, BankCollision, BorrowedForDma, FrameBuffer, FrontBuffer, InFlight, Scanout,
212};
213pub use input::{InputDevice, InputEvent};
214#[cfg(feature = "linux_fbdev")]
215pub use linux_evdev::LinuxEvdevInput;
216#[cfg(feature = "linux_fbdev")]
217pub use linux_fbdev::LinuxFbdevDisplay;
218#[cfg(feature = "simulator")]
219pub use pixels_renderer::PixelsRenderer;
220#[cfg(all(
221    feature = "stm32h747i_disco",
222    any(target_arch = "arm", target_os = "none")
223))]
224pub use qspi_flash::{Mt25tlFlash, QspiMemoryMapped};
225pub use rlvgl_core::event::Key;
226#[cfg(all(
227    feature = "audio",
228    feature = "stm32h747i_disco",
229    any(target_arch = "arm", target_os = "none")
230))]
231pub use sai::Sai1Audio;
232pub use screen::{ColorFormat, Rotation, Screen};
233#[cfg(all(
234    feature = "stm32h747i_disco",
235    feature = "sd_storage",
236    any(target_arch = "arm", target_os = "none")
237))]
238pub use sd_emmc_adapter::{DummyTimeSource, SdMmcBlockDev};
239#[cfg(all(
240    feature = "stm32h747i_disco",
241    feature = "fatfs_nostd",
242    any(target_arch = "arm", target_os = "none")
243))]
244pub use sd_fatfs_adapter::{FatfsBlockStream, mount_and_list_assets};
245#[cfg(feature = "simulator")]
246pub use simulator::WgpuDisplay;
247#[cfg(feature = "ssd1306")]
248pub use ssd1306::Ssd1306Display;
249#[cfg(feature = "st7789")]
250pub use st7789::St7789Display;
251#[cfg(all(
252    feature = "stm32h747i_disco",
253    any(target_arch = "arm", target_os = "none")
254))]
255pub use stm32h747i_disco::{Stm32h747iDiscoDisplay, Stm32h747iDiscoInput};
256#[cfg(all(
257    feature = "stm32h747i_disco",
258    any(target_arch = "arm", target_os = "none")
259))]
260pub use stm32h747i_disco_sd::DiscoSdBlockDevice;
261#[cfg(feature = "uefi")]
262pub use uefi::{SyntheticKeyRelease, UefiDisplay, UefiInput};
263#[cfg(feature = "uefi")]
264pub use uefi_serial_transport::UefiSerialTransport;
265#[cfg(all(
266    feature = "audio",
267    feature = "stm32h747i_disco",
268    any(target_arch = "arm", target_os = "none")
269))]
270pub use wav::parse_wav_header;
271#[cfg(feature = "simulator")]
272pub use wgpu_blitter::WgpuBlitter;
273#[cfg(all(
274    feature = "audio",
275    feature = "stm32h747i_disco",
276    any(target_arch = "arm", target_os = "none")
277))]
278pub use wm8994::Wm8994;