[{"element_type":"markdown","content":"\u003cp\u003eI wanted to share my experience experimenting with Rust on the Adafruit RP2040 Feather ThinkInk board, specifically using a bare E-Paper display.\u003c/p\u003e\n\n\u003ch2\u003eHardware:\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003eAdafruit RP2040 Feather ThinkInk (\u003ca href=\"https://www.adafruit.com/product/5727\"\u003ehttps://www.adafruit.com/product/5727\u003c/a\u003e)\u003c/li\u003e\n\u003cli\u003eBare EPD display (JD79661 chipset): {\u003ca href=\"https://www.adafruit.com/product/6373\"\u003ehttps://www.adafruit.com/product/6373\u003c/a\u003e)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eBackground\u003c/h2\u003e\n\n\u003cp\u003eI went through all the official tutorials for the ThinkInk Feather:\n\u003ca href=\"https://learn.adafruit.com/adafruit-rp2040-feather-thinkink\"\u003ehttps://learn.adafruit.com/adafruit-rp2040-feather-thinkink\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe provided examples are excellent, but they currently focus on CircuitPython and Arduino. Adafruit already provides solid drivers for the JD79661 chipset, and the display is also well supported in the Arduino ecosystem via the GxEPD2 library:\n\u003ca href=\"https://github.com/ZinggJM/GxEPD2\"\u003ehttps://github.com/ZinggJM/GxEPD2\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis made me curious: can I do the same thing in Rust?\u003c/p\u003e\n\n\u003ch2\u003eRust on RP2040\u003c/h2\u003e\n\n\u003cp\u003eThe RP2040 has very good Rust support thanks to the rp-rs ecosystem. A great starting point is the RP2040 project template:\n\u003ca href=\"https://github.com/rp-rs/rp2040-project-template\"\u003ehttps://github.com/rp-rs/rp2040-project-template\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThere is also an existing HAL board definition for the Adafruit Feather RP2040 here:\n\u003ca href=\"https://github.com/rp-rs/rp-hal-boards/tree/main/boards/adafruit-feather-rp2040\"\u003ehttps://github.com/rp-rs/rp-hal-boards/tree/main/boards/adafruit-feather-rp2040\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhile it’s not an exact match for the ThinkInk Feather, it’s close enough to serve as a solid base, with only minor adjustments needed.\u003c/p\u003e\n\n\u003ch2\u003eDriver work\u003c/h2\u003e\n\n\u003cp\u003eAt the moment, there is no native Rust driver for the JD79661 E-Paper controller. To move forward, I implemented a custom Rust driver, based directly on the source code from Adafruit’s CircuitPython and Arduino implementations.\u003c/p\u003e\n\n\u003cp\u003eOnce the low-level driver was in place, everything integrated nicely with the Embedded Graphics framework. Rendering text and images worked as expected.\u003c/p\u003e\n\n\u003cp\u003eAs a proof of concept, I was able to:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eConvert a JPG image to BMP\u003c/li\u003e\n\u003cli\u003eRender and display it correctly on the E-Paper display\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eResults \u0026amp; Code\u003c/h2\u003e\n\n\u003cp\u003eAll of my experiments and findings are documented here:\n\u003ca href=\"https://github.com/melastmohican/adafruit-feather-thinkink-discovery\"\u003ehttps://github.com/melastmohican/adafruit-feather-thinkink-discovery\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe repository includes:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eProject setup for Rust on the ThinkInk Feather\u003c/li\u003e\n\u003cli\u003eA custom JD79661 driver\u003c/li\u003e\n\u003cli\u003eExamples using Embedded Graphics\u003c/li\u003e\n\u003cli\u003eNotes on differences between the standard Feather RP2040 and the ThinkInk variant\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eClosing thoughts\u003c/h2\u003e\n\n\u003cp\u003eOverall, Rust works very well on the RP2040, and bringing up an E-Paper display was quite feasible even without an existing driver. Hopefully this helps others who want to explore Rust + E-Paper + Adafruit hardware.\u003c/p\u003e\n","metadata":{"markdown":"I wanted to share my experience experimenting with Rust on the Adafruit RP2040 Feather ThinkInk board, specifically using a bare E-Paper display.\n\n## Hardware:\n\n* Adafruit RP2040 Feather ThinkInk (https://www.adafruit.com/product/5727)\n* Bare EPD display (JD79661 chipset): {https://www.adafruit.com/product/6373)\n\n## Background\n\nI went through all the official tutorials for the ThinkInk Feather:\nhttps://learn.adafruit.com/adafruit-rp2040-feather-thinkink\n\nThe provided examples are excellent, but they currently focus on CircuitPython and Arduino. Adafruit already provides solid drivers for the JD79661 chipset, and the display is also well supported in the Arduino ecosystem via the GxEPD2 library:\nhttps://github.com/ZinggJM/GxEPD2\n\nThis made me curious: can I do the same thing in Rust?\n\n## Rust on RP2040\n\nThe RP2040 has very good Rust support thanks to the rp-rs ecosystem. A great starting point is the RP2040 project template:\nhttps://github.com/rp-rs/rp2040-project-template\n\nThere is also an existing HAL board definition for the Adafruit Feather RP2040 here:\nhttps://github.com/rp-rs/rp-hal-boards/tree/main/boards/adafruit-feather-rp2040\n\nWhile it’s not an exact match for the ThinkInk Feather, it’s close enough to serve as a solid base, with only minor adjustments needed.\n\n## Driver work\n\nAt the moment, there is no native Rust driver for the JD79661 E-Paper controller. To move forward, I implemented a custom Rust driver, based directly on the source code from Adafruit’s CircuitPython and Arduino implementations.\n\nOnce the low-level driver was in place, everything integrated nicely with the Embedded Graphics framework. Rendering text and images worked as expected.\n\nAs a proof of concept, I was able to:\n\n* Convert a JPG image to BMP\n* Render and display it correctly on the E-Paper display\n\n## Results \u0026amp; Code\n\nAll of my experiments and findings are documented here:\nhttps://github.com/melastmohican/adafruit-feather-thinkink-discovery\n\nThe repository includes:\n\n* Project setup for Rust on the ThinkInk Feather\n* A custom JD79661 driver\n* Examples using Embedded Graphics\n* Notes on differences between the standard Feather RP2040 and the ThinkInk variant\n\n## Closing thoughts\n\nOverall, Rust works very well on the RP2040, and bringing up an E-Paper display was quite feasible even without an existing driver. Hopefully this helps others who want to explore Rust + E-Paper + Adafruit hardware."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/104/original/thinkink_jd79661.jpg?1766363580","metadata":{}}]