Hardware Reference
In-Depth Information
actually quite rare. But for all intents and purposes, software and firmware are synonym-
ous. Firming up software to enable modification is the same for traditional software as it
is for firmware: It involves software running on hardware or, in this case, open source
hardware.
Software Interfaces
One way to make software more “firm” so as to promote its modification is to use the
concept of software interfaces. Such interfaces define how you talk to a piece of software
without defining how it actually accomplishes this task. This modular technique allows dif-
ferent implementations of the same interface to be swapped out, allowing for much greater
code reuse when only the code “hidden” behind the interface needs to be changed.
Take, for example, a communication interface that defines two methods: send and re-
ceive messages. Imagine that the system designer initially used only two implementations
of this interface: one over USB and another over Bluetooth radio. By decoupling the inter-
face definition from the implementation, the original designer makes it easy to add other
communication channels that can replace these original implementations. This makes it
possible for later developers to add a Twitter module that sends messages as Tweets and
receives messages as Twitter mentions on a particular Twitter account.
When applying this concept to open source hardware, we can go one step further by
using software interfaces to abstract whole classes of hardware and specify how we com-
municate with them. For instance, a system could consist of a button as input and an LED
as output. Imagine we define the hardware interface with modular design as follows: The
button exposes the “pressed” method, which returns whether it is currently being pressed,
and the light exposes the “turn(on/off)” method, which allows the programmer to turn it
on or off. Now imagine that the original hardware design had just a single LED and a
small button that are mounted on a small device. By utilizing interfaces, we would enable
future designers to modify the design to work with a large floor pad (that a user can step
on) and control all the lights in a building instead of a single LED. Applying software in-
terfaces to open source hardware is a powerful way to enable future modifications to the
hardware that the original designers could never foresee.
Search WWH ::




Custom Search