rlvgl_chips_nrf/lib.rs
1#![no_std]
2#![deny(missing_docs)]
3
4//! Board database for Nordic Semiconductor devices.
5//!
6//! This crate embeds board and chip configuration data extracted from
7//! upstream sources. It currently provides placeholder APIs.
8
9/// Information about a supported board.
10pub struct BoardInfo {
11 /// Board's human-friendly name.
12 pub board: &'static str,
13 /// Associated microcontroller name.
14 pub chip: &'static str,
15}
16
17/// Static list of known boards for this vendor.
18const BOARDS: &[BoardInfo] = &[BoardInfo {
19 board: "nRF52840-DK",
20 chip: "nRF52840",
21}];
22
23/// Returns the vendor name used by the UI.
24#[must_use]
25pub fn vendor() -> &'static str {
26 "nrf"
27}
28
29/// Returns the list of available boards.
30#[must_use]
31pub fn boards() -> &'static [BoardInfo] {
32 BOARDS
33}
34
35/// Looks up a board by its exact name.
36#[must_use]
37pub fn find(board_name: &str) -> Option<&'static BoardInfo> {
38 BOARDS.iter().find(|b| b.board == board_name)
39}
40
41/// Returns the raw embedded board definition blob.
42#[must_use]
43pub fn raw_db() -> &'static [u8] {
44 include_bytes!(concat!(env!("OUT_DIR"), "/chipdb.bin"))
45}