[riot-notifications] [RIOT-OS/RIOT] sys/arduino: extension to Arduino module (#10592)

Sebastian Meiling notifications at github.com
Tue Jan 22 09:57:04 CET 2019


smlng requested changes on this pull request.

some minor stuff, otherwise looks good ... needs testing though

> +
+    /**
+     * @brief   Request bytes from a I2C slave device
+     *
+     * Used by the master to request bytes from a slave device. The bytes may
+     * then be retrieved with the #available and #read methods. Sends always
+     * a STOP condition after the request.
+     *
+     * Copied from https://www.arduino.cc/en/Reference/WireRequestFrom
+     *
+     * @param[in]   addr    7-bit address of the device to request bytes from
+     * @param[in]   size    Number of bytes to request
+     *
+     * @return  number of bytes returned from the slave device
+     */
+	uint8_t requestFrom(uint8_t addr, uint8_t size);

indention

> +	virtual size_t write(uint8_t data);
+
+    /**
+     * @brief   Queue bytes for transmission from a master to slave device
+     *
+     * The method queues bytes for transmission from a master to slave device
+     * in-between calls to #beginTransmission and #endTransmission.
+     *
+     * @param[in]   data    Array of data to send as bytes
+     * @param[in]   size    Number of bytes to transmit
+     *
+     * Copied from https://www.arduino.cc/en/Reference/WireWrite
+     *
+     * @return  number of bytes queued
+     */
+	virtual size_t write(const uint8_t *data, size_t size);

indention, here and below

> +     * @param   stop    Send STOP condition after transmission if true or
+     *                  nothing if false.
+     *
+     * @retval  0   success
+     * @retval  1   data too long to fit in transmit buffer
+     * @retval  2   received NACK on transmit of address
+     * @retval  3   received NACK on transmit of data
+     * @retval  4   other error
+     */
+    uint8_t endTransmission(uint8_t stop);
+
+    /**
+     * @brief   Request bytes from a I2C slave device
+     *
+     * Used by the master to request bytes from a slave device. The bytes may
+     * then be retrieved with the #available and #read methods. Sends always

here (and throughout the documentation): if you want to link to other functions write `<func-name>()`, then doxygen should generate a link - I haven't seen this `#<func-name>` notation before, so I'm unsure if that works.

Also see http://www.doxygen.nl/manual/autolink.html

> +#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+}
+
+#include "Wire.h"
+
+#include "log.h"
+#include "panic.h"
+#include "periph/i2c.h"
+
+#define ENABLE_DEBUG    (0)
+#include "debug.h"
+
+#define WIRE_PORT_OK                    (0)

suggestion: use `enum` here?

-- 
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/10592#pullrequestreview-194869859
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190122/a75ca0ea/attachment.html>


More information about the notifications mailing list