1.. _emulators:
2
3Zephyr's device emulators/simulators
4####################################
5
6Overview
7========
8
9Zephyr includes in its codebase a set of device emulators/simulators.
10With this we refer to SW components which are built together with the embedded SW
11and present themselves as devices of a given class to the rest of the system.
12
13These device emulators/simulators can be built for any target which has sufficient RAM and flash,
14even if some may have extra functionality which is only available in some targets.
15
16.. note::
17
18   | Zephyr also includes and uses many other types of simulators/emulators, including CPU and
19     platform simulators, radio simulators, and several build targets which allow running the
20     embedded code in the development host.
21   | Some of Zephyr communication controllers/drivers include also either loopback modes or loopback
22     devices.
23   | This page does not cover any of these.
24
25.. note::
26   Drivers which are specific to some platform, like for example the
27   :ref:`native_sim specific drivers <native_sim_peripherals>` which
28   emulate a peripheral class by connecting to host APIs are not covered by this page.
29
30
31Available Emulators
32===================
33
34**ADC emulator**
35  * A fake driver which pretends to be actual ADC, and can be used for testing higher-level API
36    for ADC devices.
37  * Main Kconfig option: :kconfig:option:`CONFIG_ADC_EMUL`
38  * DT binding: :dtcompatible:`zephyr,adc-emul`
39
40**DMA emulator**
41  * Emulated DMA controller
42  * Main Kconfig option: :kconfig:option:`CONFIG_DMA_EMUL`
43  * DT binding: :dtcompatible:`zephyr,dma-emul`
44
45**EEPROM emulator**
46  * Emulate an EEPROM on a flash partition
47  * Main Kconfig option: :kconfig:option:`CONFIG_EEPROM_EMULATOR`
48  * DT binding: :dtcompatible:`zephyr,emu-eeprom`
49
50.. _emul_eeprom_simu_brief:
51
52**EEPROM simulator**
53  * Emulate an EEPROM on RAM
54  * Main Kconfig option: :kconfig:option:`CONFIG_EEPROM_SIMULATOR`
55  * DT binding: :dtcompatible:`zephyr,sim-eeprom`
56  * Note: For :ref:`native targets <native_sim>` it is also possible to keep the content
57    as a file on the host filesystem.
58
59**External bus and bus connected peripheral emulators**
60  * :ref:`Documentation <bus_emul>`
61  * Allow emulating external buses like I2C or SPI and peripherals connected to them.
62
63.. _emul_flash_simu_brief:
64
65**Flash simulator**
66  * Emulate a flash on RAM
67  * Main Kconfig option: :kconfig:option:`CONFIG_FLASH_SIMULATOR`
68  * DT binding: :dtcompatible:`zephyr,sim-flash`
69  * Note: For native targets it is also possible to keep the content as a file on the host
70    filesystem. Check :ref:`the native_sim flash simulator section <nsim_per_flash_simu>`.
71
72**GPIO emulator**
73  * Emulated GPIO controllers which can be driven from SW
74  * Main Kconfig option: :kconfig:option:`CONFIG_GPIO_EMUL`
75  * DT binding: :dtcompatible:`zephyr,gpio-emul`
76
77**I2C emulator**
78  * Emulated I2C bus. See :ref:`bus emulators <bus_emul>`.
79  * Main Kconfig option: :kconfig:option:`CONFIG_I2C_EMUL`
80  * DT binding: :dtcompatible:`zephyr,i2c-emul-controller`
81
82**RTC emulator**
83  * Emulated RTC peripheral. See :ref:`RTC emulated device section <rtc_api_emul_dev>`
84  * Main Kconfig option: :kconfig:option:`CONFIG_RTC_EMUL`
85  * DT binding: :dtcompatible:`zephyr,rtc-emul`
86
87**SPI emulator**
88  * Emulated SPI bus. See :ref:`bus emulators <bus_emul>`.
89  * Main Kconfig option: :kconfig:option:`CONFIG_SPI_EMUL`
90  * DT binding: :dtcompatible:`zephyr,spi-emul-controller`
91
92**MSPI emulator**
93  * Emulated MSPI bus. See :ref:`bus emulators <bus_emul>`.
94  * Main Kconfig option: :kconfig:option:`CONFIG_MSPI_EMUL`
95  * DT binding: :dtcompatible:`zephyr,mspi-emul-controller`
96
97**UART emulator**
98  * Emulated UART bus. See :ref:`bus emulators <bus_emul>`.
99  * Main Kconfig option: :kconfig:option:`CONFIG_UART_EMUL`
100  * DT binding: :dtcompatible:`zephyr,uart-emul`
101