zephyr/samples/drivers/eeprom
Gerard Marull-Paretas c7b5b3c419 samples: migrate includes to contain <zephyr/...> prefix
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:

```python
from pathlib import Path
import re

EXTENSIONS = ("c", "h", "cpp", "rst")

for p in Path(".").glob("samples/**/*"):
    if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
        continue

    content = ""
    with open(p) as f:
        for line in f:
            m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
            if (m and
                not m.group(2).startswith("zephyr/") and
                (Path(".") / "include" / "zephyr" / m.group(2)).exists()):
                content += (
                    m.group(1) +
                    "#include <zephyr/" + m.group(2) +">" +
                    m.group(3) + "\n"
                )
            else:
                content += line

    with open(p, "w") as f:
        f.write(content)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 11:29:59 +02:00
..
boards board: gd32e103v_eval: add at24 eeprom. 2022-03-01 18:06:14 +01:00
src samples: migrate includes to contain <zephyr/...> prefix 2022-05-06 11:29:59 +02:00
CMakeLists.txt
README.rst everywhere: fix typos 2022-03-18 13:24:08 -04:00
prj.conf
sample.yaml tests: eeprom: fix integration_platforms 2022-04-08 09:31:01 +02:00

README.rst

.. _samples_eeprom:

EEPROM Sample
#############

Overview
********

This sample demonstrates the EEPROM driver API in a simple boot counter
application.

Building and Running
********************

In case the target board has defined an EEPROM with alias ``eeprom-0`` the
sample can be built without further ado. This applies for example to the
:ref:`native_posix` board:

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/eeprom
   :host-os: unix
   :board: native_posix
   :goals: run
   :compact:

Otherwise either a board specific overlay needs to be defined, or a shield must
be activated. Any board with Arduino headers can for example build the sample
as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/eeprom
   :board: nrf52840dk_nrf52840
   :goals: build
   :shield: x_nucleo_eeprma2
   :compact:

For :ref:`gd32f450i_eval` board. First bridge the JP5 to USART with the jumper cap,
Then the sample can be built and executed for the  as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/eeprom
   :board: gd32f450i_eval
   :goals: build flash
   :compact:

Sample Output
=============

.. code-block:: console

    Found EEPROM device "EEPROM_M24C02"
    Using eeprom with size of: 256.
    Device booted 7 times.
    Reset the MCU to see the increasing boot counter.