-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20588 from crasbe/master
drivers/at24cxxx: Add M24C01 device and enhance documentation
- Loading branch information
Showing
5 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,12 @@ | |
* @{ | ||
* | ||
* @file | ||
* @brief Constants for AT24CXXX EEPROM devices. | ||
* @brief Constants for various I2C EEPROM devices. | ||
* | ||
* All the devices listed below are accessible as pseudomodules. | ||
* | ||
* @note Even though the library is called "AT24CXXX", the support for | ||
* I2C EEPROMs is not limited to Atmel/Microchip devices. | ||
* | ||
* @author Fabian Hüßler <[email protected]> | ||
*/ | ||
|
@@ -367,6 +372,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 +455,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 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
* @{ | ||
* | ||
* @file | ||
* @brief Default configuration for AT24CXXX | ||
* @brief Default configuration for the AT24CXXX driver | ||
* | ||
* @author Fabian Hüßler <[email protected]> | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters