Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/libraries/built-in/I2C-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,20 @@ It is also possible to change the default pins used by the `Wire` instance using
### Enable general call mode
Available in core version greater than **1.5.0**

Adding `true` as last parameters of the 3 `Wire::begin()` methods will enable the general call mode otherwise `false` per default:
Adding `true` as last parameters of the `Wire::begin()` methods will enable the general call mode otherwise `false` per default:

* `void begin(bool generalCall = false)`
* `void begin(uint8_t, bool generalCall = false)`
* `void begin(int, bool generalCall = false)`
* `void begin(bool generalCall)`
* `void begin(uint8_t address)` (general call disabled)
* `void begin(uint8_t address, bool generalCall, bool NoStretchMode)`
* `void begin(int address, bool generalCall = false, bool NoStretchMode = false)`

`NoStretchMode` set to `true` disables the clock stretching (slave mode).

A `uint8_t` address with only the `generalCall` parameter (`Wire.begin(addr, true);`) is handled by the `int` overload.

#### Example
`Wire.begin(true);` or `Wire.begin(0x70,true);`
`Wire.begin(true);` or `Wire.begin(0x70,true);`

## I2C buffer management
By default, I2C buffers are aligned with the Arduino API at **32 bytes**. Transfers of up to **255 bytes** are also possible:
Expand Down
5 changes: 2 additions & 3 deletions libraries/Wire/src/Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,9 @@ class TwoWire : public arduino::HardwareI2C {
* any other address initializes it as slave using this address.
* @param address 7-bit own address for slave mode, 0x01 for master mode.
* @param generalCall true to enable the general call address.
* Default: false.
* @param NoStretchMode true to disable clock stretching. Default: false.
* @param NoStretchMode true to disable clock stretching.
*/
void begin(uint8_t address, bool generalCall = false, bool NoStretchMode = false);
void begin(uint8_t address, bool generalCall, bool NoStretchMode);
/**
* @brief Initialize the TWI interface as master or slave.
*
Expand Down
Loading