mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
boards/mulle: Add FRAM to DevFS
This commit is contained in:
parent
e021b3b3f1
commit
8f81121f29
@ -6,12 +6,10 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
USEMODULE += lis3dh
|
||||
endif
|
||||
|
||||
# The RTT clock drives the core clock in the default configuration
|
||||
FEATURES_REQUIRED += periph_rtt
|
||||
|
||||
# The Mulle uses NVRAM to store persistent variables, such as boot count.
|
||||
USEMODULE += nvram_spi
|
||||
FEATURES_REQUIRED += periph_spi
|
||||
USEMODULE += nvram
|
||||
USEMODULE += devfs
|
||||
|
||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
USEMODULE += saul_gpio
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user