> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 应用笔记

> 按类别分组的 Qualcomm Dragonwing 平台设计、启动调试（bring-up）和调优指南。

export const APP_NOTE_CATEGORIES = [{
  name: "热管理",
  slug: "thermal-management",
  icon: "temperature-half",
  summary: "热架构、散热和热缓解。",
  count: 1,
  color: "blue"
}, {
  name: "启动",
  slug: "boot",
  icon: "power-off",
  summary: "Bootloader 阶段和接口。",
  count: 1,
  color: "orange"
}, {
  name: "安全基础",
  slug: "security-fundamentals",
  icon: "shield",
  summary: "安全启动、TEE 和 TrustZone。",
  count: 2,
  color: "red"
}, {
  name: "电源管理",
  slug: "power-management",
  icon: "bolt",
  summary: "整个平台的 DVFS、低功耗模式和能耗感知调度。",
  count: 3,
  color: "yellow"
}, {
  name: "性能调优",
  slug: "performance-tuning",
  icon: "wave-square",
  summary: "适用于 Qualcomm Linux 的缓存、内存带宽、性能分析和核心亲和性调优。",
  count: 2,
  color: "gray"
}, {
  name: "中断与实时行为",
  slug: "interrupts-real-time-behavior",
  icon: "stopwatch",
  summary: "延迟、确定性和实时内核。",
  count: 1,
  color: "red"
}, {
  name: "调试与跟踪",
  slug: "debugging-trace",
  icon: "bug",
  summary: "崩溃转储、早期启动日志和硬件跟踪。",
  count: 2,
  color: "gray"
}, {
  name: "摄像头",
  slug: "camera",
  icon: "camera",
  summary: "传感器启动调试、调优流程和管道设计。",
  count: 3,
  color: "purple"
}];

export const APP_NOTES = [{
  topic: "热管理",
  category: "热管理",
  slug: "thermal-management",
  summary: "提供有关热架构、散热技术和热缓解的指导",
  links: ["https://dragonwingdocs.qualcomm.com/System/Power/overview-of-thermal-management"],
  public: true
}, {
  topic: "Bootloader 阶段",
  category: "启动",
  slug: "boot",
  summary: "介绍 Bootloader 的各个阶段和接口",
  links: ["https://dragonwingdocs.qualcomm.com/System/Boot"],
  public: true
}, {
  topic: "安全启动",
  category: "安全基础",
  slug: "security-fundamentals",
  summary: "提供在 Qualcomm 平台上启用安全启动的指导，以建立可信启动链、保护系统完整性，并防止启动期间执行未经授权的软件",
  links: ["https://dragonwingdocs.qualcomm.com/System/Security/security-features#secure-boot"],
  public: true
}, {
  topic: "可信执行环境（TEE、TrustZone）",
  category: "安全基础",
  slug: "security-fundamentals",
  summary: "介绍 Qualcomm 可信执行环境（TEE）架构和基于 TrustZone 的隔离机制，用于保护敏感应用程序、数据和安全关键操作",
  links: ["https://dragonwingdocs.qualcomm.com/System/Security/security-features#qualcomm-tee"],
  public: true
}, {
  topic: "动态电压和频率调节（DVFS）",
  category: "电源管理",
  slug: "power-management",
  summary: "说明如何配置 DVFS 调节器以平衡功耗和性能",
  links: ["https://dragonwingdocs.qualcomm.com/System/Kernel/configure-the-dynamic-voltage-and-frequency-scaling-dvfs-governors#configure-dvfs-governors"],
  public: true
}, {
  topic: "低功耗模式（睡眠、深度睡眠、待机）",
  category: "电源管理",
  slug: "power-management",
  summary: "提供有关 Qualcomm 平台电源状态（包括睡眠、深度睡眠和待机模式）的指导，以在保持系统响应能力和可靠性的同时尽可能降低功耗",
  links: ["https://dragonwingdocs.qualcomm.com/System/Power/power-states-and-features"],
  public: true
}, {
  topic: "能耗感知调度",
  category: "电源管理",
  slug: "power-management",
  summary: "提供有关配置 Linux 调度器和能耗感知调度策略的指导，以优化任务分配、提高能效并保持系统性能",
  links: ["https://dragonwingdocs.qualcomm.com/System/Kernel/configure-the-scheduler#configure-the-scheduler"],
  public: true
}, {
  topic: "核心亲和性",
  category: "性能调优",
  slug: "performance-tuning",
  summary: "提供有关 CPU 核心亲和性和工作负载分配策略的指导，通过将计算密集型任务分配给高性能核心来优化性能",
  links: ["https://dragonwingdocs.qualcomm.com/System/Performance/troubleshoot-performance-issues#use-large-cores-for-heavy-use-cases"],
  public: true
}, {
  topic: "性能分析工具",
  category: "性能调优",
  slug: "performance-tuning",
  summary: "提供有关使用 Qualcomm 工具分析 CPU、内存和系统行为的指导，帮助识别瓶颈并优化应用程序性能",
  links: ["https://dragonwingdocs.qualcomm.com/System/Performance/analyze-performance-with-tools"],
  public: true
}, {
  topic: "确定性执行技术",
  category: "中断与实时行为",
  slug: "interrupts-real-time-behavior",
  summary: "提供有关利用 Linux 实时（RT）内核实现确定性任务执行、降低延迟并提高时间关键型应用程序响应能力的指导",
  links: ["https://dragonwingdocs.qualcomm.com/System/Performance/features-impacting-performance#understand-the-real-time-rt-kernel"],
  public: true
}, {
  topic: "崩溃转储分析",
  category: "调试与跟踪",
  slug: "debugging-trace",
  summary: "提供有关收集和分析 RAM 转储的指导，以确定系统崩溃、软件故障和平台异常行为的根本原因",
  links: ["https://dragonwingdocs.qualcomm.com/System/Debug-Subsystem/collect-and-parse-ram-dump#collect-and-parse-ram-dump"],
  public: true
}, {
  topic: "内核启动调试",
  category: "调试与跟踪",
  slug: "debugging-trace",
  summary: "提供有关内核日志记录和早期启动诊断的指导，以捕获关键启动信息，并加快系统启动调试期间的根本原因分析",
  links: ["https://dragonwingdocs.qualcomm.com/System/Kernel/kernel-logging"],
  public: true
}, {
  topic: "开发摄像头传感器驱动程序",
  category: "摄像头",
  slug: "camera",
  summary: "提供有关开发和集成摄像头传感器驱动程序的指导，以支持新的摄像头模组，并确保其在 Qualcomm 摄像头框架中无缝运行",
  links: ["https://dragonwingdocs.qualcomm.com/Addendum-docs/Camera/addendum/camera-addendum-overview#develop-sensor-drivers"],
  public: false
}, {
  topic: "摄像头调优",
  category: "摄像头",
  slug: "camera",
  summary: "提供有关摄像头调优工作流程和图像质量优化技术的指导，以在曝光、色彩、对焦和成像用例中实现预期性能",
  links: ["https://dragonwingdocs.qualcomm.com/Addendum-docs/Camera/addendum/camera-addendum-overview#tune-the-camera"],
  public: false
}, {
  topic: "自定义摄像头用例和管道",
  category: "摄像头",
  slug: "camera",
  summary: "提供有关通过配置传感器、ISP 和处理阶段来设计和自定义摄像头管道的指导，以满足应用程序在分辨率、帧率、格式和图像质量方面的特定需求",
  links: ["https://dragonwingdocs.qualcomm.com/Addendum-docs/Camera/addendum/camera-addendum-overview#customize-camera-use-cases-and-pipelines"],
  public: false
}];

