project for nrf51822 qfab
Dependencies: eddystone_URL mbed
Fork of eddystone_URL by
nRF51822/nordic/nrf-sdk/nrf_nvmc.h@0:76dfa9657d9d, 2014-11-12 (annotated)
- Committer:
- jksoft
- Date:
- Wed Nov 12 02:40:34 2014 +0000
- Revision:
- 0:76dfa9657d9d
????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:76dfa9657d9d | 1 | /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. |
jksoft | 0:76dfa9657d9d | 2 | * |
jksoft | 0:76dfa9657d9d | 3 | * The information contained herein is confidential property of Nordic |
jksoft | 0:76dfa9657d9d | 4 | * Semiconductor ASA.Terms and conditions of usage are described in detail |
jksoft | 0:76dfa9657d9d | 5 | * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 0:76dfa9657d9d | 6 | * |
jksoft | 0:76dfa9657d9d | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 0:76dfa9657d9d | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 0:76dfa9657d9d | 9 | * the file. |
jksoft | 0:76dfa9657d9d | 10 | * |
jksoft | 0:76dfa9657d9d | 11 | * $LastChangedRevision: 17685 $ |
jksoft | 0:76dfa9657d9d | 12 | */ |
jksoft | 0:76dfa9657d9d | 13 | |
jksoft | 0:76dfa9657d9d | 14 | /** |
jksoft | 0:76dfa9657d9d | 15 | * @file |
jksoft | 0:76dfa9657d9d | 16 | * @brief NMVC driver API. |
jksoft | 0:76dfa9657d9d | 17 | */ |
jksoft | 0:76dfa9657d9d | 18 | |
jksoft | 0:76dfa9657d9d | 19 | #ifndef NRF_NVMC_H__ |
jksoft | 0:76dfa9657d9d | 20 | #define NRF_NVMC_H__ |
jksoft | 0:76dfa9657d9d | 21 | |
jksoft | 0:76dfa9657d9d | 22 | #include <stdint.h> |
jksoft | 0:76dfa9657d9d | 23 | |
jksoft | 0:76dfa9657d9d | 24 | |
jksoft | 0:76dfa9657d9d | 25 | /** |
jksoft | 0:76dfa9657d9d | 26 | * @defgroup nrf_nvmc Non-volatile memory controller |
jksoft | 0:76dfa9657d9d | 27 | * @{ |
jksoft | 0:76dfa9657d9d | 28 | * @ingroup nrf_drivers |
jksoft | 0:76dfa9657d9d | 29 | * @brief Driver for the nRF51 NVMC peripheral. |
jksoft | 0:76dfa9657d9d | 30 | * |
jksoft | 0:76dfa9657d9d | 31 | * This driver allows writing to the non-volatile memory (NVM) regions |
jksoft | 0:76dfa9657d9d | 32 | * of the nRF51. In order to write to NVM the controller must be powered |
jksoft | 0:76dfa9657d9d | 33 | * on and the relevant page must be erased. |
jksoft | 0:76dfa9657d9d | 34 | * |
jksoft | 0:76dfa9657d9d | 35 | */ |
jksoft | 0:76dfa9657d9d | 36 | |
jksoft | 0:76dfa9657d9d | 37 | |
jksoft | 0:76dfa9657d9d | 38 | /** |
jksoft | 0:76dfa9657d9d | 39 | * @brief Erase a page in flash. This is required before writing to any |
jksoft | 0:76dfa9657d9d | 40 | * address in the page. |
jksoft | 0:76dfa9657d9d | 41 | * |
jksoft | 0:76dfa9657d9d | 42 | * @param address Start address of the page. |
jksoft | 0:76dfa9657d9d | 43 | */ |
jksoft | 0:76dfa9657d9d | 44 | void nrf_nvmc_page_erase(uint32_t address); |
jksoft | 0:76dfa9657d9d | 45 | |
jksoft | 0:76dfa9657d9d | 46 | |
jksoft | 0:76dfa9657d9d | 47 | /** |
jksoft | 0:76dfa9657d9d | 48 | * @brief Write a single byte to flash. |
jksoft | 0:76dfa9657d9d | 49 | * |
jksoft | 0:76dfa9657d9d | 50 | * The function reads the word containing the byte, and then |
jksoft | 0:76dfa9657d9d | 51 | * rewrites the entire word. |
jksoft | 0:76dfa9657d9d | 52 | * |
jksoft | 0:76dfa9657d9d | 53 | * @param address Address to write to. |
jksoft | 0:76dfa9657d9d | 54 | * @param value Value to write. |
jksoft | 0:76dfa9657d9d | 55 | */ |
jksoft | 0:76dfa9657d9d | 56 | void nrf_nvmc_write_byte(uint32_t address , uint8_t value); |
jksoft | 0:76dfa9657d9d | 57 | |
jksoft | 0:76dfa9657d9d | 58 | |
jksoft | 0:76dfa9657d9d | 59 | /** |
jksoft | 0:76dfa9657d9d | 60 | * @brief Write a 32-bit word to flash. |
jksoft | 0:76dfa9657d9d | 61 | * @param address Address to write to. |
jksoft | 0:76dfa9657d9d | 62 | * @param value Value to write. |
jksoft | 0:76dfa9657d9d | 63 | */ |
jksoft | 0:76dfa9657d9d | 64 | void nrf_nvmc_write_word(uint32_t address, uint32_t value); |
jksoft | 0:76dfa9657d9d | 65 | |
jksoft | 0:76dfa9657d9d | 66 | |
jksoft | 0:76dfa9657d9d | 67 | /** |
jksoft | 0:76dfa9657d9d | 68 | * @brief Write consecutive bytes to flash. |
jksoft | 0:76dfa9657d9d | 69 | * |
jksoft | 0:76dfa9657d9d | 70 | * @param address Address to write to. |
jksoft | 0:76dfa9657d9d | 71 | * @param src Pointer to data to copy from. |
jksoft | 0:76dfa9657d9d | 72 | * @param num_bytes Number of bytes in src to write. |
jksoft | 0:76dfa9657d9d | 73 | */ |
jksoft | 0:76dfa9657d9d | 74 | void nrf_nvmc_write_bytes(uint32_t address, const uint8_t * src, uint32_t num_bytes); |
jksoft | 0:76dfa9657d9d | 75 | |
jksoft | 0:76dfa9657d9d | 76 | |
jksoft | 0:76dfa9657d9d | 77 | /** |
jksoft | 0:76dfa9657d9d | 78 | @ @brief Write consecutive words to flash. |
jksoft | 0:76dfa9657d9d | 79 | * |
jksoft | 0:76dfa9657d9d | 80 | * @param address Address to write to. |
jksoft | 0:76dfa9657d9d | 81 | * @param src Pointer to data to copy from. |
jksoft | 0:76dfa9657d9d | 82 | * @param num_words Number of bytes in src to write. |
jksoft | 0:76dfa9657d9d | 83 | */ |
jksoft | 0:76dfa9657d9d | 84 | void nrf_nvmc_write_words(uint32_t address, const uint32_t * src, uint32_t num_words); |
jksoft | 0:76dfa9657d9d | 85 | |
jksoft | 0:76dfa9657d9d | 86 | |
jksoft | 0:76dfa9657d9d | 87 | #endif // NRF_NVMC_H__ |
jksoft | 0:76dfa9657d9d | 88 | /** @} */ |
jksoft | 0:76dfa9657d9d | 89 | |
jksoft | 0:76dfa9657d9d | 90 |