[riot-notifications] [RIOT-OS/RIOT] Driver for AT24CXXX EEPROM (#11929)

benpicco notifications at github.com
Tue Jul 30 01:09:48 CEST 2019


benpicco commented on this pull request.



> + */
+enum {
+    AT24CXXX_DEV_ADDR_00    = (0x50),   //A1 = 0, A0 = 0
+    AT24CXXX_DEV_ADDR_01    = (0x51),   //A1 = 0, A0 = 1
+    AT24CXXX_DEV_ADDR_10    = (0x52),   //A1 = 1, A0 = 0
+    AT24CXXX_DEV_ADDR_11    = (0x53)    //A1 = 1, A0 = 1
+};
+
+/**
+ * @brief struct that holds initialization parameters
+ */
+typedef struct at24cxxx_params {
+    i2c_t i2c;                      /**< I2C bus number */
+    uint8_t dev_addr;               /**< I2C device address */
+    gpio_t pin_wp;                  /**< write protect pin */
+    at24cxxx_dev_type_t dev_type;   /**< device type */

Only if it makes sense. We can always add those once it becomes necessary. But let's not make the code needlesly complicated to future proof it for some hypothetical EEPROMs that might not even exist.

If we poll with a delay, we don't need the write cycle delay. I see that 16 bit addresses are a limitation if we want to use EEPROMS > 64kB, but that can be addressed it a separate PR.

-- 
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/11929#discussion_r308474034
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190729/28b7c87f/attachment.htm>


More information about the notifications mailing list