diff --git a/drivers/Makefile.dep b/drivers/Makefile.dep index f86459b0c2..5f2f4d832a 100644 --- a/drivers/Makefile.dep +++ b/drivers/Makefile.dep @@ -104,6 +104,10 @@ ifneq (,$(filter ltc4150_%,$(USEMODULE))) USEMODULE += ltc4150 endif +ifneq (,$(filter m24c%,$(USEMODULE))) + USEMODULE += at24cxxx +endif + ifneq (,$(filter mhz19_%,$(USEMODULE))) USEMODULE += mhz19 endif diff --git a/drivers/at24cxxx/Makefile.include b/drivers/at24cxxx/Makefile.include index 62ff78b0cc..e27fb5808f 100644 --- a/drivers/at24cxxx/Makefile.include +++ b/drivers/at24cxxx/Makefile.include @@ -1,5 +1,7 @@ PSEUDOMODULES += at24c% PSEUDOMODULES += mtd_at24cxxx +PSEUDOMODULES += m24c% + # handle at24cxxx being a distinct module NO_PSEUDOMODULES += at24cxxx diff --git a/drivers/at24cxxx/include/at24cxxx_defines.h b/drivers/at24cxxx/include/at24cxxx_defines.h index 9837ad6c50..a567fd71f9 100644 --- a/drivers/at24cxxx/include/at24cxxx_defines.h +++ b/drivers/at24cxxx/include/at24cxxx_defines.h @@ -367,6 +367,29 @@ extern "C" { / AT24CXXX_POLL_DELAY_US)) /** @} */ +/** + * @name M24C01 constants + * @{ + */ +/** + * @brief 128 byte memory + */ +#define M24C01_EEPROM_SIZE (128U) +/** + * @brief 16 pages of 16 bytes each + */ +#define M24C01_PAGE_SIZE (16U) +/** + * @brief Delay to complete write operation + */ +#define M24C01_PAGE_WRITE_DELAY_US (5000U) +/** + * @brief Number of poll attempts + */ +#define M24C01_MAX_POLLS (1 + (M24C01_PAGE_WRITE_DELAY_US \ + / AT24CXXX_POLL_DELAY_US)) +/** @} */ + /** * @name Set constants depending on module * @{ @@ -427,6 +450,10 @@ extern "C" { #define AT24CXXX_EEPROM_SIZE (AT24MAC_EEPROM_SIZE) #define AT24CXXX_PAGE_SIZE (AT24MAC_PAGE_SIZE) #define AT24CXXX_MAX_POLLS (AT24MAC_MAX_POLLS) +#elif IS_USED(MODULE_M24C01) +#define AT24CXXX_EEPROM_SIZE (M24C01_EEPROM_SIZE) +#define AT24CXXX_PAGE_SIZE (M24C01_PAGE_SIZE) +#define AT24CXXX_MAX_POLLS (M24C01_MAX_POLLS) #else /* minimal */ #define AT24CXXX_EEPROM_SIZE (128U) /**< EEPROM size */ #define AT24CXXX_PAGE_SIZE (4U) /**< page size */