Index of /libsimpleio
Name Last modified Size
Parent Directory 21-Feb-2018 20:17 -
CHANGELOG.txt 16-Nov-2018 09:07 497k
COPYING 16-Aug-2018 13:03 1k
Makefile 20-Aug-2018 09:11 5k
README.txt 07-Nov-2018 10:51 9k
ada/ 05-Oct-2018 08:03 -
c++/ 05-Oct-2018 08:03 -
control 24-Jul-2017 07:51 1k
cplusplus.h 11-Jan-2018 10:20 2k
csharp/ 27-Oct-2018 13:18 -
doc/ 07-Nov-2018 10:51 -
errmsg.c 11-Jan-2018 10:20 2k
errmsg.inc 11-Jan-2018 10:20 1k
java/ 13-Jan-2018 15:02 -
libadc.c 05-Oct-2018 08:03 4k
libadc.h 14-May-2018 14:23 2k
libevent.c 05-Oct-2018 08:03 5k
libevent.h 14-May-2018 14:23 2k
libgpio.c 05-Oct-2018 08:03 19k
libgpio.h 14-May-2018 14:23 3k
libhidraw.c 05-Oct-2018 08:03 4k
libhidraw.h 14-May-2018 14:23 2k
libi2c.c 11-Jan-2018 10:20 4k
libi2c.h 22-Sep-2018 14:24 2k
libipv4.c 05-Oct-2018 08:03 11k
libipv4.h 27-Jun-2018 18:16 3k
liblinux.c 07-Nov-2018 12:47 12k
liblinux.h 07-Nov-2018 10:51 4k
liblinx.c 11-Jan-2018 10:20 7k
liblinx.h 14-May-2018 14:23 6k
libpwm.c 05-Oct-2018 08:03 9k
libpwm.h 14-May-2018 14:23 2k
libserial.c 08-Nov-2018 07:53 5k
libserial.h 14-May-2018 14:23 2k
libspi.c 05-Oct-2018 08:03 6k
libspi.h 14-May-2018 14:23 2k
libstream.c 10-Nov-2018 10:01 8k
libstream.h 10-Nov-2018 10:01 2k
libwatchdog.c 11-Jan-2018 10:20 3k
libwatchdog.h 22-Sep-2018 14:24 2k
modula2/ 05-Oct-2018 08:03 -
pascal/ 05-Oct-2018 08:03 -
tests/ 07-Nov-2018 10:51 -
udev/ 14-May-2018 14:23 -
win/ 12-Nov-2018 08:58 -
Linux Simple I/O Library
libsimpleio is an attempt to encapsulate (as much as possible) the
ugliness of Linux I/O device access. It provides services for the following
types of I/O devices:
I/O Subsystem A/D (Analog to Digital) Converter Devices
- GPIO (General Purpose Input/Output) Pins
- Raw HID (Human Interface Device) Devices
- I2C (Inter-Integrated Circuit) Bus Devices
LINX Remote I/O Devices
- PWM (Pulse Width Modulated) Output Devices
- Serial Ports
- SPI (Serial Peripheral Interface) Bus Devices
- Stream Framing
- TCP and UDP over IPv4 Network Devices
- Watchdog Timer Devices
Although libsimpleio was originally intended for Linux microcomputers
such as the Raspberry Pi, it can also be useful on larger desktop Linux
The wrapper functions exported by libsimpleio all follow the same
- All wrapper functions are proper procedures (void f() in C).
- All input arguments of primitive types (int, float, etc.)
are passed by value.
- All output arguments of primitive types are passed by reference (int
*, float *, etc.).
- All composite types are passed by reference.
- int32_t is used wherever possible for int and
All of the wrapper functions are declared between _BEGIN_STD_C and
_END_STD_C for C++. Binding modules are provided for Ada, C#, Java, and Free Pascal.
Source code files for Ada, C++, C#, Java, and Free Pascal that define OOP
(Object Oriented Programming) classes for libsimpleio are also provided.
Since libsimpleio is intended for general utility, as a matter of policy
these classes will provide interface and device services, but not any platform
- 15 November 2017 -- Started writing libsimpleio unit tests. Added
many, many parameter checks to the functions in libsimpleio. Fixed a
number of errors in the man pages.
- 16 November 2017 -- Released C# bindings for libsimpleio.
- 6 December 2017 -- Added functions STREAM_change_readfn() and
STREAM_change_writefn() to replace read() and write
inside libstream. This is probably most useful with LWIP on microcontrollers.
- 3 January 2018 -- Imported C++, C#, and Free Pascal interfaces and objects.
Imported the .Net assembly libsimplio.dll.
- 12 January 2018 -- Imported Ada and Java interfaces and objects.
- 17 January 2018 -- Extensively reworked the C++ interfaces and
- 26 February 2018 -- Added LINUX_poll(), which wraps
- 12 March 2018 -- Reworked GPIO and PWM routines and udev
- 6 April 2018 -- Imported a project to build libremoteio.dll, an
implementation of the Remote I/O
Protocol that is portable across Linux, MacOS, and Windows.
- 12 May 2018 -- Switched from the deprecated GPIO sysfs API to the
new GPIO descriptor API.
- 14 May 2018 -- Install include files to
- 16 June 2018 -- Added LINUX_usleep().
- 18 June 2018 -- Minor fixes and consistency cleanups.
- 27 June 2018 -- Added UDP over IPv4 services.
- 28 June 2018 -- Imported initial support for GNU Modula-2. This is not
complete, and what is done is still pretty rough.
- 11 July 2018 -- Imported many test programs from MuntsOS Embedded Linux.
- 8 August 2018 -- The .Net assembly libraries libsimpleio.dll and
libremoteio.dll have now been published to NuGet..
- 16 August 2018 -- Rebuilt the C# library .dll files to target .Net
Framework 4.6.1. Cleaned up the C# library .dll and package metadata.
Added experimental .Net
Standard library builders for libsimpleio and
libremoteio. The published libraries will remain .Net Framework 4.6.1
for now, as there are still some issues using .Net Standard libraries with
Mono. Also performed some general file reorganization and house cleaning.
- 18 August 2018 -- Rebuilt the C# library .dll files to target .Net
Framework 4.7.1. Added support for the ADC121C021 A/D converter chip, which
is used in the Grove
I2C A/D Converter module. Fixed a few issues in the
I2C stack. Performed yet more file reorganization and house
cleaning. Made C# .dll and package metadata more clear about what is
- 22 August 2018 -- Fixed various issues with cross-compiling the example
programs. Added more test programs for the PCA8574 I2C GPIO
- 26 August 2018 -- Added support for the PCA9685 I2C PWM
controller to the .Net libraries.
- 3 September 2018 -- Added support for the Raspberry Pi LPC1114 I/O
Processor Expansion Board to the C# libraries. Added a delay parameter to
the I2C transaction methods for Ada, C++, C#, and Free Pascal. The
Procotol has also been updated in add a delay parameter to the
I2C transaction request message.
- 23 September 2018 -- Modified libremoteio to use HidSharp 2.0.2. Added an
optional USB serial device serial number parameter to the constructor for the
libremoteio Messenger class. Added more C# test programs.
- 3 October 2018 -- More progress on the Free Pascal units and programs.
- 26 October 2018 -- Reworked the C++ library functions to throw
std::runtime_error via wrapper macros that capture locality
information instead of just an integer. Added many more device drivers. Ada
still has the most comprehensive set of device drivers, but C++, C#, and Free
Pascal all have new ones, too.
- 1 November 2018 -- Extensively refactored the Ada code tree.
- 7 November 2018 -- Added LINUX_command(), which passes a command
string to system() for execution. Continued working on the Ada Remote
The user manual for libsimpleio
is available at: http://git.munts.com/libsimpleio/doc/UserManual.pdf
The man pages specifying the libsimpleio API are available at:
The source code is available at: http://git.munts.com
Use the following command to clone it:
git clone http://git.munts.com/libsimpleio.git
Original works herein are copyrighted as follows:
Copyright (C)2016-2018, Philip Munts, President, Munts AM Corp.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Redistributed works herein are copyrighted and/or licensed by their
Questions or comments to Philip Munts firstname.lastname@example.org
I am available for custom system development (hardware and software) of
products using ARM Linux or other microcomputers.