diff options
-rw-r--r-- | driver_init.c | 14 | ||||
-rw-r--r-- | driver_init.h | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/driver_init.c b/driver_init.c index 920593a..b324be8 100644 --- a/driver_init.c +++ b/driver_init.c @@ -126,9 +126,23 @@ void USB_DEVICE_INSTANCE_init(void) USB_DEVICE_INSTANCE_PORT_init(); } +struct flash_descriptor FLASH_0; + +void FLASH_0_CLOCK_init(void) +{ + hri_mclk_set_AHBMASK_NVMCTRL_bit(MCLK); +} + +void FLASH_0_init(void) +{ + FLASH_0_CLOCK_init(); + flash_init(&FLASH_0, NVMCTRL); +} + void system_init(void) { init_mcu(); USB_DEVICE_INSTANCE_init(); + FLASH_0_init(); } diff --git a/driver_init.h b/driver_init.h index 5c029a4..0d440d4 100644 --- a/driver_init.h +++ b/driver_init.h @@ -26,6 +26,13 @@ extern "C" { void USB_DEVICE_INSTANCE_CLOCK_init(void); void USB_DEVICE_INSTANCE_init(void); +#include <hal_flash.h> + +extern struct flash_descriptor FLASH_0; + +void FLASH_0_init(void); +void FLASH_0_CLOCK_init(void); + /** * \brief Perform system initialization, initialize pins and clocks for * peripherals |