1 libmraa - Low Level Skeleton Library for Communication on GNU/Linux platforms
4 Libmraa is a C/C++ library with bindings to javascript & python to interface
5 with the IO on Galileo, Edison & other platforms, with a structured and sane
6 API where port names/numbering matches the board that you are on. Use of
7 libmraa does not tie you to specific hardware with board detection done at
8 runtime you can create portable code that will work across the supported
11 The intent is to make it easier for developers and sensor manufacturers to map
12 their sensors & actuators on top of supported hardware and to allow control of
13 low level communication protocol by high level languages & constructs.
17 These interfaces allow you to interact with all libmraa functionality. The C++
18 classes directly wrap the C API and provide a near 1:1 mapping of
22 | C API Modules | C++ API Classes |
23 |:----------------------:|:----------------------------:|
24 | @ref gpio.h "gpio" | @ref mraa::Gpio "Gpio class" |
25 | @ref i2c.h "i2c" | @ref mraa::I2c "I2c class" |
26 | @ref aio.h "aio" | @ref mraa::Aio "Aio class" |
27 | @ref pwm.h "pwm" | @ref mraa::Pwm "Pwm class" |
28 | @ref spi.h "spi" | @ref mraa::Spi "Spi class" |
29 | @ref uart.h "uart" | @ref mraa::Uart "Uart class" |
30 | @ref common.h "common" | @ref mraa "common" |
34 @snippet hellomraa.c Interesting
36 ## Supported platforms
38 Specific platform information for supported platforms is documented here:
52 Sometimes it just doesn't want to work, let us try and help you, you can file
53 issues in github or join us in #mraa on freenode IRC, hang around for a little
54 while because we're not necessarily on 24/7, but we'll get back to you! Have a
55 glance at our @debugging page too
59 More information on compiling is @ref building page.
63 Please see the @ref contributing page, the @ref internals page may also be of
68 This changelog is meant as a quick & rough guide to what has changed between
69 versions. The API is now fairly stable but when new calls/features are added
70 they are listed here. Anything pre 0.2.x is ignored.
73 * 5th Generation NUC i2c support
79 * Uart initialisation improved
80 * Better i2c bus detection on DE3815 & mmax
83 * DE3815 i2c fix when using different kernels
84 * Fixed various memory leaks in SWIG wrappers
85 * gpio enums all prefixed with mraa_
86 * Fix SPI CS pin caps causing mux_total to be > 0
87 * Improved error checking/handling
90 * Fix node.js npm builds with binding.gyp that didn't use --target-arch
93 * Uart now uses binary arrays and has optional 'Str' functions in C++/SWIG
94 * Various Uart module bugfixes
95 * Node.js 0.12.4 support
96 * Node.js documentation support
99 * Uart module now contains read/write interactions and configuration
100 * Python API contains more buffer checks
105 * Node.js 0.12 support
107 * Formatting done with clang-format
108 * Various examples and documentation updates
109 * Supported added for Beaglebone Black + Banana Pi
112 * 16bit spi iunctions added
113 * Node.js ISR now supported
116 * add device path queries for uart
117 * add platform configuration querying
119 * improve i2c/spi write/read API for python & nodejs
120 * performance improvements on edison & galileo
123 * pwm read_* fix introduced in 0.5.3
124 * improved npmpkg support
127 * OE toolchain support added to CMake
129 * SPI add CS exposure
130 * Remove functions from mraa.c into modules
131 * Rework of support for mmap
132 * Intel Edison MMAP support added. Read and Write
133 * I2C clean up, add cleaner functions
134 * MinnowBoard Max support added
135 * PWM period is written before duty
136 * Node GYP build supported added
137 * Add Get Platform Name function
140 * pwm improvement & bugfix
141 * spi mraa_spi_bit_per_word fix
142 * new spi transfer function
143 * i2c object api uses uint8_t
144 * i2c readReg() calls added
145 * edison i2c bus now defaults to a sensible value
146 * edison uart enable support
147 * edison hardware CS exposed as IO10
148 * DE3815tykhe NUC support
151 * Intel Edison - Mini breakout board support
152 * Change to use syslog throughout instead of printing to stderr.
153 * Fix misc issues brought up throuh coverity scans
154 * Clear up Analog call documentation
157 * Intel Edison - Arduino board support.
158 * Boost Allowable i2c busses to 12
159 * Additional platform hooks added
160 * ADC is now 10bits by default on all platforms but can be changed
163 * if only one spidev we default to it reguardless of number
164 * mraa_pwm_config_ms & mraa_pwm_config_percent functions added
165 * Uart C++ class added, adds python & node support
166 * galileo gen2 gpio modes supported
169 * prefix SPI mode with MRAA_SPI_
170 * added C++ adc bitness calls
173 * SPI Mode function now functional, API Change in SPI
174 * I2C read in swig worked on.
175 * Galileo Gen 2: PWM setting period sets all channel's period
176 * Galileo Gen 2: I2C setup now specific to Gen 2.
177 * General commits around freeing memory at the right times.
180 * Barebone UART module added.
181 * Hook branch merged.
182 * I2C init hooks added.
183 * Intel Galileo Gen 2, I2C gpio pins now go hiz input when I2C initialised.
186 * Rename python & nodejs modules to mraa
187 * common.hpp introduced for C++
188 * python & nodejs modules can now take binary strings for Spi & I2c
189 * improved Aio module and clear bitness
190 * Improved Galileo Gen 2 support
194 * get_platform_type function added.
197 * Initial Intel Galileo Gen 2 support
198 * mraa_gpio_isr parameters added.
199 * Detection of different supported platforms added.
202 * mraa_i2c_read now returns length of read
205 * Add global mraa.h & mraa.hpp headers
206 * usage of "gpio.h" is not legal you need to use "mraa/gpio.h" unless adding
210 * Added mraa_set_priority call
211 * Added mmap gpio call mraa_gpio_use_mmaped
214 * C++ API now uses basic types and not unistd types as C
215 * Clearer and consistent use of unistd tpyes in C api
218 * C++ examples added, using c++ headers/api.
219 * moved to open instead of fopen in all modules
220 * rename mraa_check functions and made them internal to mraa only.
221 * removed "export" functions from api
222 * Intel Galileo Gen 1 (rev d) fixes, incorrect definition of some items
223 * SPI, implementation completed.
224 * I2C internal function, completed.
225 * PWM fix bug in period set method.
226 * Swig upstream can be used for building.
227 * No longer builds docs on default cmake, needs flag
228 * GPIO/PWM ownership guard prevents closing on existing pins, still can be forced.
231 * C++/Python/Node Enums/const names now do not contain MRAA_GPIO
232 * Enum type declaration for C++ changed
233 * Python/Node get_version() -> GetVersion()
234 * i2c read calls don't use const char* and i2c write calls do
237 * All mraa_ contexts now are pointers to the actual struct which is not
238 delcared in the header. The only end user change is that instead of
239 returning a type mraa_gpio_context pointer mraa_gpio_init() now returns a
240 mraa_gpio_context (which is actually a pointer to struct _gpio internally).
241 * C++ API is available, use the .hpp headers and add stdc++ to the linker
243 * Initial SPI implementation is provided
246 * mraa_aio_read_u16() -> mraa_aio_read()
247 * mraa_aio_read() now returns a uint16_t instead of an unsigned int
250 * First version with API considered 'stable'