Commit Graph

6 Commits

Author SHA1 Message Date
Trent Piepho 0c7ff3b728 i2c: Improve formatting of i2c dump function
If an i2c message is for just one byte, instead of logging it with a
hexdump after logging the other message info, just added the one byte to
the same log message.

Since most i2c messages are one byte, this significantly reduces the
number of messages and lines needed to log i2c transactions, from three
line per message to just one.  It's also a lot easier to read.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2023-01-26 14:55:44 -05:00
Trent Piepho c09f6918fa i2c: Allow dumping the data of read messages
Add an argument to i2c_dump_msgs() to log the data from reads too.  And
then rename the function to i2c_dump_msgs_rw() so the API doesn't
change.  If the dump is done after a transaction is processed, as
opposed to before, then the read data is valid and can be very useful.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2023-01-26 14:55:44 -05:00
Andrei Emeltchenko b6c50f5347 i2c: Print more flags for i2c_dump
Add more usable information for i2c_dump_msgs() helper.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-09-09 10:13:12 -05:00
Tom Burdick a45ece6984 i2c: Adds i2c_transfer_async API for I2C
i2c_transfer_async is the asynchronous version of i2c_transfer where
the completion of the transfer is notified to the caller using a callback.

This can be used in conjuction with the common callbacks and datatypes
in async.h for directly doing an async transfer with an IPC object
to notify a thread.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-11 14:12:13 -04:00
Gerard Marull-Paretas fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Simon Glass 6b50f643da drivers: i2c: Add a dump routine
Add a function to dump out a set of I2C messages. It uses debug logging
so it only useful for debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-04 17:50:39 +02:00