Skip to content

Commit f04babd

Browse files
committed
add some doc for I2C
1 parent 25108d2 commit f04babd

1 file changed

Lines changed: 36 additions & 2 deletions

File tree

docs/api/I2C.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,39 @@ deadlock situations, it allows for communication using a repeated start
88
condition as required by some devices, the code is much more compact and the
99
structure is easier to understand.
1010

11-
The current state of the port does not include the deadlock protection,
12-
though.
11+
The current state of the port is quite incomplete. Missing parts:
12+
13+
- read functions
14+
- speed setting (100kHz only)
15+
- pullup setting
16+
- does not include the deadlock protection
17+
18+
19+
## Error codes
20+
21+
Return values for functions that use the timeOut feature will return at what
22+
point in the transmission the timeout occurred.
23+
24+
All possible return values:
25+
26+
Errorcode | Meaning
27+
---: |---
28+
0 |Function executed with no errors
29+
1-7 |Timeout occurred, see above list
30+
8-0xFF|See datasheet for exact meaning
31+
32+
33+
Looking at a full communication sequence between a master and slave
34+
(transmit data and then readback data) there a total of 7 points in the
35+
sequence where a timeout can occur. These are listed below and correspond to
36+
the returned value.
37+
38+
Errorcode | Meaning: Waiting for...
39+
---: |---
40+
1 |Waiting for successful completion of a Start bit
41+
2 |Waiting for ACK/NACK while addressing slave in transmit mode (MT)
42+
3 |Waiting for ACK/NACK while sending data to the slave
43+
4 |Waiting for successful completion of a Repeated Start
44+
5 |Waiting for ACK/NACK while addressing slave in receiver mode (MR)
45+
6 |Waiting for ACK/NACK while receiving data from the slave
46+
7 |Waiting for successful completion of the Stop bit

0 commit comments

Comments
 (0)