Go Down

Topic: I2C (TWI) Repeated Start implementation in DUE (Read 725 times) previous topic - next topic

pyjune

Mar 21, 2014, 06:19 pm Last Edit: Mar 25, 2014, 01:28 pm by pyjune Reason: 1
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().

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy