import type { McuFamily, PeripheralType } from "./enums.js"; export interface McuFamilySpec { family: McuFamily; cpu: string; maxClockMHz: number; flashKB: { min: number; max: number; }; sramKB: { min: number; max: number; }; trustZone: boolean; ethernet: boolean; usb: "none" | "fs" | "fs+hs"; notes?: string[]; } export interface DriverFamilyEntry { driverName: string; include: string; instanceType: string; configTypes: { cfg: string; ctrl: string; api: string; }; openClosePattern: "open-use-close"; variants?: string[]; constraints?: string[]; } export interface DriverMapping { peripheral: PeripheralType; byFamily?: Partial>; } export interface FspErrorFix { steps: string[]; files?: string[]; notes?: string[]; } export interface FspErrorInfo { code: string; severity: "common" | "rare" | "fatal"; symptoms: string[]; rootCauses: string[]; fixes: FspErrorFix[]; related?: string[]; } export interface InterruptFamilyEntry { irqs: Array<{ signal: string; irqName: string; vectorSymbol?: string; }>; priorityRange?: { min: number; max: number; }; commonPitfalls: string[]; verificationSteps: string[]; } export interface InterruptConfigInfo { driverName: string; byFamily?: Partial>; } export interface ClockConfigRecipe { family: McuFamily; goals: Array<"stable-uart-baud" | "high-performance" | "low-power" | "ethernet" | "usb">; constraints: string[]; steps: string[]; derivedClocks?: Array<{ name: string; typicalMHz: number; notes?: string; }>; pitfalls: string[]; } export interface FlashRule { family: McuFamily; flashType: "lp" | "hp"; driverName: string; writeAlignmentBytes: number; eraseBlockBytes: number[]; notes: string[]; } export interface FspModuleMeta { moduleId: string; layer: "hal" | "middleware" | "bsp" | "other"; displayName?: string; brief?: string; includeHeaders?: string[]; sourcePaths?: string[]; supportedFamilies?: McuFamily[]; provides?: PeripheralType[]; keywords?: string[]; } export type FreertosGoal = "basic-multitasking" | "tcp-networking" | "fat-filesystem" | "trustzone-rtos" | "low-power-tickless" | "high-performance-ipc"; export interface FreertosConfigRecipe { family: McuFamily; goals: FreertosGoal[]; freertosVersion: string; configEntries: Array<{ key: string; value: string; description: string; }>; constraints: string[]; pitfalls: string[]; } export interface FreertosIssueInfo { symptom: string; severity: "common" | "rare" | "fatal"; description: string; rootCauses: string[]; fixes: Array<{ steps: string[]; notes?: string[]; }>; related?: string[]; } export interface FreertosApiPattern { pattern: string; description: string; includes: string[]; defaultCode: string; byFamily?: Partial>; pitfalls?: string[]; }