Pages: [1]   Go Down
Author Topic: I2C (TWI) Repeated Start implementation in DUE  (Read 491 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had modified requestFrom() in Wire.cpp.
(The blue letters are changed part.)

uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop, uint32_t iaddress, uint8_t isize) {
        ......
   TWI_StartRead(twi, address, iaddress, isize);
        .......
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity) {
   return requestFrom((uint8_t) address, (uint8_t) quantity, (uint8_t) true, (uint32_t) 0, (uint8_t)  0);
}

uint8_t TwoWire::requestFrom(int address, int quantity) {
   return requestFrom((uint8_t) address, (uint8_t) quantity, (uint8_t) true, (uint32_t) 0, (uint8_t) 0);
}

uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop) {
   return requestFrom((uint8_t) address, (uint8_t) quantity, (uint8_t) sendStop, (uint32_t) 0, (uint8_t) 0);
}

And the wire.h is also changed.

    ......
    uint8_t requestFrom(uint8_t, uint8_t, uint8_t, uint32_t, uint8_t);
    ......

Please, refer to attached image for using new requestFrom().


* repeated_start.png (61.87 KB, 1244x422 - viewed 44 times.)
« Last Edit: March 25, 2014, 07:28:02 am by pyjune » Logged

Pages: [1]   Go Up
Jump to: