Commit Graph

21 Commits

Author SHA1 Message Date
King Kévin 61d65977ac i2c: minor, fix spacing 2021-07-19 18:03:14 +02:00
King Kévin e71515bcce replace header license with SPDX statement 2020-06-10 19:04:41 +02:00
King Kévin 4b1651a1a3 i2c_master: fix writing function to cope with read function now including a stop 2020-02-27 13:09:10 +01:00
King Kévin 29226246f6 i2c_master: improve sending stop and integrated it into read function 2020-02-27 13:08:55 +01:00
King Kévin 4bfcca9d50 i2c_master: fix 1 byte read 2020-02-11 12:21:35 +01:00
King Kévin 25ce80b73a i2c_master: minor, improve register read consistency 2020-02-11 12:20:13 +01:00
King Kévin 9f70665fbc i2c_master: minor, revert test change 2019-12-12 21:35:10 +01:00
King Kévin e087ff744d i2c_master: fix line check 2019-12-12 21:31:51 +01:00
King Kévin de66829811 i2c_master: minor, fix doc 2019-12-12 21:30:12 +01:00
King Kévin 230151a102 (minor) remove trailing spaces 2019-03-26 19:27:40 +01:00
King Kévin f37a6ee4ef I2C (minor): use CM3 assert instead if manual check 2019-03-26 18:35:46 +01:00
King Kévin 62b83fd34d I2C (minor): add space around operators for readability 2019-03-26 18:25:23 +01:00
King Kévin a50a181b86 I2C: fix read NACK
NACKing in receive mode is different when 1, 2, or more bytes are
read.
see the reference manual for the cases and how to handle them.
2019-03-26 18:12:22 +01:00
King Kévin bf2eca0401 I2C: add timeout to stop
similar to the start condition, a timer will prevent it to block.
2019-03-26 18:11:17 +01:00
King Kévin efbd228f8a I2C: don't clear ADDR after select
to check if the slave has successfully been selected to read or
write and the master is in the corresponding receive or transmit
state, SR2 was checked.
but reading SR2 also cleared the ADDR bit, starting the read/write
transaction.
the check is done in the read/write methods anyway.
2019-03-26 18:07:26 +01:00
King Kévin ef4685a9a3 I2C: don't block on reset
when resetting the GPIO lines are toggles.
when this is not effective it used to block.
not it just warns the used it failed.
2019-03-26 18:05:18 +01:00
King Kévin 396c7852e7 I2C: add timeout to send start condition
sometimes the internal state f the I2C peripheral is confused,
and sending a start condition is not possible and the
corresponding registers will not be set.
see the errata for more details.
as workaround a timer is used, resetting the I2C is case it times
out
2019-03-26 18:01:23 +01:00
King Kévin 593b0e0e25 take changes from busvoodoo branch 2018-04-03 16:59:02 +02:00
King Kévin 62bfaf3973 cherry-pick from busvoodoo branch, part 4 2018-02-18 15:21:18 +01:00
King Kévin 3b73f519da doc: fix typo 2017-10-04 13:55:43 +02:00
King Kévin 6d3e826c18 add general I2C library 2017-04-03 13:07:03 +02:00