123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- #ifndef NRFX_NVMC_H__
- #define NRFX_NVMC_H__
- #include <nrfx.h>
- #include <hal/nrf_nvmc.h>
- #include <hal/nrf_ficr.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- nrfx_err_t nrfx_nvmc_page_erase(uint32_t address);
- nrfx_err_t nrfx_nvmc_uicr_erase(void);
- void nrfx_nvmc_all_erase(void);
- #if defined(NRF_NVMC_PARTIAL_ERASE_PRESENT)
- nrfx_err_t nrfx_nvmc_page_partial_erase_init(uint32_t address, uint32_t duration_ms);
- bool nrfx_nvmc_page_partial_erase_continue(void);
- #endif
- bool nrfx_nvmc_byte_writable_check(uint32_t address, uint8_t value);
- void nrfx_nvmc_byte_write(uint32_t address, uint8_t value);
- bool nrfx_nvmc_word_writable_check(uint32_t address, uint32_t value);
- void nrfx_nvmc_word_write(uint32_t address, uint32_t value);
- void nrfx_nvmc_bytes_write(uint32_t address, void const * src, uint32_t num_bytes);
- void nrfx_nvmc_words_write(uint32_t address, void const * src, uint32_t num_words);
- uint32_t nrfx_nvmc_flash_size_get(void);
- uint32_t nrfx_nvmc_flash_page_size_get(void);
- uint32_t nrfx_nvmc_flash_page_count_get(void);
- __STATIC_INLINE bool nrfx_nvmc_write_done_check(void);
- #if defined(NRF_NVMC_ICACHE_PRESENT)
- __STATIC_INLINE void nrfx_nvmc_icache_enable(void);
- __STATIC_INLINE void nrfx_nvmc_icache_disable(void);
- #endif
- #ifndef SUPPRESS_INLINE_IMPLEMENTATION
- __STATIC_INLINE bool nrfx_nvmc_write_done_check(void)
- {
- return nrf_nvmc_ready_check(NRF_NVMC);
- }
- #if defined(NRF_NVMC_ICACHE_PRESENT)
- __STATIC_INLINE void nrfx_nvmc_icache_enable(void)
- {
- nrf_nvmc_icache_config_set(NRF_NVMC, NRF_NVMC_ICACHE_ENABLE_WITH_PROFILING);
- }
- __STATIC_INLINE void nrfx_nvmc_icache_disable(void)
- {
- nrf_nvmc_icache_config_set(NRF_NVMC, NRF_NVMC_ICACHE_DISABLE);
- }
- #endif
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|