LARD is an open-source hardware abstraction layer that implements the Arduino core library functions for LPC processors.
(Actually it's just for the the LPC1227 at present, but I may expand it later)
LARD is an "Arduino-like" abstraction layer, it is primarily designed to ease the task of performing common coding functions on the LPC1227 and to create a familiar environment for Arduino programmers and an easy migration path to the LPC1227 for existing Arduino code.
LARD is not Arduino and there are differences in the code and certainly the tool chain but to give you an example here is a version of the Arduino "blink without delay" program.
Note that there are many similarities with the setup() and loop() functions used as per normal. In this case though the builtin software timers with callback functions have been used to generate the "delays".
C or C++
NOTE: LPCXpresso free version now allows C++ so LARD will be converted when I get time (I have made a start). That will make it almost 100% Arduino compatible.
At present LARD is pure C, why is this?
In the LPC Xpresso environment the free version of the IDE/compiler has a limit of 128k program size which is no big deal in itself but it is also only a C compiler.
If you buy the next version you get 256k of program size and C++ but it costs $256 and at present I don't really want to spend the money. Anyway that raises the cost of entry to using LPCs considerably. As it stands you can start using the Xpresso boards for about €20 so the extra $256 is a huge increase.
This is a bit unfortunate because of a lot of this code would benefit from the data hiding and encapsulation that C++ makes easy.
That said I am trying to incorporate such object-orientated concepts so the end result should be similar.
So for the time being C++ library functions like Serial.begin() have become SerialBegin()
All electronics information and designs on this site is released
under the Creative Commons CC BY-SA and/or Open Hardware licences.
Copyright © 1973-2013 Rob Gray, All rights reserved.