Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.

Dependents:   nRF51822 nRF51822

Committer:
vcoubard
Date:
Thu Apr 07 17:37:40 2016 +0100
Revision:
19:47192cb9def7
Parent:
10:233fefd8162b
Child:
20:a90c48eb1d30
Synchronized with git rev 9251259f
Author: Liyou Zhou
Copy over coresponding files from nordic-sdk 9.0.0

Who changed what in which revision?

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