stm32cubeprogrammer_sys/
lib.rs

1//! This crate provides low level bindings to the STM32CubeProgrammer API.
2//! The bindings are generated using bindgen and use the [`libloading`](https://crates.io/crates/libloading) crate to support dynamic loading of the CubeProgrammer API.
3
4#![allow(
5    non_snake_case,
6    non_camel_case_types,
7    non_upper_case_globals,
8    unused,
9    clippy::all
10)]
11
12#[cfg(windows)]
13include!("bindings_windows.rs");
14
15#[cfg(unix)]
16include!("bindings_linux.rs");
17
18// Re-export libloading so that the user doesn't have to depend on it
19pub use libloading;
20
21/// Standard base address of STM32 flash memory
22pub const FLASH_BASE_ADDRESS: u32 = 0x08000000;
23
24/// Standard base address of STM32 RAM
25pub const SRAM_BASE_ADDRESS: u32 = 0x20000000;
26
27/// Base address of SRAM2A stm32wb5x (shared RAM containing FUS info)
28pub const SRAM2A_BASE_ADDRESS_STM32WB5X: u32 = 0x20030000;
29
30/// Base address of SRAM2A stm32wb1x (shared RAM containing FUS info)
31pub const SRAM2A_BASE_ADDRESS_STM32WB1X: u32 = 0x20003000;
32
33#[cfg(windows)]
34pub const PATH_API_LIBRARY_RELATIVE: &str = "api/lib/CubeProgrammer_API.dll";
35
36#[cfg(unix)]
37pub const PATH_API_LIBRARY_RELATIVE: &str = "lib/libCubeProgrammer_API.so";
38
39#[cfg(windows)]
40pub const PATH_LOADER_DIR_RELATIVE: &str = "bin";
41
42#[cfg(unix)]
43pub const PATH_LOADER_DIR_RELATIVE: &str = "bin";