Go Down

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


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