Skip to content

Conversation

@bluesign2k
Copy link
Contributor

Fix reading and use of TWI status register.
Also, update endTransmission to be compatible with original & give more useful return values.

Fix reading and use of TWI status register.
Also, update endTransmission to be compatible with original & give more
useful return.
@Lauszus
Copy link
Contributor

Lauszus commented Apr 6, 2014

Note this closes: #1976.

Adds ability to set length, parity and stop bit configuration to
hardware serial ports using USART module (Serial1, Serial2, and Serial
3) on Due to allow compatibility with avr devices.
@bluesign2k
Copy link
Contributor Author

The latest two commits should be ignored... forgot to make a new branch so it got merged with this pull. Oops.

The original commit to add compatibility still stands.

@cmaglie cmaglie added this to the Release 1.5.7 milestone Apr 8, 2014
@bluesign2k
Copy link
Contributor Author

FWIW. This also enables polling of devices of device on the bus. A basic example...

uint8_t I2C_DevicePoll(uint8_t device_addr) {
    uint32_t timeout = millis();

    while (1) {
        Wire.beginTransmission(device_addr);
        Wire.write(0x00);
        if (!Wire.endTransmission(true)) break;

        if ((millis() - timeout) > I2C_TIMEOUT) return 1;
    }
    return 0;
}

@odbol
Copy link

odbol commented May 11, 2014

I have tested this with an 24LC64B EEPROM and it works! The I2CScanner finally detects my device properly now. Thank you @bluesign2k

I wrote some read/write tests which passed and are available here: https://github.com/odbol/EEPROM_I2C

Can we please merge this in ASAP?

@cmaglie
Copy link
Member

cmaglie commented May 23, 2014

I've manually merged the relevant commit here:

e079baa

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Board: Arduino Due Applies only to the Due Component: Core Related to the code for the standard Arduino API Library: Wire The Wire Arduino library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants