rlvgl-chips-microchip 0.0.2

Microchip chip database adapter for rlvgl code generation.
Documentation
#![no_std]
#![deny(missing_docs)]

//! Board database for Microchip devices.
//!
//! This crate embeds board and chip configuration data extracted from
//! upstream sources. It currently provides placeholder APIs.

/// Information about a supported board.
pub struct BoardInfo {
    /// Board's human-friendly name.
    pub board: &'static str,
    /// Associated microcontroller name.
    pub chip: &'static str,
}

/// Static list of known boards for this vendor.
const BOARDS: &[BoardInfo] = &[BoardInfo {
    board: "ATSAMD51J19A",
    chip: "ATSAMD51J19A",
}];

/// Returns the vendor name used by the UI.
#[must_use]
pub fn vendor() -> &'static str {
    "microchip"
}

/// Returns the list of available boards.
#[must_use]
pub fn boards() -> &'static [BoardInfo] {
    BOARDS
}

/// Looks up a board by its exact name.
#[must_use]
pub fn find(board_name: &str) -> Option<&'static BoardInfo> {
    BOARDS.iter().find(|b| b.board == board_name)
}

/// Returns the raw embedded board definition blob.
#[must_use]
pub fn raw_db() -> &'static [u8] {
    include_bytes!(concat!(env!("OUT_DIR"), "/chipdb.bin"))
}