Revert "drivers: move eeprom_slave driver to tests directory"
This reverts commit cabbd916cf
.
This is considered to be useful enough that it should be restored
as a stable Zephyr API.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
20689c17d4
commit
96fa707e0c
|
@ -208,6 +208,7 @@
|
|||
/drivers/i2c/i2c_emul.c @sjg20
|
||||
/drivers/i2c/i2c_shell.c @nashif
|
||||
/drivers/i2c/Kconfig.i2c_emul @sjg20
|
||||
/drivers/i2c/slave/*eeprom* @henrikbrixandersen
|
||||
/drivers/i2s/*litex* @mateusz-holenko @kgugala @pgielda
|
||||
/drivers/ieee802154/ @jukkar @tbursztyka
|
||||
/drivers/ieee802154/ieee802154_rf2xx* @jukkar @tbursztyka @nandojve
|
||||
|
|
|
@ -142,6 +142,11 @@ current :ref:`stability level <api_lifecycle>`.
|
|||
- 1.14
|
||||
- 2.3
|
||||
|
||||
* - :ref:`i2c_eeprom_slave_api`
|
||||
- Stable
|
||||
- 1.13
|
||||
- 1.13
|
||||
|
||||
* - :ref:`i2c_api`
|
||||
- Stable
|
||||
- 1.0
|
||||
|
|
13
doc/reference/peripherals/i2c_eeprom_slave.rst
Normal file
13
doc/reference/peripherals/i2c_eeprom_slave.rst
Normal file
|
@ -0,0 +1,13 @@
|
|||
.. _i2c_eeprom_slave_api:
|
||||
|
||||
I2C EEPROM Slave
|
||||
################
|
||||
|
||||
Overview
|
||||
********
|
||||
|
||||
API Reference
|
||||
**************
|
||||
|
||||
.. doxygengroup:: i2c_eeprom_slave_api
|
||||
:project: Zephyr
|
|
@ -18,6 +18,7 @@ Peripherals
|
|||
gna.rst
|
||||
gpio.rst
|
||||
hwinfo.rst
|
||||
i2c_eeprom_slave.rst
|
||||
i2c.rst
|
||||
ipm.rst
|
||||
kscan.rst
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_sources_ifdef(CONFIG_I2C_EEPROM_SLAVE eeprom_slave.c)
|
||||
|
|
|
@ -6,11 +6,19 @@
|
|||
#
|
||||
# I2C options
|
||||
#
|
||||
config I2C_SLAVE
|
||||
menuconfig I2C_SLAVE
|
||||
bool "I2C Slave Drivers"
|
||||
help
|
||||
Enable I2C Slave Driver Configuration
|
||||
|
||||
if I2C_SLAVE
|
||||
|
||||
config I2C_SLAVE_INIT_PRIORITY
|
||||
int "Init priority"
|
||||
default 60
|
||||
help
|
||||
I2C Slave device driver initialization priority.
|
||||
|
||||
source "drivers/i2c/slave/Kconfig.eeprom"
|
||||
|
||||
endif # I2C_SLAVE
|
||||
|
|
9
drivers/i2c/slave/Kconfig.eeprom
Normal file
9
drivers/i2c/slave/Kconfig.eeprom
Normal file
|
@ -0,0 +1,9 @@
|
|||
# I2C EEPROM Slave configuration options
|
||||
|
||||
# Copyright (c) 2017 BayLibre, SAS
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config I2C_EEPROM_SLAVE
|
||||
bool "I2C Slave EEPROM driver"
|
||||
help
|
||||
Enable virtual I2C Slave EEPROM driver
|
|
@ -11,11 +11,11 @@
|
|||
#include <errno.h>
|
||||
#include <drivers/i2c.h>
|
||||
#include <string.h>
|
||||
#include "eeprom.h"
|
||||
#include <drivers/i2c/slave/eeprom.h>
|
||||
|
||||
#define LOG_LEVEL CONFIG_I2C_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(eeprom_slave);
|
||||
LOG_MODULE_REGISTER(i2c_slave);
|
||||
|
||||
struct i2c_eeprom_slave_data {
|
||||
const struct device *i2c_controller;
|
||||
|
@ -225,8 +225,8 @@ static int i2c_eeprom_slave_init(const struct device *dev)
|
|||
&i2c_eeprom_slave_init, \
|
||||
&i2c_eeprom_slave_##inst##_dev_data, \
|
||||
&i2c_eeprom_slave_##inst##_cfg, \
|
||||
APPLICATION, \
|
||||
0, \
|
||||
POST_KERNEL, \
|
||||
CONFIG_I2C_SLAVE_INIT_PRIORITY, \
|
||||
&api_funcs);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(I2C_EEPROM_INIT)
|
|
@ -4,3 +4,5 @@ CONFIG_BOOT_BANNER=y
|
|||
CONFIG_ZTEST=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_SLAVE=y
|
||||
CONFIG_I2C_EEPROM_SLAVE=y
|
||||
CONFIG_I2C_VIRTUAL=y
|
||||
|
|
|
@ -18,7 +18,7 @@ LOG_MODULE_REGISTER(main);
|
|||
#include <sys/util.h>
|
||||
|
||||
#include <drivers/i2c.h>
|
||||
#include "eeprom.h"
|
||||
#include <drivers/i2c/slave/eeprom.h>
|
||||
|
||||
#include <ztest.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue