A lesson from the mbed

Yesterday in a short post about I2C  I published a fragment of code for the mbed.

I wondered at the time why I was posting here rather than on the very helpful mbed site.

Here's why.

Take a look at the code, and think about the library it's using.

The mbed I2C library is about as simple as you could wish for, but it does everything you need. You can even specify the I2C data rate at run time.

On other platforms that small change is a big deal; Arduino requires you to recompile the Wire library, and the BeagleBone requires you to recompile  the kernel.

The mbed library for SPI is just as good as its I2C library: simple, intuitive and complete.

That's what we need on the BeagleBone and Raspberry Pi.

We've been waiting for userland SPI support on the BeagleBone for a while, and we seem to be getting a mixed message from the kernel developers:

  1. It's really hard to do SPI right, and it will take a while
  2. It's done already; all you have to do is find half-a-dozen emails scattered round various user groups, merge the information, patch the correct kernel version, recompile the kernel, flash a card, and repeat whenever there's a kernel update :(
That's not what we want. We want userland configuration that's as easy as it is on the mbed, and we need clever people to do it and push their work upstream.

There is some hope. Yesterday,  @waxpraxis tweeted that he'd added userland SPI to a custom kernel for the Beaglebone, and he plans to write up and release his patch. Now we just need that (and I2C support) for the Raspberry Pi!

And a Pi to run it on, of course.

Update: @waxpraxis has posted/uploaded his BeagleBone SPI-enabled image, and is working on the documentation. Thanks!


Popular posts from this blog

Controlling a Raspberry Pi Pico remotely using PySerial

Five steps to connect Jetson Nano and Arduino

Raspberry Pi Pico project 2 - MCP3008