![]() |
RUI3 (RAK Unified Interface 3) - RAK4631
|
Functions | |
void | begin (void) |
void | end (void) |
void | setClock (uint32_t freq) |
void | beginTransmission (uint8_t address) |
uint32_t | endTransmission (uint8_t sendStop=true) |
uint8_t | requestFrom (uint8_t address, uint8_t quantity, uint8_t sendStop) |
virtual size_t | write (const uint8_t *data, size_t size) |
virtual int | available (void) |
virtual int | read (void) |
void begin | ( | void | ) |
void setup() { Wire.begin(); } void loop() { }
void end | ( | void | ) |
void setup() { Wire.begin(); } void loop() { Wire.end(); }
void setClock | ( | uint32_t | freq | ) |
freq | the value (in Hertz) of desired communication clock. Accepted values are 100000 (standard mode) and 400000 (fast mode) |
void setup() { Wire.begin(); Wire.setClock(400000); } void loop() { }
void beginTransmission | ( | uint8_t | address | ) |
address | the 7-bit address of the device to transmit to |
void setup() { Wire.begin(); } void loop() { Wire.beginTransmission(0b1110000); Wire.write(0x35); Wire.endTransmission(); }
uint32_t endTransmission | ( | uint8_t | sendStop = true | ) |
sendStop(optional) | true will send a stop message, releasing the bus after transmission. false will send a restart, keeping the connection active(default = false) |
0 | success |
1 | fail |
void setup() { Wire.begin(); } void loop() { Wire.beginTransmission(0b1110000); Wire.write(0x35); Wire.endTransmission(); }
uint8_t requestFrom | ( | uint8_t | address, |
uint8_t | quantity, | ||
uint8_t | sendStop | ||
) |
address | the 7-bit address of the device to request bytes from |
quantity | the number of bytes to request |
sendStop | true will send a stop message after the request, releasing the bus. false will continually send a restart after the request, keeping the connection active(default = false) |
void setup() { Wire.begin(); } void loop() { Wire.beginTransmission(0b1110000); Wire.write(0x35); Wire.endTransmission(); Wire.requestFrom(0b1110000, 6); while(Wire.available()) { char c = Wire.read(); Serial.print(c); } delay(5000); }
|
virtual |
value | a value to send as a single byte |
data | an array of data to send as bytes |
size | the number of bytes to transmit |
void setup() { Wire.begin(); } void loop() { Wire.beginTransmission(0b1110000); Wire.write(0x35); Wire.endTransmission(); Wire.requestFrom(0b1110000, 6); while(Wire.available()) { char c = Wire.read(); Serial.print(c); } delay(5000); }
Reimplemented from Print.
|
virtual |
void setup() { Wire.begin(); } void loop() { Wire.beginTransmission(0b1110000); Wire.write(0x35); Wire.endTransmission(); Wire.requestFrom(0b1110000, 6); while(Wire.available()) { char c = Wire.read(); Serial.print(c); } delay(5000); }
Implements Stream.
|
virtual |
void setup() { Wire.begin(); } void loop() { Wire.beginTransmission(0b1110000); Wire.write(0x35); Wire.endTransmission(); Wire.requestFrom(0b1110000, 6); while(Wire.available()) { char c = Wire.read(); Serial.print(c); } delay(5000); }
Implements Stream.