Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
This tutorial explores how devicetree bindings in Zephyr create the crucial connection between hardware descriptions and driver code. Learn how bindings define required devicetree properties and their interpretation by drivers, allowing hardware details to remain in devicetree files and YAML schemas while keeping C code clean and platform-agnostic. Using the ESP32-S3 Analog-to-Digital Converter (ADC) as an example, examine binding files that specify properties like reference voltage, gain, and resolution, and walk through creating an overlay file to configure ADC0. Discover how devicetree macros like DEVICE_DT_GET() and ADC_CHANNEL_CFG_DT() dynamically fetch appropriate drivers and configurations without hardcoded addresses. See how this pattern applies to other peripherals like UART, I2C, SPI, and PWM, with each having corresponding YAML binding files listing required properties that Zephyr enforces at build time. The tutorial includes a challenge to combine ADC input with PWM output for driving an LED, demonstrating how devicetree and bindings unify hardware configuration across multiple subsystems.
Syllabus
0:00 Intro
1:00 Hardware Overview
2:57 DeviceTree Nodes
5:09 ADC Binding
18:12 Compatible Strings
19:04 Driver Header
23:16 ADC Demo Application
39:55 Going Further
40:31 Challenge: PWM Controller
44:09 Conclusion
Taught by
Digi-Key