The Apple Touch Bar Lives a Life Free of Its MacBook Pro Prison, Thanks to Some Reverse Engineering
Apple may have all but abandoned its ultra-ultra-widescreen replacement for function keys, but the Touch Bar is not without its fans.
Engineers Wenting Zhang and Yukidamayaki have taken a piece of Apple's more recent history and made it a display for any device that can talk MIPI Display Serial Interface (DSI): the divisive Apple Touch Bar.
"Recently, my friend Yukidamayaki-san wants to use the [Apple] Touch Bar screen for some DIY projects," Zhang explains of the project's origins in a video brought to our attention by Adafruit. "He asked me to help reverse engineer and drive that long screen. I can't find any information about it online, so I have to do it myself. Apple's screen probably has a custom-made controller, meaning I simply cannot find the datasheet."
First released in 2016 on that year's MacBook Pro refresh, the Apple Touch Bar replaced the traditional function key row above the number keys on the keyboard with an ultra-ultra-wide OLED touchscreen display capable of customizing its functionality according to what application was in focus at any given time. With limited take-up by third-party application developers and complaints about its effect on battery life, Apple removed the Touch Bar and replaced physical keys in the 14- and 16-inch MacBook Pros released in late 2021 β though it remains a feature of the smaller 13" variants to this day.
As a piece of custom Apple hardware, the Touch Bar was never designed to run on anything else β but that wasn't going to stop Zhang. "[I'll be] starting directly from the original MacBook Pro, probing the signals on the [device] to understand how to control the screen," Zhang explains in the video. "One can basically probe on the board to derive the pinout, 'cause there are not many signals to begin with β or cheat a little bit by just looking at the schematics for repairing."
The probing unveiled a pinout with 3.3V and 1.8V power supplies, a seemingly-unused I2C channel, and a single-lane MIPI Display Serial Interface (DSI) connection. "The main task in writing the driver," Zhang adds of the next step in the process, "is to know what needs to be sent over during initialization. The answer to that is hidden in [the] MacBook." With a logic analyzer in-hand, the initial setup β which, handily, takes place in DSI's low-speed mode β was captured and decoded. A little more work had it talking to an NXP i.MX RT1176 microcontroller and displaying images.
"The screen does not support video mode at all," Yukidamayaki adds of the pair's discovery. "It's a command-only display. The initialization sequence does contain some secret, non-standard commands, but the display seems to work just fine without them. The touchscreen [interface] is yet to be done. It's using the same Broadcom multi-touch ASIC [Application Specific Integrated Circuit] found on other Apple products."
Source code for the reverse engineered driver and the hardware developed as part of the project are available on Yukidamayaki's GitLab repository under the MIT license and CERN Open Hardware License 2 - Strongly Reciprocal respectively.