MCPcopy Create free account
hub / github.com/SmingHub/Sming / requestFrom

Method requestFrom

Sming/Libraries/I2Cdev/I2Cdev.cpp:1416–1432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1414 }
1415
1416 uint8_t TwoWire::requestFrom(uint8_t address, int quantity, uint16_t timeout) {
1417 // clamp to buffer length
1418 if (quantity > NBWIRE_BUFFER_LENGTH) {
1419 quantity = NBWIRE_BUFFER_LENGTH;
1420 }
1421
1422 // perform blocking read into buffer
1423 twi_cbreadFromDone = NULL;
1424 twi_readFrom(address, rxBuffer, quantity);
1425 uint8_t read = twii_WaitForDone(timeout);
1426
1427 // set rx buffer iterator vars
1428 rxBufferIndex = 0;
1429 rxBufferLength = read;
1430
1431 return read;
1432 }
1433
1434 void TwoWire::nbrequestFrom(uint8_t address, int quantity, void (*function)(int)) {
1435 // clamp to buffer length

Callers 15

readBytesMethod · 0.45
readWordsMethod · 0.45
readAxisMethod · 0.45
readRawMethod · 0.45
getLightIntensityMethod · 0.45
Read2Method · 0.45
beginMethod · 0.45
readMethod · 0.45
Read2Method · 0.45
readbyteMethod · 0.45
_readRegMethod · 0.45
readRegisterMethod · 0.45

Calls 2

twii_WaitForDoneFunction · 0.85
twi_readFromFunction · 0.70

Tested by

no test coverage detected