[riot-notifications] [RIOT-OS/RIOT] [WIP, RFC] drivers/eeprom: Common API to access EEPROM memory (#12091)

Marian Buschsieweke notifications at github.com
Tue Sep 10 09:37:22 CEST 2019


maribu commented on this pull request.



> +     */
+    int (*erase)(void *handle);
+    /**
+     * @brief   The EEPROM is filled with this byte after being erased
+     */
+    uint8_t clear_byte;
+} eeprom_driver_t;
+
+/**
+ * @brief   The current state of an EEPROM device
+ */
+typedef struct {
+    const eeprom_driver_t *driver;  /**< The driver of the EEPROM device */
+    const void *params;             /**< The initialization parameters */
+    void *handle;                   /**< The handle to pass to the driver */
+} eeprom_dev_t;

@aabadie: I think if we drop the `params` in the init callback, it will no longer be possible to add multiple external EEPROM devices that are using the same driver, without some dark magic. Assume the init function of an external driver is only called with the device handle to initialize. With what parameters should it initialize that device handle?

If there is only one device of that kind, it is clear. But RIOT policy is to allow multiple devices of a kind. I don't see how this could work.

-- 
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/12091#pullrequestreview-285957074
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190910/924983ac/attachment-0001.htm>


More information about the notifications mailing list