diff options
author | Hanna Mendes Levitin <hanna@anomaly-3.local> | 2010-12-01 03:37:07 -0600 |
---|---|---|
committer | Hanna Mendes Levitin <hanna@anomaly-3.local> | 2010-12-01 03:37:07 -0600 |
commit | 5a7dd1bea32458a4afc038984a903959134b82d3 (patch) | |
tree | 4171e71c34841212585f855a3fbdf8aaf3b9bb4e /source/lang/api/highbyte.rst | |
parent | 8e42d34c8d3c81c037a3acaca553ea8c5e4f25aa (diff) | |
download | librambutan-5a7dd1bea32458a4afc038984a903959134b82d3.tar.gz librambutan-5a7dd1bea32458a4afc038984a903959134b82d3.zip |
docs, now with style
Diffstat (limited to 'source/lang/api/highbyte.rst')
-rw-r--r-- | source/lang/api/highbyte.rst | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/source/lang/api/highbyte.rst b/source/lang/api/highbyte.rst new file mode 100644 index 0000000..50a1fa6 --- /dev/null +++ b/source/lang/api/highbyte.rst @@ -0,0 +1,59 @@ +.. highlight:: cpp + +.. _lang-highbyte: + +highByte() +========== + +(Macro) Extracts the second lowest byte of an integral data type. + +.. warning:: This macro is provided for compatibility with Arduino + only. It returns the second-least significant byte in an integral + value. It makes sense to call this the "high" byte on a 16-bit + ``int`` microcontroller like the Atmel chips on Arduinos, but it + makes no sense at all on a 32-bit microcontroller like the STM32s + in the Maple line. + + In short: we provide this so that existing Arduino code works as + expected, but **strongly discourage its use** in new programs. + +Syntax +------ + +:: + + highByte(x) + +Parameters +---------- + +**x**: a value of any integral type. + +Returns +------- + +Second lowest byte in **x**. + +Example +------- + +:: + + int x = 0xDEADBEEF; + SerialUSB.println(x, HEX); // prints "BE" + +Arduino Compatibility +--------------------- + +The Maple version of ``highByte()`` is compatible with Arduino. + +See Also +-------- + +- :ref:`lowByte() <lang-lowbyte>` + + + + + +.. include:: cc-attribution.txt |