Nordic stack and drivers for the mbed BLE API

Dependents:   idd_hw5_bleFanProto

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nrf_nvmc.h Source File

nrf_nvmc.h

Go to the documentation of this file.
00001 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is confidential property of Nordic 
00004  * Semiconductor ASA.Terms and conditions of usage are described in detail 
00005  * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *              
00011  * $LastChangedRevision: 17685 $
00012  */
00013 
00014 /**
00015  * @file
00016  * @brief NMVC driver API.
00017  */
00018 
00019 #ifndef NRF_NVMC_H__
00020 #define NRF_NVMC_H__
00021 
00022 #include <stdint.h>
00023 
00024 
00025 /**
00026  * @defgroup nrf_nvmc Non-volatile memory controller
00027  * @{
00028  * @ingroup nrf_drivers
00029  * @brief Driver for the nRF51 NVMC peripheral.
00030  *
00031  * This driver allows writing to the non-volatile memory (NVM) regions
00032  * of the nRF51. In order to write to NVM the controller must be powered
00033  * on and the relevant page must be erased.
00034  *
00035  */
00036 
00037 
00038 /**
00039  * @brief Erase a page in flash. This is required before writing to any
00040  * address in the page.
00041  *
00042  * @param address Start address of the page. 
00043  */
00044 void nrf_nvmc_page_erase(uint32_t address);
00045 
00046 
00047 /**
00048  * @brief Write a single byte to flash.
00049  *
00050  * The function reads the word containing the byte, and then
00051  * rewrites the entire word.
00052  *
00053  * @param address Address to write to.
00054  * @param value   Value to write.
00055  */
00056 void nrf_nvmc_write_byte(uint32_t address , uint8_t value);
00057 
00058 
00059 /**
00060  * @brief Write a 32-bit word to flash. 
00061  * @param address Address to write to.
00062  * @param value   Value to write.
00063  */
00064 void nrf_nvmc_write_word(uint32_t address, uint32_t value);
00065 
00066 
00067 /**
00068  * @brief Write consecutive bytes to flash.
00069  *
00070  * @param address   Address to write to.
00071  * @param src       Pointer to data to copy from.
00072  * @param num_bytes Number of bytes in src to write.
00073  */
00074 void nrf_nvmc_write_bytes(uint32_t  address, const uint8_t * src, uint32_t num_bytes);
00075 
00076 
00077 /**
00078  @ @brief Write consecutive words to flash.
00079  * 
00080  * @param address   Address to write to.
00081  * @param src       Pointer to data to copy from.
00082  * @param num_words Number of bytes in src to write.
00083  */
00084 void nrf_nvmc_write_words(uint32_t address, const uint32_t * src, uint32_t num_words);
00085 
00086 
00087 #endif // NRF_NVMC_H__
00088 /** @} */
00089 
00090