1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/same54-xpro: expose at24mac as MTD_1

This commit is contained in:
Benjamin Valentin 2021-01-24 00:26:12 +01:00
parent 69f7baa478
commit 57f40e5afb
3 changed files with 18 additions and 3 deletions

View File

@ -9,6 +9,7 @@ endif
ifneq (,$(filter mtd,$(USEMODULE)))
FEATURES_REQUIRED += periph_spi_on_qspi
USEMODULE += mtd_spi_nor
USEMODULE += mtd_at24cxxx at24mac
endif
# enables sam0_eth as default network device

View File

@ -49,8 +49,19 @@ static mtd_spi_nor_t same54_nor_dev = {
},
.params = &_same54_nor_params,
};
mtd_dev_t *mtd0 = (mtd_dev_t *)&same54_nor_dev;
#include "mtd_at24cxxx.h"
#include "at24cxxx_params.h"
static at24cxxx_t at24cxxx_dev;
static mtd_at24cxxx_t at24mac_dev = {
.base = {
.driver = &mtd_at24cxxx_driver,
},
.at24cxxx_eeprom = &at24cxxx_dev,
.params = at24cxxx_params,
};
mtd_dev_t *mtd1 = (mtd_dev_t *)&at24mac_dev;
#endif /* MODULE_MTD */
void board_init(void)

View File

@ -34,6 +34,7 @@ extern "C" {
#define AT24MAC_PARAM_I2C_DEV I2C_DEV(1)
#define AT24MAC_PARAM_I2C_ADDR (0x5E)
#define AT24MAC_PARAM_TYPE AT24MAC4XX
#define AT24CXXX_PARAM_I2C I2C_DEV(1)
#define AT24CXXX_PARAM_ADDR (0x56)
/** @} */
@ -71,8 +72,10 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
extern mtd_dev_t *mtd0, *mtd1;
#define MTD_0 mtd0
#define MTD_1 mtd1
#define MTD_NUMOF 2
/** @} */
/**