Skip to content

Commit

Permalink
boards/mulle: Add FRAM to DevFS
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed Mar 7, 2017
1 parent 171748f commit e77f7e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 2 additions & 4 deletions boards/mulle/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion boards/mulle/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down Expand Up @@ -210,6 +218,10 @@ static int mulle_nvram_init(void)
return -5;
}
}

/* Register DevFS node */
devfs_register(&mulle_nvram_devfs);

return 0;
}

Expand Down

0 comments on commit e77f7e6

Please sign in to comment.