drivers/mtd/at25ee: Multi-device SPI bus support

Adds a device ID to at25ee_initialize, which is stored in the
at25ee_dev_s structure. This ID is used when calling SPI_SELECT.

The implementation is based on the handling of the chip select in
mtd/ramtron.c

This change is NOT backward compatible: the function signature has changed

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
This commit is contained in:
Antoine Juckler
2025-11-18 09:37:07 -03:00
committed by Alan C. Assis
parent 34febea2df
commit 81550800d4
2 changed files with 18 additions and 12 deletions
+4 -2
View File
@@ -418,7 +418,7 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev);
#endif
/****************************************************************************
* Name: at25xx_initialize
* Name: at25ee_initialize
*
* Description:
* Create an initialized MTD device instance for an AT25 SPI EEPROM
@@ -428,6 +428,7 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev);
*
* Input Parameters:
* dev - a reference to the spi device structure
* spi_devid - SPI device ID to manage CS lines in board
* devtype - device type, from include/nuttx/eeprom/spi_xx25xx.h
* readonly - sets block driver to be readonly
*
@@ -437,7 +438,8 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev);
****************************************************************************/
FAR struct mtd_dev_s *at25ee_initialize(FAR struct spi_dev_s *dev,
int devtype, int readonly);
uint16_t spi_devid, int devtype,
int readonly);
/****************************************************************************
* Name: at24c_uninitialize