aboutsummaryrefslogtreecommitdiff
path: root/libraries/Wire
diff options
context:
space:
mode:
authorDave Madison <dmadison@users.noreply.github.com>2022-02-22 02:32:00 -0500
committerGitHub <noreply@github.com>2022-02-22 02:32:00 -0500
commitd52b6ea456dd145025659359847e3ba8b58b5a27 (patch)
tree7c106c4e741e47ef5dd9f4f45529fd6a6010a896 /libraries/Wire
parentf47a97522dc28c16c432422e3085035de69cfaf6 (diff)
parent6f5881438af5b416fe83b0721a51215b9833498c (diff)
Merge pull request #14 from dmadison/upstream-1.8.4
Merge upstream tag '1.8.4'
Diffstat (limited to 'libraries/Wire')
-rw-r--r--libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino8
-rw-r--r--libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino3
-rw-r--r--libraries/Wire/examples/i2c_scanner/i2c_scanner.ino6
-rw-r--r--libraries/Wire/examples/master_reader/master_reader.ino2
-rw-r--r--libraries/Wire/examples/master_writer/master_writer.ino2
-rw-r--r--libraries/Wire/examples/slave_receiver/slave_receiver.ino2
-rw-r--r--libraries/Wire/examples/slave_sender/slave_sender.ino2
-rw-r--r--libraries/Wire/src/Wire.cpp4
-rw-r--r--libraries/Wire/src/utility/twi.c12
9 files changed, 20 insertions, 21 deletions
diff --git a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino
index 4d0a68f..aeb1a9c 100644
--- a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino
+++ b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino
@@ -3,7 +3,7 @@
// and James Tichenor <http://www.jamestichenor.net>
// Demonstrates use of the Wire library reading data from the
-// Devantech Utrasonic Rangers SFR08 and SFR10
+// Devantech Ultrasonic Rangers SFR08 and SFR10
// Created 29 April 2006
@@ -13,8 +13,8 @@
#include <Wire.h>
void setup() {
- Wire.begin(); // join i2c bus (address optional for master)
- Serial.begin(9600); // start serial communication at 9600bps
+ Wire.begin(); // join I2C bus (address optional for master)
+ Serial.begin(9600); // start serial communication at 9600 bps
}
int reading = 0;
@@ -23,7 +23,7 @@ void loop() {
// step 1: instruct sensor to read echoes
Wire.beginTransmission(112); // transmit to device #112 (0x70)
// the address specified in the datasheet is 224 (0xE0)
- // but i2c adressing uses the high 7 bits so it's 112
+ // but I2C addressing uses the high 7 bits so it's 112
Wire.write(byte(0x00)); // sets register pointer to the command register (0x00)
Wire.write(byte(0x50)); // command sensor to measure in "inches" (0x50)
// use 0x51 for centimeters
diff --git a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino
index dd40a25..b5da366 100644
--- a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino
+++ b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino
@@ -13,7 +13,7 @@
#include <Wire.h>
void setup() {
- Wire.begin(); // join i2c bus (address optional for master)
+ Wire.begin(); // join I2C bus (address optional for master)
}
byte val = 0;
@@ -31,4 +31,3 @@ void loop() {
}
delay(500);
}
-
diff --git a/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino b/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino
index 3febbf4..295edf7 100644
--- a/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino
+++ b/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino
@@ -5,7 +5,7 @@
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
-// The original author is not know.
+// The original author is not known.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
@@ -33,7 +33,7 @@ void setup() {
Wire.begin();
Serial.begin(9600);
- while (!Serial); // Leonardo: wait for serial monitor
+ while (!Serial); // Leonardo: wait for Serial Monitor
Serial.println("\nI2C Scanner");
}
@@ -44,7 +44,7 @@ void loop() {
for (byte address = 1; address < 127; ++address) {
// The i2c_scanner uses the return value of
- // the Write.endTransmisstion to see if
+ // the Wire.endTransmission to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
byte error = Wire.endTransmission();
diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino
index ecab72a..e27cac3 100644
--- a/libraries/Wire/examples/master_reader/master_reader.ino
+++ b/libraries/Wire/examples/master_reader/master_reader.ino
@@ -13,7 +13,7 @@
#include <Wire.h>
void setup() {
- Wire.begin(); // join i2c bus (address optional for master)
+ Wire.begin(); // join I2C bus (address optional for master)
Serial.begin(9600); // start serial for output
}
diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino
index 5cbea11..7a17668 100644
--- a/libraries/Wire/examples/master_writer/master_writer.ino
+++ b/libraries/Wire/examples/master_writer/master_writer.ino
@@ -13,7 +13,7 @@
#include <Wire.h>
void setup() {
- Wire.begin(); // join i2c bus (address optional for master)
+ Wire.begin(); // join I2C bus (address optional for master)
}
byte x = 0;
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 8051d53..9b3f814 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -13,7 +13,7 @@
#include <Wire.h>
void setup() {
- Wire.begin(8); // join i2c bus with address #8
+ Wire.begin(8); // join I2C bus with address #8
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index d2e72bb..6e2ed49 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -13,7 +13,7 @@
#include <Wire.h>
void setup() {
- Wire.begin(8); // join i2c bus with address #8
+ Wire.begin(8); // join I2C bus with address #8
Wire.onRequest(requestEvent); // register event
}
diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp
index c407776..001d924 100644
--- a/libraries/Wire/src/Wire.cpp
+++ b/libraries/Wire/src/Wire.cpp
@@ -100,7 +100,7 @@ void TwoWire::setClock(uint32_t clock)
* when `clearWireTimeoutFlag()` or `setWireTimeoutUs()` is called.
*
* Note that this timeout can also trigger while waiting for clock stretching or waiting for a second master
- * to complete its transaction. So make sure to adapt the timeout to accomodate for those cases if needed.
+ * to complete its transaction. So make sure to adapt the timeout to accommodate for those cases if needed.
* A typical timeout would be 25ms (which is the maximum clock stretching allowed by the SMBus protocol),
* but (much) shorter values will usually also work.
*
@@ -120,7 +120,7 @@ void TwoWire::setWireTimeout(uint32_t timeout, bool reset_with_timeout){
/***
* Returns the TWI timeout flag.
*
- * @return true if timeout has occured since the flag was last cleared.
+ * @return true if timeout has occurred since the flag was last cleared.
*/
bool TwoWire::getWireTimeoutFlag(void){
return(twi_manageTimeoutFlag(false));
diff --git a/libraries/Wire/src/utility/twi.c b/libraries/Wire/src/utility/twi.c
index e8a41a2..e09a33c 100644
--- a/libraries/Wire/src/utility/twi.c
+++ b/libraries/Wire/src/utility/twi.c
@@ -175,7 +175,7 @@ uint8_t twi_readFrom(uint8_t address, uint8_t* data, uint8_t length, uint8_t sen
}
twi_state = TWI_MRX;
twi_sendStop = sendStop;
- // reset error state (0xFF.. no error occured)
+ // reset error state (0xFF.. no error occurred)
twi_error = 0xFF;
// initialize buffer iteration vars
@@ -183,7 +183,7 @@ uint8_t twi_readFrom(uint8_t address, uint8_t* data, uint8_t length, uint8_t sen
twi_masterBufferLength = length-1; // This is not intuitive, read on...
// On receive, the previously configured ACK/NACK setting is transmitted in
// response to the received byte before the interrupt is signalled.
- // Therefor we must actually set NACK when the _next_ to last byte is
+ // Therefore we must actually set NACK when the _next_ to last byte is
// received, causing that NACK to be sent in response to receiving the last
// expected byte of data.
@@ -269,7 +269,7 @@ uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait
}
twi_state = TWI_MTX;
twi_sendStop = sendStop;
- // reset error state (0xFF.. no error occured)
+ // reset error state (0xFF.. no error occurred)
twi_error = 0xFF;
// initialize buffer iteration vars
@@ -294,7 +294,7 @@ uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait
// We need to remove ourselves from the repeated start state before we enable interrupts,
// since the ISR is ASYNC, and we could get confused if we hit the ISR before cleaning
// up. Also, don't enable the START interrupt. There may be one pending from the
- // repeated start that we sent outselves, and that would really confuse things.
+ // repeated start that we sent ourselves, and that would really confuse things.
twi_inRepStart = false; // remember, we're dealing with an ASYNC ISR
startMicros = micros();
do {
@@ -411,7 +411,7 @@ void twi_stop(void)
// send stop condition
TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO);
- // wait for stop condition to be exectued on bus
+ // wait for stop condition to be executed on bus
// TWINT is not set after a stop condition!
// We cannot use micros() from an ISR, so approximate the timeout with cycle-counted delays
const uint8_t us_per_loop = 8;
@@ -490,7 +490,7 @@ void twi_handleTimeout(bool reset){
* Desc returns true if twi has seen a timeout
* optionally clears the timeout flag
* Input clear_flag: true if we should reset the hardware
- * Output none
+ * Output the value of twi_timed_out_flag when the function was called
*/
bool twi_manageTimeoutFlag(bool clear_flag){
bool flag = twi_timed_out_flag;