Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: compote component pack --name waveshare_boards

build:
name: ${{ matrix.board }} / ${{ matrix.idf }} / BMGR ${{ matrix.bmgr }} / ${{ matrix.integration }}
name: ${{ matrix.board }} / ${{ matrix.idf }} / BMGR ${{ matrix.bmgr }}
needs: validate
if: needs.validate.outputs.has_builds == 'true'
runs-on: ubuntu-latest
Expand All @@ -92,7 +92,6 @@ jobs:
set -eu
python -m pip install '${{ matrix.component_manager }}' '${{ matrix.bmgr_assist }}'
python ../scripts/board_pack.py pin '${{ matrix.bmgr }}'
python ../scripts/board_pack.py integration '${{ matrix.integration }}'
idf.py bmgr -l
idf.py bmgr -b '${{ matrix.board }}'
idf.py build
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ CI validates generation and compilation; physical operation requires board testi

## 🚀 Quick start

Activate ESP-IDF first. Until a registry version is published, clone this pack
into an **existing ESP-IDF application's** component directory:
Activate ESP-IDF first. For a local checkout, clone this pack into an
**existing ESP-IDF application's** component directory:

```bash
mkdir -p components
Expand All @@ -69,24 +69,22 @@ the component name. The pack declares `espressif/esp_board_manager` as a public
dependency. Applications can include `esp_board_manager.h` and initialize the
selected board using `esp_board_manager_init()`.

After maintainers publish the component, install it from the registry instead
of keeping the local clone:
Published versions can be installed from the registry:

```bash
idf.py add-dependency "waveshare/waveshare_boards"
idf.py reconfigure
idf.py bmgr -l
```

The intended registry identity is `waveshare/waveshare_boards`; a repository version
or a passing packaging check does not by itself mean that version is published.
Find available versions in the
[Component Registry](https://components.espressif.com/components/waveshare/waveshare_boards).

## 🗂️ Repository layout

```text
boards/<full_model>/ Board metadata, peripherals, devices, and setup code
include/ Framework-independent AMOLED brightness helper
integrations/ Optional framework adapters, shared across boards
idf_component.yml Component metadata and managed dependencies
CMakeLists.txt Board-pack component registration
ci/test_app/ Board Manager integration compile test
Expand Down Expand Up @@ -116,7 +114,7 @@ unique `board` value. The catalog is regenerated from the definitions.
## 📚 Documentation

- [Board organization, hardware revisions, and migration](docs/BOARDS.md)
- [AMOLED brightness and optional Brookesia integration](docs/INTEGRATIONS.md)
- [AMOLED brightness control](docs/INTEGRATIONS.md)
- [CI coverage and local validation](docs/CI.md)
- [Registry credentials and publication](docs/PUBLISHING.md)
- [Contributing](CONTRIBUTING.md)
Expand Down
10 changes: 4 additions & 6 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

## 🚀 快速开始

先激活 ESP-IDF 环境。在组件库版本发布之前,将本仓库克隆到**已有 ESP-IDF 应用**的组件目录:
先激活 ESP-IDF 环境。使用本地源码时,将本仓库克隆到**已有 ESP-IDF 应用**的组件目录:

```bash
mkdir -p components
Expand All @@ -63,23 +63,21 @@ idf.py build
组件包已经公开依赖 `espressif/esp_board_manager`;应用可以包含
`esp_board_manager.h`,并通过 `esp_board_manager_init()` 初始化所选板卡。

维护者正式发布组件后,可以通过组件库安装,替代本地克隆:
也可以通过组件库安装已发布版本:

```bash
idf.py add-dependency "waveshare/waveshare_boards"
idf.py reconfigure
idf.py bmgr -l
```

计划使用的组件库名称为 `waveshare/waveshare_boards`。仓库里的版本号或打包检查通过,
不代表该版本已经在组件库发布。
可用版本见[在线组件库](https://components.espressif.com/components/waveshare/waveshare_boards)。

## 🗂️ 仓库结构

```text
boards/<完整型号>/ 板卡信息、外设、设备与初始化代码
include/ 不依赖应用框架的 AMOLED 调光函数
integrations/ 跨板卡共用的可选框架适配
idf_component.yml 组件元数据与托管依赖
CMakeLists.txt 板卡包组件注册
ci/test_app/ Board Manager 集成编译测试
Expand Down Expand Up @@ -107,7 +105,7 @@ python -m unittest discover -s ci/scripts -p 'test_*.py' -v
## 📚 文档

- [板卡组织、硬件版本与迁移说明](docs/BOARDS_ZH.md)
- [AMOLED 调光与可选 Brookesia 集成](docs/INTEGRATIONS_ZH.md)
- [AMOLED 亮度控制](docs/INTEGRATIONS_ZH.md)
- [CI 覆盖范围与本地验证](docs/CI_ZH.md)
- [组件库凭据与发布](docs/PUBLISHING_ZH.md)
- [贡献指南](CONTRIBUTING_ZH.md)
Expand Down
8 changes: 0 additions & 8 deletions ci/markdown-audit.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,5 @@
"license"
]
}
],
"classification_rules": [
{
"category": "embedded_upstream",
"patterns": [
"integrations/brookesia_hal_custom/CHANGELOG.md"
]
}
]
}
42 changes: 6 additions & 36 deletions ci/scripts/board_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

ROOT = Path(__file__).resolve().parents[2]
EXCLUDED = {"ci", "scripts", "docs", "firmware", "examples", "build",
"managed_components", "components", "third_party", "libraries", "dist", "integrations"}
"managed_components", "components", "third_party", "libraries", "dist"}
STABLE = re.compile(r"\d+\.\d+\.\d+(?:~\d+)?")


Expand Down Expand Up @@ -94,7 +94,7 @@ def route(boards, paths):
selected.update(direct)
else:
selected.update(b["board"] for b in boards)
if not (value.startswith(("ci/", "scripts/", ".github/workflows/", "integrations/", "include/"))
if not (value.startswith(("ci/", "scripts/", ".github/workflows/", "include/"))
or value in {"CMakeLists.txt", "idf_component.yml"}):
unknown.append(value)
return {"boards": [b for b in boards if b["board"] in selected],
Expand All @@ -113,42 +113,17 @@ def registry_versions(root):

def matrix(root, boards, versions):
config = json.loads((root / "ci/versions.json").read_text(encoding="utf-8"))
if not set(config.get("brookesia_idf", [])).issubset(config["idf"]):
raise ValueError("Brookesia test versions must be in the main IDF matrix")
cells = []
profiles = root / "integrations/brookesia_hal_custom/profiles"
for board in boards:
modes = ["none"]
if (profiles / board["board"] / "sdkconfig.defaults").is_file():
modes.append("brookesia")
for idf in config["idf"]:
for version in versions:
for mode in modes:
if mode == "brookesia" and idf not in config.get("brookesia_idf", []):
continue
cells.append(dict(board=board["board"], target=board["target"],
idf=idf, bmgr=version, integration=mode,
component_manager=config["component_manager"][idf],
bmgr_assist=config["bmgr_assist"]))
cells.append(dict(board=board["board"], target=board["target"],
idf=idf, bmgr=version,
component_manager=config["component_manager"][idf],
bmgr_assist=config["bmgr_assist"]))
return {"include": cells}


def configure_integration(root, name):
path = root / "ci/test_app/main/idf_component.yml"
data = load_yaml(path)
if name == "brookesia":
component = root / "integrations/brookesia_hal_custom"
if not (component / "CMakeLists.txt").is_file():
raise ValueError("Brookesia integration component is missing")
data["dependencies"]["brookesia_hal_custom"] = {
"override_path": "../../../integrations/brookesia_hal_custom"}
elif name == "none":
data["dependencies"].pop("brookesia_hal_custom", None)
else:
raise ValueError("unknown integration")
path.write_text(yaml.safe_dump(data, sort_keys=False), encoding="utf-8")


def pin(root, version):
if not STABLE.fullmatch(version):
raise ValueError("an exact stable Board Manager version is required")
Expand All @@ -165,8 +140,6 @@ def main():
sub.add_parser("check")
pin_parser = sub.add_parser("pin")
pin_parser.add_argument("version")
integration = sub.add_parser("integration")
integration.add_argument("name", choices=("none", "brookesia"))
plan = sub.add_parser("matrix")
scope = plan.add_mutually_exclusive_group(required=True)
scope.add_argument("--all", action="store_true")
Expand All @@ -178,9 +151,6 @@ def main():
if args.command == "pin":
pin(args.root, args.version)
return 0
if args.command == "integration":
configure_integration(args.root, args.name)
return 0
boards = discover(args.root)
if args.command == "check":
print(json.dumps(boards, indent=2))
Expand Down
33 changes: 3 additions & 30 deletions ci/scripts/test_board_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def cli(self, *args):
return result, values

def test_discovery_excludes_generated_and_upstream(self):
for root in ('ci', 'managed_components', 'components', 'firmware', 'libraries', 'integrations', '.hidden'):
for root in ('ci', 'managed_components', 'components', 'firmware', 'libraries', '.hidden'):
self.add_board(f'{root}/ignored')
self.assertEqual(['alpha', 'beta'], [b['board'] for b in bp.discover(self.root)])

Expand Down Expand Up @@ -182,35 +182,8 @@ def test_full_matrix_cli_records_exact_tooling(self):
self.assertEqual({'idf-component-manager==2.5.0', 'idf-component-manager==3.0.3'},
{c['component_manager'] for c in cells})
self.assertEqual('true', values['has_builds'])

def test_matrix_only_adds_integration_for_declared_profiles(self):
self.write('integrations/brookesia_hal_custom/profiles/alpha/sdkconfig.defaults', '# profile\n')
result, values = self.cli('matrix', '--all', '--bmgr', '0.7.2')
self.assertEqual(0, result.returncode, result.stderr)
cells = json.loads(values['matrix'])['include']
self.assertEqual(5, len(cells))
opt_in = [cell for cell in cells if cell['integration'] == 'brookesia']
self.assertEqual(1, len(opt_in))
self.assertEqual({'v6.1'}, {cell['idf'] for cell in opt_in})
self.assertEqual({'alpha'}, {cell['board'] for cell in opt_in})
self.assertTrue(bp.route(self.boards, ['integrations/brookesia_hal_custom/README.md'])['docs_only'])
self.assertEqual(self.boards, bp.route(self.boards, ['integrations/brookesia_hal_custom/src/plugin.cpp'])['boards'])

def test_integration_cli_preserves_pack_and_requires_component(self):
self.write('ci/test_app/main/idf_component.yml',
'dependencies:\n waveshare_boards:\n override_path: ../../../\n')
result, _ = self.cli('integration', 'brookesia')
self.assertEqual(2, result.returncode)
self.write('integrations/brookesia_hal_custom/CMakeLists.txt', 'idf_component_register()\n')
result, _ = self.cli('integration', 'brookesia')
self.assertEqual(0, result.returncode, result.stderr)
path = self.root / 'ci/test_app/main/idf_component.yml'
deps = bp.load_yaml(path)['dependencies']
self.assertEqual('../../../', deps['waveshare_boards']['override_path'])
self.assertEqual('../../../integrations/brookesia_hal_custom', deps['brookesia_hal_custom']['override_path'])
result, _ = self.cli('integration', 'none')
self.assertEqual(0, result.returncode, result.stderr)
self.assertEqual({'waveshare_boards'}, set(bp.load_yaml(path)['dependencies']))
for cell in cells:
self.assertEqual({'board', 'target', 'idf', 'bmgr', 'component_manager', 'bmgr_assist'}, set(cell))

def test_pin_is_exact_and_preserves_pack(self):
self.write('ci/test_app/main/idf_component.yml',
Expand Down
5 changes: 1 addition & 4 deletions ci/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
"v5.5.5": "idf-component-manager==2.5.0",
"v6.1": "idf-component-manager==3.0.3"
},
"bmgr_assist": "esp-bmgr-assist==0.8.3",
"brookesia_idf": [
"v6.1"
]
"bmgr_assist": "esp-bmgr-assist==0.8.3"
}
14 changes: 5 additions & 9 deletions docs/BOARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,18 @@ The migration makes these changes to the imported profiles:

- Include `dev_custom.h` explicitly for custom-device registration on Board Manager 0.7.2.
- Extract the unchanged QSPI brightness command into the public
`waveshare_amoled_set_brightness()` helper. Both ordinary applications and the
optional framework adapter can use it without duplicating the hardware command.
`waveshare_amoled_set_brightness()` helper for applications to control panel brightness.
See [brightness control](INTEGRATIONS.md).
- Keep only hardware defaults in `sdkconfig.defaults.board`. Applications choose
their own feature settings and partition layout.
- Consolidate the three Brookesia brightness plugins into one optional component
under `integrations/brookesia_hal_custom/`, with the original three application
profiles under its `profiles/` directory. Board YAML no longer selects a
framework plugin automatically. See [explicit integration](INTEGRATIONS.md).
- Disable automatic SD formatting after mount failure on the 1.8 and 2.16 boards.
Mount failure is reported without erasing an existing card.
- Remove duplicate YAML keys with identical values and correct stale pin comments.

The imported PMU rail and charging initialization remains unchanged. Display,
touch, audio, SD, peripheral configuration, and panel initialization are retained
in each board directory. The shared integration keeps the brightness methods,
plugin/interface names, display group, mutex, command format, and default values.
in each board directory. Runtime AMOLED brightness control remains available
through the public helper, with the original command format and percentage scaling.
The AXP2101 implementation remains board-local because the 1.8 setup also uses
its GPIO expander; merging those paths is a separate hardware change.

Expand Down Expand Up @@ -115,7 +111,7 @@ physical display/touch test after implementation.

Brookesia's board package carries Apache-2.0; individual imported files retain
SPDX notices, including CC0-1.0 on setup code. Preserve the original copyright
headers. The imported integration changelog remains upstream-owned and unchanged.
headers.
Managed drivers retain their respective licenses; this pack does not relicense
them. See [the upstream package license](https://github.com/espressif/esp-brookesia/blob/6a087b6d76e989802b72fdb835928b273af76af8/hal/brookesia_hal_boards/license.txt)
and [CC0-1.0 terms](https://creativecommons.org/publicdomain/zero/1.0/legalcode.en).
11 changes: 4 additions & 7 deletions docs/BOARDS_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ boards/

- 显式包含 `dev_custom.h`,适配 Board Manager 0.7.2 的自定义设备注册接口。
- 将原有 QSPI 亮度命令提取为公共函数 `waveshare_amoled_set_brightness()`,
普通应用与可选框架适配均可调用,硬件命令无需重复实现。
应用可以直接调用它控制面板亮度,详见[亮度控制](INTEGRATIONS_ZH.md)。
- `sdkconfig.defaults.board` 仅保留硬件默认配置,由应用自行选择功能配置和分区表。
- 将三份 Brookesia 调光插件合并到一份可选组件 `integrations/brookesia_hal_custom/`,
三块板卡的原应用配置分别保存在其 `profiles/` 目录。板卡 YAML 不再自动选择框架插件,
应用可[显式接入](INTEGRATIONS_ZH.md)。
- 将 1.8、2.16 的 SD 挂载失败自动格式化关闭,挂载失败会报错,不会清空已有卡片。
- 删除值相同的重复 YAML 键,修正过时的引脚注释。

导入的 PMU 电源轨及充电初始化保持不变。显示、触摸、音频、SD、外设配置和面板初始化
继续保存在各板卡目录。共用集成保留原调光方法、插件与接口名称、显示分组、线程互斥、
命令格式及默认值。AXP2101 实现继续随板卡维护,因为 1.8 的初始化还涉及 GPIO 扩展器,
继续保存在各板卡目录。公共函数继续提供运行时 AMOLED 调光,保留原命令格式和百分比换算。
AXP2101 实现继续随板卡维护,因为 1.8 的初始化还涉及 GPIO 扩展器,
合并这些路径属于另一项硬件行为修改。

## 硬件资料核对
Expand Down Expand Up @@ -97,6 +94,6 @@ CST816S 是兼容驱动的 API 名称,V2 实际安装的是 CST820。
## 来源许可证

Brookesia 板卡包采用 Apache-2.0,导入文件保留原 SPDX 声明,包括初始化代码中的 CC0-1.0。
请保留原版权头。导入的集成更新日志保持上游原文。托管驱动遵循各自的许可证,本组件包不改变其授权。
请保留原版权头。托管驱动遵循各自的许可证,本组件包不改变其授权。
详见[上游板卡包许可证](https://github.com/espressif/esp-brookesia/blob/6a087b6d76e989802b72fdb835928b273af76af8/hal/brookesia_hal_boards/license.txt)及
[CC0-1.0 条款](https://creativecommons.org/publicdomain/zero/1.0/legalcode.en)。
15 changes: 3 additions & 12 deletions docs/CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ Registry lookup failures fail the job. Each matrix entry records an exact versio

The initial Board Manager floor is **0.7.2**, matching the reference board-pack
template. The current floor and latest resolve to the same version, giving eight
plain board builds across the two IDF lines plus three optional Brookesia adapter
builds on IDF 6.1, eleven builds in total. Keep the floor until a deliberate compatibility change
is tested. Unsupported catalog profiles or generation failures fail CI; they are
board builds across the two IDF lines. Keep the floor until a deliberate
compatibility change is tested. Unsupported catalog profiles or generation failures fail CI; they are
not counted as successful builds.

For IDF 5.5, Component Manager **2.5.0** is selected because the reference template documents
Expand All @@ -35,13 +34,6 @@ Use `boards/<full_model>/` inside the pack: local scanning begins at the
application's `components/` root, so adding another chip directory exceeds its
three-level search limit. See [layout and source evidence](BOARDS.md).

The optional adapter uses HAL interface/lib_utils 0.8.2. Upstream lib_utils 0.8
requires IDF 6.0–6.2, so `ci/versions.json` declares its native IDF test line in
`brookesia_idf`. The ordinary board builds still cover both lines. The three
preserved application profiles identify the boards with this additional test;
full application profiles are not applied by the standalone adapter compile test.
See [integration coverage and upstream constraints](INTEGRATIONS.md).

## Change routing

The lightweight metadata, unit-test, navigation, and packaging checks run on every
Expand All @@ -52,7 +44,7 @@ PR. `Board pack checks` is the stable aggregate status suitable for branch prote
| Root or nested Markdown, documentation images | None |
| Issue forms, license, ignore rules | None |
| Files inside one board directory | That board |
| CI scripts, tests, workflows, integrations, root manifest or CMake | All boards |
| CI scripts, tests, workflows, public headers, root manifest or CMake | All boards |
| Deleted or renamed board paths | Both sides are considered; removed paths can select all remaining boards |
| Firmware documentation, source, binary, archive | Reported separately; no board build |
| Unrecognized non-documentation input | All boards; path reported for review |
Expand Down Expand Up @@ -82,7 +74,6 @@ python scripts/update_supported_boards_table.py --check
python ci/scripts/check_docs.py
python ci/scripts/board_pack.py matrix --all
python ci/scripts/board_pack.py pin 0.7.2
python ci/scripts/board_pack.py integration none
idf.py -C ci/test_app bmgr -l
idf.py -C ci/test_app bmgr -b esp32_s3_touch_lcd_7
idf.py -C ci/test_app build
Expand Down
Loading
Loading