‹ 首页

hardware-io

@beriberikix · 收录于 昨天 · 上游提交 2 个月前

Hardware interfacing and peripheral management for Zephyr RTOS. Covers the sensor subsystem (channels, triggers, fetch/get), pin control (Pinctrl) and multiplexing, GPIO management using Devicetree specs, and SoC-level hardware configurations. Trigger when adding new hardware components, configuring pinmux, or developing sensor-based applications.

适合你,如果需要在 Zephyr 项目中添加或配置硬件外设。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add beriberikix/zephyr-agent-skills/hardware-io
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- beriberikix/zephyr-agent-skills/hardware-io
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify beriberikix/zephyr-agent-skills/hardware-io
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
58GitHub stars
~585最小装载
~2.1K含声明引用
~2.2K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 ed63cdf · 表述以原文为准
它做什么

安装后,Claude 能帮助你编写 Zephyr RTOS 的硬件接口代码,例如传感器数据采集、引脚复用配置和 GPIO 控制。它会生成传感器轮询模板,检查设备树设置,并确保硬件初始化正确。

什么时候触发

当你添加新硬件组件、配置引脚复用 (pinmux),或开发基于传感器的应用时,Claude 会自动提供硬件接口相关的代码和配置建议。

装好后可以这样说
Claude 会生成传感器初始化和数据读取的 C 代码。
Claude 会给出使用 gpio_dt_spec 的示例。
技能原文 SKILL.md作者撰写 · Apache-2.0 · ed63cdf

Zephyr Hardware I/O

Interface with the physical world using Zephyr's standardized driver models and hardware abstraction layers.

Core Workflows
1. Sensor Subsystem

Interact with various sensors using a uniform API for data fetching and decoding.

  • Reference: [sensors.md](references/sensors.md)
  • Key Tools: sensor_sample_fetch, sensor_channel_get, struct sensor_value.
2. Pinctrl & GPIO

Manage pin multiplexing, electrical configuration, and basic digital input/output.

  • Reference: [pinctrl_gpio.md](references/pinctrl_gpio.md)
  • Key Tools: pinctrl, gpio_dt_spec, GPIO_DT_SPEC_GET.
3. SoC Configuration

Tune chip-level parameters and manage hardware across multiple board variants.

  • Reference: [soc_config.md](references/soc_config.md)
  • Key Tools: Kconfig, soc_common.dtsi, SoC-level overlays.
Quick Start (Sensor Polling)
#include <zephyr/drivers/sensor.h>

const struct device *temp_sensor = DEVICE_DT_GET(DT_ALIAS(ambient_temp0));
struct sensor_value val;

void poll_sensor(void) {
    if (sensor_sample_fetch(temp_sensor) == 0) {
        sensor_channel_get(temp_sensor, SENSOR_CHAN_AMBIENT_TEMP, &val);
    }
}
Professional Patterns (Hardware Engineering)
  • Safe GPIO: Always use gpio_dt_spec to ensure polarity and pin number are automatically handled by the driver.
  • Background Sampling: Never poll sensors in high-priority threads; use a background work queue. See [kernel-services](../kernel-services/SKILL.md) for work-queue patterns.
  • Deferred Pinctrl: Define pin states in a shared .dtsi to simplify multi-revision hardware support.
Automation Tools
  • [gpio_alias_check.py](scripts/gpio_alias_check.py): Detect duplicate alias entries across DTS/overlay files.
Examples & Templates
  • [sensor_poll_template.c](assets/sensor_poll_template.c): Starter polling function with readiness/error checks.
Validation Checklist
  • [ ] Sensor device nodes resolve correctly and DEVICE_DT_GET(...) targets are ready at runtime.
  • [ ] GPIO and pinctrl states match the intended board schematic and polarity rules.
  • [ ] Sensor sampling path returns stable values with expected units/scaling.
  • [ ] Background acquisition does not block high-priority or interrupt-critical code paths.
Resources
  • [References](references/):
  • sensors.md: Reading data, channels, and triggers.
  • pinctrl_gpio.md: Pin multiplexing and GPIO specs.
  • soc_config.md: Multi-variant SoC configuration.
  • [Scripts](scripts/):
  • gpio_alias_check.py: Alias duplication checker for DTS/overlay sets.
  • [Assets](assets/):
  • sensor_poll_template.c: Polling loop starter template.
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。