[riot-notifications] [RIOT-OS/RIOT] sys/arduino: Added SPI interface (#12118)

Marian Buschsieweke notifications at github.com
Mon Sep 9 09:51:57 CEST 2019


maribu commented on this pull request.



> +     * @brief   Transfer a single byte of data
+     * @param[in]   data        Byte to send
+     * @return  The received byte
+     */
+    uint8_t transfer(uint8_t data) {
+        transfer(&data, sizeof(data));
+        return data;
+    }
+
+    /**
+     * @brief   Transfer two bytes of data
+     * @param[in]       data        The two bytes to send
+     * @return  The received two bytes
+     */
+    uint16_t transfer16(uint16_t data) {
+        transfer(&data, sizeof(data));

Arduino is sending the most significant byte first, if the most significant bit is first send over the wire: https://github.com/arduino/ArduinoCore-megaavr/blob/7df9f211927b902a67ed322734a32ebfe89dd34b/libraries/SPI/src/SPI.cpp#L245-L254

I do not understand why this is tied together, as these are completely unrelated things... But anyhow, I will just follow suit for compatibility.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12118#discussion_r322104973
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190909/4db184e7/attachment.htm>


More information about the notifications mailing list