Commit graph

28 commits

Author SHA1 Message Date
Kumar Gala 26bfddf1ee drivers: i2c: i2c_dw: Move to devicetree detection
We can utilize the devicetree macros to determine which instances to
enable.  This will allow us to phase out the per instance Kconfig
symbols.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 14:44:25 -05:00
Maureen Helm 3005094994 drivers: i2c: Add mcux flexcomm driver
Adds a shim layer around the mcux lpc flexcomm driver to adapt it to the
zephyr i2c interface. It leverages heavily from the existing mcux lpi2c
shim driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-09 08:52:13 -05:00
Anas Nashif 89005438bc i2c: add i2c shell with scan cmd
Add a shell to interact with I2C devices. Currently scanning for devices
is supported. Example output:

uart:~$ i2c scan I2C_1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:             -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
2 devices found on I2C_1
uart:~$ i2c scan I2C_3
i2c - I2C commands
Subcommands:
  I2C_1  :I2C_1
  I2C_2  :I2C_2
uart:~$ i2c scan I2C_2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:             -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- 2d -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- 56 -- -- -- -- -- -- 5d -- 5f
60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- --
70: -- -- -- -- -- -- -- --
7 devices found on I2C_2

This shell is based on the a sample that did the same thing and was
limited in support. The sample is now removed in favour of this generic
shell module.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-10 08:55:47 -05:00
Robert Winkler 7f8a70a74b drivers: i2c: Add driver for LiteX I2C controller
This adds I2C bitbang driver for LiteX SoC builder with its bindings.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-01-07 20:55:43 +01:00
Anas Nashif 3138e10d5b drivers: i2c: remove qmsi I2C driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif a47f0a35b9 i2c: remove unused qmsi driver
This driver was used by the sensor subsystem in Arudino 101. Remove as
the board was dropped.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-08-21 09:52:01 -04:00
Brett Witherspoon 6eb0cb0d85 drivers: add CC13xx / CC26xx I2C driver
Add I2C driver for the TI CC13xx / CC26xx series SoCs.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-21 15:37:22 -04:00
Charles E. Youse 59ebe6a072 drivers/i2c/i2c_dw.c: templatize device configuration boilerplate
The 50-odd lines of boilerplate per I2C port is moved into a template
which is generated by CMake as needed at build-time.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 08:23:22 -04:00
Jose Alberto Meza a94f1718ce drivers: i2c: mchp: Add I2C driver for MEC family
Add i2c_mchp_xec byte-to-byte driver to support I2C instances
for MEC family

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-05-08 15:02:26 -07:00
Derek Hageman 46730e1f57 drivers: i2c: Add SAM0 I2C driver
This adds a SERCOM I2C driver for SAM0 series chips.

Tested with a SAMD21 chip on a SSD1306 display and a MLX90393
sensor.  Only compile tested for SAMD20 and SAMR21.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-05-07 08:42:24 -04:00
Henrik Brix Andersen 8a4dbb5b03 drivers: i2c: rv32m1: add I2C driver for the RV32M1 RI5CY SoC
Add driver and device tree binding for the Low Power Inter-Integrated
Circuit (LPI2C) controllers found in the RV32M1 RI5CY SoC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-18 16:04:23 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Nathaniel Graff b0844959f6 drivers/i2c: I2C driver for SiFive Freedom
Driver for the I2C peripheral in the SiFive Blocks RTL
Repository (https://github.com/sifive/sifive-blocks).

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-02-07 10:47:48 -06:00
Maureen Helm d7dfa21391 drivers: i2c: Introduce mcux lpi2c shim driver
Adds a shim layer around the mcux lpi2c driver to adapt it to the zephyr
i2c interface. This shim driver leverages heavily from the mcux i2c shim
driver because the MCUXpresso SDK provides similar APIs for the i2c and
lpi2c peripherals.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-18 06:49:35 -05:00
Piotr Mienkowski 1bfc52b81b drivers: i2c: remove deprecated i2c_atmel_sam3 driver
The i2c_atmel_sam3 driver was deprecated at release 1.9, this commit
removes it. Also pinmux_dev_atmel_sam3x driver is removed.
i2c_atmel_sam3 was the last one which depended on it.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-08 09:23:17 -06:00
Diego Sueiro 4ce6555c1d drivers: Introduce Silabs i2c shim driver
Adds the I2C shim driver for Silabs Gecko Devices.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-10-31 09:00:38 -05:00
Diego Sueiro 8c2acab53a drivers: add i.MX I2C driver shim
Adds a shim layer around the imx i2c driver to adapt it to the Zephyr
i2c master interface.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-07-06 15:55:57 -05:00
Neil Armstrong 9a73cdfe9e i2c: slave: Add EEPROM I2C Slave driver
Add a new EEPROM simulated driver with all it's build infrastructure.

The EEPROM can be loaded/poked from applications by getting its funcs.

It is multi-instance capable, right now 2 instances are supported by
enabling them in KConfig.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2018-07-04 11:57:33 +02:00
Mieszko Mierunski 1aa61d60c5 drivers: i2c: Removed redundant i2c_nrf5 shim
After switching to TWI and TWIM drivers, old i2c_nrf5 shim
is no longer needed.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-06-20 13:38:18 +02:00
Mieszko Mierunski 1edc29c47f drivers: i2c: Add shims for nrfx TWI and TWIM drivers
Changes add a translation layer to make nrfx TWI and TWIM drivers
work with Zephyr API.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-06-20 13:38:18 +02:00
Adithya Baglody b0db28b512 drivers: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for driver files.
Normally a syscall would check the current privilege level and then
decide to go to _impl_<syscall> directly or go through a
_handler_<syscall>.
__ZEPHYR_SUPERVISOR__ is a compiler optimization flag which will
make all the system calls from the driver files directly link
to the _impl_<syscall>. Thereby reducing the overhead of checking the
privileges.

In the previous implementation all the source files would be compiled
by zephyr_source() rule. This means that zephyr_* is a catchall CMake
library for source files that can be built purely with the include
paths, defines, and other compiler flags that all zephyr source
files uses. This states that adding one extra compiler flag for only
one complete directory would fail.
This limitation can be overcome by using zephyr_libray* APIs. This
creates a library for the required directories and it also supports
directory level properties.
Hence we use zephyr_library* to create a new library with
macro _ZEPHYR_SUPERVISOR_ for the optimization.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-05-15 17:48:18 +03:00
Tomasz Bursztyka d506da2879 drivers/i2c: Indent sources the same way everywhere
Using tabs only.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-23 10:42:33 +08:00
Ramakrishna Pallala 3eb62bc905 drivers: i2c: Add i2c master driver for Nios-II i2c core
Add I2C Master driver for Nios-II I2C soft IP core.

This driver relies upon the Altera HAL I2C driver for all the bus level
transactions, interrupt handling and register programming.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-02-07 19:37:35 -05:00
Gil Pitney e5cef70abd drivers: i2c: Add support for cc32xx I2C bus
This was validated on the cc3220sf_launchxl board
using the Zephyr thermometer sample program
adapted to call the i2c driver directly, and fetching
samples from the on-board TMP006 temperature sensor.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-01-09 08:39:59 -06:00
Piotr Mienkowski 1f47ed75b7 drivers: i2c: rename twihs_sam to i2c_sam_twihs
Rename the Atmel SAM I2C driver based on TWIHS module to match the
convention:
<driver class>_<SoC family>_<hardware module used by the driver>

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-15 11:13:08 -06:00
Sebastian Bøe 780d9facbe cmake: s/CONFIG_I2C_STM32_V1x/CONFIG_I2C_STM32_V1/
Fix typo in build scripts for STM's I2C driver. The typo was
introduced in the cmake migration.

Discovered by Dmitry:
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-November/008383.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-15 07:06:26 -06:00
Sebastian Bøe f2a3977261 cmake: Added missing zephyr_sources() calls for esp32 drivers
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-14 10:47:15 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00