diff --git a/libraries/Wire/Wire_nRF52.cpp b/libraries/Wire/Wire_nRF52.cpp index 427f56c9..3875039e 100755 --- a/libraries/Wire/Wire_nRF52.cpp +++ b/libraries/Wire/Wire_nRF52.cpp @@ -46,7 +46,7 @@ TwoWire::TwoWire(NRF_TWIM_Type * p_twim, NRF_TWIS_Type * p_twis, IRQn_Type IRQn, } void TwoWire::begin(void) { - //Master Mode + //Main Mode master = true; *pincfg_reg(_uc_pinSCL) = ((uint32_t)GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos) @@ -72,7 +72,7 @@ void TwoWire::begin(void) { } void TwoWire::begin(uint8_t address) { - //Slave mode + //Secondary mode master = false; *pincfg_reg(_uc_pinSCL) = ((uint32_t)GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos) diff --git a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino index f41511c1..67007804 100755 --- a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino +++ b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino @@ -14,7 +14,7 @@ void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join i2c bus (address optional for main) Serial.begin(9600); // start serial communication at 9600bps while ( !Serial ) delay(10); // for nrf52840 with native usb } @@ -42,7 +42,7 @@ void loop() Wire.endTransmission(); // stop transmitting // step 4: request reading from sensor - Wire.requestFrom(112, 2); // request 2 bytes from slave device #112 + Wire.requestFrom(112, 2); // request 2 bytes from secondary device #112 // step 5: receive reading from sensor if(2 <= Wire.available()) // if two bytes were received diff --git a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino index 38da1c54..54909907 100755 --- a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino +++ b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino @@ -16,7 +16,7 @@ void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join i2c bus (address optional for main) } byte val = 0; diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/main_reader/main_reader.ino similarity index 57% rename from libraries/Wire/examples/master_reader/master_reader.ino rename to libraries/Wire/examples/main_reader/main_reader.ino index ee59610e..7927fab4 100755 --- a/libraries/Wire/examples/master_reader/master_reader.ino +++ b/libraries/Wire/examples/main_reader/main_reader.ino @@ -1,9 +1,9 @@ -// Wire Master Reader +// Wire Main Reader // by Nicholas Zambetti // Demonstrates use of the Wire library -// Reads data from an I2C/TWI slave device -// Refer to the "Wire Slave Sender" example for use with this +// Reads data from an I2C/TWI secondary device +// Refer to the "Wire Secondary Sender" example for use with this // Created 29 March 2006 @@ -14,16 +14,16 @@ void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join i2c bus (address optional for main) Serial.begin(9600); // start serial for output while ( !Serial ) delay(10); // for nrf52840 with native usb } void loop() { - Wire.requestFrom(2, 6); // request 6 bytes from slave device #2 + Wire.requestFrom(2, 6); // request 6 bytes from secondary device #2 - while(Wire.available()) // slave may send less than requested + while(Wire.available()) // secondary may send less than requested { char c = Wire.read(); // receive a byte as character Serial.print(c); // print the character diff --git a/libraries/Wire/examples/master_scan/master_scan.ino b/libraries/Wire/examples/main_scan/main_scan.ino similarity index 100% rename from libraries/Wire/examples/master_scan/master_scan.ino rename to libraries/Wire/examples/main_scan/main_scan.ino diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/main_writer/main_writer.ino similarity index 70% rename from libraries/Wire/examples/master_writer/master_writer.ino rename to libraries/Wire/examples/main_writer/main_writer.ino index ccaa0361..988a3089 100755 --- a/libraries/Wire/examples/master_writer/master_writer.ino +++ b/libraries/Wire/examples/main_writer/main_writer.ino @@ -1,9 +1,9 @@ -// Wire Master Writer +// Wire Main Writer // by Nicholas Zambetti // Demonstrates use of the Wire library -// Writes data to an I2C/TWI slave device -// Refer to the "Wire Slave Receiver" example for use with this +// Writes data to an I2C/TWI secondary device +// Refer to the "Wire Secondary Receiver" example for use with this // Created 29 March 2006 @@ -14,7 +14,7 @@ void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join i2c bus (address optional for main) } byte x = 0; diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/secondary_receiver/secondary_receiver.ino similarity index 81% rename from libraries/Wire/examples/slave_receiver/slave_receiver.ino rename to libraries/Wire/examples/secondary_receiver/secondary_receiver.ino index c0c26286..77e9590c 100755 --- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino +++ b/libraries/Wire/examples/secondary_receiver/secondary_receiver.ino @@ -1,9 +1,9 @@ -// Wire Slave Receiver +// Wire Secondary Receiver // by Nicholas Zambetti // Demonstrates use of the Wire library -// Receives data as an I2C/TWI slave device -// Refer to the "Wire Master Writer" example for use with this +// Receives data as an I2C/TWI secondary device +// Refer to the "Wire Main Writer" example for use with this // Created 29 March 2006 @@ -25,7 +25,7 @@ void loop() delay(100); } -// function that executes whenever data is received from master +// function that executes whenever data is received from main // this function is registered as an event, see setup() void receiveEvent(int howMany) { diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/secondary_sender/secondary_sender.ino similarity index 67% rename from libraries/Wire/examples/slave_sender/slave_sender.ino rename to libraries/Wire/examples/secondary_sender/secondary_sender.ino index d3b238af..974ea45d 100755 --- a/libraries/Wire/examples/slave_sender/slave_sender.ino +++ b/libraries/Wire/examples/secondary_sender/secondary_sender.ino @@ -1,9 +1,9 @@ -// Wire Slave Sender +// Wire Secondary Sender // by Nicholas Zambetti // Demonstrates use of the Wire library -// Sends data as an I2C/TWI slave device -// Refer to the "Wire Master Reader" example for use with this +// Sends data as an I2C/TWI secondary device +// Refer to the "Wire Main Reader" example for use with this // Created 29 March 2006 @@ -23,10 +23,10 @@ void loop() delay(100); } -// function that executes whenever data is requested by master +// function that executes whenever data is requested by main // this function is registered as an event, see setup() void requestEvent() { Wire.write("hello "); // respond with message of 6 bytes - // as expected by master + // as expected by main }