|
|
|
@ -24,11 +24,13 @@
|
|
|
|
|
#include "cpu.h"
|
|
|
|
|
#include "mcg.h"
|
|
|
|
|
#include "periph/gpio.h"
|
|
|
|
|
#include "periph/uart.h"
|
|
|
|
|
#include "periph/rtt.h"
|
|
|
|
|
#include "periph/spi.h"
|
|
|
|
|
#include "nvram-spi.h"
|
|
|
|
|
#include "nvram.h"
|
|
|
|
|
#include "xtimer.h"
|
|
|
|
|
#include "vfs.h"
|
|
|
|
|
#include "fs/devfs.h"
|
|
|
|
|
|
|
|
|
|
static nvram_t mulle_nvram_dev;
|
|
|
|
|
nvram_t *mulle_nvram = &mulle_nvram_dev;
|
|
|
|
@ -39,6 +41,12 @@ static nvram_spi_params_t nvram_spi_params = {
|
|
|
|
|
.address_count = MULLE_NVRAM_SPI_ADDRESS_COUNT,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static devfs_t mulle_nvram_devfs = {
|
|
|
|
|
.path = "/mulle-fram",
|
|
|
|
|
.f_op = &nvram_vfs_ops,
|
|
|
|
|
.private_data = &mulle_nvram_dev,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** @brief Initialize the GPIO pins controlling the power switches. */
|
|
|
|
|
static inline void power_pins_init(void);
|
|
|
|
|
|
|
|
|
@ -210,6 +218,10 @@ static int mulle_nvram_init(void)
|
|
|
|
|
return -5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Register DevFS node */
|
|
|
|
|
devfs_register(&mulle_nvram_devfs);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|