nrf/flash: Update flash driver to use nrfx_nvmc driver.

The the nrfx driver is aware of chip specific registers, while
the raw HAL abstraction is not. This driver enables use of NVMC
in non-secure domain for nrf9160.
This commit is contained in:
Glenn Ruben Bakke 2019-04-03 23:51:38 +02:00
parent c561ae61a1
commit cf383412ef
3 changed files with 7 additions and 8 deletions

View File

@ -181,10 +181,7 @@ SRC_NRFX += $(addprefix lib/nrfx/drivers/src/,\
nrfx_timer.c \
nrfx_pwm.c \
nrfx_gpiote.c \
)
SRC_NRFX_HAL += $(addprefix lib/nrfx/hal/,\
nrf_nvmc.c \
nrfx_nvmc.c \
)
SRC_C += \

View File

@ -27,7 +27,7 @@
#ifndef __MICROPY_INCLUDED_LIB_FLASH_H__
#define __MICROPY_INCLUDED_LIB_FLASH_H__
#include "nrf_nvmc.h"
#include "nrfx_nvmc.h"
#if defined(NRF51)
#define FLASH_PAGESIZE (1024)
@ -55,9 +55,9 @@ void flash_operation_finished(flash_state_t result);
#else
#define flash_page_erase nrf_nvmc_page_erase
#define flash_write_byte nrf_nvmc_write_byte
#define flash_write_bytes nrf_nvmc_write_bytes
#define flash_page_erase nrfx_nvmc_page_erase
#define flash_write_byte nrfx_nvmc_byte_write
#define flash_write_bytes nrfx_nvmc_bytes_write
#endif

View File

@ -103,6 +103,8 @@
#define NRFX_PWM2_ENABLED 1
#define NRFX_PWM3_ENABLED (NRF52840)
#define NRFX_NVMC_ENABLED 1
// Peripheral Resource Sharing
#if defined(NRF51) || defined(NRF52832)
#define NRFX_PRS_BOX_0_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI0_ENABLED && NRFX_SPI_ENABLED && NRFX_SPI0_ENABLED)