aboutsummaryrefslogtreecommitdiff
path: root/libraries/Wire
diff options
context:
space:
mode:
authorMartino Facchin <m.facchin@arduino.cc>2021-05-26 15:50:02 +0200
committerGitHub <noreply@github.com>2021-05-26 15:50:02 +0200
commit24e6edd475c287cdafee0a4db2eb98927ce3cf58 (patch)
treeb3251605dc629e3bbc8ab899b4f4ffe66b1e1e98 /libraries/Wire
parent1ac42f7ac0c365cfa4d901889ff6d4c23d3b4796 (diff)
parent20dc2e532e5cecd17a7f463cf86541d87e5090e8 (diff)
Merge pull request #413 from per1234/ci
Use GitHub Actions for continuous integration
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.c10
9 files changed, 19 insertions, 20 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 d223760..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;