This page briefly summarizes the Arduino libraries that have been ported to Maple. You can use a library from within a sketch by going to Sketch > Import Library... from within the IDE, then choosing the library you want.
Any incompatibilities between the Maple and Arduino versions are noted in the description of the library.
The LiquidCrystal library allows Maple to control LCD screens. For more information, see the Arduino LiquidCrystal documentation.
At this time, no incompatibilities between the Maple and Arduino versions are known. Any observed differences should be considered bugs, and reported on the forums.
We provide a soft (bit-banged) implementation of the Wire I2C library.
This implementation is synchronous, and thus supports only a subset of the full Wire interface (however, the functionality which is supported is fully compatible with Arduino). For now, please use the function reference which follows when developing projects using our implementation.
Please note that the current implementation only supports master mode using a bit-banged (software) protocol. Future enhancements will use the hardware i2c peripheral on the stm32 as well as the DMA for performance. Support for slave, smBUS, and multimaster modes are also slated for inclusion in the enhanced Wire port.
Wire.begin()
Wire.begin(sda, scl)
Wire.begin()
, but with the given pins as SDA
and SCL.
Wire.beginTransmission(slave_address)
Wire.send
) will be sent
to slave_address
when Wire.endTransmission
is called.Wire.send(byte)
int
or uint8
)
to the slave address previously specified by a call
to Wire.beginTransmission
. At most 32 bytes may be
queued in a single transmission.Wire.send(string)
char*
) for transmission.
The characters of the string are individually queued for
transmission as bytes. At most 32 bytes may be queued in a single
transmission.Wire.send(buffer, length)
buffer
(int*
or uint8*
), of length length
, for
transmission. At most 32 bytes may be queued in a single
transmission.Wire.endTransmission()
Wire.beginTransmission
), and actually sends the
bytes queued by calls to Wire.send
.
The return value is one of the following status codes:
SUCCESS
: All bytes were transmitted
successfullyEDATA
: More than 32 bytes were queued for
transmission. No bytes are actually sent when this
happens.ENACKADDR
: Did not receive ACK on transmit of
address. No bytes are actually sent when this happens.ENACKTRNS
: Did not receive ACK during
transmit of data. Some bytes may have been sent when this
happens; however, the transmission is aborted after the first
byte of data which is not ACKed by the slave device.EOTHER
: Other error occurred.Wire.requestFrom(address, num_bytes)
num_bytes
bytes from 7-bit slave
address address
. Returns the actual number of bytes
read. These bytes may subsequently be read one at a time
using Wire.receive()
.
Note: if num_bytes
exceeds the size of the
transmit/receive buffer (currently 32), it will be truncated to
32.
Wire.receive()
Wire.requestFrom
. You can check how many bytes are
left to read using Wire.available()
.
Wire.available()
Wire.requestFrom
.