arduino-esp32/cores/esp32
chuck todd b05430cfd9 Wire ReSTART fix, with others (#1717)
* ReSTART fix, Sequencing fix

pr #1665 introduce a problem with ReSTART, when solving this problem I found an interaction between the TxFifo refill, RxFifo empty and CMD[] fill.  during certain sequences a dataqueue command would be skipped, this skipping resulted in a mismatch between the contents of the TxFifo and the i2c command sequence.  The problem manifested as an ACK error. 
In addition to this required bug fix I propose:
* `Wire.begin()` be changed from a `void` to a `bool` this will allow the reset functionality of `Wire.begin()` to be reported.  Currently `Wire.begin()` attempts to reset the i2c Peripheral, but cannot report success/failure.
* `Wire.busy()` be added. this `bool` function returns the hardware status of the bus. This status can be use in multi-master environments for application level interleaving of commands, also in single master environment, it can be used to detect a 'hung' bus.  With the functional change to `Wire.begin()` this allows app level recover of a hung bus.
* `Wire.lastError()` value updated for all errors, previously when interleaving `Wire.endTransmission(false)` and `Wire.readTransmission(false)`, the 128 byte `Wire.write()` buffer was exhausted without generating and error(very exotic). I discovered this error when I created a sequence of directed reads to a EEPROM. Each directed read used 2 bytes of the 128 byte `write()` buffer, so after 64 consecutive ReSTART writes with ReSTART reads, `Wire()`  had no room to record the directed address bytes.  It generated just a NAK check without setting the EEPROMs internal register address.  The succeeding ReSTART read succeeded at incorrect address.
* Changes to the HAL layer:
** added `i2cGetStatus()` which returns the i2c peripheral status word, used to detect bus_busy currently
** added `i2cDebug()` programmatic control of debug buffer output
** changed `i2cAddQueue()` to allow data_only queue element this will allow a i2c transaction to use multiple data pointers.
** removed direct access to DumpInts(), DumpI2c() from app, use i2cDebug() to set trigger points 
 
*

* Update esp32-hal-i2c.c

* Update Wire.cpp

* ReSTART, Sequencing

pr #1665 introduce a problem with ReSTART, when solving this problem I found an interaction between the TxFifo refill, RxFifo empty and CMD[] fill.  during certain sequences a dataqueue command would be skipped, this skipping resulted in a mismatch between the contents of the TxFifo and the i2c command sequence.  The problem manifested as an ACK error. 
In addition to this required bug fix I propose:
* `Wire.begin()` be changed from a `void` to a `bool` this will allow the reset functionality of `Wire.begin()` to be reported.  Currently `Wire.begin()` attempts to reset the i2c Peripheral, but cannot report success/failure.
* `Wire.busy()` be added. this `bool` function returns the hardware status of the bus. This status can be use in multi-master environments for application level interleaving of commands, also in single master environment, it can be used to detect a 'hung' bus.  With the functional change to `Wire.begin()` this allows app level recover of a hung bus.
* `Wire.lastError()` value updated for all errors, previously when interleaving `Wire.endTransmission(false)` and `Wire.readTransmission(false)`, the 128 byte `Wire.write()` buffer was exhausted without generating and error(very exotic). I discovered this error when I created a sequence of directed reads to a EEPROM. Each directed read used 2 bytes of the 128 byte `write()` buffer, so after 64 consecutive ReSTART writes with ReSTART reads, `Wire()`  had no room to record the directed address bytes.  It generated just a NAK check without setting the EEPROMs internal register address.  The succeeding ReSTART read succeeded at incorrect address.
* Changes to the HAL layer:
** added `i2cGetStatus()` which returns the i2c peripheral status word, used to detect bus_busy currently
** added `i2cDebug()` programmatic control of debug buffer output
** changed `i2cAddQueue()` to allow data_only queue element this will allow a i2c transaction to use multiple data pointers.
** removed direct access to DumpInts(), DumpI2c() from app, use i2cDebug() to set trigger points 
 
*

* Forgot DebugFlags Return

@andriyadi found this, total brain fade on my part.
2018-08-14 11:51:15 +02:00
..
libb64 fix libb64 2017-05-06 18:56:25 +03:00
Arduino.h Add compatibility macros with esp8266 (#783) 2017-10-30 10:27:26 +01:00
base64.cpp Convert the few remaining cr/lf files to use lf for eol. (#1316) 2018-04-16 16:34:39 +02:00
base64.h Convert the few remaining cr/lf files to use lf for eol. (#1316) 2018-04-16 16:34:39 +02:00
binary.h initial import 2016-10-06 07:09:44 -06:00
cbuf.cpp Fix cbuf not being able to hold the full length 2017-01-24 17:57:44 +02:00
cbuf.h initial import 2016-10-06 07:09:44 -06:00
Client.h initial import 2016-10-06 07:09:44 -06:00
esp32-hal-adc.c Add Arduino SAM compatible analogReadResolution and Non-Blocking ADC api 2017-03-03 15:53:20 +02:00
esp32-hal-adc.h Add Arduino SAM compatible analogReadResolution and Non-Blocking ADC api 2017-03-03 15:53:20 +02:00
esp32-hal-bt.c Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
esp32-hal-bt.h BT define the hal methods even if BT is disabled (but return false) 2017-05-06 18:50:20 +03:00
esp32-hal-dac.c Add analogRead, touchRead, dacWrite and updated esp-idf 2016-12-08 23:43:41 +02:00
esp32-hal-dac.h Missing include gpio.h in esp32-hal-dac.h (#1512) 2018-06-19 11:33:17 +03:00
esp32-hal-gpio.c Allow using argument with attachInterrupt (#1535) 2018-07-07 11:26:58 +02:00
esp32-hal-gpio.h Allow using argument with attachInterrupt (#1535) 2018-07-07 11:26:58 +02:00
esp32-hal-i2c.c Wire ReSTART fix, with others (#1717) 2018-08-14 11:51:15 +02:00
esp32-hal-i2c.h Wire ReSTART fix, with others (#1717) 2018-08-14 11:51:15 +02:00
esp32-hal-ledc.c Update IDF to 1c3dd23 2018-01-18 00:56:58 +02:00
esp32-hal-ledc.h LEDC Driver Update 2017-01-09 18:05:30 +02:00
esp32-hal-log.h Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
esp32-hal-matrix.c initial import 2016-10-06 07:09:44 -06:00
esp32-hal-matrix.h initial import 2016-10-06 07:09:44 -06:00
esp32-hal-misc.c Add Wrover Support and Option to enable SPIRAM 2018-07-03 23:03:50 +02:00
esp32-hal-psram.c Add Wrover Support and Option to enable SPIRAM 2018-07-03 23:03:50 +02:00
esp32-hal-psram.h Add Wrover Support and Option to enable SPIRAM 2018-07-03 23:03:50 +02:00
esp32-hal-sigmadelta.c Fix wrong range of duty cycle (#1353) 2018-05-14 13:18:03 +02:00
esp32-hal-sigmadelta.h fix renamed method names for SigmaDelta 2017-01-09 21:55:37 +02:00
esp32-hal-spi.c Fixes SPI mode setting (Issue #1094) (#1096) 2018-03-04 20:56:33 +01:00
esp32-hal-spi.h SPI implement transaction locking 2017-02-14 04:15:38 +02:00
esp32-hal-time.c Use correct sign of offset for TZ variable (#685) 2017-10-01 10:19:00 +08:00
esp32-hal-timer.c OK Really change timer allocator 2017-09-28 18:38:07 +08:00
esp32-hal-timer.h Initial Timers driver 2016-12-09 17:47:30 +02:00
esp32-hal-touch.c Change Touch interrupt allocator 2017-09-28 16:44:47 +08:00
esp32-hal-touch.h Add analogRead, touchRead, dacWrite and updated esp-idf 2016-12-08 23:43:41 +02:00
esp32-hal-uart.c Port UART reset fix from ESP-IDF (#1408) 2018-07-03 17:54:08 +02:00
esp32-hal-uart.h HardwareSerial - availableForWrite() support (#1226) 2018-04-06 19:07:46 +03:00
esp32-hal.h Add Wrover Support and Option to enable SPIRAM 2018-07-03 23:03:50 +02:00
esp8266-compat.h Convert the few remaining cr/lf files to use lf for eol. (#1316) 2018-04-16 16:34:39 +02:00
Esp.cpp FIX: getEfuseMac can return random data (#1059) 2018-03-04 20:35:14 +01:00
Esp.h Add ESP.getChipId() function to get ESP32's ChipID. (#322) 2017-05-05 09:59:54 +03:00
HardwareSerial.cpp Add declarations for all Serial, SPI and Wire buses 2018-07-03 20:41:03 +02:00
HardwareSerial.h Add declarations for all Serial, SPI and Wire buses 2018-07-03 20:41:03 +02:00
IPAddress.cpp const correctness (#89) 2016-12-12 01:32:55 +02:00
IPAddress.h const correctness (#89) 2016-12-12 01:32:55 +02:00
IPv6Address.cpp Add initial IPv6 Support 2017-01-06 00:54:50 +02:00
IPv6Address.h Add initial IPv6 Support 2017-01-06 00:54:50 +02:00
main.cpp Use esp_timer_get_time as time source for micros and mills (#1424) 2018-05-22 16:12:30 +02:00
MD5Builder.cpp initial import 2016-10-06 07:09:44 -06:00
MD5Builder.h initial import 2016-10-06 07:09:44 -06:00
pgmspace.h std::functioanl for WFIF event + Minor fix (#1366) 2018-05-14 13:05:49 +02:00
Print.cpp Fixes implementation of __FlashStringHelper (#183) 2017-02-08 19:57:26 +02:00
Print.h Fixes implementation of __FlashStringHelper (#183) 2017-02-08 19:57:26 +02:00
Printable.h initial import 2016-10-06 07:09:44 -06:00
Server.h Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
stdlib_noniso.c include stdlib_noniso in Arduino.h 2016-10-26 02:13:00 +03:00
stdlib_noniso.h initial import 2016-10-06 07:09:44 -06:00
Stream.cpp Wiring.h -> Arduino.h 2016-10-06 07:09:45 -06:00
Stream.h initial import 2016-10-06 07:09:44 -06:00
StreamString.cpp Convert the few remaining cr/lf files to use lf for eol. (#1316) 2018-04-16 16:34:39 +02:00
StreamString.h Convert the few remaining cr/lf files to use lf for eol. (#1316) 2018-04-16 16:34:39 +02:00
Udp.h initial import 2016-10-06 07:09:44 -06:00
WCharacter.h Wiring.h -> Arduino.h 2016-10-06 07:09:45 -06:00
wiring_private.h Do not include file that does not exist 2016-11-13 13:26:49 +02:00
wiring_pulse.c Enable pulseIn() (#140) 2017-01-20 21:49:17 +02:00
wiring_shift.c add shiftIn shiftOut 2016-11-13 16:53:56 +02:00
WMath.cpp use esp_random in WMath.cpp 2016-12-02 13:42:31 +02:00
WString.cpp Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
WString.h Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00