Feedback
Feedback

If you are having issues with the exercises, please create a ticket on DevZone: devzone.nordicsemi.com
Drag & Drop Files, Choose Files to Upload 您最多可以上传 2 个文件。
  • 简体中文
    Eng
    简体中文
  • 第 2 课 – 读取按钮并控制 LED

    概览

    在本课程中,我们将研究 nRF Connect SDK 如何描述硬件,无论是开发套件 (DK)、片上系统 (SoC)、系统级封装 (SiP) 还是模块。应用程序与硬件之间的交互是通过称为设备驱动程序的软件片段完成的,我们将解释 nRF Connect SDK 中使用的设备驱动程序模型。我们将以通用输入/输出 (GPIO) 硬件外设和驱动程序作为案例研究。我们将对上一课中烧录到开发板上的 blinky 示例进行逐行讲解。 Ali Test

    在本课程的练习部分,我们将学习如何使用 GPIO 外设,通过轮询和中断两种方法来控制 LED 并读取按钮状态。

    目标

    • 研究设备树 (devicetree) API <zephyr/devicetree.h>
    • 研究板级设备树 (devicetree) .dts
    • 研究 SoC 级设备树 (devicetree) .dtsi
    • 了解设备树绑定文件 (.yaml) 的用途以及 compatible 属性
    • 理解设备驱动程序模型 <zephyr/device.h>
    • 分析设备驱动程序 API 与设备驱动程序实现之间的解耦,以及使用设备指针的必要性
    • 研究通用 GPIO 接口 API <zephyr/drivers/gpio.h>
    • 通过动手练习实践配置 GPIO 引脚,学习如何对 GPIO 引脚进行读/写操作,以及如何为输入 GPIO 引脚设置中断

    Switch language?

    Progress is tracked separately for each language. Switching will continue from your progress in that language or start fresh if you haven't begun.

    Your current progress is saved, and you can switch back anytime.

    Register an account
    Already have an account? Log in
    (All fields are required unless specified optional)

    • 8 or more characters
    • Upper and lower case letters
    • At least one number or special character

    Forgot your password?
    Enter the email associated with your account, and we will send you a link to reset your password.