Skip to content

Commit d71140f

Browse files
author
Joakim Nohlgård
committed
boards/mulle: Add FRAM to DevFS
1 parent 82720d8 commit d71140f

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

boards/mulle/Makefile.dep

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
77
endif
88

99
# The RTT clock drives the core clock in the default configuration
10-
FEATURES_REQUIRED += periph_rtt
10+
#FEATURES_REQUIRED += periph_rtt
1111

1212
# The Mulle uses NVRAM to store persistent variables, such as boot count.
1313
USEMODULE += nvram_spi
14-
FEATURES_REQUIRED += periph_spi
14+
USEMODULE += nvram
15+
USEMODULE += devfs
16+
17+
#FEATURES_REQUIRED += periph_spi
1518

1619
ifneq (,$(filter saul_default,$(USEMODULE)))
1720
USEMODULE += saul_gpio

boards/mulle/board.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
#include "cpu.h"
2525
#include "mcg.h"
2626
#include "periph/gpio.h"
27-
#include "periph/uart.h"
2827
#include "periph/rtt.h"
2928
#include "periph/spi.h"
3029
#include "nvram-spi.h"
30+
#include "nvram.h"
3131
#include "xtimer.h"
32+
#include "vfs.h"
33+
#include "fs/devfs.h"
3234

3335
static nvram_t mulle_nvram_dev;
3436
nvram_t *mulle_nvram = &mulle_nvram_dev;
@@ -38,6 +40,12 @@ static nvram_spi_params_t nvram_spi_params = {
3840
.address_count = MULLE_NVRAM_SPI_ADDRESS_COUNT,
3941
};
4042

43+
static devfs_t mulle_nvram_devfs = {
44+
.path = "/mulle-fram",
45+
.f_op = &nvram_vfs_ops,
46+
.private_data = &mulle_nvram_dev,
47+
};
48+
4149
/** @brief Initialize the GPIO pins controlling the power switches. */
4250
static inline void power_pins_init(void);
4351

@@ -213,6 +221,10 @@ static int mulle_nvram_init(void)
213221
return -5;
214222
}
215223
}
224+
225+
/* Register DevFS node */
226+
devfs_register(&mulle_nvram_devfs);
227+
216228
return 0;
217229
}
218230

0 commit comments

Comments
 (0)