ESP8266
Public Member Functions | List of all members
EspClass Class Reference

Public Member Functions

void wdtEnable (uint32_t timeout_ms=0)
 
void wdtEnable (WDTO_t timeout_ms=WDTO_0MS)
 
void wdtDisable ()
 
void wdtFeed ()
 
void deepSleep (uint32_t time_us, RFMode mode=RF_DEFAULT)
 
void reset ()
 
void restart ()
 
uint16_t getVcc ()
 
uint32_t getFreeHeap ()
 
uint32_t getChipId ()
 
const char * getSdkVersion ()
 
uint8_t getBootVersion ()
 
uint8_t getBootMode ()
 
uint8_t getCpuFreqMHz ()
 
uint32_t getFlashChipId ()
 
uint32_t getFlashChipRealSize ()
 
uint32_t getFlashChipSize ()
 
uint32_t getFlashChipSpeed ()
 
FlashMode_t getFlashChipMode ()
 
uint32_t getFlashChipSizeByChipId ()
 
uint32_t magicFlashChipSize (uint8_t byte)
 
uint32_t magicFlashChipSpeed (uint8_t byte)
 
FlashMode_t magicFlashChipMode (uint8_t byte)
 
bool checkFlashConfig (bool needsEquals=false)
 
bool flashEraseSector (uint32_t sector)
 
bool flashWrite (uint32_t offset, uint32_t *data, size_t size)
 
bool flashRead (uint32_t offset, uint32_t *data, size_t size)
 
uint32_t getSketchSize ()
 
uint32_t getFreeSketchSpace ()
 
bool updateSketch (Stream &in, uint32_t size, bool restartOnFail=false, bool restartOnSuccess=true)
 
String getResetInfo ()
 
struct rst_info * getResetInfoPtr ()
 
bool eraseConfig ()
 
uint32_t getCycleCount ()
 

Member Function Documentation

bool EspClass::checkFlashConfig ( bool  needsEquals = false)

check the Flash settings from IDE against the Real flash size

Parameters
needsEquals(return only true it equals)
Returns
ok or not
void EspClass::deepSleep ( uint32_t  time_us,
RFMode  mode = RF_DEFAULT 
)
bool EspClass::eraseConfig ( void  )
bool EspClass::flashEraseSector ( uint32_t  sector)
bool EspClass::flashRead ( uint32_t  offset,
uint32_t *  data,
size_t  size 
)
bool EspClass::flashWrite ( uint32_t  offset,
uint32_t *  data,
size_t  size 
)
uint8_t EspClass::getBootMode ( void  )
uint8_t EspClass::getBootVersion ( void  )
uint32_t EspClass::getChipId ( void  )
uint8_t EspClass::getCpuFreqMHz ( void  )
uint32_t EspClass::getCycleCount ( )
uint32_t EspClass::getFlashChipId ( void  )
FlashMode_t EspClass::getFlashChipMode ( void  )
uint32_t EspClass::getFlashChipRealSize ( void  )
uint32_t EspClass::getFlashChipSize ( void  )
uint32_t EspClass::getFlashChipSizeByChipId ( void  )

Infos from http://www.wlxmall.com/images/stock_item/att/A1010004.pdf http://www.gigadevice.com/product-series/5.html?locale=en_US http://www.elinux.org/images/f/f5/Winbond-w25q32.pdf

Chip ID 00 - always 00 (Chip ID use only 3 byte) 17 - ? looks like 2^xx is size in Byte ? //todo: find docu to this 40 - ? may be Speed ? //todo: find docu to this C8 - manufacturer ID

uint32_t EspClass::getFlashChipSpeed ( void  )
uint32_t EspClass::getFreeHeap ( void  )
uint32_t EspClass::getFreeSketchSpace ( )
String EspClass::getResetInfo ( void  )
struct rst_info * EspClass::getResetInfoPtr ( void  )
const char * EspClass::getSdkVersion ( void  )
uint32_t EspClass::getSketchSize ( )
uint16_t EspClass::getVcc ( void  )
FlashMode_t EspClass::magicFlashChipMode ( uint8_t  byte)
uint32_t EspClass::magicFlashChipSize ( uint8_t  byte)
uint32_t EspClass::magicFlashChipSpeed ( uint8_t  byte)
void EspClass::reset ( void  )
void EspClass::restart ( void  )
bool EspClass::updateSketch ( Stream in,
uint32_t  size,
bool  restartOnFail = false,
bool  restartOnSuccess = true 
)
void EspClass::wdtDisable ( void  )

Please don't stop software watchdog too long (less than 6 seconds), otherwise it will trigger hardware watchdog reset.

void EspClass::wdtEnable ( uint32_t  timeout_ms = 0)

This API can only be called if software watchdog is stopped

void EspClass::wdtEnable ( WDTO_t  timeout_ms = WDTO_0MS)
void EspClass::wdtFeed ( void  )