ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Intro to Embedded Rust Part 7: Creating a TMP102 Driver Library and Crate | DigiKey

Автор: DigiKey

Загружено: 2026-03-05

Просмотров: 1331

Описание: In this video, we create reusable embedded Rust libraries in this comprehensive tutorial on driver development for the Raspberry Pi Pico 2 and other microcontrollers. We'll extract our previous TMP102 temperature sensor code into a separate library crate that uses generics and embedded-hal traits to work across any platform that implements the standard I2C interface. This tutorial demonstrates real-world embedded Rust development practices: drivers are published as separate crates on crates.io, allowing the community to share platform-agnostic code that works with STM32, ESP32, nRF52, RP2350, and countless other microcontrollers.
The written guide for this episode can be found here: https://www.digikey.com/en/maker/tuto...
The GitHub repository containing the Docker image and example code for this series can be found here: https://github.com/ShawnHymel/introdu...
This hands-on Rust library development tutorial covers the complete process of creating an embedded driver from scratch. We demonstrate how to use rustdoc documentation comments (/// and //!) to generate API documentation and how to design public interfaces with proper encapsulation. We explore advanced generic programming patterns including generic structs with type parameters, trait bounds using the where clause, and associated types like I2C::Error from the embedded-hal traits. The tutorial demonstrates creating custom error enums with generic type parameters, using the #[derive(Debug, Clone, Copy)] attribute to automatically implement common traits, and defining enums for hardware configuration options like I2C addresses. You'll understand how trait bounds constrain generic types to only those implementing specific interfaces, enabling compile-time verification that your driver works with any compatible HAL implementation.
We then create a demo application that imports our library using a path dependency in Cargo.toml, showing how to use local libraries during development before publishing to crates.io. The demo application demonstrates the practical benefits of good library design: instead of managing raw I2C transactions with register addresses and bit manipulation scattered throughout the code, we simply instantiate our TMP102 driver and call clean methods like read_temperature_c(). You'll see how the application code becomes dramatically simpler and more maintainable when driver complexity is properly encapsulated in a separate library. We walk through the minimal changes needed to convert our previous I2C example to use the new library, highlighting how ownership of the I2C peripheral transfers to the driver and how the generic type parameters get filled in with concrete types from the rp235x-hal when you instantiate the driver with real hardware.

Related Link: https://www.digikey.com/en/maker/tuto...

Links:
Getting Started with STM32 and Nucleo:    • Getting Started with STM32 and Nucleo Part...  
Introduction to Real-Time Operating Systems (RTOS):    • Introduction to RTOS Part 1 - What is a Re...  
Raspberry Pi Pico 2: https://www.digikey.com/en/products/d...

Learn more:
Maker.io - https://www.digikey.com/en/maker
DigiKey’s Blog – TheCircuit https://www.digikey.com/en/blog
Connect with DigiKey on Facebook   / digikey.electronics  
And follow us on X: https://x.com/digikey

Product:
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...
https://www.digikey.com/en/products/d...

Chapters:
0:00 Intro
0:50 Create TMP102 Driver Library
15:34 Create Demo Application
21:19 Build and Flash
23:50 Challenge: Use tmp1x2 Crate
24:39 Reading Assignment
24:55 Conclusion

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Intro to Embedded Rust Part 7: Creating a TMP102 Driver Library and Crate | DigiKey

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Intro to Embedded Rust Part 8: Lifetimes and Lifetime Annotations | DigiKey

Intro to Embedded Rust Part 8: Lifetimes and Lifetime Annotations | DigiKey

Intro to Embedded Rust - Part 1: What is Rust? | DigiKey

Intro to Embedded Rust - Part 1: What is Rust? | DigiKey

Raspberry Pi Pico 2 с поддержкой MQTT в минутах, а не в часах.

Raspberry Pi Pico 2 с поддержкой MQTT в минутах, а не в часах.

Обзор Waveshare Touch 3.49: почему это портативное устройство меня поразило.

Обзор Waveshare Touch 3.49: почему это портативное устройство меня поразило.

Building AI-Powered Applications on Microcontrollers with TensorFlow Lite

Building AI-Powered Applications on Microcontrollers with TensorFlow Lite

Portable Firmware: Cross-MCU Development with Zephyr

Portable Firmware: Cross-MCU Development with Zephyr

Linus Tech Tips Tries Linux (Again), a Guru of Sudo Reacts

Linus Tech Tips Tries Linux (Again), a Guru of Sudo Reacts

Back On Track [Maker Update] | Maker.io

Back On Track [Maker Update] | Maker.io

Intro to Embedded Rust Part 5: Reading from an I2C Temperature Sensor | DigiKey

Intro to Embedded Rust Part 5: Reading from an I2C Temperature Sensor | DigiKey

Детский вопрос поставил Учёных в ТУПИК: Почему всё Вращается?

Детский вопрос поставил Учёных в ТУПИК: Почему всё Вращается?

Plowing Ahead [Maker Update] | Maker.io

Plowing Ahead [Maker Update] | Maker.io

Even if It's Free, Don't Do It.

Even if It's Free, Don't Do It.

Intro to Embedded Rust Part 6: Generics and Traits | DigiKey

Intro to Embedded Rust Part 6: Generics and Traits | DigiKey

Как вредит смартфону беспроводная зарядка? + НОВОСТИ!

Как вредит смартфону беспроводная зарядка? + НОВОСТИ!

How to use an oscilloscope part 2 - The Byte Sized Engineer | DigiKey

How to use an oscilloscope part 2 - The Byte Sized Engineer | DigiKey

«Матрица» приближается

«Матрица» приближается

Every Dev Board Explained in 6 Minutes

Every Dev Board Explained in 6 Minutes

Spool Speed Ahead [Maker Update] | Maker.io

Spool Speed Ahead [Maker Update] | Maker.io

In My Lane, Flourishing [Maker Update] | Maker.io

In My Lane, Flourishing [Maker Update] | Maker.io

Tools of the Trade: The Modern Hardware Toolkit - Engineering Unlocked S1E2 | DigiKey

Tools of the Trade: The Modern Hardware Toolkit - Engineering Unlocked S1E2 | DigiKey

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]