Skip to content

Commit c5783be

Browse files
authored
Add info about 8bit address format
There is not much clear info about the I2CSlave API also use 8bit format and need to be bit shifted. It can be confusing for a novice. So I suggest to copy same info like is on I2C API page.
1 parent b73f97e commit c5783be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/api/drivers/I2CSlave.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ Use I2C Slave to communicate with I2C Master.
44

55
Synchronization level: not protected.
66

7+
<span class="notes">**Note:** Remember that you need a pull-up resistor on sda and scl. All drivers on the I2C bus are required to be open collector, and so it is necessary to use pull-up resistors on the two signals. A typical value for the pull-up resistors is around 2.2k ohms, connected between the pin and 3v3. </span>
8+
79
## I2CSlave class reference
810

11+
<span class="notes">**Note:** The Arm Mbed API uses 8 bit addresses, so make sure to left-shift 7 bit addresses by 1 bit before passing them. </span>
12+
913
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/mbed-os/development/mbed-os-api-doxy/classmbed_1_1_i2_c_slave.html)
1014

1115
## I2CSlave example

0 commit comments

Comments
 (0)