| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Non-volatile memory controller
Peripheral drivers

Driver for the NVMC peripheral. More...

## Functions
void | nrf_nvmc_page_erase (uint32_t address)
| Erase a page in flash. This is required before writing to any address in the page. More...
void | nrf_nvmc_write_byte (uint32_t address, uint8_t value)
| Write a single byte to flash. More...
void | nrf_nvmc_write_word (uint32_t address, uint32_t value)
| Write a 32-bit word to flash. More...
void | nrf_nvmc_write_bytes (uint32_t address, const uint8_t *src, uint32_t num_bytes)
| Write consecutive bytes to flash. More...
void | nrf_nvmc_write_words (uint32_t address, const uint32_t *src, uint32_t num_words)
| Write consecutive words to flash. More...

## Detailed Description

Driver for the NVMC peripheral.

This driver allows writing to the non-volatile memory (NVM) regions of the chip. In order to write to NVM the controller must be powered on and the relevant page must be erased.

## Function Documentation

void nrf_nvmc_page_erase | ( | uint32_t | address | ) |

Erase a page in flash. This is required before writing to any address in the page.

Parameters

  address | Start address of the page.

void nrf_nvmc_write_byte | ( | uint32_t | address,
|  | uint8_t | value
| ) |  |

Write a single byte to flash.

The function reads the word containing the byte, and then rewrites the entire word.

Parameters

  address | Address to write to.
  value | Value to write.

void nrf_nvmc_write_bytes | ( | uint32_t | address,
|  | const uint8_t * | src,
|  | uint32_t | num_bytes
| ) |  |

Write consecutive bytes to flash.

Parameters

  address | Address to write to.
  src | Pointer to data to copy from.
  num_bytes | Number of bytes in src to write.

void nrf_nvmc_write_word | ( | uint32_t | address,
|  | uint32_t | value
| ) |  |

Write a 32-bit word to flash.

Parameters

  address | Address to write to.
  value | Value to write.

void nrf_nvmc_write_words | ( | uint32_t | address,
|  | const uint32_t * | src,
|  | uint32_t | num_words
| ) |  |

Write consecutive words to flash.

Parameters

  address | Address to write to.
  src | Pointer to data to copy from.
  num_words | Number of bytes in src to write.