In the previous part of the series, we discussed the FT232H breakout board and how we can use it with Rust to interact with our I2C devices from a desktop environment. In this part, we will explore how we we can use our I2C driver on multiple platforms without changing any of the driver code, thanks to the embedded-hal and embedded-hal-async traits.
The Platforms
The beauty of using the embedded-hal traits is that we can write our driver code once and then use it on multiple platforms without any modifications. This is because the embedded-hal traits provide a common interface for interacting with hardware peripherals, regardless of the underlying platform. This means our vendors are responsible for implementing these traits in their HALs.