Improvements in EspClass (#222)

* Improvements in EspClass

- fixed not working functions for flash chip size, speed and mode
- added function to retrieve chip revision from eFuse
- flashRead / flashWrite supports encrypted flash

* Rename getCpuRevision function to getChipRevision

* Revert: flashRead / flashWrite supports encrypted flash

Reading and writing to encrypted flash has to be aligned to 16-bytes. Also NAND way of writing (i.e. flipping 1s to 0s) will not work with spi_flash_write_encrypted. Note: spi_flash_read_encrypted will always try to decrypt data, even if it wasn't encrypted in the first place.
This commit is contained in:
Martin Sloup
2017-02-23 01:23:27 +01:00
committed by Me No Dev
parent 1d759380a6
commit 00c1a65612
2 changed files with 41 additions and 32 deletions

View File

@ -45,6 +45,8 @@ typedef enum {
FM_QOUT = 0x01,
FM_DIO = 0x02,
FM_DOUT = 0x03,
FM_FAST_READ = 0x04,
FM_SLOW_READ = 0x05,
FM_UNKNOWN = 0xff
} FlashMode_t;
@ -55,6 +57,7 @@ public:
~EspClass() {}
void restart();
uint32_t getFreeHeap();
uint8_t getChipRevision();
uint8_t getCpuFreqMHz(){ return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ; }
uint32_t getCycleCount();
const char * getSdkVersion();