export const SHOW_CATEGORY_CARDS = false;

export const CATEGORY_OPTIONS = [{
  name: "所有类别",
  slug: "all",
  icon: "layer-group"
}, ...APP_NOTE_CATEGORIES];

export const AppNotes = () => {
  const [query, setQuery] = useState('');
  const [category, setCategory] = useState('all');
  const [open, setOpen] = useState(false);
  const dropdown = useRef(null);
  const needle = query.trim().toLowerCase();
  const current = APP_NOTE_CATEGORIES.find(c => c.slug === category);
  const selected = CATEGORY_OPTIONS.find(c => c.slug === category) || CATEGORY_OPTIONS[0];
  const notes = APP_NOTES.filter(n => (category === 'all' || n.slug === category) && (needle === '' || (n.topic + ' ' + n.summary + ' ' + n.category).toLowerCase().includes(needle)));
  const showCards = category === 'all' && needle === '';
  useEffect(() => {
    if (!open) return;
    const onPointerDown = event => {
      if (dropdown.current && !dropdown.current.contains(event.target)) setOpen(false);
    };
    const onKeyDown = event => {
      if (event.key === 'Escape') {
        setOpen(false);
        const trigger = dropdown.current && dropdown.current.querySelector('.appnotes-dd-trigger');
        if (trigger) trigger.focus();
      }
    };
    document.addEventListener('mousedown', onPointerDown);
    document.addEventListener('keydown', onKeyDown);
    return () => {
      document.removeEventListener('mousedown', onPointerDown);
      document.removeEventListener('keydown', onKeyDown);
    };
  }, [open]);
  const openNote = note => event => {
    if (note.links.length === 0 || event.target.closest('a, button')) return;
    if (String(window.getSelection() || '').length > 0) return;
    window.open(note.links[0], '_blank', 'noopener,noreferrer');
  };
  const pickCategory = event => {
    const link = event.target.closest('a[href^="#category-"]');
    if (!link || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
    event.preventDefault();
    setCategory(link.getAttribute('href').replace('#category-', ''));
  };
  return <div className="appnotes">
      <div className="appnotes-head">
        <h1 className="appnotes-title text-3xl sm:text-4xl font-semibold tracking-tight text-gray-900 dark:text-gray-200 [overflow-wrap:anywhere]">应用笔记</h1>
      </div>
      <div className="appnotes-controls">
        <label className="appnotes-search">
          <Icon icon="magnifying-glass" size={15} />
          <input type="search" value={query} placeholder="搜索应用笔记..." aria-label="搜索应用笔记" onChange={event => setQuery(event.target.value)} />
        </label>
        <div className="appnotes-dd" ref={dropdown}>
          <button type="button" className="appnotes-dd-trigger group flex w-full items-center gap-1 pl-2 pr-3.5 py-1.5 rounded-[0.85rem] border border-gray-200/70 dark:border-white/[0.07] hover:bg-gray-600/5 dark:hover:bg-gray-200/5" aria-haspopup="listbox" aria-expanded={open} aria-label="按类别筛选" onClick={() => setOpen(!open)}>
            <span className="nav-dropdown-item-icon size-8 flex items-center justify-center rounded-lg shrink-0 border border-gray-200/70 dark:border-white/[0.07]"><Icon icon={selected.icon} size={16} /></span>
            <span className="nav-dropdown-item-text-container flex-1 px-1 flex flex-col grow text-left"><span className="nav-dropdown-item-title text-base lg:text-sm font-medium text-gray-800 dark:text-gray-300">{selected.name}</span></span>
            <svg viewBox="0 0 18 18" width="18" height="18" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" className={open ? 'appnotes-dd-chevron size-3 shrink-0 is-open' : 'appnotes-dd-chevron size-3 shrink-0'}><path d="M6.5 2.75L12.75 9L6.5 15.25" /></svg>
          </button>
          {open ? <div className="appnotes-dd-panel shadow-xl dark:shadow-none shadow-gray-500/5 bg-background-light dark:bg-background-dark rounded-2xl border-standard p-1" role="listbox" aria-label="类别">
              {CATEGORY_OPTIONS.map(c => <button key={c.slug} type="button" role="option" aria-selected={c.slug === category} className="appnotes-dd-item w-full flex group items-center gap-1 rounded-xl pl-1.5 pr-2.5 py-1.5 hover:bg-gray-950/5 dark:hover:bg-white/5" onClick={() => {
    setCategory(c.slug);
    setOpen(false);
  }}>
                  <span className="nav-dropdown-item-icon size-8 flex items-center justify-center rounded-lg shrink-0 border border-gray-200/70 dark:border-white/[0.07]"><Icon icon={c.icon} size={16} /></span>
                  <span className="nav-dropdown-item-text-container flex-1 px-1 flex flex-col grow text-left"><span className={c.slug === category ? 'nav-dropdown-item-title text-base lg:text-sm font-medium text-primary dark:text-primary-light' : 'nav-dropdown-item-title text-base lg:text-sm font-medium text-gray-800 dark:text-gray-300'}>{c.name}</span></span>
                  {c.slug === category ? <svg viewBox="0 0 18 18" width="18" height="18" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" className="appnotes-dd-check ml-2 size-4 shrink-0"><path d="M2.75 9.5L6.5 13.25L15.25 4.5" /></svg> : null}
                </button>)}
            </div> : null}
        </div>
      </div>
      {showCards && SHOW_CATEGORY_CARDS ? <div className="appnotes-cards" onClick={pickCategory}>
          <Columns cols={3}>
            {APP_NOTE_CATEGORIES.map(c => <Card key={c.slug} title={c.name} icon={c.icon} href={'#category-' + c.slug}>
                {c.summary} 共 {c.count} 个主题。
              </Card>)}
          </Columns>
        </div> : null}
      {showCards ? null : <div className="appnotes-result">
          <button type="button" className="appnotes-clear" onClick={() => {
    setCategory('all');
    setQuery('');
  }}>清除筛选</button>
        </div>}
      {notes.length === 0 ? <p className="appnotes-empty">没有与该搜索匹配的应用笔记。</p> : <div className="appnotes-table-wrap" role="region" aria-label="应用笔记" tabIndex={0}>
          <table className="appnotes-table">
            <thead>
              <tr>
                <th scope="col">主题</th>
                <th scope="col">类别</th>
              </tr>
            </thead>
            <tbody>
              {notes.map(n => <tr key={n.topic} className={n.links.length > 0 ? 'appnotes-row is-linked' : 'appnotes-row'} onClick={openNote(n)}>
                  <td>
                    <span className="appnotes-topic">
                      {n.links.length > 0 ? <a href={n.links[0]} target="_blank" rel="noopener noreferrer">{n.public ? null : <span className="appnotes-lock" title="需要 Qualcomm 登录"><Icon icon="lock" size={12} /><span className="appnotes-sr-only">（需要 Qualcomm 登录） </span></span>}{n.topic}<span className="appnotes-sr-only"> （在新标签页中打开）</span></a> : n.topic}
                    </span>
                    <span className="appnotes-summary">{n.summary}</span>
                  </td>
                  <td className="appnotes-category"><Badge color={(APP_NOTE_CATEGORIES.find(c => c.slug === n.slug) || ({})).color}>{n.category}</Badge></td>
                </tr>)}
            </tbody>
          </table>
        </div>}
    </div>;
};

<AppNotes />
