mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-04 18:03:20 +03:00
Merge branch 'esp8266-esp8266' into esp8266
This commit is contained in:
commit
93f7240329
20
.gitignore
vendored
20
.gitignore
vendored
@ -21,32 +21,36 @@ build/windows/libastylej*
|
||||
build/windows/arduino-*.zip
|
||||
build/windows/dist/*.tar.gz
|
||||
build/windows/dist/*.tar.bz2
|
||||
build/windows/launch4j-*
|
||||
build/windows/launch4j-*.tgz
|
||||
build/windows/launch4j-*.zip
|
||||
build/windows/launcher/launch4j
|
||||
build/windows/WinAVR-*.zip
|
||||
build/macosx/arduino-*.zip
|
||||
build/macosx/dist/*.tar.gz
|
||||
build/macosx/dist/*.tar.bz2
|
||||
build/macosx/*.tar.bz2
|
||||
build/macosx/libastylej*
|
||||
build/macosx/appbundler*.jar
|
||||
build/macosx/appbundler*.zip
|
||||
build/macosx/appbundler
|
||||
build/macosx/appbundler-1.0ea-arduino2
|
||||
build/macosx/appbundler-1.0ea-upstream1
|
||||
build/linux/work/
|
||||
build/linux/dist/*.tar.gz
|
||||
build/linux/dist/*.tar.bz2
|
||||
build/linux/*.tgz
|
||||
build/linux/*.tar.xz
|
||||
build/linux/*.tar.bz2
|
||||
build/linux/*.zip
|
||||
build/linux/libastylej*
|
||||
build/shared/reference*.zip
|
||||
build/shared/Edison*.zip
|
||||
build/shared/Galileo*.zip
|
||||
test-bin
|
||||
*.iml
|
||||
.idea
|
||||
.DS_Store
|
||||
.directory
|
||||
build/windows/launch4j-*
|
||||
build/windows/launcher/launch4j
|
||||
build/windows/WinAVR-*.zip
|
||||
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
|
||||
avr-toolchain-*.zip
|
||||
/hardware/tools/esp8266/utils/
|
||||
@ -57,6 +61,14 @@ avr-toolchain-*.zip
|
||||
/hardware/tools/bossac.exe
|
||||
/hardware/tools/listComPorts.exe
|
||||
|
||||
/app/nbproject/private/
|
||||
/arduino-core/nbproject/private/
|
||||
/app/build/
|
||||
/arduino-core/build/
|
||||
|
||||
manifest.mf
|
||||
nbbuild.xml
|
||||
nbproject
|
||||
build/macosx/esptool-*-osx.zip
|
||||
|
||||
build/macosx/dist/osx-xtensa-lx106-elf.tgz
|
||||
|
@ -38,7 +38,6 @@ extern "C" {
|
||||
#include "pgmspace.h"
|
||||
#include "esp8266_peri.h"
|
||||
#include "twi.h"
|
||||
//#include "spiffs/spiffs.h"
|
||||
|
||||
void yield(void);
|
||||
|
||||
|
@ -20,60 +20,126 @@
|
||||
*/
|
||||
#include "FileSystem.h"
|
||||
#include "Arduino.h"
|
||||
#include "spiffs/spiffs_esp8266.h"
|
||||
|
||||
bool FSClass::mount() {
|
||||
if(SPIFFS_mounted(&_filesystemStorageHandle)) return true;
|
||||
int res = spiffs_mount();
|
||||
if(res != 0){
|
||||
int formated = SPIFFS_format(&_filesystemStorageHandle);
|
||||
if(formated != 0) return false;
|
||||
res = spiffs_mount();
|
||||
}
|
||||
return (res == 0);
|
||||
#define LOGICAL_PAGE_SIZE 256
|
||||
#define LOGICAL_BLOCK_SIZE 512
|
||||
|
||||
|
||||
// These addresses are defined in the linker script.
|
||||
// For each flash memory size there is a linker script variant
|
||||
// which sets spiffs location and size.
|
||||
extern "C" uint32_t _SPIFFS_start;
|
||||
extern "C" uint32_t _SPIFFS_end;
|
||||
|
||||
static s32_t api_spiffs_read(u32_t addr, u32_t size, u8_t *dst);
|
||||
static s32_t api_spiffs_write(u32_t addr, u32_t size, u8_t *src);
|
||||
static s32_t api_spiffs_erase(u32_t addr, u32_t size);
|
||||
|
||||
FSClass FS((uint32_t) &_SPIFFS_start, (uint32_t) &_SPIFFS_end, 4);
|
||||
|
||||
FSClass::FSClass(uint32_t beginAddress, uint32_t endAddress, uint32_t maxOpenFiles)
|
||||
: _beginAddress(beginAddress)
|
||||
, _endAddress(endAddress)
|
||||
, _maxOpenFiles(maxOpenFiles)
|
||||
, _fs({0})
|
||||
{
|
||||
}
|
||||
|
||||
int FSClass::_mountInternal(){
|
||||
if (_beginAddress == 0 || _beginAddress >= _endAddress){
|
||||
SPIFFS_API_DBG_E("Can't start file system, wrong address\r\n");
|
||||
return SPIFFS_ERR_NOT_CONFIGURED;
|
||||
}
|
||||
|
||||
spiffs_config cfg = {0};
|
||||
cfg.phys_addr = _beginAddress;
|
||||
cfg.phys_size = _endAddress - _beginAddress;
|
||||
cfg.phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE;
|
||||
cfg.log_block_size = LOGICAL_BLOCK_SIZE;
|
||||
cfg.log_page_size = LOGICAL_PAGE_SIZE;
|
||||
cfg.hal_read_f = api_spiffs_read;
|
||||
cfg.hal_write_f = api_spiffs_write;
|
||||
cfg.hal_erase_f = api_spiffs_erase;
|
||||
|
||||
SPIFFS_API_DBG_V("FSClass::_mountInternal: start:%x, size:%d Kb\n", cfg.phys_addr, cfg.phys_size / 1024);
|
||||
|
||||
_work.reset(new uint8_t[LOGICAL_BLOCK_SIZE]);
|
||||
_fdsSize = 32 * _maxOpenFiles;
|
||||
_fds.reset(new uint8_t[_fdsSize]);
|
||||
_cacheSize = (32 + LOGICAL_PAGE_SIZE) * _maxOpenFiles;
|
||||
_cache.reset(new uint8_t[_cacheSize]);
|
||||
|
||||
s32_t res = SPIFFS_mount(&_fs,
|
||||
&cfg,
|
||||
_work.get(),
|
||||
_fds.get(),
|
||||
_fdsSize,
|
||||
_cache.get(),
|
||||
_cacheSize,
|
||||
NULL);
|
||||
SPIFFS_API_DBG_V("FSClass::_mountInternal: %d\n", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
bool FSClass::mount() {
|
||||
if(SPIFFS_mounted(&_fs))
|
||||
return true;
|
||||
|
||||
int res = _mountInternal();
|
||||
if(res != SPIFFS_OK){
|
||||
int formated = SPIFFS_format(&_fs);
|
||||
if(formated != SPIFFS_OK)
|
||||
return false;
|
||||
res = _mountInternal();
|
||||
}
|
||||
return (res == SPIFFS_OK);
|
||||
}
|
||||
|
||||
// TODO: need to invalidate open file objects
|
||||
void FSClass::unmount() {
|
||||
if(SPIFFS_mounted(&_filesystemStorageHandle))
|
||||
SPIFFS_unmount(&_filesystemStorageHandle);
|
||||
if(SPIFFS_mounted(&_fs))
|
||||
SPIFFS_unmount(&_fs);
|
||||
}
|
||||
|
||||
bool FSClass::format() {
|
||||
if(!SPIFFS_mounted(&_filesystemStorageHandle)){
|
||||
spiffs_mount();
|
||||
if(!SPIFFS_mounted(&_fs)){
|
||||
_mountInternal();
|
||||
}
|
||||
SPIFFS_unmount(&_filesystemStorageHandle);
|
||||
int formated = SPIFFS_format(&_filesystemStorageHandle);
|
||||
if(formated != 0) return false;
|
||||
return (spiffs_mount() == 0);
|
||||
SPIFFS_unmount(&_fs);
|
||||
int formated = SPIFFS_format(&_fs);
|
||||
if(formated != SPIFFS_OK)
|
||||
return false;
|
||||
return (_mountInternal() == SPIFFS_OK);
|
||||
}
|
||||
|
||||
bool FSClass::check() {
|
||||
return SPIFFS_check(&_filesystemStorageHandle) == 0;
|
||||
return SPIFFS_check(&_fs) == SPIFFS_OK;
|
||||
}
|
||||
|
||||
bool FSClass::exists(char *filename) {
|
||||
spiffs_stat stat = {0};
|
||||
if (SPIFFS_stat(&_filesystemStorageHandle, filename, &stat) < 0)
|
||||
if (SPIFFS_stat(&_fs, filename, &stat) < 0)
|
||||
return false;
|
||||
return stat.name[0] != '\0';
|
||||
}
|
||||
|
||||
bool FSClass::create(char *filepath){
|
||||
return SPIFFS_creat(&_filesystemStorageHandle, filepath, 0) == 0;
|
||||
return SPIFFS_creat(&_fs, filepath, 0) == SPIFFS_OK;
|
||||
}
|
||||
|
||||
bool FSClass::remove(char *filepath){
|
||||
return SPIFFS_remove(&_filesystemStorageHandle, filepath) == 0;
|
||||
return SPIFFS_remove(&_fs, filepath) == SPIFFS_OK;
|
||||
}
|
||||
|
||||
bool FSClass::rename(char *filename, char *newname) {
|
||||
return SPIFFS_rename(&_filesystemStorageHandle, filename, newname) == 0;
|
||||
return SPIFFS_rename(&_fs, filename, newname) == SPIFFS_OK;
|
||||
}
|
||||
|
||||
size_t FSClass::totalBytes(){
|
||||
u32_t totalBytes;
|
||||
u32_t usedBytes;
|
||||
if(SPIFFS_info(&_filesystemStorageHandle, &totalBytes, &usedBytes) == 0)
|
||||
if(SPIFFS_info(&_fs, &totalBytes, &usedBytes) == SPIFFS_OK)
|
||||
return totalBytes;
|
||||
return 0;
|
||||
}
|
||||
@ -81,13 +147,16 @@ size_t FSClass::totalBytes(){
|
||||
size_t FSClass::usedBytes(){
|
||||
u32_t totalBytes;
|
||||
u32_t usedBytes;
|
||||
if(SPIFFS_info(&_filesystemStorageHandle, &totalBytes, &usedBytes) == 0)
|
||||
if(SPIFFS_info(&_fs, &totalBytes, &usedBytes) == SPIFFS_OK)
|
||||
return usedBytes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
FSFile FSClass::open(char *filename, uint8_t mode) {
|
||||
if(String(filename) == "" || String(filename) == "/") return FSFile("/");
|
||||
if(strcmp(filename, "") == 0 ||
|
||||
strcmp(filename, "/") == 0)
|
||||
return FSFile(&_fs, "/");
|
||||
|
||||
int repeats = 0;
|
||||
bool notExist;
|
||||
bool canRecreate = (mode & SPIFFS_CREAT) == SPIFFS_CREAT;
|
||||
@ -95,8 +164,8 @@ FSFile FSClass::open(char *filename, uint8_t mode) {
|
||||
|
||||
do{
|
||||
notExist = false;
|
||||
res = SPIFFS_open(&_filesystemStorageHandle, filename, (spiffs_flags)mode, 0);
|
||||
int code = SPIFFS_errno(&_filesystemStorageHandle);
|
||||
res = SPIFFS_open(&_fs, filename, (spiffs_flags)mode, 0);
|
||||
int code = SPIFFS_errno(&_fs);
|
||||
if (res < 0){
|
||||
SPIFFS_API_DBG_E("open errno %d\n", code);
|
||||
notExist = (code == SPIFFS_ERR_NOT_FOUND || code == SPIFFS_ERR_DELETED || code == SPIFFS_ERR_FILE_DELETED || code == SPIFFS_ERR_IS_FREE);
|
||||
@ -106,63 +175,68 @@ FSFile FSClass::open(char *filename, uint8_t mode) {
|
||||
} while (notExist && canRecreate && repeats++ < 3);
|
||||
|
||||
if(res){
|
||||
return FSFile(res);
|
||||
return FSFile(&_fs, res);
|
||||
}
|
||||
return FSFile();
|
||||
}
|
||||
|
||||
FSFile FSClass::open(spiffs_dirent* entry, uint8_t mode){
|
||||
int res = SPIFFS_open_by_dirent(&_filesystemStorageHandle, entry, (spiffs_flags)mode, 0);
|
||||
if(res){
|
||||
return FSFile(res);
|
||||
int res = SPIFFS_open_by_dirent(&_fs, entry, (spiffs_flags)mode, 0);
|
||||
if (res){
|
||||
return FSFile(&_fs, res);
|
||||
}
|
||||
return FSFile();
|
||||
}
|
||||
|
||||
FSClass FS;
|
||||
|
||||
FSFile::FSFile() {
|
||||
_file = 0;
|
||||
_stats = {0};
|
||||
FSFile::FSFile()
|
||||
: _file(0)
|
||||
, _stats({0})
|
||||
, _fs(0)
|
||||
{
|
||||
}
|
||||
|
||||
FSFile::FSFile(String path) {
|
||||
FSFile::FSFile(spiffs* fs, String path)
|
||||
: _fs(fs)
|
||||
{
|
||||
if(path == "/"){
|
||||
_file = 0x1;
|
||||
os_sprintf((char*)_stats.name, "%s", (char*)path.c_str());
|
||||
_stats.size = 0;
|
||||
_stats.type = SPIFFS_TYPE_DIR;
|
||||
SPIFFS_opendir(&_filesystemStorageHandle, (char*)_stats.name, &_dir);
|
||||
SPIFFS_opendir(_fs, (char*)_stats.name, &_dir);
|
||||
} else {
|
||||
_file = SPIFFS_open(&_filesystemStorageHandle, (char *)path.c_str(), (spiffs_flags)FSFILE_READ, 0);
|
||||
if(SPIFFS_fstat(&_filesystemStorageHandle, _file, &_stats) != 0){
|
||||
SPIFFS_API_DBG_E("fstat errno %d\n", SPIFFS_errno(&_filesystemStorageHandle));
|
||||
_file = SPIFFS_open(_fs, (char *)path.c_str(), (spiffs_flags)FSFILE_READ, 0);
|
||||
if(SPIFFS_fstat(_fs, _file, &_stats) != 0){
|
||||
SPIFFS_API_DBG_E("fstat errno %d\n", SPIFFS_errno(_fs));
|
||||
}
|
||||
//debugf("FSFile name: %s, size: %d, type: %d\n", _stats.name, _stats.size, _stats.type);
|
||||
if(_stats.type == SPIFFS_TYPE_DIR){
|
||||
SPIFFS_opendir(&_filesystemStorageHandle, (char*)_stats.name, &_dir);
|
||||
SPIFFS_opendir(_fs, (char*)_stats.name, &_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FSFile::FSFile(file_t f) {
|
||||
_file = f;
|
||||
if(SPIFFS_fstat(&_filesystemStorageHandle, _file, &_stats) != 0){
|
||||
SPIFFS_API_DBG_E("fstat errno %d\n", SPIFFS_errno(&_filesystemStorageHandle));
|
||||
FSFile::FSFile(spiffs* fs, file_t f)
|
||||
: _file(f)
|
||||
, _fs(fs)
|
||||
{
|
||||
if(SPIFFS_fstat(_fs, _file, &_stats) != 0){
|
||||
SPIFFS_API_DBG_E("fstat errno %d\n", SPIFFS_errno(_fs));
|
||||
}
|
||||
//debugf("FSFile name: %s, size: %d, type: %d\n", _stats.name, _stats.size, _stats.type);
|
||||
if(_stats.type == SPIFFS_TYPE_DIR){
|
||||
SPIFFS_opendir(&_filesystemStorageHandle, (char*)_stats.name, &_dir);
|
||||
SPIFFS_opendir(_fs, (char*)_stats.name, &_dir);
|
||||
}
|
||||
}
|
||||
|
||||
void FSFile::close() {
|
||||
if (! _file) return;
|
||||
if (!_file)
|
||||
return;
|
||||
if(_stats.type == SPIFFS_TYPE_DIR){
|
||||
SPIFFS_closedir(&_dir);
|
||||
}
|
||||
if(os_strlen((char*)_stats.name) > 1)
|
||||
SPIFFS_close(&_filesystemStorageHandle, _file);
|
||||
SPIFFS_close(_fs, _file);
|
||||
_file = 0;
|
||||
}
|
||||
|
||||
@ -175,97 +249,138 @@ bool FSFile::isDirectory(void) {
|
||||
}
|
||||
|
||||
void FSFile::rewindDirectory() {
|
||||
if (!_file || !isDirectory()) return;
|
||||
if (!_file || !isDirectory())
|
||||
return;
|
||||
SPIFFS_closedir(&_dir);
|
||||
SPIFFS_opendir(&_filesystemStorageHandle, (char*)_stats.name, &_dir);
|
||||
SPIFFS_opendir(_fs, (char*)_stats.name, &_dir);
|
||||
}
|
||||
|
||||
FSFile FSFile::openNextFile(){
|
||||
if (!_file || !isDirectory()) return FSFile();
|
||||
if (!_file || !isDirectory())
|
||||
return FSFile();
|
||||
struct spiffs_dirent e;
|
||||
struct spiffs_dirent *pe = &e;
|
||||
if ((pe = SPIFFS_readdir(&_dir, pe))){
|
||||
// TODO: store actual FS pointer
|
||||
return FS.open((char *)pe->name);
|
||||
}
|
||||
return FSFile();
|
||||
}
|
||||
|
||||
uint32_t FSFile::size() {
|
||||
if(!_file) return 0;
|
||||
if(_stats.size) return _stats.size;
|
||||
uint32_t pos = SPIFFS_tell(&_filesystemStorageHandle, _file);
|
||||
SPIFFS_lseek(&_filesystemStorageHandle, _file, 0, SPIFFS_SEEK_END);
|
||||
_stats.size = SPIFFS_tell(&_filesystemStorageHandle, _file);
|
||||
SPIFFS_lseek(&_filesystemStorageHandle, _file, pos, SPIFFS_SEEK_SET);
|
||||
if(!_file)
|
||||
return 0;
|
||||
if(_stats.size)
|
||||
return _stats.size;
|
||||
uint32_t pos = SPIFFS_tell(_fs, _file);
|
||||
SPIFFS_lseek(_fs, _file, 0, SPIFFS_SEEK_END);
|
||||
_stats.size = SPIFFS_tell(_fs, _file);
|
||||
SPIFFS_lseek(_fs, _file, pos, SPIFFS_SEEK_SET);
|
||||
return _stats.size;
|
||||
}
|
||||
|
||||
int FSFile::available() {
|
||||
if (!_file) return 0;
|
||||
uint32_t pos = SPIFFS_tell(&_filesystemStorageHandle, _file);
|
||||
if (!_file)
|
||||
return 0;
|
||||
uint32_t pos = SPIFFS_tell(_fs, _file);
|
||||
return size() - pos;
|
||||
}
|
||||
|
||||
uint32_t FSFile::seek(uint32_t pos) {
|
||||
if (!_file) return 0;
|
||||
return SPIFFS_lseek(&_filesystemStorageHandle, _file, pos, SPIFFS_SEEK_SET);
|
||||
if (!_file)
|
||||
return 0;
|
||||
return SPIFFS_lseek(_fs, _file, pos, SPIFFS_SEEK_SET);
|
||||
}
|
||||
|
||||
uint32_t FSFile::position() {
|
||||
if (!_file) return 0;
|
||||
return SPIFFS_tell(&_filesystemStorageHandle, _file);
|
||||
if (!_file)
|
||||
return 0;
|
||||
return SPIFFS_tell(_fs, _file);
|
||||
}
|
||||
|
||||
bool FSFile::eof() {
|
||||
if (!_file) return 0;
|
||||
return SPIFFS_eof(&_filesystemStorageHandle, _file);
|
||||
if (!_file)
|
||||
return 0;
|
||||
return SPIFFS_eof(_fs, _file);
|
||||
}
|
||||
|
||||
int FSFile::read(void *buf, uint16_t nbyte) {
|
||||
if (! _file || isDirectory()) return -1;
|
||||
return SPIFFS_read(&_filesystemStorageHandle, _file, buf, nbyte);
|
||||
if (!_file || isDirectory())
|
||||
return -1;
|
||||
return SPIFFS_read(_fs, _file, buf, nbyte);
|
||||
}
|
||||
|
||||
int FSFile::read() {
|
||||
if (! _file || isDirectory()) return -1;
|
||||
if (! _file || isDirectory())
|
||||
return -1;
|
||||
int val;
|
||||
if(SPIFFS_read(&_filesystemStorageHandle, _file, &val, 1) != 1) return -1;
|
||||
if(SPIFFS_read(_fs, _file, &val, 1) != 1) return -1;
|
||||
return val;
|
||||
}
|
||||
|
||||
int FSFile::peek() {
|
||||
if (! _file || isDirectory()) return 0;
|
||||
if (!_file || isDirectory())
|
||||
return 0;
|
||||
int c = read();
|
||||
SPIFFS_lseek(&_filesystemStorageHandle, _file, -1, SPIFFS_SEEK_CUR);
|
||||
SPIFFS_lseek(_fs, _file, -1, SPIFFS_SEEK_CUR);
|
||||
return c;
|
||||
}
|
||||
|
||||
size_t FSFile::write(const uint8_t *buf, size_t size){
|
||||
if (! _file || isDirectory()) return 0;
|
||||
int res = SPIFFS_write(&_filesystemStorageHandle, _file, (uint8_t *)buf, size);
|
||||
if (!_file || isDirectory())
|
||||
return 0;
|
||||
int res = SPIFFS_write(_fs, _file, (uint8_t *)buf, size);
|
||||
return (res > 0)?(size_t)res:0;
|
||||
}
|
||||
|
||||
size_t FSFile::write(uint8_t val) {
|
||||
if (! _file || isDirectory()) return 0;
|
||||
if (!_file || isDirectory())
|
||||
return 0;
|
||||
return write(&val, 1);
|
||||
}
|
||||
|
||||
void FSFile::flush(){
|
||||
if (! _file || isDirectory()) return;
|
||||
SPIFFS_fflush(&_filesystemStorageHandle, _file);
|
||||
if (!_file || isDirectory())
|
||||
return;
|
||||
SPIFFS_fflush(_fs, _file);
|
||||
}
|
||||
|
||||
bool FSFile::remove(){
|
||||
if (! _file) return 0;
|
||||
if (!_file)
|
||||
return 0;
|
||||
close();
|
||||
return SPIFFS_remove(&_filesystemStorageHandle, (char *)_stats.name) == 0;
|
||||
return SPIFFS_remove(_fs, (char *)_stats.name) == 0;
|
||||
}
|
||||
|
||||
int FSFile::lastError(){
|
||||
return SPIFFS_errno(&_filesystemStorageHandle);
|
||||
return SPIFFS_errno(_fs);
|
||||
}
|
||||
|
||||
void FSFile::clearError(){
|
||||
_filesystemStorageHandle.err_code = SPIFFS_OK;
|
||||
_fs->err_code = SPIFFS_OK;
|
||||
}
|
||||
|
||||
|
||||
static s32_t api_spiffs_read(u32_t addr, u32_t size, u8_t *dst){
|
||||
SPIFFS_API_DBG_V("api_spiffs_read: 0x%08x len: %u\n", addr, size);
|
||||
flashmem_read(dst, addr, size);
|
||||
return SPIFFS_OK;
|
||||
}
|
||||
|
||||
static s32_t api_spiffs_write(u32_t addr, u32_t size, u8_t *src){
|
||||
SPIFFS_API_DBG_V("api_spiffs_write: 0x%08x len: %u\n", addr, size);
|
||||
flashmem_write(src, addr, size);
|
||||
return SPIFFS_OK;
|
||||
}
|
||||
|
||||
static s32_t api_spiffs_erase(u32_t addr, u32_t size){
|
||||
SPIFFS_API_DBG_V("api_spiffs_erase: 0x%08x len: %u\n", addr, size);
|
||||
u32_t sect_first = flashmem_get_sector_of_address(addr);
|
||||
u32_t sect_last = flashmem_get_sector_of_address(addr+size);
|
||||
while( sect_first <= sect_last )
|
||||
if( !flashmem_erase_sector( sect_first ++ ) )
|
||||
return SPIFFS_ERR_INTERNAL;
|
||||
return SPIFFS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,9 +21,9 @@
|
||||
#ifndef _SPIFFS_CORE_FILESYSTEM_H_
|
||||
#define _SPIFFS_CORE_FILESYSTEM_H_
|
||||
|
||||
#include <memory>
|
||||
#include "spiffs/spiffs.h"
|
||||
#include "Arduino.h"
|
||||
class String;
|
||||
|
||||
#define FSFILE_READ SPIFFS_RDONLY
|
||||
#define FSFILE_WRITE (SPIFFS_RDONLY | SPIFFS_WRONLY | SPIFFS_CREAT | SPIFFS_APPEND )
|
||||
@ -34,10 +34,11 @@ private:
|
||||
spiffs_stat _stats;
|
||||
file_t _file;
|
||||
spiffs_DIR _dir;
|
||||
spiffs * _fs;
|
||||
|
||||
public:
|
||||
FSFile(String path);
|
||||
FSFile(file_t f);
|
||||
FSFile(spiffs* fs, String path);
|
||||
FSFile(spiffs* fs, file_t f);
|
||||
FSFile(void);
|
||||
virtual size_t write(uint8_t);
|
||||
virtual size_t write(const uint8_t *buf, size_t size);
|
||||
@ -83,10 +84,9 @@ public:
|
||||
};
|
||||
|
||||
class FSClass {
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
FSClass(uint32_t beginAddress, uint32_t endAddress, uint32_t maxOpenFiles);
|
||||
|
||||
bool mount();
|
||||
void unmount();
|
||||
bool format();
|
||||
@ -97,17 +97,30 @@ public:
|
||||
bool rename(char *filename, char *newname);
|
||||
size_t totalBytes();
|
||||
size_t usedBytes();
|
||||
size_t size(){ return _filesystemStorageHandle.cfg.phys_size; }
|
||||
size_t blockSize(){ return _filesystemStorageHandle.cfg.log_block_size; }
|
||||
size_t totalBlocks(){ return _filesystemStorageHandle.block_count; }
|
||||
size_t freeBlocks(){ return _filesystemStorageHandle.free_blocks; }
|
||||
size_t pageSize(){ return _filesystemStorageHandle.cfg.log_page_size; }
|
||||
size_t allocatedPages(){ return _filesystemStorageHandle.stats_p_allocated; }
|
||||
size_t deletedPages(){ return _filesystemStorageHandle.stats_p_deleted; }
|
||||
size_t size(){ return _fs.cfg.phys_size; }
|
||||
size_t blockSize(){ return _fs.cfg.log_block_size; }
|
||||
size_t totalBlocks(){ return _fs.block_count; }
|
||||
size_t freeBlocks(){ return _fs.free_blocks; }
|
||||
size_t pageSize(){ return _fs.cfg.log_page_size; }
|
||||
size_t allocatedPages(){ return _fs.stats_p_allocated; }
|
||||
size_t deletedPages(){ return _fs.stats_p_deleted; }
|
||||
|
||||
FSFile open(char *filename, uint8_t mode = FSFILE_READ);
|
||||
FSFile open(spiffs_dirent* entry, uint8_t mode = FSFILE_READ);
|
||||
|
||||
protected:
|
||||
int _mountInternal();
|
||||
std::unique_ptr<uint8_t[]> _work;
|
||||
std::unique_ptr<uint8_t[]> _fds;
|
||||
size_t _fdsSize;
|
||||
std::unique_ptr<uint8_t[]> _cache;
|
||||
size_t _cacheSize;
|
||||
uint32_t _beginAddress;
|
||||
uint32_t _endAddress;
|
||||
uint32_t _maxOpenFiles;
|
||||
spiffs _fs;
|
||||
|
||||
|
||||
private:
|
||||
friend class FSFile;
|
||||
};
|
||||
|
@ -78,5 +78,4 @@ void init() {
|
||||
timer1_isr_init();
|
||||
os_timer_setfn(µs_overflow_timer, (os_timer_func_t*) µs_overflow_tick, 0);
|
||||
os_timer_arm(µs_overflow_timer, 60000, REPEAT);
|
||||
spiffs_mount();
|
||||
}
|
||||
|
@ -155,79 +155,3 @@ uint32_t flashmem_get_sector_of_address( uint32_t addr ){
|
||||
return (addr - INTERNAL_FLASH_START_ADDRESS) / INTERNAL_FLASH_SECTOR_SIZE;;
|
||||
}
|
||||
|
||||
/*
|
||||
SPIFFS BOOTSTRAP
|
||||
*/
|
||||
|
||||
//SPIFFS Address Range (defined in eagle ld)
|
||||
extern uint32_t _SPIFFS_start;
|
||||
extern uint32_t _SPIFFS_end;
|
||||
|
||||
//SPIFFS Storage Handle
|
||||
spiffs _filesystemStorageHandle;
|
||||
|
||||
//SPIFFS Buffers (INTERNAL_FLASH_PAGE_SIZE = 256) Total 1792 bytes
|
||||
static u8_t spiffs_work_buf[INTERNAL_FLASH_PAGE_SIZE*2]; //512 bytes
|
||||
static u8_t spiffs_fds[32*4]; //128 bytes
|
||||
static u8_t spiffs_cache[(INTERNAL_FLASH_PAGE_SIZE+32)*4]; //1152 bytes
|
||||
|
||||
//SPIFFS API Read CallBack
|
||||
static s32_t api_spiffs_read(u32_t addr, u32_t size, u8_t *dst){
|
||||
SPIFFS_API_DBG_V("api_spiffs_read: 0x%08x len: %u\n", addr, size);
|
||||
flashmem_read(dst, addr, size);
|
||||
return SPIFFS_OK;
|
||||
}
|
||||
|
||||
//SPIFFS API Write CallBack
|
||||
static s32_t api_spiffs_write(u32_t addr, u32_t size, u8_t *src){
|
||||
SPIFFS_API_DBG_V("api_spiffs_write: 0x%08x len: %u\n", addr, size);
|
||||
flashmem_write(src, addr, size);
|
||||
return SPIFFS_OK;
|
||||
}
|
||||
|
||||
//SPIFFS API Erase CallBack
|
||||
static s32_t api_spiffs_erase(u32_t addr, u32_t size){
|
||||
SPIFFS_API_DBG_V("api_spiffs_erase: 0x%08x len: %u\n", addr, size);
|
||||
u32_t sect_first = flashmem_get_sector_of_address(addr);
|
||||
u32_t sect_last = flashmem_get_sector_of_address(addr+size);
|
||||
while( sect_first <= sect_last )
|
||||
if( !flashmem_erase_sector( sect_first ++ ) )
|
||||
return SPIFFS_ERR_INTERNAL;
|
||||
return SPIFFS_OK;
|
||||
}
|
||||
|
||||
// Our own SPIFFS Setup Method
|
||||
// All of the above gets put in the configuration
|
||||
// and a mount attempt is made, initializing the storage handle
|
||||
// that is used in all further api calls
|
||||
s32_t spiffs_mount(){
|
||||
u32_t start_address = (u32_t)&_SPIFFS_start;
|
||||
u32_t end_address = (u32_t)&_SPIFFS_end;
|
||||
if (start_address == 0 || start_address >= end_address){
|
||||
SPIFFS_API_DBG_E("Can't start file system, wrong address");
|
||||
return SPIFFS_ERR_NOT_CONFIGURED;
|
||||
}
|
||||
|
||||
spiffs_config cfg = {0};
|
||||
cfg.phys_addr = start_address;
|
||||
cfg.phys_size = end_address - start_address;
|
||||
cfg.phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE; // according to datasheet
|
||||
cfg.log_block_size = INTERNAL_FLASH_SECTOR_SIZE * 2; // Important to make large
|
||||
cfg.log_page_size = INTERNAL_FLASH_PAGE_SIZE; // according to datasheet
|
||||
cfg.hal_read_f = api_spiffs_read;
|
||||
cfg.hal_write_f = api_spiffs_write;
|
||||
cfg.hal_erase_f = api_spiffs_erase;
|
||||
|
||||
SPIFFS_API_DBG_V("spiffs_mount: start:%x, size:%d Kb\n", cfg.phys_addr, cfg.phys_size / 1024);
|
||||
|
||||
s32_t res = SPIFFS_mount(&_filesystemStorageHandle,
|
||||
&cfg,
|
||||
spiffs_work_buf,
|
||||
spiffs_fds,
|
||||
sizeof(spiffs_fds),
|
||||
spiffs_cache,
|
||||
sizeof(spiffs_cache),
|
||||
NULL);
|
||||
SPIFFS_API_DBG_V("spiffs_mount: %d\n", res);
|
||||
return res;
|
||||
}
|
||||
|
@ -24,14 +24,11 @@ The small 4KB sectors allow for greater flexibility in applications that require
|
||||
#define INTERNAL_FLASH_WRITE_UNIT_SIZE 4
|
||||
#define INTERNAL_FLASH_READ_UNIT_SIZE 4
|
||||
|
||||
extern spiffs _filesystemStorageHandle;
|
||||
|
||||
extern uint32_t flashmem_write( const void *from, uint32_t toaddr, uint32_t size );
|
||||
extern uint32_t flashmem_read( void *to, uint32_t fromaddr, uint32_t size );
|
||||
extern bool flashmem_erase_sector( uint32_t sector_id );
|
||||
uint32_t flashmem_find_sector( uint32_t address, uint32_t *pstart, uint32_t *pend );
|
||||
uint32_t flashmem_get_sector_of_address( uint32_t addr );
|
||||
s32_t spiffs_mount();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Majenko Technologies
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Majenko Technologies nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
|
||||
const char *ssid = "YourSSIDHere";
|
||||
const char *password = "YourPSKHere";
|
||||
MDNSResponder mdns;
|
||||
|
||||
ESP8266WebServer server ( 80 );
|
||||
|
||||
const int led = 13;
|
||||
|
||||
void handleRoot() {
|
||||
digitalWrite ( led, 1 );
|
||||
char temp[400];
|
||||
int sec = millis() / 1000;
|
||||
int min = sec / 60;
|
||||
int hr = min / 60;
|
||||
|
||||
snprintf ( temp, 400,
|
||||
|
||||
"<html>\
|
||||
<head>\
|
||||
<meta http-equiv='refresh' content='5'/>\
|
||||
<title>ESP8266 Demo</title>\
|
||||
<style>\
|
||||
body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
|
||||
</style>\
|
||||
</head>\
|
||||
<body>\
|
||||
<h1>Hello from ESP8266!</h1>\
|
||||
<p>Uptime: %02d:%02d:%02d</p>\
|
||||
<img src=\"/test.svg\" />\
|
||||
</body>\
|
||||
</html>",
|
||||
|
||||
hr, min % 60, sec % 60
|
||||
);
|
||||
server.send ( 200, "text/html", temp );
|
||||
digitalWrite ( led, 0 );
|
||||
}
|
||||
|
||||
void handleNotFound() {
|
||||
digitalWrite ( led, 1 );
|
||||
String message = "File Not Found\n\n";
|
||||
message += "URI: ";
|
||||
message += server.uri();
|
||||
message += "\nMethod: ";
|
||||
message += ( server.method() == HTTP_GET ) ? "GET" : "POST";
|
||||
message += "\nArguments: ";
|
||||
message += server.args();
|
||||
message += "\n";
|
||||
|
||||
for ( uint8_t i = 0; i < server.args(); i++ ) {
|
||||
message += " " + server.argName ( i ) + ": " + server.arg ( i ) + "\n";
|
||||
}
|
||||
|
||||
server.send ( 404, "text/plain", message );
|
||||
digitalWrite ( led, 0 );
|
||||
}
|
||||
|
||||
void setup ( void ) {
|
||||
pinMode ( led, OUTPUT );
|
||||
digitalWrite ( led, 0 );
|
||||
Serial.begin ( 115200 );
|
||||
WiFi.begin ( ssid, password );
|
||||
Serial.println ( "" );
|
||||
|
||||
// Wait for connection
|
||||
while ( WiFi.status() != WL_CONNECTED ) {
|
||||
delay ( 500 );
|
||||
Serial.print ( "." );
|
||||
}
|
||||
|
||||
Serial.println ( "" );
|
||||
Serial.print ( "Connected to " );
|
||||
Serial.println ( ssid );
|
||||
Serial.print ( "IP address: " );
|
||||
Serial.println ( WiFi.localIP() );
|
||||
|
||||
if ( mdns.begin ( "esp8266", WiFi.localIP() ) ) {
|
||||
Serial.println ( "MDNS responder started" );
|
||||
}
|
||||
|
||||
server.on ( "/", handleRoot );
|
||||
server.on ( "/test.svg", drawGraph );
|
||||
server.on ( "/inline", []() {
|
||||
server.send ( 200, "text/plain", "this works as well" );
|
||||
} );
|
||||
server.onNotFound ( handleNotFound );
|
||||
server.begin();
|
||||
Serial.println ( "HTTP server started" );
|
||||
}
|
||||
|
||||
void loop ( void ) {
|
||||
mdns.update();
|
||||
server.handleClient();
|
||||
}
|
||||
|
||||
void drawGraph() {
|
||||
String out = "";
|
||||
char temp[100];
|
||||
out += "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"400\" height=\"150\">\n";
|
||||
out += "<rect width=\"400\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"1\" stroke=\"rgb(0, 0, 0)\" />\n";
|
||||
out += "<g stroke=\"black\">\n";
|
||||
int y = rand() % 130;
|
||||
for (int x = 10; x < 390; x+= 10) {
|
||||
int y2 = rand() % 130;
|
||||
sprintf(temp, "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"1\" />\n", x, 140 - y, x + 10, 140 - y2);
|
||||
out += temp;
|
||||
y = y2;
|
||||
}
|
||||
out += "</g>\n</svg>\n";
|
||||
|
||||
server.send ( 200, "image/svg+xml", out);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Majenko Technologies
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Majenko Technologies nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Create a WiFi access point and provide a web server on it. */
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
/* Set these to your desired credentials. */
|
||||
const char *ssid = "ESPap";
|
||||
const char *password = "thereisnospoon";
|
||||
|
||||
ESP8266WebServer server(80);
|
||||
|
||||
/* Just a little test message. Go to http://192.168.4.1 in a web browser
|
||||
* connected to this access point to see it.
|
||||
*/
|
||||
void handleRoot() {
|
||||
server.send(200, "text/html", "<h1>You are connected</h1>");
|
||||
}
|
||||
|
||||
void setup() {
|
||||
delay(1000);
|
||||
Serial.begin(115200);
|
||||
Serial.println();
|
||||
Serial.print("Configuring access point...");
|
||||
/* You can remove the password parameter if you want the AP to be open. */
|
||||
WiFi.softAP(ssid, password);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); }
|
||||
|
||||
Serial.println("done");
|
||||
IPAddress myIP = WiFi.softAPIP();
|
||||
Serial.print("AP IP address: ");
|
||||
Serial.println(myIP);
|
||||
server.on("/", handleRoot);
|
||||
server.begin();
|
||||
Serial.println("HTTP server started");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
server.handleClient();
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
WiFiServer.h - Library for Arduino Wifi shield.
|
||||
Copyright (c) 2011-2014 Arduino. All right reserved.
|
||||
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
WiFiUdp.h - Library for Arduino Wifi shield.
|
||||
Copyright (c) 2011-2014 Arduino. All right reserved.
|
||||
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -7,18 +7,18 @@ http://arduino.cc/en/Reference/SD
|
||||
|
||||
== License ==
|
||||
|
||||
Copyright (c) Arduino LLC. All right reserved.
|
||||
Copyright (C) 2009 by William Greiman
|
||||
Copyright (c) 2010 SparkFun Electronics
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
@ -44,19 +44,13 @@ void setup()
|
||||
|
||||
|
||||
Serial.print("\nInitializing SD card...");
|
||||
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
|
||||
// Note that even if it's not used as the CS pin, the hardware SS pin
|
||||
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
|
||||
// or the SD library functions will not work.
|
||||
pinMode(10, OUTPUT); // change this to 53 on a mega
|
||||
|
||||
|
||||
// we'll use the initialization code from the utility libraries
|
||||
// since we're just testing if the card is working!
|
||||
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
|
||||
Serial.println("initialization failed. Things to check:");
|
||||
Serial.println("* is a card is inserted?");
|
||||
Serial.println("* Is your wiring correct?");
|
||||
Serial.println("* is a card inserted?");
|
||||
Serial.println("* is your wiring correct?");
|
||||
Serial.println("* did you change the chipSelect pin to match your shield or module?");
|
||||
return;
|
||||
} else {
|
||||
|
@ -23,10 +23,6 @@
|
||||
#include <SPI.h>
|
||||
#include <SD.h>
|
||||
|
||||
// On the Ethernet Shield, CS is pin 4. Note that even if it's not
|
||||
// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
|
||||
// 53 on the Mega) must be left as an output or the SD library
|
||||
// functions will not work.
|
||||
const int chipSelect = 4;
|
||||
|
||||
void setup()
|
||||
@ -39,9 +35,6 @@ void setup()
|
||||
|
||||
|
||||
Serial.print("Initializing SD card...");
|
||||
// make sure that the default chip select pin is set to
|
||||
// output, even if you don't use it:
|
||||
pinMode(10, OUTPUT);
|
||||
|
||||
// see if the card is present and can be initialized:
|
||||
if (!SD.begin(chipSelect)) {
|
||||
|
@ -23,10 +23,6 @@
|
||||
#include <SPI.h>
|
||||
#include <SD.h>
|
||||
|
||||
// On the Ethernet Shield, CS is pin 4. Note that even if it's not
|
||||
// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
|
||||
// 53 on the Mega) must be left as an output or the SD library
|
||||
// functions will not work.
|
||||
const int chipSelect = 4;
|
||||
|
||||
void setup()
|
||||
@ -39,9 +35,6 @@ void setup()
|
||||
|
||||
|
||||
Serial.print("Initializing SD card...");
|
||||
// make sure that the default chip select pin is set to
|
||||
// output, even if you don't use it:
|
||||
pinMode(10, OUTPUT);
|
||||
|
||||
// see if the card is present and can be initialized:
|
||||
if (!SD.begin(chipSelect)) {
|
||||
|
@ -32,11 +32,6 @@ void setup()
|
||||
|
||||
|
||||
Serial.print("Initializing SD card...");
|
||||
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
|
||||
// Note that even if it's not used as the CS pin, the hardware SS pin
|
||||
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
|
||||
// or the SD library functions will not work.
|
||||
pinMode(10, OUTPUT);
|
||||
|
||||
if (!SD.begin(4)) {
|
||||
Serial.println("initialization failed!");
|
||||
|
@ -33,11 +33,6 @@ void setup()
|
||||
|
||||
|
||||
Serial.print("Initializing SD card...");
|
||||
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
|
||||
// Note that even if it's not used as the CS pin, the hardware SS pin
|
||||
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
|
||||
// or the SD library functions will not work.
|
||||
pinMode(10, OUTPUT);
|
||||
|
||||
if (!SD.begin(4)) {
|
||||
Serial.println("initialization failed!");
|
||||
|
@ -35,11 +35,6 @@ void setup()
|
||||
}
|
||||
|
||||
Serial.print("Initializing SD card...");
|
||||
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
|
||||
// Note that even if it's not used as the CS pin, the hardware SS pin
|
||||
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
|
||||
// or the SD library functions will not work.
|
||||
pinMode(10, OUTPUT);
|
||||
|
||||
if (!SD.begin(4)) {
|
||||
Serial.println("initialization failed!");
|
||||
|
@ -6,8 +6,8 @@
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
|
||||
SD KEYWORD1
|
||||
File KEYWORD1
|
||||
SD KEYWORD1 SD
|
||||
File KEYWORD1 SD
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
|
@ -1,9 +1,9 @@
|
||||
name=SD
|
||||
version=1.0
|
||||
author=Arduino, SparkFun
|
||||
maintainer=Arduino <info@arduino.cc>
|
||||
sentence=Enables reading and writing on SD cards. For all Arduino boards.
|
||||
paragraph=Once an SD memory card is connected to the SPI interfare of the Arduino board you are enabled to create files and read/write on them. You can also move through directories on the SD card.
|
||||
category=Data Storage
|
||||
url=http://arduino.cc/en/Reference/SD
|
||||
architectures=*
|
||||
name=SD
|
||||
version=1.0.4
|
||||
author=Arduino, SparkFun
|
||||
maintainer=Arduino <info@arduino.cc>
|
||||
sentence=Enables reading and writing on SD cards. For all Arduino boards.
|
||||
paragraph=Once an SD memory card is connected to the SPI interfare of the Arduino board you are enabled to create files and read/write on them. You can also move through directories on the SD card.
|
||||
category=Data Storage
|
||||
url=http://arduino.cc/en/Reference/SD
|
||||
architectures=*
|
||||
|
@ -448,7 +448,7 @@ File SDClass::open(const char *filepath, uint8_t mode) {
|
||||
|
||||
// there is a special case for the Root directory since its a static dir
|
||||
if (parentdir.isRoot()) {
|
||||
if ( ! file.open(SD.root, filepath, mode)) {
|
||||
if ( ! file.open(root, filepath, mode)) {
|
||||
// failed to open the file :(
|
||||
return File();
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
||||
|
||||
// command to go idle in SPI mode
|
||||
while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) {
|
||||
if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
|
||||
if (((uint16_t)(millis() - t0)) > SD_INIT_TIMEOUT) {
|
||||
error(SD_CARD_ERROR_CMD0);
|
||||
goto fail;
|
||||
}
|
||||
@ -319,7 +319,7 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
||||
|
||||
while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) {
|
||||
// check for timeout
|
||||
if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
|
||||
if (((uint16_t)(millis() - t0)) > SD_INIT_TIMEOUT) {
|
||||
error(SD_CARD_ERROR_ACMD41);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
name=ESP8266 Modules
|
||||
version=1.6.1
|
||||
|
||||
compiler.tools.path={runtime.ide.path}/hardware/tools/esp8266/
|
||||
compiler.tools.path={runtime.platform.path}/tools/
|
||||
compiler.path={compiler.tools.path}xtensa-lx106-elf/bin/
|
||||
compiler.sdk.path={compiler.tools.path}sdk/
|
||||
|
||||
@ -85,7 +85,7 @@ recipe.size.regex=^(?:\.text|\.data|\.rodata|\.irom0\.text|)\s+([0-9]+).*
|
||||
|
||||
tools.esptool.cmd=esptool
|
||||
tools.esptool.cmd.windows=esptool.exe
|
||||
tools.esptool.path={runtime.ide.path}/hardware/tools/esp8266
|
||||
tools.esptool.path={compiler.tools.path}
|
||||
|
||||
tools.esptool.upload.protocol=esp
|
||||
tools.esptool.upload.params.verbose=-vv
|
||||
|
68
tools/sdk/License
Normal file
68
tools/sdk/License
Normal file
@ -0,0 +1,68 @@
|
||||
ESPRESSIF GENERAL PUBLIC LICENSE
|
||||
|
||||
PREAMBLE
|
||||
|
||||
The Espressif General Public License is a free, copyleft license for software and other kinds of works.
|
||||
The Espressif General Public License is intended to guarantee your freedom to share and change all versions of a program released by ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD, to make sure it remains free software for all its users. We use the Espressif General Public License for all of our open-source software.
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
Developers that use the Espressif GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
“This License” refers to the Espressif Public License.
|
||||
|
||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
1. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below.
|
||||
|
||||
2. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law prohibiting or restricting circumvention of such measures.
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
3. Conveying Verbatim Copies.
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License applies to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
4. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 3, provided that you also meet all of these conditions:
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
b) The work must carry prominent notices stating that it is released under this License. This requirement modifies the requirement in section 3 to “keep intact all notices”.
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
5. Termination.
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License.
|
||||
However, if you cease all violation of this License, then your license is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license.
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 7.
|
||||
|
||||
6. Acceptance Not Required for Having Copies.
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
7. Automatic Licensing of Downstream Recipients.
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
8. No Surrender of Others' Freedom.
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
9. Revised Versions of this License.
|
||||
ESPRESSIF SYSTEMS (SHANGHAI) PTE LED may publish revised and/or new versions of the ESPRESSIF General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the Espressif General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD. If the Program does not specify a version number of the Espressif General Public License, you may choose any version ever published.
|
||||
|
||||
10. Disclaimer of Warranty.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
11. Limitation of Liability.
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
|
||||
12. Interpretation of Sections 10 and 11.
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
274
tools/sdk/changelog.txt
Normal file
274
tools/sdk/changelog.txt
Normal file
@ -0,0 +1,274 @@
|
||||
esp_iot_sdk_v1.0.1_15_05_04_p1
|
||||
-------------------------------------------
|
||||
Here is a patch for station+softAP issue that users may have, based on SDK_v1.0.1,
|
||||
solved problem that connect to ESP8266 softAP may fail in station+softAP mode.
|
||||
|
||||
Sorry for the inconvenience.
|
||||
|
||||
esp_iot_sdk_v1.0.1_15_04_24 Release Note
|
||||
-------------------------------------------
|
||||
|
||||
Resolved Issues(Bugs below are eligible for Bug Bounty Program):
|
||||
1. SSL connection may fail if SSL packet size larger than 2kBytes [PeteW ]
|
||||
2. UDP remote IP to be 0.0.0.0 may cause reset [Jerry S]
|
||||
3. Optimize wifi_get_ip_info to fix loss of wireless connectivity problem
|
||||
4. Air-Kiss restart [Orgmar]
|
||||
|
||||
Optimization:
|
||||
1. Optimized IOT_Espressif_EspTouch.APK (apply for access from Espressif) for improved compatibility. [???]
|
||||
2. TCP server can not open again immediately with the same port [624908539]
|
||||
3. Update UART driver for parity bit value may be incorrect [1062583993]
|
||||
4. Add define of “ICACHE_RODATA_ATTR” for Symbol 'ICACHE_RODATA_ATTR' could not be resolved. [???]
|
||||
5. Add API wifi_softap_dhcps_set_offer_option to enable/disable ESP8266 softAP DHCP server default gateway. [xyz769]
|
||||
6. AT register_uart_rx_intr may enter callback twice. [???]
|
||||
7.optimize document that WPA password length range : 8 ~ 64 bytes [785057041]
|
||||
8. ESP8266 softAP DHCP server record 8 DHCP client's IP at most [ygjeon]
|
||||
9. To set static IP (wifi_set_ip_info) has to disable DHCP first(wifi_softap_dhcps_stop or wifi_station_dhcpc_stop)
|
||||
10.Add example of wifi_softap_set_dhcps_lease
|
||||
11. smartconfig_start can only be called in ESP8266 station mode
|
||||
|
||||
Added APIs:
|
||||
1. Wi-Fi related APIs:
|
||||
wifi_station_set_reconnect_policy: enable/disable reconnect when ESP8266 disconnect from router,default to be enable reconnect.
|
||||
wifi_set_event_handler_cb: set event handler of ESP8266 softAP or station status change.
|
||||
wifi_softap_dhcps_set_offer_option: enable/disable get router information from ESP8266 softAP, default to be enable.
|
||||
2. SNTP APIs:
|
||||
sntp_get_current_timestamp: get current timestamp from Jan 01, 1970, 00:00 (GMT)
|
||||
sntp_get_real_time: char,get real time (GTM + 8 time zone)
|
||||
sntp_init: initialize SNTP
|
||||
sntp_stop: stop SNTP
|
||||
sntp_setserver: set SNTP server by IP
|
||||
sntp_getserver: get SNTP server IP
|
||||
sntp_setservername: set SNTP server by domain name
|
||||
sntp_getservername: get domain name of SNTP server set by sntp_setservername
|
||||
3. MDNS APIs:
|
||||
espconn_mdns_init: initialize mDNS
|
||||
espconn_mdns_close: close mDNS
|
||||
espconn_mdns_server_register: register mDNS server
|
||||
espconn_mdns_server_unregister: unregister mDNS server
|
||||
espconn_mdns_get_servername: get mDNS server name
|
||||
espconn_mdns_set_servername: set mDNS server name
|
||||
espconn_mdns_set_hostname: get mDNS host name
|
||||
espconn_mdns_get_hostname: set mDNS host name
|
||||
espconn_mdns_disable: disable mDNS
|
||||
espconn_mdns_enable: endisable mDNS
|
||||
|
||||
AT_v0.23 Release Note:
|
||||
Optimized:
|
||||
1.AT+CWJAP add parameter "bssid", for several APs may have the same SSID
|
||||
|
||||
New AT commands:
|
||||
1. AT+CIPSENDBUF: write data into TCP-send-buffer; non-blocking. Background task automatically handles transmission. Has much higher throughput.
|
||||
2. AT+CIPBUFRESET: resets segment count in TCP-send-buffer
|
||||
3. AT+CIPBUFSTATUS: checks status of TCP-send-buffer
|
||||
4. AT+CIPCHECKSEGID: checks if a specific segment in TCP-send-buffer has sent successfully
|
||||
|
||||
|
||||
|
||||
esp_iot_sdk_v1.0.1_b2_15_04_10 release note
|
||||
-------------------------------------------
|
||||
|
||||
Fix bugs:
|
||||
1.Call espconn_sent to send UDP packet in user_init cause reset.[BBP#2 reporter (????)]
|
||||
2.UART & FlowControl issue: send data to FIFO without CTS flag will cause WDT [BBP#11 reporter (pvxx)]
|
||||
3.SSL issue,add an API (espconn_secure_set_size) to set SSL buffer size [BBP#29 reporter (PeteW)]
|
||||
4.UDP broadcast issue in WEP
|
||||
|
||||
Optimize:
|
||||
1.Add more details about measure ADC & VDD3P3 in appendix of document“2C-SDK-Espressif IoT SDK Programming Guide”[BBP#15 reporter (DarkByte)]
|
||||
2.Can not do any WiFi related operation if WiFi mode is in NULL_MODE [BBP#23 reporter (hao.wang)]
|
||||
3.start_ip and end_ip won't change through API wifi_softap_set_dhcps_lease [BBP#37 reporter (glb)]
|
||||
4.AT get into busy state [BBP#35 reporter (tommy_hk)]
|
||||
5.ssid + password length limitation when using AirKiss [BBP#45 reporter (zhchbin)]
|
||||
|
||||
Add APIs:
|
||||
1.espconn_secure_set_size:set buffer size for SSL packet
|
||||
2.espconn_secure_get_size:get SSL buffer size
|
||||
3.at_register_uart_rx_intr:set UART0 to be used by user or AT commands
|
||||
|
||||
Add AT command:
|
||||
1.AT+SLEEP: set ESP8266 sleep mode
|
||||
|
||||
esp_iot_sdk_v1.0.1_b1_15_04_02 Release note
|
||||
-------------------------------------------
|
||||
|
||||
Fix bugs:
|
||||
1. Connect to ESP8266 softAP fail after SmartConfig;
|
||||
2. SmartConfig loses one bit of SSID
|
||||
|
||||
Optimize:
|
||||
1. espconn_set_opt: set configuration of TCP connection,add parameter for TCP keep-alive
|
||||
|
||||
Add APIs:
|
||||
1. espconn_clear_opt: clear configuration of TCP connection
|
||||
2. espconn_set_keepalive: set configuration of TCP keep-alive to detect if TCP connection broke
|
||||
3. espconn_get_keepalive: get configuration of TCP keep-alive
|
||||
|
||||
AT_v0.23_b1 release note
|
||||
Note: AT added some functions so flash size need to be 1024KB or more than that.
|
||||
|
||||
Fix bug:
|
||||
1. Always "busy" if TCP connection abnormally broke during AT+CIPSEND
|
||||
|
||||
Optimize:
|
||||
1. Add UDP transparent transmission
|
||||
2. Optimize the initial value of AT+CWDHCP?
|
||||
3. Add TCP keep-alive function in AT+CIPSTART
|
||||
|
||||
Add AT command:
|
||||
1. Add AT+CIPSENDEX which support quit from sending mode by "\0" (so an useful "\0" need to be "\\0")
|
||||
|
||||
esp_iot_sdk_v1.0.0_15_03_20 Release Note
|
||||
----------------------------------------
|
||||
|
||||
Optimize:
|
||||
1. Optimize smartconfig to version v1.0; Please don't call any other APIs during SmartConfig.
|
||||
2. Optimize AT to version 0.22.0.0;
|
||||
3. Optimize the protection of system parameters, and add error-check about it;
|
||||
4. Optimize beacon delay of ESP8266 softAP;
|
||||
5. Optimize boot to version 1.3(b3);
|
||||
- Add API system_restart_enhance: for factory test, support to load and run program in any specific address;
|
||||
- Add APIs to get boot version and start address of current user bin;
|
||||
- Fix compatibility problem of dual flash;
|
||||
6. Optimize sniffer, structure sniffer_buf changed, please refer to document;
|
||||
7. Optimize espconn;
|
||||
8. Optimize pwm;
|
||||
9. Other optimize to make the software more reliable;
|
||||
|
||||
Add APIs:
|
||||
1. system_update_cpu_freq: change CPU frequency;
|
||||
2. wifi_promiscuous_set_mac: set a mac address filter during sniffer;
|
||||
3. wifi_set_broadcast_if : set which interface will UDP broadcast send from;
|
||||
|
||||
Fix bugs:
|
||||
1. Interrupt during flash erasing will cause wdt reset;
|
||||
2. Read/write rtc memory;
|
||||
3. If router disconnect to ESP8266, ESP8266 won't reconnect;
|
||||
4. Connect to router which hid its SSID
|
||||
|
||||
AT_v0.22 release note
|
||||
|
||||
Fix bug:
|
||||
1. Wrong return value of AT+CIPSTATUS;
|
||||
2. wdt rest after "0,CONNECT FAIL";
|
||||
|
||||
Add AT commands:
|
||||
1. Change AT commands of which configuration will store into flash to two kinds:
|
||||
XXX_CUR: current, only set configuration won't save it into Flash;
|
||||
XXX_DEF: default, set configuration and save it to Flash
|
||||
2. Add SmartConfig in AT:
|
||||
AT+CWSTARTSMART/AT+CWSTOPSMART: start / stop SmartConfig
|
||||
Notice: please refer to the document, call "AT+CWSTOPSMART" to stop SmartConfig first since "AT+CWSTARTSMART", then call other AT commands. Don't call any other AT commands during SmartConfig.
|
||||
2. AT+SAVETRANSLINK: save transparent transmission link to Flash;
|
||||
Note:AT+CIPMODE=1 set to enter transparent transmission mode, won't save to Flash.
|
||||
|
||||
|
||||
Add AT APIs
|
||||
1. at_customLinkMax: set the max link that allowed, most can be 10; if you want to set it, please set it before at_init; if you didn't set it, the max link allowed is 5 by default.
|
||||
2. at_enter_special_state/ at_leave_special_state:Enter/leave AT processing state. In processing state, AT core will return "busy" for any further AT commands.
|
||||
3. at_set_custom_info:set custom version information of AT which can be got by AT+GMR;
|
||||
4. at_get_version:get version information of AT lib .
|
||||
|
||||
Optimize
|
||||
1. Add UDP remote ip and remote port is allowed to be parameters of "AT+CIPSEND"
|
||||
2. Move "AT+CIUPDATE" from lib to AT "demo\esp_iot_sdk\examples\at", AT demo shows how to upgrade AT firmware from a local server. Notice that AT upgrade the bin files name have to be "user1.bin" and "user2.bin".
|
||||
3. Optimize "AT+CIPSTA", add gateway and netmask as parameters
|
||||
4. Optimize transparent transmission.
|
||||
|
||||
esp_iot_sdk_v0.9.5_15_01_22 Release Note
|
||||
----------------------------------------
|
||||
|
||||
AT becomes a lib attached to esp_iot_sdk, programming guide in "document" shows APIs for user to define their own AT commands, AT bin files are in \esp_iot_sdk\bin\at
|
||||
|
||||
Fix bugs:
|
||||
1. Incorrect status got by API : wifi_station_get_connect_status;
|
||||
2. Sniffer can not quit without restart;
|
||||
3. wifi_station_ap_change always return true;
|
||||
4. TCP connection issues
|
||||
|
||||
Add APIs:
|
||||
1. system_deep_sleep_set_option: set what the chip will do when deep-sleep wake up;
|
||||
2. wifi_status_led_uninstall;
|
||||
3. wifi_station_ap_get_info: get information of AP that ESP8266 station connected.
|
||||
4. wifi_station_dhcpc_status & wifi_softap_dhcps_status : get DHCP status
|
||||
5. smart config APIs, more details in documents.
|
||||
6. add beacon_interval parameter in struct softap_config
|
||||
7. espconn_recv_hold and espconn_recv_unhold to block TCP receiving data and unblock it.
|
||||
8. AT APIs to let user define their own AT, more details in documents.
|
||||
|
||||
Optimize:
|
||||
1. light sleep, modem sleep, deep sleep
|
||||
2. compile method: ./gen_misc.sh, then follow the tips and steps.
|
||||
3. when no buffer for os_malloc, return NULL instead of malloc assert.
|
||||
4. users can enable #define USE_OPTIMIZE_PRINTF in user_config.h to remove strings of os_printf from ram to irom
|
||||
5. faster the re-connection of ESP8266 station to router after deep-sleep.
|
||||
6. update to boot v1.2 to support new format user.bin;
|
||||
7. update ARP
|
||||
8. update SSL
|
||||
9. revised system_deep_sleep,system_deep_sleep(0),set no wake up timer,connect a GPIO to pin RST, the chip will wake up by a falling-edge on pin RST
|
||||
|
||||
esp_iot_sdk_v0.9.4_14_12_19 Release Note
|
||||
----------------------------------------
|
||||
|
||||
1. Update sniffer to support capture HT20/HT40 packet;
|
||||
2. Add APIs to set and get sleep type;
|
||||
3. Add APIs to get version info of sdk, delete version.h;
|
||||
4. RAW in LWIP is open source now, add API of function ping;
|
||||
5. Update spi driver;
|
||||
6. Optimize APIs related to espconn;
|
||||
7. Fix some bugs to make the software more reliable;
|
||||
|
||||
Known Issue:
|
||||
1. exception of small probability occured while recving multi-client data in softap
|
||||
2. restart of small probability occured while tcp client reconnecting
|
||||
|
||||
So sorry that we have some known issues here, we will solve it ASAP.
|
||||
|
||||
esp_iot_sdk_v0.9.3_14_11_21 Release Note
|
||||
----------------------------------------
|
||||
|
||||
1. Add license documentation of ESPRESSIF SDK
|
||||
2. Add APIs to read and write RTC memory, and APIs to get RTC time.
|
||||
3. Add APIs to swap UART0
|
||||
4. Add API to read ADC, delete adc.c.
|
||||
5. Add API to read spi flash id
|
||||
6. Revise struct station_config, add bssid parameters to distinguish different AP with same ssid ;
|
||||
Note: if station_config.bssid_set == 1 , station_config.bssid has to be set, or connection will fail. So in general, station_config.bssid_set need to be 0.
|
||||
7. Revise struct scan_config, add scan_config.show_hidden to set whether scan APs which ssid is hidden or not; not scan, set scan_config.show_hidden to be 0.
|
||||
Add bss_info.is_hidden in struct bss_info to show if this APTs ssid is hidden.
|
||||
8. Revise struct softap_config, add softap_config.ssid_len. If softap_config.ssid_len == 0, check ssid till find a termination characters; otherwise it depends on softap_config.ssid_len.
|
||||
9. Revise API "wifi_softap_set_config" to take effect immediately, needs not restart to make the configuration enable any more.
|
||||
10. Add APIs to set and get physical layer mode(802.11b/g/n)
|
||||
11. Add APIs to enable and disable DHCP server of ESP8266 softAP
|
||||
12. Add APIs to enable and disable DHCP client of ESP8266 station
|
||||
13. Add API to set range of ip address that get from DHCP server
|
||||
14. Add APIs to set and get how many TCP connections allowed at max.
|
||||
15. Add APIs to set and get how many TCP clients allowed at max to a TCP server.
|
||||
16. Revise "wifi_set_ip_info" and "wifi_set_macaddr" to take effect immediately.
|
||||
17. Fix some bugs to make the software more reliable.
|
||||
|
||||
ESP8266EX: Fix A Potential Error For UART RX in esp_iot_sdk_v0.9.2_14_10_24
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
The previously released SDK for ESP8266EX inadvertently introduced a bug that may cause a little packet loss when transferring packet by Uart RX.
|
||||
So for now,I will release the patch for this bug.Please download the patch from the attachment,and refer to the following steps:
|
||||
Following Commands:
|
||||
1. REPLACE LIBPHY.A IN SDK/LIB
|
||||
2. ADD LIBPP.A TO SDK/LIB
|
||||
3. MODIFY SDK/APP/MAKEFILE
|
||||
4. ADD "-lpp \" AS BELOW
|
||||
-lgcc
|
||||
-lhal
|
||||
-lpp
|
||||
-lphy
|
||||
-lnet80211
|
||||
-llwip
|
||||
-lwpa
|
||||
-lmain
|
||||
-lssc
|
||||
-lssl
|
||||
|
||||
esp_iot_sdk_v0.9.2_14_10_24 Release Note
|
||||
----------------------------------------
|
||||
|
||||
Initial version for public, can be compiled on both windows and lubuntu.
|
86
tools/sdk/include/c_types.h
Normal file
86
tools/sdk/include/c_types.h
Normal file
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2010 - 2011 Espressif System
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _C_TYPES_H_
|
||||
#define _C_TYPES_H_
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
typedef signed char sint8_t;
|
||||
typedef signed short sint16_t;
|
||||
typedef signed long sint32_t;
|
||||
typedef signed long long sint64_t;
|
||||
typedef unsigned long long u_int64_t;
|
||||
typedef float real32_t;
|
||||
typedef double real64_t;
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned char u8;
|
||||
typedef signed char sint8;
|
||||
typedef signed char int8;
|
||||
typedef signed char s8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned short u16;
|
||||
typedef signed short sint16;
|
||||
typedef signed short s16;
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned int u32;
|
||||
typedef signed int sint32;
|
||||
typedef signed int s32;
|
||||
typedef int int32;
|
||||
typedef signed long long sint64;
|
||||
typedef unsigned long long uint64;
|
||||
typedef unsigned long long u64;
|
||||
typedef float real32;
|
||||
typedef double real64;
|
||||
|
||||
#define __le16 u16
|
||||
|
||||
#define __packed __attribute__((packed))
|
||||
|
||||
#define LOCAL static
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void *)0
|
||||
#endif /* NULL */
|
||||
|
||||
/* probably should not put STATUS here */
|
||||
typedef enum {
|
||||
OK = 0,
|
||||
FAIL,
|
||||
PENDING,
|
||||
BUSY,
|
||||
CANCEL,
|
||||
} STATUS;
|
||||
|
||||
#define BIT(nr) (1UL << (nr))
|
||||
|
||||
#define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b))
|
||||
#define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b))
|
||||
|
||||
#define DMEM_ATTR __attribute__((section(".bss")))
|
||||
#define SHMEM_ATTR
|
||||
|
||||
#ifdef ICACHE_FLASH
|
||||
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
|
||||
#define ICACHE_RAM_ATTR __attribute__((section(".text")))
|
||||
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
|
||||
#else
|
||||
#define ICACHE_FLASH_ATTR
|
||||
#define ICACHE_RAM_ATTR
|
||||
#define ICACHE_RODATA_ATTR
|
||||
#endif /* ICACHE_FLASH */
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define BOOL bool
|
||||
#define TRUE true
|
||||
#define FALSE false
|
||||
|
||||
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#endif /* _C_TYPES_H_ */
|
312
tools/sdk/include/eagle_soc.h
Normal file
312
tools/sdk/include/eagle_soc.h
Normal file
@ -0,0 +1,312 @@
|
||||
/*
|
||||
* Copyright (c) Espressif System 2010 - 2012
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _EAGLE_SOC_H_
|
||||
#define _EAGLE_SOC_H_
|
||||
|
||||
//Register Bits{{
|
||||
#define BIT31 0x80000000
|
||||
#define BIT30 0x40000000
|
||||
#define BIT29 0x20000000
|
||||
#define BIT28 0x10000000
|
||||
#define BIT27 0x08000000
|
||||
#define BIT26 0x04000000
|
||||
#define BIT25 0x02000000
|
||||
#define BIT24 0x01000000
|
||||
#define BIT23 0x00800000
|
||||
#define BIT22 0x00400000
|
||||
#define BIT21 0x00200000
|
||||
#define BIT20 0x00100000
|
||||
#define BIT19 0x00080000
|
||||
#define BIT18 0x00040000
|
||||
#define BIT17 0x00020000
|
||||
#define BIT16 0x00010000
|
||||
#define BIT15 0x00008000
|
||||
#define BIT14 0x00004000
|
||||
#define BIT13 0x00002000
|
||||
#define BIT12 0x00001000
|
||||
#define BIT11 0x00000800
|
||||
#define BIT10 0x00000400
|
||||
#define BIT9 0x00000200
|
||||
#define BIT8 0x00000100
|
||||
#define BIT7 0x00000080
|
||||
#define BIT6 0x00000040
|
||||
#define BIT5 0x00000020
|
||||
#define BIT4 0x00000010
|
||||
#define BIT3 0x00000008
|
||||
#define BIT2 0x00000004
|
||||
#define BIT1 0x00000002
|
||||
#define BIT0 0x00000001
|
||||
//}}
|
||||
|
||||
//Registers Operation {{
|
||||
#define ETS_UNCACHED_ADDR(addr) (addr)
|
||||
#define ETS_CACHED_ADDR(addr) (addr)
|
||||
|
||||
|
||||
#define READ_PERI_REG(addr) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr)))
|
||||
#define WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) = (uint32_t)(val)
|
||||
#define CLEAR_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg)&(~(mask))))
|
||||
#define SET_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg)|(mask)))
|
||||
#define GET_PERI_REG_BITS(reg, hipos,lowpos) ((READ_PERI_REG(reg)>>(lowpos))&((1<<((hipos)-(lowpos)+1))-1))
|
||||
#define SET_PERI_REG_BITS(reg,bit_map,value,shift) (WRITE_PERI_REG((reg),(READ_PERI_REG(reg)&(~((bit_map)<<(shift))))|((value)<<(shift)) ))
|
||||
//}}
|
||||
|
||||
//Periheral Clock {{
|
||||
#define CPU_CLK_FREQ 80*1000000 //unit: Hz
|
||||
#define APB_CLK_FREQ CPU_CLK_FREQ
|
||||
#define UART_CLK_FREQ APB_CLK_FREQ
|
||||
#define TIMER_CLK_FREQ (APB_CLK_FREQ>>8) //divided by 256
|
||||
//}}
|
||||
|
||||
//Peripheral device base address define{{
|
||||
#define PERIPHS_DPORT_BASEADDR 0x3ff00000
|
||||
#define PERIPHS_GPIO_BASEADDR 0x60000300
|
||||
#define PERIPHS_TIMER_BASEDDR 0x60000600
|
||||
#define PERIPHS_RTC_BASEADDR 0x60000700
|
||||
#define PERIPHS_IO_MUX 0x60000800
|
||||
//}}
|
||||
|
||||
//Interrupt remap control registers define{{
|
||||
#define EDGE_INT_ENABLE_REG (PERIPHS_DPORT_BASEADDR+0x04)
|
||||
#define TM1_EDGE_INT_ENABLE() SET_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1)
|
||||
#define TM1_EDGE_INT_DISABLE() CLEAR_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1)
|
||||
//}}
|
||||
|
||||
//GPIO reg {{
|
||||
#define GPIO_REG_READ(reg) READ_PERI_REG(PERIPHS_GPIO_BASEADDR + reg)
|
||||
#define GPIO_REG_WRITE(reg, val) WRITE_PERI_REG(PERIPHS_GPIO_BASEADDR + reg, val)
|
||||
#define GPIO_OUT_ADDRESS 0x00
|
||||
#define GPIO_OUT_W1TS_ADDRESS 0x04
|
||||
#define GPIO_OUT_W1TC_ADDRESS 0x08
|
||||
|
||||
#define GPIO_ENABLE_ADDRESS 0x0c
|
||||
#define GPIO_ENABLE_W1TS_ADDRESS 0x10
|
||||
#define GPIO_ENABLE_W1TC_ADDRESS 0x14
|
||||
#define GPIO_OUT_W1TC_DATA_MASK 0x0000ffff
|
||||
|
||||
#define GPIO_IN_ADDRESS 0x18
|
||||
|
||||
#define GPIO_STATUS_ADDRESS 0x1c
|
||||
#define GPIO_STATUS_W1TS_ADDRESS 0x20
|
||||
#define GPIO_STATUS_W1TC_ADDRESS 0x24
|
||||
#define GPIO_STATUS_INTERRUPT_MASK 0x0000ffff
|
||||
|
||||
#define GPIO_RTC_CALIB_SYNC PERIPHS_GPIO_BASEADDR+0x6c
|
||||
#define RTC_CALIB_START BIT31 //first write to zero, then to one to start
|
||||
#define RTC_PERIOD_NUM_MASK 0x3ff //max 8ms
|
||||
#define GPIO_RTC_CALIB_VALUE PERIPHS_GPIO_BASEADDR+0x70
|
||||
#define RTC_CALIB_RDY_S 31 //after measure, flag to one, when start from zero to one, turn to zero
|
||||
#define RTC_CALIB_VALUE_MASK 0xfffff
|
||||
|
||||
#define GPIO_PIN0_ADDRESS 0x28
|
||||
|
||||
#define GPIO_ID_PIN0 0
|
||||
#define GPIO_ID_PIN(n) (GPIO_ID_PIN0+(n))
|
||||
#define GPIO_LAST_REGISTER_ID GPIO_ID_PIN(15)
|
||||
#define GPIO_ID_NONE 0xffffffff
|
||||
|
||||
#define GPIO_PIN_COUNT 16
|
||||
|
||||
#define GPIO_PIN_CONFIG_MSB 12
|
||||
#define GPIO_PIN_CONFIG_LSB 11
|
||||
#define GPIO_PIN_CONFIG_MASK 0x00001800
|
||||
#define GPIO_PIN_CONFIG_GET(x) (((x) & GPIO_PIN_CONFIG_MASK) >> GPIO_PIN_CONFIG_LSB)
|
||||
#define GPIO_PIN_CONFIG_SET(x) (((x) << GPIO_PIN_CONFIG_LSB) & GPIO_PIN_CONFIG_MASK)
|
||||
|
||||
#define GPIO_WAKEUP_ENABLE 1
|
||||
#define GPIO_WAKEUP_DISABLE (~GPIO_WAKEUP_ENABLE)
|
||||
#define GPIO_PIN_WAKEUP_ENABLE_MSB 10
|
||||
#define GPIO_PIN_WAKEUP_ENABLE_LSB 10
|
||||
#define GPIO_PIN_WAKEUP_ENABLE_MASK 0x00000400
|
||||
#define GPIO_PIN_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN_WAKEUP_ENABLE_MASK) >> GPIO_PIN_WAKEUP_ENABLE_LSB)
|
||||
#define GPIO_PIN_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN_WAKEUP_ENABLE_LSB) & GPIO_PIN_WAKEUP_ENABLE_MASK)
|
||||
|
||||
#define GPIO_PIN_INT_TYPE_MASK 0x380
|
||||
#define GPIO_PIN_INT_TYPE_MSB 9
|
||||
#define GPIO_PIN_INT_TYPE_LSB 7
|
||||
#define GPIO_PIN_INT_TYPE_GET(x) (((x) & GPIO_PIN_INT_TYPE_MASK) >> GPIO_PIN_INT_TYPE_LSB)
|
||||
#define GPIO_PIN_INT_TYPE_SET(x) (((x) << GPIO_PIN_INT_TYPE_LSB) & GPIO_PIN_INT_TYPE_MASK)
|
||||
|
||||
#define GPIO_PAD_DRIVER_ENABLE 1
|
||||
#define GPIO_PAD_DRIVER_DISABLE (~GPIO_PAD_DRIVER_ENABLE)
|
||||
#define GPIO_PIN_PAD_DRIVER_MSB 2
|
||||
#define GPIO_PIN_PAD_DRIVER_LSB 2
|
||||
#define GPIO_PIN_PAD_DRIVER_MASK 0x00000004
|
||||
#define GPIO_PIN_PAD_DRIVER_GET(x) (((x) & GPIO_PIN_PAD_DRIVER_MASK) >> GPIO_PIN_PAD_DRIVER_LSB)
|
||||
#define GPIO_PIN_PAD_DRIVER_SET(x) (((x) << GPIO_PIN_PAD_DRIVER_LSB) & GPIO_PIN_PAD_DRIVER_MASK)
|
||||
|
||||
#define GPIO_AS_PIN_SOURCE 0
|
||||
#define SIGMA_AS_PIN_SOURCE (~GPIO_AS_PIN_SOURCE)
|
||||
#define GPIO_PIN_SOURCE_MSB 0
|
||||
#define GPIO_PIN_SOURCE_LSB 0
|
||||
#define GPIO_PIN_SOURCE_MASK 0x00000001
|
||||
#define GPIO_PIN_SOURCE_GET(x) (((x) & GPIO_PIN_SOURCE_MASK) >> GPIO_PIN_SOURCE_LSB)
|
||||
#define GPIO_PIN_SOURCE_SET(x) (((x) << GPIO_PIN_SOURCE_LSB) & GPIO_PIN_SOURCE_MASK)
|
||||
// }}
|
||||
|
||||
// TIMER reg {{
|
||||
#define RTC_REG_READ(addr) READ_PERI_REG(PERIPHS_TIMER_BASEDDR + addr)
|
||||
#define RTC_REG_WRITE(addr, val) WRITE_PERI_REG(PERIPHS_TIMER_BASEDDR + addr, val)
|
||||
#define RTC_CLR_REG_MASK(reg, mask) CLEAR_PERI_REG_MASK(PERIPHS_TIMER_BASEDDR +reg, mask)
|
||||
/* Returns the current time according to the timer timer. */
|
||||
#define NOW() RTC_REG_READ(FRC2_COUNT_ADDRESS)
|
||||
|
||||
//load initial_value to timer1
|
||||
#define FRC1_LOAD_ADDRESS 0x00
|
||||
|
||||
//timer1's counter value(count from initial_value to 0)
|
||||
#define FRC1_COUNT_ADDRESS 0x04
|
||||
|
||||
#define FRC1_CTRL_ADDRESS 0x08
|
||||
|
||||
//clear timer1's interrupt when write this address
|
||||
#define FRC1_INT_ADDRESS 0x0c
|
||||
#define FRC1_INT_CLR_MASK 0x00000001
|
||||
|
||||
//timer2's counter value(count from initial_value to 0)
|
||||
#define FRC2_COUNT_ADDRESS 0x24
|
||||
// }}
|
||||
|
||||
//RTC reg {{
|
||||
#define REG_RTC_BASE PERIPHS_RTC_BASEADDR
|
||||
|
||||
#define RTC_GPIO_OUT (REG_RTC_BASE + 0x068)
|
||||
#define RTC_GPIO_ENABLE (REG_RTC_BASE + 0x074)
|
||||
#define RTC_GPIO_IN_DATA (REG_RTC_BASE + 0x08C)
|
||||
#define RTC_GPIO_CONF (REG_RTC_BASE + 0x090)
|
||||
#define PAD_XPD_DCDC_CONF (REG_RTC_BASE + 0x0A0)
|
||||
//}}
|
||||
|
||||
//PIN Mux reg {{
|
||||
#define PERIPHS_IO_MUX_FUNC 0x13
|
||||
#define PERIPHS_IO_MUX_FUNC_S 4
|
||||
#define PERIPHS_IO_MUX_PULLUP BIT7
|
||||
#define PERIPHS_IO_MUX_PULLDWN BIT6
|
||||
#define PERIPHS_IO_MUX_SLEEP_PULLUP BIT3
|
||||
#define PERIPHS_IO_MUX_SLEEP_PULLDWN BIT2
|
||||
#define PERIPHS_IO_MUX_SLEEP_OE BIT1
|
||||
#define PERIPHS_IO_MUX_OE BIT0
|
||||
|
||||
#define PERIPHS_IO_MUX_CONF_U (PERIPHS_IO_MUX + 0x00)
|
||||
#define SPI0_CLK_EQU_SYS_CLK BIT8
|
||||
#define SPI1_CLK_EQU_SYS_CLK BIT9
|
||||
|
||||
#define PERIPHS_IO_MUX_MTDI_U (PERIPHS_IO_MUX + 0x04)
|
||||
#define FUNC_MTDI 0
|
||||
#define FUNC_I2SI_DATA 1
|
||||
#define FUNC_HSPIQ_MISO 2
|
||||
#define FUNC_GPIO12 3
|
||||
#define FUNC_UART0_DTR 4
|
||||
|
||||
#define PERIPHS_IO_MUX_MTCK_U (PERIPHS_IO_MUX + 0x08)
|
||||
#define FUNC_MTCK 0
|
||||
#define FUNC_I2SI_BCK 1
|
||||
#define FUNC_HSPID_MOSI 2
|
||||
#define FUNC_GPIO13 3
|
||||
#define FUNC_UART0_CTS 4
|
||||
|
||||
#define PERIPHS_IO_MUX_MTMS_U (PERIPHS_IO_MUX + 0x0C)
|
||||
#define FUNC_MTMS 0
|
||||
#define FUNC_I2SI_WS 1
|
||||
#define FUNC_HSPI_CLK 2
|
||||
#define FUNC_GPIO14 3
|
||||
#define FUNC_UART0_DSR 4
|
||||
|
||||
#define PERIPHS_IO_MUX_MTDO_U (PERIPHS_IO_MUX + 0x10)
|
||||
#define FUNC_MTDO 0
|
||||
#define FUNC_I2SO_BCK 1
|
||||
#define FUNC_HSPI_CS0 2
|
||||
#define FUNC_GPIO15 3
|
||||
#define FUNC_U0RTS 4
|
||||
#define FUNC_UART0_RTS 4
|
||||
|
||||
#define PERIPHS_IO_MUX_U0RXD_U (PERIPHS_IO_MUX + 0x14)
|
||||
#define FUNC_U0RXD 0
|
||||
#define FUNC_I2SO_DATA 1
|
||||
#define FUNC_GPIO3 3
|
||||
#define FUNC_CLK_XTAL_BK 4
|
||||
|
||||
#define PERIPHS_IO_MUX_U0TXD_U (PERIPHS_IO_MUX + 0x18)
|
||||
#define FUNC_U0TXD 0
|
||||
#define FUNC_SPICS1 1
|
||||
#define FUNC_GPIO1 3
|
||||
#define FUNC_CLK_RTC_BK 4
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_CLK_U (PERIPHS_IO_MUX + 0x1c)
|
||||
#define FUNC_SDCLK 0
|
||||
#define FUNC_SPICLK 1
|
||||
#define FUNC_GPIO6 3
|
||||
#define UART1_CTS 4
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA0_U (PERIPHS_IO_MUX + 0x20)
|
||||
#define FUNC_SDDATA0 0
|
||||
#define FUNC_SPIQ_MISO 1
|
||||
#define FUNC_SPIQ 1
|
||||
#define FUNC_GPIO7 3
|
||||
#define FUNC_U1TXD 4
|
||||
#define FUNC_UART1_TXD 4
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA1_U (PERIPHS_IO_MUX + 0x24)
|
||||
#define FUNC_SDDATA1 0
|
||||
#define FUNC_SPID_MOSI 1
|
||||
#define FUNC_SPID 1
|
||||
#define FUNC_GPIO8 3
|
||||
#define FUNC_U1RXD 4
|
||||
#define FUNC_UART1_RXD 4
|
||||
#define FUNC_SDDATA1_U1RXD 7
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA2_U (PERIPHS_IO_MUX + 0x28)
|
||||
#define FUNC_SDDATA2 0
|
||||
#define FUNC_SPIHD 1
|
||||
#define FUNC_GPIO9 3
|
||||
#define UFNC_HSPIHD 4
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA3_U (PERIPHS_IO_MUX + 0x2c)
|
||||
#define FUNC_SDDATA3 0
|
||||
#define FUNC_SPIWP 1
|
||||
#define FUNC_GPIO10 3
|
||||
#define FUNC_HSPIWP 4
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_CMD_U (PERIPHS_IO_MUX + 0x30)
|
||||
#define FUNC_SDCMD 0
|
||||
#define FUNC_SPICS0 1
|
||||
#define FUNC_GPIO11 3
|
||||
#define U1RTS 4
|
||||
#define UART1_RTS 4
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO0_U (PERIPHS_IO_MUX + 0x34)
|
||||
#define FUNC_GPIO0 0
|
||||
#define FUNC_SPICS2 1
|
||||
#define FUNC_CLK_OUT 4
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO2_U (PERIPHS_IO_MUX + 0x38)
|
||||
#define FUNC_GPIO2 0
|
||||
#define FUNC_I2SO_WS 1
|
||||
#define FUNC_U1TXD_BK 2
|
||||
#define FUNC_UART1_TXD_BK 2
|
||||
#define FUNC_U0TXD_BK 4
|
||||
#define FUNC_UART0_TXD_BK 4
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO4_U (PERIPHS_IO_MUX + 0x3C)
|
||||
#define FUNC_GPIO4 0
|
||||
#define FUNC_CLK_XTAL 1
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO5_U (PERIPHS_IO_MUX + 0x40)
|
||||
#define FUNC_GPIO5 0
|
||||
#define FUNC_CLK_RTC 1
|
||||
|
||||
#define PIN_PULLUP_DIS(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLUP)
|
||||
#define PIN_PULLUP_EN(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLUP)
|
||||
#define PIN_PULLDWN_DIS(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLDWN)
|
||||
#define PIN_PULLDWN_EN(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLDWN)
|
||||
#define PIN_FUNC_SELECT(PIN_NAME, FUNC) do { \
|
||||
CLEAR_PERI_REG_MASK(PIN_NAME, (PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S)); \
|
||||
SET_PERI_REG_MASK(PIN_NAME, (((FUNC&BIT2)<<2)|(FUNC&0x3))<<PERIPHS_IO_MUX_FUNC_S); \
|
||||
} while (0)
|
||||
|
||||
//}}
|
||||
|
||||
#endif //_EAGLE_SOC_H_
|
598
tools/sdk/include/espconn.h
Normal file
598
tools/sdk/include/espconn.h
Normal file
@ -0,0 +1,598 @@
|
||||
#ifndef __ESPCONN_H__
|
||||
#define __ESPCONN_H__
|
||||
|
||||
typedef sint8 err_t;
|
||||
|
||||
typedef void *espconn_handle;
|
||||
typedef void (* espconn_connect_callback)(void *arg);
|
||||
typedef void (* espconn_reconnect_callback)(void *arg, sint8 err);
|
||||
|
||||
/* Definitions for error constants. */
|
||||
|
||||
#define ESPCONN_OK 0 /* No error, everything OK. */
|
||||
#define ESPCONN_MEM -1 /* Out of memory error. */
|
||||
#define ESPCONN_TIMEOUT -3 /* Timeout. */
|
||||
#define ESPCONN_RTE -4 /* Routing problem. */
|
||||
#define ESPCONN_INPROGRESS -5 /* Operation in progress */
|
||||
|
||||
#define ESPCONN_ABRT -8 /* Connection aborted. */
|
||||
#define ESPCONN_RST -9 /* Connection reset. */
|
||||
#define ESPCONN_CLSD -10 /* Connection closed. */
|
||||
#define ESPCONN_CONN -11 /* Not connected. */
|
||||
|
||||
#define ESPCONN_ARG -12 /* Illegal argument. */
|
||||
#define ESPCONN_ISCONN -15 /* Already connected. */
|
||||
|
||||
/** Protocol family and type of the espconn */
|
||||
enum espconn_type {
|
||||
ESPCONN_INVALID = 0,
|
||||
/* ESPCONN_TCP Group */
|
||||
ESPCONN_TCP = 0x10,
|
||||
/* ESPCONN_UDP Group */
|
||||
ESPCONN_UDP = 0x20,
|
||||
};
|
||||
|
||||
/** Current state of the espconn. Non-TCP espconn are always in state ESPCONN_NONE! */
|
||||
enum espconn_state {
|
||||
ESPCONN_NONE,
|
||||
ESPCONN_WAIT,
|
||||
ESPCONN_LISTEN,
|
||||
ESPCONN_CONNECT,
|
||||
ESPCONN_WRITE,
|
||||
ESPCONN_READ,
|
||||
ESPCONN_CLOSE
|
||||
};
|
||||
|
||||
typedef struct _esp_tcp {
|
||||
int remote_port;
|
||||
int local_port;
|
||||
uint8 local_ip[4];
|
||||
uint8 remote_ip[4];
|
||||
espconn_connect_callback connect_callback;
|
||||
espconn_reconnect_callback reconnect_callback;
|
||||
espconn_connect_callback disconnect_callback;
|
||||
espconn_connect_callback write_finish_fn;
|
||||
} esp_tcp;
|
||||
|
||||
typedef struct _esp_udp {
|
||||
int remote_port;
|
||||
int local_port;
|
||||
uint8 local_ip[4];
|
||||
uint8 remote_ip[4];
|
||||
} esp_udp;
|
||||
|
||||
typedef struct _remot_info{
|
||||
enum espconn_state state;
|
||||
int remote_port;
|
||||
uint8 remote_ip[4];
|
||||
}remot_info;
|
||||
|
||||
/** A callback prototype to inform about events for a espconn */
|
||||
typedef void (* espconn_recv_callback)(void *arg, char *pdata, unsigned short len);
|
||||
typedef void (* espconn_sent_callback)(void *arg);
|
||||
|
||||
/** A espconn descriptor */
|
||||
struct espconn {
|
||||
/** type of the espconn (TCP, UDP) */
|
||||
enum espconn_type type;
|
||||
/** current state of the espconn */
|
||||
enum espconn_state state;
|
||||
union {
|
||||
esp_tcp *tcp;
|
||||
esp_udp *udp;
|
||||
} proto;
|
||||
/** A callback function that is informed about events for this espconn */
|
||||
espconn_recv_callback recv_callback;
|
||||
espconn_sent_callback sent_callback;
|
||||
uint8 link_cnt;
|
||||
void *reverse;
|
||||
};
|
||||
|
||||
enum espconn_option{
|
||||
ESPCONN_START = 0x00,
|
||||
ESPCONN_REUSEADDR = 0x01,
|
||||
ESPCONN_NODELAY = 0x02,
|
||||
ESPCONN_COPY = 0x04,
|
||||
ESPCONN_KEEPALIVE = 0x08,
|
||||
ESPCONN_END
|
||||
};
|
||||
|
||||
enum espconn_level{
|
||||
ESPCONN_KEEPIDLE,
|
||||
ESPCONN_KEEPINTVL,
|
||||
ESPCONN_KEEPCNT
|
||||
};
|
||||
|
||||
enum {
|
||||
ESPCONN_IDLE = 0,
|
||||
ESPCONN_CLIENT,
|
||||
ESPCONN_SERVER,
|
||||
ESPCONN_BOTH,
|
||||
ESPCONN_MAX
|
||||
};
|
||||
|
||||
struct espconn_packet{
|
||||
uint16 sent_length; /* sent length successful*/
|
||||
uint16 snd_buf_size; /* Available buffer size for sending */
|
||||
uint16 snd_queuelen; /* Available buffer space for sending */
|
||||
uint16 total_queuelen; /* total Available buffer space for sending */
|
||||
uint32 packseqno; /* seqno to be sent */
|
||||
uint32 packseq_nxt; /* seqno expected */
|
||||
uint32 packnum;
|
||||
};
|
||||
|
||||
struct mdns_info {
|
||||
char *host_name;
|
||||
char *server_name;
|
||||
uint16 server_port;
|
||||
unsigned long ipAddr;
|
||||
char *txt_data;
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_connect
|
||||
* Description : The function given as the connect
|
||||
* Parameters : espconn -- the espconn used to listen the connection
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_connect(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_disconnect
|
||||
* Description : disconnect with host
|
||||
* Parameters : espconn -- the espconn used to disconnect the connection
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_disconnect(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_delete
|
||||
* Description : disconnect with host
|
||||
* Parameters : espconn -- the espconn used to disconnect the connection
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_delete(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_accept
|
||||
* Description : The function given as the listen
|
||||
* Parameters : espconn -- the espconn used to listen the connection
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_accept(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_create
|
||||
* Description : sent data for client or server
|
||||
* Parameters : espconn -- espconn to the data transmission
|
||||
* Returns : result
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_create(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_sent
|
||||
* Description : sent data for client or server
|
||||
* Parameters : espconn -- espconn to set for client or server
|
||||
* psent -- data to send
|
||||
* length -- length of data to send
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_sent(struct espconn *espconn, uint8 *psent, uint16 length);
|
||||
|
||||
/***** Connetion Settings *******/
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_tcp_get_max_con
|
||||
* Description : get the number of simulatenously active TCP connections
|
||||
* Parameters : none
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
uint8 espconn_tcp_get_max_con(void);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_tcp_set_max_con
|
||||
* Description : set the number of simulatenously active TCP connections
|
||||
* Parameters : num -- total number
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_tcp_set_max_con(uint8 num);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_tcp_get_max_con_allow
|
||||
* Description : get the count of simulatenously active connections on the server
|
||||
* Parameters : espconn -- espconn to get the count
|
||||
* Returns : result
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_tcp_get_max_con_allow(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_tcp_set_max_con_allow
|
||||
* Description : set the count of simulatenously active connections on the server
|
||||
* Parameters : espconn -- espconn to set the count
|
||||
* num -- support the connection number
|
||||
* Returns : result
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_tcp_set_max_con_allow(struct espconn *espconn, uint8 num);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_regist_time
|
||||
* Description : used to specify the time that should be called when don't recv data
|
||||
* Parameters : espconn -- the espconn used to the connection
|
||||
* interval -- the timer when don't recv data
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_regist_time(struct espconn *espconn, uint32 interval, uint8 type_flag);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_get_connection_info
|
||||
* Description : used to specify the function that should be called when disconnect
|
||||
* Parameters : espconn -- espconn to set the err callback
|
||||
* discon_cb -- err callback function to call when err
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_get_connection_info(struct espconn *pespconn, remot_info **pcon_info, uint8 typeflags);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_get_packet_info
|
||||
* Description : get the packet info with host
|
||||
* Parameters : espconn -- the espconn used to disconnect the connection
|
||||
* infoarg -- the packet info
|
||||
* Returns : the errur code
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_get_packet_info(struct espconn *espconn, struct espconn_packet* infoarg);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_port
|
||||
* Description : access port value for client so that we don't end up bouncing
|
||||
* all connections at the same time .
|
||||
* Parameters : none
|
||||
* Returns : access port value
|
||||
*******************************************************************************/
|
||||
|
||||
uint32 espconn_port(void);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_set_opt
|
||||
* Description : access port value for client so that we don't end up bouncing
|
||||
* all connections at the same time .
|
||||
* Parameters : espconn -- the espconn used to set the connection
|
||||
* opt -- the option to set
|
||||
* Returns : access port value
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_set_opt(struct espconn *espconn, uint8 opt);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_clear_opt
|
||||
* Description : clear the option for connections so that we don't end up bouncing
|
||||
* all connections at the same time .
|
||||
* Parameters : espconn -- the espconn used to set the connection
|
||||
* opt -- the option for clear
|
||||
* Returns : the result
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_clear_opt(struct espconn *espconn, uint8 opt);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_set_keepalive
|
||||
* Description : access level value for connection so that we set the value for
|
||||
* keep alive
|
||||
* Parameters : espconn -- the espconn used to set the connection
|
||||
* level -- the connection's level
|
||||
* value -- the value of time(s)
|
||||
* Returns : access port value
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_set_keepalive(struct espconn *espconn, uint8 level, void* optarg);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_get_keepalive
|
||||
* Description : access level value for connection so that we get the value for
|
||||
* keep alive
|
||||
* Parameters : espconn -- the espconn used to get the connection
|
||||
* level -- the connection's level
|
||||
* Returns : access keep alive value
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_get_keepalive(struct espconn *espconn, uint8 level, void *optarg);
|
||||
|
||||
/***** CALLBACKS *******/
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_regist_sentcb
|
||||
* Description : Used to specify the function that should be called when data
|
||||
* has been successfully delivered to the remote host.
|
||||
* Parameters : struct espconn *espconn -- espconn to set the sent callback
|
||||
* espconn_sent_callback sent_cb -- sent callback function to
|
||||
* call for this espconn when data is successfully sent
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_regist_sentcb(struct espconn *espconn, espconn_sent_callback sent_cb);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_regist_write_finish
|
||||
* Description : Used to specify the function that should be called when data
|
||||
* has been successfully written to the send buffer
|
||||
* Parameters : espconn -- espconn to set the sent callback
|
||||
* sent_cb -- sent callback function to call for this espconn
|
||||
* when data is successfully sent
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_regist_write_finish(struct espconn *espconn, espconn_connect_callback write_finish_fn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_regist_connectcb
|
||||
* Description : used to specify the function that should be called when
|
||||
* connects to host.
|
||||
* Parameters : espconn -- espconn to set the connect callback
|
||||
* connect_cb -- connected callback function to call when connected
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_regist_connectcb(struct espconn *espconn, espconn_connect_callback connect_cb);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_regist_recvcb
|
||||
* Description : used to specify the function that should be called when recv
|
||||
* data from host.
|
||||
* Parameters : espconn -- espconn to set the recv callback
|
||||
* recv_cb -- recv callback function to call when recv data
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_regist_recvcb(struct espconn *espconn, espconn_recv_callback recv_cb);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_regist_reconcb
|
||||
* Description : used to specify the function that should be called when connection
|
||||
* because of err disconnect.
|
||||
* Parameters : espconn -- espconn to set the err callback
|
||||
* recon_cb -- err callback function to call when err
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_regist_reconcb(struct espconn *espconn, espconn_reconnect_callback recon_cb);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_regist_disconcb
|
||||
* Description : used to specify the function that should be called when disconnect
|
||||
* Parameters : espconn -- espconn to set the err callback
|
||||
* discon_cb -- err callback function to call when err
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_regist_disconcb(struct espconn *espconn, espconn_connect_callback discon_cb);
|
||||
|
||||
/***** DNS *******/
|
||||
|
||||
/******************************************************************************
|
||||
* TypedefName : dns_found_callback
|
||||
* Description : Callback which is invoked when a hostname is found.
|
||||
* Parameters : name -- pointer to the name that was looked up.
|
||||
* ipaddr -- pointer to an ip_addr_t containing the IP address of
|
||||
* the hostname, or NULL if the name could not be found (or on any
|
||||
* other error).
|
||||
* callback_arg -- a user-specified callback argument passed to
|
||||
* dns_gethostbyname
|
||||
*******************************************************************************/
|
||||
|
||||
typedef void (*dns_found_callback)(const char *name, ip_addr_t *ipaddr, void *callback_arg);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_gethostbyname
|
||||
* Description : Resolve a hostname (string) into an IP address.
|
||||
* Parameters : pespconn -- espconn to resolve a hostname
|
||||
* hostname -- the hostname that is to be queried
|
||||
* addr -- pointer to a ip_addr_t where to store the address if
|
||||
* it is already cached in the dns_table (only valid if ESPCONN_OK
|
||||
* is returned!)
|
||||
* found -- a callback function to be called on success, failure
|
||||
* or timeout (only if ERR_INPROGRESS is returned!)
|
||||
* Returns : err_t return code
|
||||
* - ESPCONN_OK if hostname is a valid IP address string or the host
|
||||
* name is already in the local names table.
|
||||
* - ESPCONN_INPROGRESS enqueue a request to be sent to the DNS server
|
||||
* for resolution if no errors are present.
|
||||
* - ESPCONN_ARG: dns client not initialized or invalid hostname
|
||||
*******************************************************************************/
|
||||
|
||||
err_t espconn_gethostbyname(struct espconn *pespconn, const char *hostname, ip_addr_t *addr, dns_found_callback found);
|
||||
|
||||
/***** SSL *******/
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_encry_connect
|
||||
* Description : The function given as connection
|
||||
* Parameters : espconn -- the espconn used to connect with the host
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_secure_connect(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_encry_disconnect
|
||||
* Description : The function given as the disconnection
|
||||
* Parameters : espconn -- the espconn used to disconnect with the host
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_secure_disconnect(struct espconn *espconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_encry_sent
|
||||
* Description : sent data for client or server
|
||||
* Parameters : espconn -- espconn to set for client or server
|
||||
* psent -- data to send
|
||||
* length -- length of data to send
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_secure_sent(struct espconn *espconn, uint8 *psent, uint16 length);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_secure_set_size
|
||||
* Description : set the buffer size for client or server
|
||||
* Parameters : level -- set for client or server
|
||||
* 1: client,2:server,3:client and server
|
||||
* size -- buffer size
|
||||
* Returns : true or false
|
||||
*******************************************************************************/
|
||||
|
||||
bool espconn_secure_set_size(uint8 level, uint16 size);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_secure_get_size
|
||||
* Description : get buffer size for client or server
|
||||
* Parameters : level -- set for client or server
|
||||
* 1: client,2:server,3:client and server
|
||||
* Returns : buffer size for client or server
|
||||
*******************************************************************************/
|
||||
|
||||
sint16 espconn_secure_get_size(uint8 level);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_secure_accept
|
||||
* Description : The function given as the listen
|
||||
* Parameters : espconn -- the espconn used to listen the connection
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
sint8 espconn_secure_accept(struct espconn *espconn);
|
||||
|
||||
/***** TCP RX HOLD *******/
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_recv_hold
|
||||
* Description : hold tcp receive
|
||||
* Parameters : espconn -- espconn to hold
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
sint8 espconn_recv_hold(struct espconn *pespconn);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_recv_unhold
|
||||
* Description : unhold tcp receive
|
||||
* Parameters : espconn -- espconn to unhold
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
sint8 espconn_recv_unhold(struct espconn *pespconn);
|
||||
|
||||
/***** IGMP *******/
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_igmp_join
|
||||
* Description : join a multicast group
|
||||
* Parameters : host_ip -- the ip address of udp server
|
||||
* multicast_ip -- multicast ip given by user
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
sint8 espconn_igmp_join(ip_addr_t *host_ip, ip_addr_t *multicast_ip);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_igmp_leave
|
||||
* Description : leave a multicast group
|
||||
* Parameters : host_ip -- the ip address of udp server
|
||||
* multicast_ip -- multicast ip given by user
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
sint8 espconn_igmp_leave(ip_addr_t *host_ip, ip_addr_t *multicast_ip);
|
||||
|
||||
/***** mDNS *******/
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_init
|
||||
* Description : register a device with mdns
|
||||
* Parameters : ipAddr -- the ip address of device
|
||||
* hostname -- the hostname of device
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
void espconn_mdns_init(struct mdns_info *info);
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_close
|
||||
* Description : close a device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
void espconn_mdns_close(void);
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_server_register
|
||||
* Description : register a device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void espconn_mdns_server_register(void);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_server_unregister
|
||||
* Description : unregister a device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void espconn_mdns_server_unregister(void);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_get_servername
|
||||
* Description : get server name of device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
|
||||
char* espconn_mdns_get_servername(void);
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_set_servername
|
||||
* Description : set server name of device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void espconn_mdns_set_servername(const char *name);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_set_hostname
|
||||
* Description : set host name of device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void espconn_mdns_set_hostname(char *name);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_get_hostname
|
||||
* Description : get host name of device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
char* espconn_mdns_get_hostname(void);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_disable
|
||||
* Description : disable a device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void espconn_mdns_disable(void);
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : espconn_mdns_enable
|
||||
* Description : disable a device with mdns
|
||||
* Parameters : a
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
void espconn_mdns_enable(void);
|
||||
#endif
|
||||
|
124
tools/sdk/include/ets_sys.h
Normal file
124
tools/sdk/include/ets_sys.h
Normal file
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* copyright (c) 2008 - 2011 Espressif System
|
||||
*
|
||||
* Define user specified Event signals and Task priorities here
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ETS_SYS_H
|
||||
#define _ETS_SYS_H
|
||||
|
||||
#include "c_types.h"
|
||||
#include "eagle_soc.h"
|
||||
|
||||
typedef uint32_t ETSSignal;
|
||||
typedef uint32_t ETSParam;
|
||||
|
||||
typedef struct ETSEventTag ETSEvent;
|
||||
|
||||
struct ETSEventTag {
|
||||
ETSSignal sig;
|
||||
ETSParam par;
|
||||
};
|
||||
|
||||
typedef void (*ETSTask)(ETSEvent *e);
|
||||
|
||||
/* timer related */
|
||||
typedef uint32_t ETSHandle;
|
||||
typedef void ETSTimerFunc(void *timer_arg);
|
||||
|
||||
typedef struct _ETSTIMER_ {
|
||||
struct _ETSTIMER_ *timer_next;
|
||||
uint32_t timer_expire;
|
||||
uint32_t timer_period;
|
||||
ETSTimerFunc *timer_func;
|
||||
void *timer_arg;
|
||||
} ETSTimer;
|
||||
|
||||
/* interrupt related */
|
||||
|
||||
typedef void (*int_handler_t)(void*);
|
||||
|
||||
#define ETS_SPI_INUM 2
|
||||
#define ETS_GPIO_INUM 4
|
||||
#define ETS_UART_INUM 5
|
||||
#define ETS_UART1_INUM 5
|
||||
#define ETS_FRC_TIMER1_INUM 9 /* use edge*/
|
||||
|
||||
#define ETS_INTR_LOCK() \
|
||||
ets_intr_lock()
|
||||
|
||||
#define ETS_INTR_UNLOCK() \
|
||||
ets_intr_unlock()
|
||||
|
||||
#define ETS_FRC_TIMER1_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_FRC_TIMER1_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_GPIO_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_GPIO_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_UART_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_UART_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_SPI_INTR_ATTACH(func, arg) \
|
||||
ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg))
|
||||
|
||||
#define ETS_INTR_ENABLE(inum) \
|
||||
ets_isr_unmask((1<<inum))
|
||||
|
||||
#define ETS_INTR_DISABLE(inum) \
|
||||
ets_isr_mask((1<<inum))
|
||||
|
||||
#define ETS_SPI_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_SPI_INUM)
|
||||
|
||||
#define ETS_UART_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_UART_INUM)
|
||||
|
||||
#define ETS_UART_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_UART_INUM)
|
||||
|
||||
#define ETS_FRC1_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM)
|
||||
|
||||
#define ETS_FRC1_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM)
|
||||
|
||||
#define ETS_GPIO_INTR_ENABLE() \
|
||||
ETS_INTR_ENABLE(ETS_GPIO_INUM)
|
||||
|
||||
#define ETS_GPIO_INTR_DISABLE() \
|
||||
ETS_INTR_DISABLE(ETS_GPIO_INUM)
|
||||
|
||||
|
||||
void *pvPortMalloc(size_t xWantedSize) __attribute__((malloc, alloc_size(1)));
|
||||
void *pvPortRealloc(void* ptr, size_t xWantedSize) __attribute__((alloc_size(2)));
|
||||
void pvPortFree(void *ptr);
|
||||
void *vPortMalloc(size_t xWantedSize) __attribute__((malloc, alloc_size(1)));
|
||||
void vPortFree(void *ptr);
|
||||
void *ets_memcpy(void *dest, const void *src, size_t n);
|
||||
void *ets_memset(void *s, int c, size_t n);
|
||||
void ets_timer_arm_new(ETSTimer *a, int b, int c, int isMstimer);
|
||||
void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *fn, void *parg);
|
||||
void ets_timer_disarm(ETSTimer *a);
|
||||
int atoi(const char *nptr);
|
||||
int ets_strncmp(const char *s1, const char *s2, int len);
|
||||
int ets_strcmp(const char *s1, const char *s2);
|
||||
int ets_strlen(const char *s);
|
||||
char *ets_strcpy(char *dest, const char *src);
|
||||
char *ets_strncpy(char *dest, const char *src, size_t n);
|
||||
char *ets_strstr(const char *haystack, const char *needle);
|
||||
int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
|
||||
int os_snprintf(char *str, size_t size, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
int ets_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
void ets_install_putc1(void* routine);
|
||||
void uart_div_modify(int no, int freq);
|
||||
void ets_isr_mask(int intr);
|
||||
void ets_isr_unmask(int intr);
|
||||
void ets_isr_attach(int intr, int_handler_t handler, void *arg);
|
||||
void ets_intr_lock();
|
||||
void ets_intr_unlock();
|
||||
int ets_vsnprintf(char * s, size_t n, const char * format, va_list arg);
|
||||
int ets_vprintf(const char * format, va_list arg);
|
||||
|
||||
#endif /* _ETS_SYS_H */
|
100
tools/sdk/include/gpio.h
Normal file
100
tools/sdk/include/gpio.h
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* copyright (c) Espressif System 2010
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GPIO_H_
|
||||
#define _GPIO_H_
|
||||
|
||||
#define GPIO_PIN_ADDR(i) (GPIO_PIN0_ADDRESS + i*4)
|
||||
|
||||
#define GPIO_ID_IS_PIN_REGISTER(reg_id) \
|
||||
((reg_id >= GPIO_ID_PIN0) && (reg_id <= GPIO_ID_PIN(GPIO_PIN_COUNT-1)))
|
||||
|
||||
#define GPIO_REGID_TO_PINIDX(reg_id) ((reg_id) - GPIO_ID_PIN0)
|
||||
|
||||
typedef enum {
|
||||
GPIO_PIN_INTR_DISABLE = 0,
|
||||
GPIO_PIN_INTR_POSEDGE = 1,
|
||||
GPIO_PIN_INTR_NEGEDGE = 2,
|
||||
GPIO_PIN_INTR_ANYEDGE = 3,
|
||||
GPIO_PIN_INTR_LOLEVEL = 4,
|
||||
GPIO_PIN_INTR_HILEVEL = 5
|
||||
} GPIO_INT_TYPE;
|
||||
|
||||
#define GPIO_OUTPUT_SET(gpio_no, bit_value) \
|
||||
gpio_output_set(bit_value<<gpio_no, ((~bit_value)&0x01)<<gpio_no, 1<<gpio_no,0)
|
||||
#define GPIO_DIS_OUTPUT(gpio_no) gpio_output_set(0,0,0, 1<<gpio_no)
|
||||
#define GPIO_INPUT_GET(gpio_no) ((gpio_input_get()>>gpio_no)&BIT0)
|
||||
|
||||
/* GPIO interrupt handler, registered through gpio_intr_handler_register */
|
||||
typedef void (* gpio_intr_handler_fn_t)(uint32 intr_mask, void *arg);
|
||||
|
||||
|
||||
/*
|
||||
* Initialize GPIO. This includes reading the GPIO Configuration DataSet
|
||||
* to initialize "output enables" and pin configurations for each gpio pin.
|
||||
* Must be called once during startup.
|
||||
*/
|
||||
void gpio_init(void);
|
||||
|
||||
/*
|
||||
* Change GPIO pin output by setting, clearing, or disabling pins.
|
||||
* In general, it is expected that a bit will be set in at most one
|
||||
* of these masks. If a bit is clear in all masks, the output state
|
||||
* remains unchanged.
|
||||
*
|
||||
* There is no particular ordering guaranteed; so if the order of
|
||||
* writes is significant, calling code should divide a single call
|
||||
* into multiple calls.
|
||||
*/
|
||||
void gpio_output_set(uint32 set_mask,
|
||||
uint32 clear_mask,
|
||||
uint32 enable_mask,
|
||||
uint32 disable_mask);
|
||||
|
||||
/*
|
||||
* Sample the value of GPIO input pins and returns a bitmask.
|
||||
*/
|
||||
uint32 gpio_input_get(void);
|
||||
|
||||
/*
|
||||
* Set the specified GPIO register to the specified value.
|
||||
* This is a very general and powerful interface that is not
|
||||
* expected to be used during normal operation. It is intended
|
||||
* mainly for debug, or for unusual requirements.
|
||||
*/
|
||||
void gpio_register_set(uint32 reg_id, uint32 value);
|
||||
|
||||
/* Get the current value of the specified GPIO register. */
|
||||
uint32 gpio_register_get(uint32 reg_id);
|
||||
|
||||
/*
|
||||
* Register an application-specific interrupt handler for GPIO pin
|
||||
* interrupts. Once the interrupt handler is called, it will not
|
||||
* be called again until after a call to gpio_intr_ack. Any GPIO
|
||||
* interrupts that occur during the interim are masked.
|
||||
*
|
||||
* The application-specific handler is called with a mask of
|
||||
* pending GPIO interrupts. After processing pin interrupts, the
|
||||
* application-specific handler may wish to use gpio_intr_pending
|
||||
* to check for any additional pending interrupts before it returns.
|
||||
*/
|
||||
void gpio_intr_handler_register(gpio_intr_handler_fn_t fn, void *arg);
|
||||
|
||||
/* Determine which GPIO interrupts are pending. */
|
||||
uint32 gpio_intr_pending(void);
|
||||
|
||||
/*
|
||||
* Acknowledge GPIO interrupts.
|
||||
* Intended to be called from the gpio_intr_handler_fn.
|
||||
*/
|
||||
void gpio_intr_ack(uint32 ack_mask);
|
||||
|
||||
void gpio_pin_wakeup_enable(uint32 i, GPIO_INT_TYPE intr_state);
|
||||
|
||||
void gpio_pin_wakeup_disable();
|
||||
|
||||
void gpio_pin_intr_state_set(uint32 i, GPIO_INT_TYPE intr_state);
|
||||
|
||||
#endif // _GPIO_H_
|
68
tools/sdk/include/ip_addr.h
Normal file
68
tools/sdk/include/ip_addr.h
Normal file
@ -0,0 +1,68 @@
|
||||
#ifndef __IP_ADDR_H__
|
||||
#define __IP_ADDR_H__
|
||||
|
||||
#include "c_types.h"
|
||||
|
||||
struct ip_addr {
|
||||
uint32 addr;
|
||||
};
|
||||
|
||||
typedef struct ip_addr ip_addr_t;
|
||||
|
||||
struct ip_info {
|
||||
struct ip_addr ip;
|
||||
struct ip_addr netmask;
|
||||
struct ip_addr gw;
|
||||
};
|
||||
|
||||
#define IP4_ADDR(ipaddr, a,b,c,d) \
|
||||
(ipaddr)->addr = ((uint32)((d) & 0xff) << 24) | \
|
||||
((uint32)((c) & 0xff) << 16) | \
|
||||
((uint32)((b) & 0xff) << 8) | \
|
||||
(uint32)((a) & 0xff)
|
||||
|
||||
/**
|
||||
* Determine if two address are on the same network.
|
||||
*
|
||||
* @arg addr1 IP address 1
|
||||
* @arg addr2 IP address 2
|
||||
* @arg mask network identifier mask
|
||||
* @return !0 if the network identifiers of both address match
|
||||
*/
|
||||
#define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \
|
||||
(mask)->addr) == \
|
||||
((addr2)->addr & \
|
||||
(mask)->addr))
|
||||
|
||||
/** Set an IP address given by the four byte-parts.
|
||||
Little-endian version that prevents the use of htonl. */
|
||||
#define IP4_ADDR(ipaddr, a,b,c,d) \
|
||||
(ipaddr)->addr = ((uint32)((d) & 0xff) << 24) | \
|
||||
((uint32)((c) & 0xff) << 16) | \
|
||||
((uint32)((b) & 0xff) << 8) | \
|
||||
(uint32)((a) & 0xff)
|
||||
|
||||
#define ip4_addr1(ipaddr) (((uint8*)(ipaddr))[0])
|
||||
#define ip4_addr2(ipaddr) (((uint8*)(ipaddr))[1])
|
||||
#define ip4_addr3(ipaddr) (((uint8*)(ipaddr))[2])
|
||||
#define ip4_addr4(ipaddr) (((uint8*)(ipaddr))[3])
|
||||
|
||||
#define ip4_addr1_16(ipaddr) ((uint16)ip4_addr1(ipaddr))
|
||||
#define ip4_addr2_16(ipaddr) ((uint16)ip4_addr2(ipaddr))
|
||||
#define ip4_addr3_16(ipaddr) ((uint16)ip4_addr3(ipaddr))
|
||||
#define ip4_addr4_16(ipaddr) ((uint16)ip4_addr4(ipaddr))
|
||||
|
||||
|
||||
/** 255.255.255.255 */
|
||||
#define IPADDR_NONE ((uint32)0xffffffffUL)
|
||||
/** 0.0.0.0 */
|
||||
#define IPADDR_ANY ((uint32)0x00000000UL)
|
||||
uint32 ipaddr_addr(const char *cp);
|
||||
|
||||
#define IP2STR(addr) (uint8_t)(addr & 0xFF), (uint8_t)((addr >> 8) & 0xFF), (uint8_t)((addr >> 16) & 0xFF), (uint8_t)((addr >> 24) & 0xFF)
|
||||
#define IPSTR "%d.%d.%d.%d"
|
||||
|
||||
#define MAC2STR(mac) (uint8_t)mac[0], (uint8_t)mac[1], (uint8_t)mac[2], (uint8_t)mac[3], (uint8_t)mac[4], (uint8_t)mac[5]
|
||||
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
|
||||
#endif /* __IP_ADDR_H__ */
|
70
tools/sdk/include/json/json.h
Executable file
70
tools/sdk/include/json/json.h
Executable file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2012, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* A few JSON defines used for parsing and generating JSON.
|
||||
* \author
|
||||
* Niclas Finne <nfi@sics.se>
|
||||
* Joakim Eriksson <joakime@sics.se>
|
||||
*/
|
||||
|
||||
#ifndef __JSON_H__
|
||||
#define __JSON_H__
|
||||
|
||||
#define JSON_TYPE_ARRAY '['
|
||||
#define JSON_TYPE_OBJECT '{'
|
||||
#define JSON_TYPE_PAIR ':'
|
||||
#define JSON_TYPE_PAIR_NAME 'N' /* for N:V pairs */
|
||||
#define JSON_TYPE_STRING '"'
|
||||
#define JSON_TYPE_INT 'I'
|
||||
#define JSON_TYPE_NUMBER '0'
|
||||
#define JSON_TYPE_ERROR 0
|
||||
|
||||
/* how should we handle null vs false - both can be 0? */
|
||||
#define JSON_TYPE_NULL 'n'
|
||||
#define JSON_TYPE_TRUE 't'
|
||||
#define JSON_TYPE_FALSE 'f'
|
||||
|
||||
#define JSON_TYPE_CALLBACK 'C'
|
||||
|
||||
enum {
|
||||
JSON_ERROR_OK,
|
||||
JSON_ERROR_SYNTAX,
|
||||
JSON_ERROR_UNEXPECTED_ARRAY,
|
||||
JSON_ERROR_UNEXPECTED_END_OF_ARRAY,
|
||||
JSON_ERROR_UNEXPECTED_OBJECT,
|
||||
JSON_ERROR_UNEXPECTED_STRING
|
||||
};
|
||||
|
||||
#define JSON_CONTENT_TYPE "application/json"
|
||||
|
||||
#endif /* __JSON_H__ */
|
94
tools/sdk/include/json/jsonparse.h
Executable file
94
tools/sdk/include/json/jsonparse.h
Executable file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2012, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*/
|
||||
|
||||
#ifndef __JSONPARSE_H__
|
||||
#define __JSONPARSE_H__
|
||||
|
||||
#include "c_types.h"
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef JSONPARSE_CONF_MAX_DEPTH
|
||||
#define JSONPARSE_MAX_DEPTH JSONPARSE_CONF_MAX_DEPTH
|
||||
#else
|
||||
#define JSONPARSE_MAX_DEPTH 10
|
||||
#endif
|
||||
|
||||
struct jsonparse_state {
|
||||
const char *json;
|
||||
int pos;
|
||||
int len;
|
||||
int depth;
|
||||
/* for handling atomic values */
|
||||
int vstart;
|
||||
int vlen;
|
||||
char vtype;
|
||||
char error;
|
||||
char stack[JSONPARSE_MAX_DEPTH];
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Initialize a JSON parser state.
|
||||
* \param state A pointer to a JSON parser state
|
||||
* \param json The string to parse as JSON
|
||||
* \param len The length of the string to parse
|
||||
*
|
||||
* This function initializes a JSON parser state for
|
||||
* parsing a string as JSON.
|
||||
*/
|
||||
void jsonparse_setup(struct jsonparse_state *state, const char *json,
|
||||
int len);
|
||||
|
||||
/* move to next JSON element */
|
||||
int jsonparse_next(struct jsonparse_state *state);
|
||||
|
||||
/* copy the current JSON value into the specified buffer */
|
||||
int jsonparse_copy_value(struct jsonparse_state *state, char *buf,
|
||||
int buf_size);
|
||||
|
||||
/* get the current JSON value parsed as an int */
|
||||
int jsonparse_get_value_as_int(struct jsonparse_state *state);
|
||||
|
||||
/* get the current JSON value parsed as a long */
|
||||
long jsonparse_get_value_as_long(struct jsonparse_state *state);
|
||||
|
||||
/* get the current JSON value parsed as a unsigned long */
|
||||
unsigned long jsonparse_get_value_as_ulong(struct jsonparse_state *state);
|
||||
|
||||
/* get the length of the current JSON value */
|
||||
int jsonparse_get_len(struct jsonparse_state *state);
|
||||
|
||||
/* get the type of the current JSON value */
|
||||
int jsonparse_get_type(struct jsonparse_state *state);
|
||||
|
||||
/* compare the JSON value with the specified string */
|
||||
int jsonparse_strcmp_value(struct jsonparse_state *state, const char *str);
|
||||
|
||||
#endif /* __JSONPARSE_H__ */
|
145
tools/sdk/include/json/jsontree.h
Executable file
145
tools/sdk/include/json/jsontree.h
Executable file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2012, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* JSON output generation
|
||||
* \author
|
||||
* Niclas Finne <nfi@sics.se>
|
||||
* Joakim Eriksson <joakime@sics.se>
|
||||
*/
|
||||
|
||||
#ifndef __JSONTREE_H__
|
||||
#define __JSONTREE_H__
|
||||
|
||||
#include "c_types.h"
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef JSONTREE_CONF_MAX_DEPTH
|
||||
#define JSONTREE_MAX_DEPTH JSONTREE_CONF_MAX_DEPTH
|
||||
#else
|
||||
#define JSONTREE_MAX_DEPTH 10
|
||||
#endif /* JSONTREE_CONF_MAX_DEPTH */
|
||||
|
||||
struct jsontree_context {
|
||||
struct jsontree_value *values[JSONTREE_MAX_DEPTH];
|
||||
uint16_t index[JSONTREE_MAX_DEPTH];
|
||||
int (* putchar)(int);
|
||||
uint8_t depth;
|
||||
uint8_t path;
|
||||
int callback_state;
|
||||
};
|
||||
|
||||
struct jsontree_value {
|
||||
uint8_t type;
|
||||
/* followed by a value */
|
||||
};
|
||||
|
||||
struct jsontree_string {
|
||||
uint8_t type;
|
||||
const char *value;
|
||||
};
|
||||
|
||||
struct jsontree_int {
|
||||
uint8_t type;
|
||||
int value;
|
||||
};
|
||||
|
||||
/* NOTE: the jsontree_callback set will receive a jsonparse state */
|
||||
struct jsonparse_state;
|
||||
struct jsontree_callback {
|
||||
uint8_t type;
|
||||
int (* output)(struct jsontree_context *js_ctx);
|
||||
int (* set)(struct jsontree_context *js_ctx, struct jsonparse_state *parser);
|
||||
};
|
||||
|
||||
struct jsontree_pair {
|
||||
const char *name;
|
||||
struct jsontree_value *value;
|
||||
};
|
||||
|
||||
struct jsontree_object {
|
||||
uint8_t type;
|
||||
uint8_t count;
|
||||
struct jsontree_pair *pairs;
|
||||
};
|
||||
|
||||
struct jsontree_array {
|
||||
uint8_t type;
|
||||
uint8_t count;
|
||||
struct jsontree_value **values;
|
||||
};
|
||||
|
||||
#define JSONTREE_STRING(text) {JSON_TYPE_STRING, (text)}
|
||||
#define JSONTREE_PAIR(name, value) {(name), (struct jsontree_value *)(value)}
|
||||
#define JSONTREE_CALLBACK(output, set) {JSON_TYPE_CALLBACK, (output), (set)}
|
||||
|
||||
#define JSONTREE_OBJECT(name, ...) \
|
||||
static struct jsontree_pair jsontree_pair_##name[] = {__VA_ARGS__}; \
|
||||
static struct jsontree_object name = { \
|
||||
JSON_TYPE_OBJECT, \
|
||||
sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \
|
||||
jsontree_pair_##name }
|
||||
|
||||
#define JSONTREE_PAIR_ARRAY(value) (struct jsontree_value *)(value)
|
||||
#define JSONTREE_ARRAY(name, ...) \
|
||||
static struct jsontree_value* jsontree_value_##name[] = {__VA_ARGS__}; \
|
||||
static struct jsontree_array name = { \
|
||||
JSON_TYPE_ARRAY, \
|
||||
sizeof(jsontree_value_##name)/sizeof(struct jsontree_value*), \
|
||||
jsontree_value_##name }
|
||||
|
||||
#define JSONTREE_OBJECT_EXT(name, ...) \
|
||||
static struct jsontree_pair jsontree_pair_##name[] = {__VA_ARGS__}; \
|
||||
struct jsontree_object name = { \
|
||||
JSON_TYPE_OBJECT, \
|
||||
sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \
|
||||
jsontree_pair_##name }
|
||||
|
||||
void jsontree_setup(struct jsontree_context *js_ctx,
|
||||
struct jsontree_value *root, int (* putchar)(int));
|
||||
void jsontree_reset(struct jsontree_context *js_ctx);
|
||||
|
||||
const char *jsontree_path_name(const struct jsontree_context *js_ctx,
|
||||
int depth);
|
||||
|
||||
void jsontree_write_int(const struct jsontree_context *js_ctx, int value);
|
||||
void jsontree_write_int_array(const struct jsontree_context *js_ctx, const int *text, uint32 length);
|
||||
|
||||
void jsontree_write_atom(const struct jsontree_context *js_ctx,
|
||||
const char *text);
|
||||
void jsontree_write_string(const struct jsontree_context *js_ctx,
|
||||
const char *text);
|
||||
int jsontree_print_next(struct jsontree_context *js_ctx);
|
||||
struct jsontree_value *jsontree_find_next(struct jsontree_context *js_ctx,
|
||||
int type);
|
||||
|
||||
#endif /* __JSONTREE_H__ */
|
13
tools/sdk/include/mem.h
Normal file
13
tools/sdk/include/mem.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef __MEM_H__
|
||||
#define __MEM_H__
|
||||
|
||||
//void *pvPortMalloc( size_t xWantedSize );
|
||||
//void vPortFree( void *pv );
|
||||
//void *pvPortZalloc(size_t size);
|
||||
|
||||
#define os_malloc pvPortMalloc
|
||||
#define os_free vPortFree
|
||||
#define os_zalloc pvPortZalloc
|
||||
#define os_realloc pvPortRealloc
|
||||
|
||||
#endif
|
19
tools/sdk/include/os_type.h
Normal file
19
tools/sdk/include/os_type.h
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* copyright (c) Espressif System 2010
|
||||
*
|
||||
* mapping to ETS structures
|
||||
*
|
||||
*/
|
||||
#ifndef _OS_TYPES_H_
|
||||
#define _OS_TYPES_H_
|
||||
|
||||
#include "ets_sys.h"
|
||||
|
||||
#define os_signal_t ETSSignal
|
||||
#define os_param_t ETSParam
|
||||
#define os_event_t ETSEvent
|
||||
#define os_task_t ETSTask
|
||||
#define os_timer_t ETSTimer
|
||||
#define os_timer_func_t ETSTimerFunc
|
||||
|
||||
#endif
|
58
tools/sdk/include/osapi.h
Normal file
58
tools/sdk/include/osapi.h
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Espressif System
|
||||
*/
|
||||
|
||||
#ifndef _OSAPI_H_
|
||||
#define _OSAPI_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "user_config.h"
|
||||
|
||||
#define os_bzero ets_bzero
|
||||
#define os_delay_us ets_delay_us
|
||||
#define os_install_putc1 ets_install_putc1
|
||||
#define os_install_putc2 ets_install_putc2
|
||||
#define os_intr_lock ets_intr_lock
|
||||
#define os_intr_unlock ets_intr_unlock
|
||||
#define os_isr_attach ets_isr_attach
|
||||
#define os_isr_mask ets_isr_mask
|
||||
#define os_isr_unmask ets_isr_unmask
|
||||
#define os_memcmp ets_memcmp
|
||||
#define os_memcpy ets_memcpy
|
||||
#define os_memmove ets_memmove
|
||||
#define os_memset ets_memset
|
||||
#define os_putc ets_putc
|
||||
#define os_str2macaddr ets_str2macaddr
|
||||
#define os_strcat strcat
|
||||
#define os_strchr strchr
|
||||
#define os_strcmp ets_strcmp
|
||||
#define os_strcpy ets_strcpy
|
||||
#define os_strlen ets_strlen
|
||||
#define os_strncmp ets_strncmp
|
||||
#define os_strncpy ets_strncpy
|
||||
#define os_strstr ets_strstr
|
||||
#ifdef USE_US_TIMER
|
||||
#define os_timer_arm_us(a, b, c) ets_timer_arm_new(a, b, c, 0)
|
||||
#endif
|
||||
#define os_timer_arm(a, b, c) ets_timer_arm_new(a, b, c, 1)
|
||||
#define os_timer_disarm ets_timer_disarm
|
||||
#define os_timer_done ets_timer_done
|
||||
#define os_timer_handler_isr ets_timer_handler_isr
|
||||
#define os_timer_init ets_timer_init
|
||||
#define os_timer_setfn ets_timer_setfn
|
||||
|
||||
#define os_sprintf ets_sprintf
|
||||
#define os_update_cpu_frequency ets_update_cpu_frequency
|
||||
|
||||
#ifdef USE_OPTIMIZE_PRINTF
|
||||
#define os_printf(fmt, ...) do { \
|
||||
static const char flash_str[] ICACHE_RODATA_ATTR = fmt; \
|
||||
os_printf_plus(flash_str, ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
#else
|
||||
extern int os_printf_plus(const char * format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
#define os_printf os_printf_plus
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
32
tools/sdk/include/ping.h
Normal file
32
tools/sdk/include/ping.h
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef __PING_H__
|
||||
#define __PING_H__
|
||||
|
||||
|
||||
typedef void (* ping_recv_function)(void* arg, void *pdata);
|
||||
typedef void (* ping_sent_function)(void* arg, void *pdata);
|
||||
|
||||
struct ping_option{
|
||||
uint32 count;
|
||||
uint32 ip;
|
||||
uint32 coarse_time;
|
||||
ping_recv_function recv_function;
|
||||
ping_sent_function sent_function;
|
||||
void* reverse;
|
||||
};
|
||||
|
||||
struct ping_resp{
|
||||
uint32 total_count;
|
||||
uint32 resp_time;
|
||||
uint32 seqno;
|
||||
uint32 timeout_count;
|
||||
uint32 bytes;
|
||||
uint32 total_bytes;
|
||||
uint32 total_time;
|
||||
sint8 ping_err;
|
||||
};
|
||||
|
||||
bool ping_start(struct ping_option *ping_opt);
|
||||
bool ping_regist_recv(struct ping_option *ping_opt, ping_recv_function ping_recv);
|
||||
bool ping_regist_sent(struct ping_option *ping_opt, ping_sent_function ping_sent);
|
||||
|
||||
#endif /* __PING_H__ */
|
204
tools/sdk/include/queue.h
Normal file
204
tools/sdk/include/queue.h
Normal file
@ -0,0 +1,204 @@
|
||||
#ifndef _SYS_QUEUE_H_
|
||||
#define _SYS_QUEUE_H_
|
||||
|
||||
#define QMD_SAVELINK(name, link)
|
||||
#define TRASHIT(x)
|
||||
|
||||
/*
|
||||
* Singly-linked List declarations.
|
||||
*/
|
||||
#define SLIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *slh_first; /* first element */ \
|
||||
}
|
||||
|
||||
#define SLIST_HEAD_INITIALIZER(head) \
|
||||
{ NULL }
|
||||
|
||||
#define SLIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *sle_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Singly-linked List functions.
|
||||
*/
|
||||
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
|
||||
|
||||
#define SLIST_FIRST(head) ((head)->slh_first)
|
||||
|
||||
#define SLIST_FOREACH(var, head, field) \
|
||||
for ((var) = SLIST_FIRST((head)); \
|
||||
(var); \
|
||||
(var) = SLIST_NEXT((var), field))
|
||||
|
||||
#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
|
||||
for ((var) = SLIST_FIRST((head)); \
|
||||
(var) && ((tvar) = SLIST_NEXT((var), field), 1); \
|
||||
(var) = (tvar))
|
||||
|
||||
#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
|
||||
for ((varp) = &SLIST_FIRST((head)); \
|
||||
((var) = *(varp)) != NULL; \
|
||||
(varp) = &SLIST_NEXT((var), field))
|
||||
|
||||
#define SLIST_INIT(head) do { \
|
||||
SLIST_FIRST((head)) = NULL; \
|
||||
} while (0)
|
||||
|
||||
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
|
||||
SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
|
||||
SLIST_NEXT((slistelm), field) = (elm); \
|
||||
} while (0)
|
||||
|
||||
#define SLIST_INSERT_HEAD(head, elm, field) do { \
|
||||
SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
|
||||
SLIST_FIRST((head)) = (elm); \
|
||||
} while (0)
|
||||
|
||||
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
|
||||
|
||||
#define SLIST_REMOVE(head, elm, type, field) do { \
|
||||
QMD_SAVELINK(oldnext, (elm)->field.sle_next); \
|
||||
if (SLIST_FIRST((head)) == (elm)) { \
|
||||
SLIST_REMOVE_HEAD((head), field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = SLIST_FIRST((head)); \
|
||||
while (SLIST_NEXT(curelm, field) != (elm)) \
|
||||
curelm = SLIST_NEXT(curelm, field); \
|
||||
SLIST_REMOVE_AFTER(curelm, field); \
|
||||
} \
|
||||
TRASHIT(*oldnext); \
|
||||
} while (0)
|
||||
|
||||
#define SLIST_REMOVE_AFTER(elm, field) do { \
|
||||
SLIST_NEXT(elm, field) = \
|
||||
SLIST_NEXT(SLIST_NEXT(elm, field), field); \
|
||||
} while (0)
|
||||
|
||||
#define SLIST_REMOVE_HEAD(head, field) do { \
|
||||
SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue declarations.
|
||||
*/
|
||||
#define STAILQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *stqh_first;/* first element */ \
|
||||
struct type **stqh_last;/* addr of last next element */ \
|
||||
}
|
||||
|
||||
#define STAILQ_HEAD_INITIALIZER(head) \
|
||||
{ NULL, &(head).stqh_first }
|
||||
|
||||
#define STAILQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *stqe_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue functions.
|
||||
*/
|
||||
#define STAILQ_CONCAT(head1, head2) do { \
|
||||
if (!STAILQ_EMPTY((head2))) { \
|
||||
*(head1)->stqh_last = (head2)->stqh_first; \
|
||||
(head1)->stqh_last = (head2)->stqh_last; \
|
||||
STAILQ_INIT((head2)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
|
||||
|
||||
#define STAILQ_FIRST(head) ((head)->stqh_first)
|
||||
|
||||
#define STAILQ_FOREACH(var, head, field) \
|
||||
for((var) = STAILQ_FIRST((head)); \
|
||||
(var); \
|
||||
(var) = STAILQ_NEXT((var), field))
|
||||
|
||||
|
||||
#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
|
||||
for ((var) = STAILQ_FIRST((head)); \
|
||||
(var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
|
||||
(var) = (tvar))
|
||||
|
||||
#define STAILQ_INIT(head) do { \
|
||||
STAILQ_FIRST((head)) = NULL; \
|
||||
(head)->stqh_last = &STAILQ_FIRST((head)); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
|
||||
if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
|
||||
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
|
||||
STAILQ_NEXT((tqelm), field) = (elm); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
|
||||
if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
|
||||
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
|
||||
STAILQ_FIRST((head)) = (elm); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_INSERT_TAIL(head, elm, field) do { \
|
||||
STAILQ_NEXT((elm), field) = NULL; \
|
||||
*(head)->stqh_last = (elm); \
|
||||
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_LAST(head, type, field) \
|
||||
(STAILQ_EMPTY((head)) ? \
|
||||
NULL : \
|
||||
((struct type *)(void *) \
|
||||
((char *)((head)->stqh_last) - __offsetof(struct type, field))))
|
||||
|
||||
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
|
||||
|
||||
#define STAILQ_REMOVE(head, elm, type, field) do { \
|
||||
QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \
|
||||
if (STAILQ_FIRST((head)) == (elm)) { \
|
||||
STAILQ_REMOVE_HEAD((head), field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = STAILQ_FIRST((head)); \
|
||||
while (STAILQ_NEXT(curelm, field) != (elm)) \
|
||||
curelm = STAILQ_NEXT(curelm, field); \
|
||||
STAILQ_REMOVE_AFTER(head, curelm, field); \
|
||||
} \
|
||||
TRASHIT(*oldnext); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_REMOVE_HEAD(head, field) do { \
|
||||
if ((STAILQ_FIRST((head)) = \
|
||||
STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
|
||||
(head)->stqh_last = &STAILQ_FIRST((head)); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_REMOVE_AFTER(head, elm, field) do { \
|
||||
if ((STAILQ_NEXT(elm, field) = \
|
||||
STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \
|
||||
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_SWAP(head1, head2, type) do { \
|
||||
struct type *swap_first = STAILQ_FIRST(head1); \
|
||||
struct type **swap_last = (head1)->stqh_last; \
|
||||
STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \
|
||||
(head1)->stqh_last = (head2)->stqh_last; \
|
||||
STAILQ_FIRST(head2) = swap_first; \
|
||||
(head2)->stqh_last = swap_last; \
|
||||
if (STAILQ_EMPTY(head1)) \
|
||||
(head1)->stqh_last = &STAILQ_FIRST(head1); \
|
||||
if (STAILQ_EMPTY(head2)) \
|
||||
(head2)->stqh_last = &STAILQ_FIRST(head2); \
|
||||
} while (0)
|
||||
|
||||
#define STAILQ_INSERT_CHAIN_HEAD(head, elm_chead, elm_ctail, field) do { \
|
||||
if ((STAILQ_NEXT(elm_ctail, field) = STAILQ_FIRST(head)) == NULL ) { \
|
||||
(head)->stqh_last = &STAILQ_NEXT(elm_ctail, field); \
|
||||
} \
|
||||
STAILQ_FIRST(head) = (elm_chead); \
|
||||
} while (0)
|
||||
|
||||
#endif /* !_SYS_QUEUE_H_ */
|
30
tools/sdk/include/smartconfig.h
Normal file
30
tools/sdk/include/smartconfig.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2015 -2018 Espressif System
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __SMARTCONFIG_H__
|
||||
#define __SMARTCONFIG_H__
|
||||
|
||||
typedef void (*sc_callback_t)(void *data);
|
||||
|
||||
typedef enum {
|
||||
SC_STATUS_WAIT = 0,
|
||||
SC_STATUS_FIND_CHANNEL,
|
||||
SC_STATUS_GETTING_SSID_PSWD,
|
||||
SC_STATUS_GOT_SSID_PSWD,
|
||||
SC_STATUS_LINK,
|
||||
SC_STATUS_LINK_OVER,
|
||||
} sc_status;
|
||||
|
||||
typedef enum {
|
||||
SC_TYPE_ESPTOUCH = 0,
|
||||
SC_TYPE_AIRKISS,
|
||||
} sc_type;
|
||||
|
||||
sc_status smartconfig_get_status(void);
|
||||
const char *smartconfig_get_version(void);
|
||||
bool smartconfig_start(sc_type type, sc_callback_t cb, ...);
|
||||
bool smartconfig_stop(void);
|
||||
|
||||
#endif
|
60
tools/sdk/include/sntp.h
Executable file
60
tools/sdk/include/sntp.h
Executable file
@ -0,0 +1,60 @@
|
||||
#ifndef __SNTP_H__
|
||||
#define __SNTP_H__
|
||||
|
||||
#include "os_type.h"
|
||||
#ifdef LWIP_OPEN_SRC
|
||||
#include "lwip/ip_addr.h"
|
||||
#else
|
||||
#include "ip_addr.h"
|
||||
#endif
|
||||
/**
|
||||
* get the seconds since Jan 01, 1970, 00:00 (GMT)
|
||||
*/
|
||||
uint32 sntp_get_current_timestamp();
|
||||
/**
|
||||
* get real time (GTM + 8 time zone)
|
||||
*/
|
||||
char* sntp_get_real_time(long t);
|
||||
/**
|
||||
* Initialize this module.
|
||||
* Send out request instantly or after SNTP_STARTUP_DELAY(_FUNC).
|
||||
*/
|
||||
void sntp_init(void);
|
||||
/**
|
||||
* Stop this module.
|
||||
*/
|
||||
void sntp_stop(void);
|
||||
/**
|
||||
* Initialize one of the NTP servers by IP address
|
||||
*
|
||||
* @param numdns the index of the NTP server to set must be < SNTP_MAX_SERVERS
|
||||
* @param dnsserver IP address of the NTP server to set
|
||||
*/
|
||||
void sntp_setserver(unsigned char idx, ip_addr_t *addr);
|
||||
/**
|
||||
* Obtain one of the currently configured by IP address (or DHCP) NTP servers
|
||||
*
|
||||
* @param numdns the index of the NTP server
|
||||
* @return IP address of the indexed NTP server or "ip_addr_any" if the NTP
|
||||
* server has not been configured by address (or at all).
|
||||
*/
|
||||
ip_addr_t sntp_getserver(unsigned char idx);
|
||||
/**
|
||||
* Initialize one of the NTP servers by name
|
||||
*
|
||||
* @param numdns the index of the NTP server to set must be < SNTP_MAX_SERVERS,now sdk support SNTP_MAX_SERVERS = 3
|
||||
* @param dnsserver DNS name of the NTP server to set, to be resolved at contact time
|
||||
*/
|
||||
void sntp_setservername(unsigned char idx, char *server);
|
||||
/**
|
||||
* Obtain one of the currently configured by name NTP servers.
|
||||
*
|
||||
* @param numdns the index of the NTP server
|
||||
* @return IP address of the indexed NTP server or NULL if the NTP
|
||||
* server has not been configured by name (or at all)
|
||||
*/
|
||||
char *sntp_getservername(unsigned char idx);
|
||||
|
||||
#define sntp_servermode_dhcp(x)
|
||||
|
||||
#endif
|
33
tools/sdk/include/spi_flash.h
Normal file
33
tools/sdk/include/spi_flash.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* copyright (c) Espressif System 2010
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SPI_FLASH_H
|
||||
#define SPI_FLASH_H
|
||||
|
||||
typedef enum {
|
||||
SPI_FLASH_RESULT_OK,
|
||||
SPI_FLASH_RESULT_ERR,
|
||||
SPI_FLASH_RESULT_TIMEOUT
|
||||
} SpiFlashOpResult;
|
||||
|
||||
typedef struct{
|
||||
uint32 deviceId;
|
||||
uint32 chip_size; // chip size in byte
|
||||
uint32 block_size;
|
||||
uint32 sector_size;
|
||||
uint32 page_size;
|
||||
uint32 status_mask;
|
||||
} SpiFlashChip;
|
||||
|
||||
#define SPI_FLASH_SEC_SIZE 4096
|
||||
|
||||
extern SpiFlashChip * flashchip; // in ram ROM-BIOS
|
||||
|
||||
uint32 spi_flash_get_id(void);
|
||||
SpiFlashOpResult spi_flash_erase_sector(uint16 sec);
|
||||
SpiFlashOpResult spi_flash_write(uint32 des_addr, uint32 *src_addr, uint32 size);
|
||||
SpiFlashOpResult spi_flash_read(uint32 src_addr, uint32 *des_addr, uint32 size);
|
||||
|
||||
#endif
|
128
tools/sdk/include/uart_register.h
Normal file
128
tools/sdk/include/uart_register.h
Normal file
@ -0,0 +1,128 @@
|
||||
//Generated at 2012-07-03 18:44:06
|
||||
/*
|
||||
* Copyright (c) 2010 - 2011 Espressif System
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef UART_REGISTER_H_INCLUDED
|
||||
#define UART_REGISTER_H_INCLUDED
|
||||
#define REG_UART_BASE( i ) (0x60000000+(i)*0xf00)
|
||||
//version value:32'h062000
|
||||
|
||||
#define UART_FIFO( i ) (REG_UART_BASE( i ) + 0x0)
|
||||
#define UART_RXFIFO_RD_BYTE 0x000000FF
|
||||
#define UART_RXFIFO_RD_BYTE_S 0
|
||||
|
||||
#define UART_INT_RAW( i ) (REG_UART_BASE( i ) + 0x4)
|
||||
#define UART_RXFIFO_TOUT_INT_RAW (BIT(8))
|
||||
#define UART_BRK_DET_INT_RAW (BIT(7))
|
||||
#define UART_CTS_CHG_INT_RAW (BIT(6))
|
||||
#define UART_DSR_CHG_INT_RAW (BIT(5))
|
||||
#define UART_RXFIFO_OVF_INT_RAW (BIT(4))
|
||||
#define UART_FRM_ERR_INT_RAW (BIT(3))
|
||||
#define UART_PARITY_ERR_INT_RAW (BIT(2))
|
||||
#define UART_TXFIFO_EMPTY_INT_RAW (BIT(1))
|
||||
#define UART_RXFIFO_FULL_INT_RAW (BIT(0))
|
||||
|
||||
#define UART_INT_ST( i ) (REG_UART_BASE( i ) + 0x8)
|
||||
#define UART_RXFIFO_TOUT_INT_ST (BIT(8))
|
||||
#define UART_BRK_DET_INT_ST (BIT(7))
|
||||
#define UART_CTS_CHG_INT_ST (BIT(6))
|
||||
#define UART_DSR_CHG_INT_ST (BIT(5))
|
||||
#define UART_RXFIFO_OVF_INT_ST (BIT(4))
|
||||
#define UART_FRM_ERR_INT_ST (BIT(3))
|
||||
#define UART_PARITY_ERR_INT_ST (BIT(2))
|
||||
#define UART_TXFIFO_EMPTY_INT_ST (BIT(1))
|
||||
#define UART_RXFIFO_FULL_INT_ST (BIT(0))
|
||||
|
||||
#define UART_INT_ENA( i ) (REG_UART_BASE( i ) + 0xC)
|
||||
#define UART_RXFIFO_TOUT_INT_ENA (BIT(8))
|
||||
#define UART_BRK_DET_INT_ENA (BIT(7))
|
||||
#define UART_CTS_CHG_INT_ENA (BIT(6))
|
||||
#define UART_DSR_CHG_INT_ENA (BIT(5))
|
||||
#define UART_RXFIFO_OVF_INT_ENA (BIT(4))
|
||||
#define UART_FRM_ERR_INT_ENA (BIT(3))
|
||||
#define UART_PARITY_ERR_INT_ENA (BIT(2))
|
||||
#define UART_TXFIFO_EMPTY_INT_ENA (BIT(1))
|
||||
#define UART_RXFIFO_FULL_INT_ENA (BIT(0))
|
||||
|
||||
#define UART_INT_CLR( i ) (REG_UART_BASE( i ) + 0x10)
|
||||
#define UART_RXFIFO_TOUT_INT_CLR (BIT(8))
|
||||
#define UART_BRK_DET_INT_CLR (BIT(7))
|
||||
#define UART_CTS_CHG_INT_CLR (BIT(6))
|
||||
#define UART_DSR_CHG_INT_CLR (BIT(5))
|
||||
#define UART_RXFIFO_OVF_INT_CLR (BIT(4))
|
||||
#define UART_FRM_ERR_INT_CLR (BIT(3))
|
||||
#define UART_PARITY_ERR_INT_CLR (BIT(2))
|
||||
#define UART_TXFIFO_EMPTY_INT_CLR (BIT(1))
|
||||
#define UART_RXFIFO_FULL_INT_CLR (BIT(0))
|
||||
|
||||
#define UART_CLKDIV( i ) (REG_UART_BASE( i ) + 0x14)
|
||||
#define UART_CLKDIV_CNT 0x000FFFFF
|
||||
#define UART_CLKDIV_S 0
|
||||
|
||||
#define UART_AUTOBAUD( i ) (REG_UART_BASE( i ) + 0x18)
|
||||
#define UART_GLITCH_FILT 0x000000FF
|
||||
#define UART_GLITCH_FILT_S 8
|
||||
#define UART_AUTOBAUD_EN (BIT(0))
|
||||
|
||||
#define UART_STATUS( i ) (REG_UART_BASE( i ) + 0x1C)
|
||||
#define UART_TXD (BIT(31))
|
||||
#define UART_RTSN (BIT(30))
|
||||
#define UART_DTRN (BIT(29))
|
||||
#define UART_TXFIFO_CNT 0x000000FF
|
||||
#define UART_TXFIFO_CNT_S 16
|
||||
#define UART_RXD (BIT(15))
|
||||
#define UART_CTSN (BIT(14))
|
||||
#define UART_DSRN (BIT(13))
|
||||
#define UART_RXFIFO_CNT 0x000000FF
|
||||
#define UART_RXFIFO_CNT_S 0
|
||||
|
||||
#define UART_CONF0( i ) (REG_UART_BASE( i ) + 0x20)
|
||||
#define UART_TXFIFO_RST (BIT(18))
|
||||
#define UART_RXFIFO_RST (BIT(17))
|
||||
#define UART_IRDA_EN (BIT(16))
|
||||
#define UART_TX_FLOW_EN (BIT(15))
|
||||
#define UART_LOOPBACK (BIT(14))
|
||||
#define UART_IRDA_RX_INV (BIT(13))
|
||||
#define UART_IRDA_TX_INV (BIT(12))
|
||||
#define UART_IRDA_WCTL (BIT(11))
|
||||
#define UART_IRDA_TX_EN (BIT(10))
|
||||
#define UART_IRDA_DPLX (BIT(9))
|
||||
#define UART_TXD_BRK (BIT(8))
|
||||
#define UART_SW_DTR (BIT(7))
|
||||
#define UART_SW_RTS (BIT(6))
|
||||
#define UART_STOP_BIT_NUM 0x00000003
|
||||
#define UART_STOP_BIT_NUM_S 4
|
||||
#define UART_BIT_NUM 0x00000003
|
||||
#define UART_BIT_NUM_S 2
|
||||
#define UART_PARITY_EN (BIT(1))
|
||||
#define UART_PARITY (BIT(0))
|
||||
|
||||
#define UART_CONF1( i ) (REG_UART_BASE( i ) + 0x24)
|
||||
#define UART_RX_TOUT_EN (BIT(31))
|
||||
#define UART_RX_TOUT_THRHD 0x0000007F
|
||||
#define UART_RX_TOUT_THRHD_S 24
|
||||
#define UART_RX_FLOW_EN (BIT(23))
|
||||
#define UART_RX_FLOW_THRHD 0x0000007F
|
||||
#define UART_RX_FLOW_THRHD_S 16
|
||||
#define UART_TXFIFO_EMPTY_THRHD 0x0000007F
|
||||
#define UART_TXFIFO_EMPTY_THRHD_S 8
|
||||
#define UART_RXFIFO_FULL_THRHD 0x0000007F
|
||||
#define UART_RXFIFO_FULL_THRHD_S 0
|
||||
|
||||
#define UART_LOWPULSE( i ) (REG_UART_BASE( i ) + 0x28)
|
||||
#define UART_LOWPULSE_MIN_CNT 0x000FFFFF
|
||||
#define UART_LOWPULSE_MIN_CNT_S 0
|
||||
|
||||
#define UART_HIGHPULSE( i ) (REG_UART_BASE( i ) + 0x2C)
|
||||
#define UART_HIGHPULSE_MIN_CNT 0x000FFFFF
|
||||
#define UART_HIGHPULSE_MIN_CNT_S 0
|
||||
|
||||
#define UART_PULSE_NUM( i ) (REG_UART_BASE( i ) + 0x30)
|
||||
#define UART_PULSE_NUM_CNT 0x0003FF
|
||||
#define UART_PULSE_NUM_CNT_S 0
|
||||
|
||||
#define UART_DATE( i ) (REG_UART_BASE( i ) + 0x78)
|
||||
#define UART_ID( i ) (REG_UART_BASE( i ) + 0x7C)
|
||||
#endif // UART_REGISTER_H_INCLUDED
|
51
tools/sdk/include/upgrade.h
Executable file
51
tools/sdk/include/upgrade.h
Executable file
@ -0,0 +1,51 @@
|
||||
#ifndef __UPGRADE_H__
|
||||
#define __UPGRADE_H__
|
||||
|
||||
#define SPI_FLASH_SEC_SIZE 4096
|
||||
|
||||
#define USER_BIN1 0x00
|
||||
#define USER_BIN2 0x01
|
||||
|
||||
#define UPGRADE_FLAG_IDLE 0x00
|
||||
#define UPGRADE_FLAG_START 0x01
|
||||
#define UPGRADE_FLAG_FINISH 0x02
|
||||
|
||||
#define UPGRADE_FW_BIN1 0x00
|
||||
#define UPGRADE_FW_BIN2 0x01
|
||||
|
||||
typedef void (*upgrade_states_check_callback)(void * arg);
|
||||
|
||||
//#define UPGRADE_SSL_ENABLE
|
||||
|
||||
struct upgrade_server_info {
|
||||
uint8 ip[4];
|
||||
uint16 port;
|
||||
|
||||
uint8 upgrade_flag;
|
||||
|
||||
uint8 pre_version[16];
|
||||
uint8 upgrade_version[16];
|
||||
|
||||
uint32 check_times;
|
||||
uint8 *url;
|
||||
|
||||
upgrade_states_check_callback check_cb;
|
||||
struct espconn *pespconn;
|
||||
};
|
||||
|
||||
#define UPGRADE_FLAG_IDLE 0x00
|
||||
#define UPGRADE_FLAG_START 0x01
|
||||
#define UPGRADE_FLAG_FINISH 0x02
|
||||
|
||||
//bool system_upgrade_start(struct upgrade_server_info *server);
|
||||
bool system_upgrade_start_ssl(struct upgrade_server_info *server);
|
||||
void system_upgrade_init();
|
||||
void system_upgrade_deinit();
|
||||
bool system_upgrade(uint8 *data, uint16 len);
|
||||
|
||||
#ifdef UPGRADE_SSL_ENABLE
|
||||
bool system_upgrade_start_ssl(struct upgrade_server_info *server);
|
||||
#else
|
||||
bool system_upgrade_start(struct upgrade_server_info *server);
|
||||
#endif
|
||||
#endif
|
390
tools/sdk/include/user_interface.h
Normal file
390
tools/sdk/include/user_interface.h
Normal file
@ -0,0 +1,390 @@
|
||||
/*
|
||||
* Copyright (C) 2013 -2014 Espressif System
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __USER_INTERFACE_H__
|
||||
#define __USER_INTERFACE_H__
|
||||
|
||||
#include "os_type.h"
|
||||
#ifdef LWIP_OPEN_SRC
|
||||
#include "lwip/ip_addr.h"
|
||||
#else
|
||||
#include "ip_addr.h"
|
||||
#endif
|
||||
|
||||
#include "queue.h"
|
||||
#include "user_config.h"
|
||||
#include "spi_flash.h"
|
||||
|
||||
#ifndef MAC2STR
|
||||
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
|
||||
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
#endif
|
||||
|
||||
enum rst_reason {
|
||||
DEFAULT_RST_FLAG = 0,
|
||||
WDT_RST_FLAG = 1,
|
||||
EXP_RST_FLAG = 2
|
||||
};
|
||||
|
||||
struct rst_info{
|
||||
uint32 flag;
|
||||
uint32 exccause;
|
||||
uint32 epc1;
|
||||
uint32 epc2;
|
||||
uint32 epc3;
|
||||
uint32 excvaddr;
|
||||
uint32 depc;
|
||||
};
|
||||
|
||||
#define UPGRADE_FW_BIN1 0x00
|
||||
#define UPGRADE_FW_BIN2 0x01
|
||||
|
||||
void system_restore(void);
|
||||
void system_restart(void);
|
||||
|
||||
bool system_deep_sleep_set_option(uint8 option);
|
||||
void system_deep_sleep(uint32 time_in_us);
|
||||
|
||||
uint8 system_upgrade_userbin_check(void);
|
||||
void system_upgrade_reboot(void);
|
||||
uint8 system_upgrade_flag_check();
|
||||
void system_upgrade_flag_set(uint8 flag);
|
||||
|
||||
void system_timer_reinit(void);
|
||||
uint32 system_get_time(void);
|
||||
|
||||
/* user task's prio must be 0/1/2 !!!*/
|
||||
enum {
|
||||
USER_TASK_PRIO_0 = 0,
|
||||
USER_TASK_PRIO_1,
|
||||
USER_TASK_PRIO_2,
|
||||
USER_TASK_PRIO_MAX
|
||||
};
|
||||
|
||||
bool system_os_task(os_task_t task, uint8 prio, os_event_t *queue, uint8 qlen);
|
||||
bool system_os_post(uint8 prio, os_signal_t sig, os_param_t par);
|
||||
|
||||
void system_print_meminfo(void);
|
||||
uint32 system_get_free_heap_size(void);
|
||||
|
||||
void system_set_os_print(uint8 onoff);
|
||||
uint8 system_get_os_print();
|
||||
|
||||
uint64 system_mktime(uint32 year, uint32 mon, uint32 day, uint32 hour, uint32 min, uint32 sec);
|
||||
|
||||
uint32 system_get_chip_id(void);
|
||||
|
||||
typedef void (* init_done_cb_t)(void);
|
||||
|
||||
void system_init_done_cb(init_done_cb_t cb);
|
||||
|
||||
uint32 system_rtc_clock_cali_proc(void);
|
||||
uint32 system_get_rtc_time(void);
|
||||
|
||||
bool system_rtc_mem_read(uint8 src_addr, void *des_addr, uint16 load_size);
|
||||
bool system_rtc_mem_write(uint8 des_addr, const void *src_addr, uint16 save_size);
|
||||
|
||||
void system_uart_swap(void);
|
||||
|
||||
uint16 system_adc_read(void);
|
||||
uint16 system_get_vdd33(void);
|
||||
|
||||
const char *system_get_sdk_version(void);
|
||||
|
||||
#define SYS_BOOT_ENHANCE_MODE 0
|
||||
#define SYS_BOOT_NORMAL_MODE 1
|
||||
|
||||
#define SYS_BOOT_NORMAL_BIN 0
|
||||
#define SYS_BOOT_TEST_BIN 1
|
||||
|
||||
uint8 system_get_boot_version(void);
|
||||
uint32 system_get_userbin_addr(void);
|
||||
uint8 system_get_boot_mode(void);
|
||||
bool system_restart_enhance(uint8 bin_type, uint32 bin_addr);
|
||||
|
||||
#define SYS_CPU_80MHZ 80
|
||||
#define SYS_CPU_160MHZ 160
|
||||
|
||||
bool system_update_cpu_freq(uint8 freq);
|
||||
uint8 system_get_cpu_freq(void);
|
||||
|
||||
#define NULL_MODE 0x00
|
||||
#define STATION_MODE 0x01
|
||||
#define SOFTAP_MODE 0x02
|
||||
#define STATIONAP_MODE 0x03
|
||||
|
||||
typedef enum _auth_mode {
|
||||
AUTH_OPEN = 0,
|
||||
AUTH_WEP,
|
||||
AUTH_WPA_PSK,
|
||||
AUTH_WPA2_PSK,
|
||||
AUTH_WPA_WPA2_PSK,
|
||||
AUTH_MAX
|
||||
} AUTH_MODE;
|
||||
|
||||
uint8 wifi_get_opmode(void);
|
||||
uint8 wifi_get_opmode_default(void);
|
||||
bool wifi_set_opmode(uint8 opmode);
|
||||
bool wifi_set_opmode_current(uint8 opmode);
|
||||
uint8 wifi_get_broadcast_if(void);
|
||||
bool wifi_set_broadcast_if(uint8 interface);
|
||||
|
||||
struct bss_info {
|
||||
STAILQ_ENTRY(bss_info) next;
|
||||
|
||||
uint8 bssid[6];
|
||||
uint8 ssid[32];
|
||||
uint8 channel;
|
||||
sint8 rssi;
|
||||
AUTH_MODE authmode;
|
||||
uint8 is_hidden;
|
||||
};
|
||||
|
||||
typedef struct _scaninfo {
|
||||
STAILQ_HEAD(, bss_info) *pbss;
|
||||
struct espconn *pespconn;
|
||||
uint8 totalpage;
|
||||
uint8 pagenum;
|
||||
uint8 page_sn;
|
||||
uint8 data_cnt;
|
||||
} scaninfo;
|
||||
|
||||
typedef void (* scan_done_cb_t)(void *arg, STATUS status);
|
||||
|
||||
struct station_config {
|
||||
uint8 ssid[32];
|
||||
uint8 password[64];
|
||||
uint8 bssid_set; // Note: If bssid_set is 1, station will just connect to the router
|
||||
// with both ssid[] and bssid[] matched. Please check about this.
|
||||
uint8 bssid[6];
|
||||
};
|
||||
|
||||
bool wifi_station_get_config(struct station_config *config);
|
||||
bool wifi_station_get_config_default(struct station_config *config);
|
||||
bool wifi_station_set_config(struct station_config *config);
|
||||
bool wifi_station_set_config_current(struct station_config *config);
|
||||
|
||||
bool wifi_station_connect(void);
|
||||
bool wifi_station_disconnect(void);
|
||||
|
||||
struct scan_config {
|
||||
uint8 *ssid; // Note: ssid == NULL, don't filter ssid.
|
||||
uint8 *bssid; // Note: bssid == NULL, don't filter bssid.
|
||||
uint8 channel; // Note: channel == 0, scan all channels, otherwise scan set channel.
|
||||
uint8 show_hidden; // Note: show_hidden == 1, can get hidden ssid routers' info.
|
||||
};
|
||||
|
||||
bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb);
|
||||
|
||||
uint8 wifi_station_get_auto_connect(void);
|
||||
bool wifi_station_set_auto_connect(uint8 set);
|
||||
|
||||
bool wifi_station_set_reconnect_policy(bool set);
|
||||
|
||||
enum {
|
||||
STATION_IDLE = 0,
|
||||
STATION_CONNECTING,
|
||||
STATION_WRONG_PASSWORD,
|
||||
STATION_NO_AP_FOUND,
|
||||
STATION_CONNECT_FAIL,
|
||||
STATION_GOT_IP
|
||||
};
|
||||
|
||||
enum dhcp_status {
|
||||
DHCP_STOPPED,
|
||||
DHCP_STARTED
|
||||
};
|
||||
|
||||
uint8 wifi_station_get_connect_status(void);
|
||||
|
||||
uint8 wifi_station_get_current_ap_id(void);
|
||||
bool wifi_station_ap_change(uint8 current_ap_id);
|
||||
bool wifi_station_ap_number_set(uint8 ap_number);
|
||||
|
||||
bool wifi_station_dhcpc_start(void);
|
||||
bool wifi_station_dhcpc_stop(void);
|
||||
enum dhcp_status wifi_station_dhcpc_status(void);
|
||||
|
||||
struct softap_config {
|
||||
uint8 ssid[32];
|
||||
uint8 password[64];
|
||||
uint8 ssid_len; // Note: Recommend to set it according to your ssid
|
||||
uint8 channel; // Note: support 1 ~ 13
|
||||
AUTH_MODE authmode; // Note: Don't support AUTH_WEP in softAP mode.
|
||||
uint8 ssid_hidden; // Note: default 0
|
||||
uint8 max_connection; // Note: default 4, max 4
|
||||
uint16 beacon_interval; // Note: support 100 ~ 60000 ms, default 100
|
||||
};
|
||||
|
||||
bool wifi_softap_get_config(struct softap_config *config);
|
||||
bool wifi_softap_get_config_default(struct softap_config *config);
|
||||
bool wifi_softap_set_config(struct softap_config *config);
|
||||
bool wifi_softap_set_config_current(struct softap_config *config);
|
||||
|
||||
struct station_info {
|
||||
STAILQ_ENTRY(station_info) next;
|
||||
|
||||
uint8 bssid[6];
|
||||
struct ip_addr ip;
|
||||
};
|
||||
|
||||
struct dhcps_lease {
|
||||
struct ip_addr start_ip;
|
||||
struct ip_addr end_ip;
|
||||
};
|
||||
|
||||
enum dhcps_offer_option{
|
||||
OFFER_START = 0x00,
|
||||
OFFER_ROUTER = 0x01,
|
||||
OFFER_END
|
||||
};
|
||||
|
||||
struct station_info * wifi_softap_get_station_info(void);
|
||||
void wifi_softap_free_station_info(void);
|
||||
uint8 wifi_station_get_ap_info(struct station_config config[]);
|
||||
|
||||
bool wifi_softap_dhcps_start(void);
|
||||
bool wifi_softap_dhcps_stop(void);
|
||||
bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please);
|
||||
enum dhcp_status wifi_softap_dhcps_status(void);
|
||||
bool wifi_softap_dhcps_set_offer_option(uint8 level, void* optarg);
|
||||
|
||||
#define STATION_IF 0x00
|
||||
#define SOFTAP_IF 0x01
|
||||
|
||||
bool wifi_get_ip_info(uint8 if_index, struct ip_info *info);
|
||||
bool wifi_set_ip_info(uint8 if_index, struct ip_info *info);
|
||||
bool wifi_get_macaddr(uint8 if_index, uint8 *macaddr);
|
||||
bool wifi_set_macaddr(uint8 if_index, uint8 *macaddr);
|
||||
|
||||
uint8 wifi_get_channel(void);
|
||||
bool wifi_set_channel(uint8 channel);
|
||||
|
||||
void wifi_status_led_install(uint8 gpio_id, uint32 gpio_name, uint8 gpio_func);
|
||||
void wifi_status_led_uninstall();
|
||||
|
||||
/** Get the absolute difference between 2 u32_t values (correcting overflows)
|
||||
* 'a' is expected to be 'higher' (without overflow) than 'b'. */
|
||||
#define ESP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1)))
|
||||
|
||||
void wifi_promiscuous_enable(uint8 promiscuous);
|
||||
|
||||
typedef void (* wifi_promiscuous_cb_t)(uint8 *buf, uint16 len);
|
||||
|
||||
void wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb);
|
||||
|
||||
void wifi_promiscuous_set_mac(const uint8_t *address);
|
||||
|
||||
enum phy_mode {
|
||||
PHY_MODE_11B = 1,
|
||||
PHY_MODE_11G = 2,
|
||||
PHY_MODE_11N = 3
|
||||
};
|
||||
|
||||
enum phy_mode wifi_get_phy_mode(void);
|
||||
bool wifi_set_phy_mode(enum phy_mode mode);
|
||||
|
||||
enum sleep_type {
|
||||
NONE_SLEEP_T = 0,
|
||||
LIGHT_SLEEP_T,
|
||||
MODEM_SLEEP_T
|
||||
};
|
||||
|
||||
bool wifi_set_sleep_type(enum sleep_type type);
|
||||
enum sleep_type wifi_get_sleep_type(void);
|
||||
|
||||
enum {
|
||||
EVENT_STAMODE_CONNECTED = 0,
|
||||
EVENT_STAMODE_DISCONNECTED,
|
||||
EVENT_STAMODE_AUTHMODE_CHANGE,
|
||||
EVENT_STAMODE_GOT_IP,
|
||||
EVENT_SOFTAPMODE_STACONNECTED,
|
||||
EVENT_SOFTAPMODE_STADISCONNECTED,
|
||||
EVENT_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
REASON_UNSPECIFIED = 1,
|
||||
REASON_AUTH_EXPIRE = 2,
|
||||
REASON_AUTH_LEAVE = 3,
|
||||
REASON_ASSOC_EXPIRE = 4,
|
||||
REASON_ASSOC_TOOMANY = 5,
|
||||
REASON_NOT_AUTHED = 6,
|
||||
REASON_NOT_ASSOCED = 7,
|
||||
REASON_ASSOC_LEAVE = 8,
|
||||
REASON_ASSOC_NOT_AUTHED = 9,
|
||||
REASON_DISASSOC_PWRCAP_BAD = 10, /* 11h */
|
||||
REASON_DISASSOC_SUPCHAN_BAD = 11, /* 11h */
|
||||
REASON_IE_INVALID = 13, /* 11i */
|
||||
REASON_MIC_FAILURE = 14, /* 11i */
|
||||
REASON_4WAY_HANDSHAKE_TIMEOUT = 15, /* 11i */
|
||||
REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, /* 11i */
|
||||
REASON_IE_IN_4WAY_DIFFERS = 17, /* 11i */
|
||||
REASON_GROUP_CIPHER_INVALID = 18, /* 11i */
|
||||
REASON_PAIRWISE_CIPHER_INVALID = 19, /* 11i */
|
||||
REASON_AKMP_INVALID = 20, /* 11i */
|
||||
REASON_UNSUPP_RSN_IE_VERSION = 21, /* 11i */
|
||||
REASON_INVALID_RSN_IE_CAP = 22, /* 11i */
|
||||
REASON_802_1X_AUTH_FAILED = 23, /* 11i */
|
||||
REASON_CIPHER_SUITE_REJECTED = 24, /* 11i */
|
||||
|
||||
REASON_BEACON_TIMEOUT = 200,
|
||||
REASON_NO_AP_FOUND = 201,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint8 ssid[32];
|
||||
uint8 ssid_len;
|
||||
uint8 bssid[6];
|
||||
uint8 channel;
|
||||
} Event_StaMode_Connected_t;
|
||||
|
||||
typedef struct {
|
||||
uint8 ssid[32];
|
||||
uint8 ssid_len;
|
||||
uint8 bssid[6];
|
||||
uint8 reason;
|
||||
} Event_StaMode_Disconnected_t;
|
||||
|
||||
typedef struct {
|
||||
uint8 old_mode;
|
||||
uint8 new_mode;
|
||||
} Event_StaMode_AuthMode_Change_t;
|
||||
|
||||
typedef struct {
|
||||
struct ip_addr ip;
|
||||
struct ip_addr mask;
|
||||
struct ip_addr gw;
|
||||
} Event_StaMode_Got_IP_t;
|
||||
|
||||
typedef struct {
|
||||
uint8 mac[6];
|
||||
uint8 aid;
|
||||
} Event_SoftAPMode_StaConnected_t;
|
||||
|
||||
typedef struct {
|
||||
uint8 mac[6];
|
||||
uint8 aid;
|
||||
} Event_SoftAPMode_StaDisconnected_t;
|
||||
|
||||
typedef union {
|
||||
Event_StaMode_Connected_t connected;
|
||||
Event_StaMode_Disconnected_t disconnected;
|
||||
Event_StaMode_AuthMode_Change_t auth_change;
|
||||
Event_StaMode_Got_IP_t got_ip;
|
||||
Event_SoftAPMode_StaConnected_t sta_connected;
|
||||
Event_SoftAPMode_StaDisconnected_t sta_disconnected;
|
||||
} Event_Info_u;
|
||||
|
||||
typedef struct _esp_event {
|
||||
uint32 event;
|
||||
Event_Info_u event_info;
|
||||
} System_Event_t;
|
||||
|
||||
typedef void (* wifi_event_handler_cb_t)(System_Event_t *event);
|
||||
|
||||
void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb);
|
||||
|
||||
#endif
|
185
tools/sdk/ld/eagle.app.v6.common.ld
Normal file
185
tools/sdk/ld/eagle.app.v6.common.ld
Normal file
@ -0,0 +1,185 @@
|
||||
/* This linker script generated from xt-genldscripts.tpp for LSP . */
|
||||
/* Linker Script for ld -N */
|
||||
|
||||
PHDRS
|
||||
{
|
||||
dport0_0_phdr PT_LOAD;
|
||||
dram0_0_phdr PT_LOAD;
|
||||
dram0_0_bss_phdr PT_LOAD;
|
||||
iram1_0_phdr PT_LOAD;
|
||||
irom0_0_phdr PT_LOAD;
|
||||
}
|
||||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(call_user_start)
|
||||
PROVIDE(_memmap_vecbase_reset = 0x40000000);
|
||||
/* Various memory-map dependent cache attribute settings: */
|
||||
_memmap_cacheattr_wb_base = 0x00000110;
|
||||
_memmap_cacheattr_wt_base = 0x00000110;
|
||||
_memmap_cacheattr_bp_base = 0x00000220;
|
||||
_memmap_cacheattr_unused_mask = 0xFFFFF00F;
|
||||
_memmap_cacheattr_wb_trapnull = 0x2222211F;
|
||||
_memmap_cacheattr_wba_trapnull = 0x2222211F;
|
||||
_memmap_cacheattr_wbna_trapnull = 0x2222211F;
|
||||
_memmap_cacheattr_wt_trapnull = 0x2222211F;
|
||||
_memmap_cacheattr_bp_trapnull = 0x2222222F;
|
||||
_memmap_cacheattr_wb_strict = 0xFFFFF11F;
|
||||
_memmap_cacheattr_wt_strict = 0xFFFFF11F;
|
||||
_memmap_cacheattr_bp_strict = 0xFFFFF22F;
|
||||
_memmap_cacheattr_wb_allvalid = 0x22222112;
|
||||
_memmap_cacheattr_wt_allvalid = 0x22222112;
|
||||
_memmap_cacheattr_bp_allvalid = 0x22222222;
|
||||
PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull);
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
.dport0.rodata : ALIGN(4)
|
||||
{
|
||||
_dport0_rodata_start = ABSOLUTE(.);
|
||||
*(.dport0.rodata)
|
||||
*(.dport.rodata)
|
||||
_dport0_rodata_end = ABSOLUTE(.);
|
||||
} >dport0_0_seg :dport0_0_phdr
|
||||
|
||||
.dport0.literal : ALIGN(4)
|
||||
{
|
||||
_dport0_literal_start = ABSOLUTE(.);
|
||||
*(.dport0.literal)
|
||||
*(.dport.literal)
|
||||
_dport0_literal_end = ABSOLUTE(.);
|
||||
} >dport0_0_seg :dport0_0_phdr
|
||||
|
||||
.dport0.data : ALIGN(4)
|
||||
{
|
||||
_dport0_data_start = ABSOLUTE(.);
|
||||
*(.dport0.data)
|
||||
*(.dport.data)
|
||||
_dport0_data_end = ABSOLUTE(.);
|
||||
} >dport0_0_seg :dport0_0_phdr
|
||||
|
||||
.data : ALIGN(4)
|
||||
{
|
||||
_data_start = ABSOLUTE(.);
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
*(.sdata2)
|
||||
*(.sdata2.*)
|
||||
*(.gnu.linkonce.s2.*)
|
||||
*(.jcr)
|
||||
_data_end = ABSOLUTE(.);
|
||||
} >dram0_0_seg :dram0_0_phdr
|
||||
|
||||
.rodata : ALIGN(4)
|
||||
{
|
||||
_rodata_start = ABSOLUTE(.);
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(.gnu.linkonce.r.*)
|
||||
*(.rodata1)
|
||||
__XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
|
||||
*(.xt_except_table)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.e.*)
|
||||
*(.gnu.version_r)
|
||||
*(.eh_frame)
|
||||
. = (. + 3) & ~ 3;
|
||||
/* C++ constructor and destructor tables, properly ordered: */
|
||||
__init_array_start = ABSOLUTE(.);
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__init_array_end = ABSOLUTE(.);
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
/* C++ exception handlers table: */
|
||||
__XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
|
||||
*(.xt_except_desc)
|
||||
*(.gnu.linkonce.h.*)
|
||||
__XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
|
||||
*(.xt_except_desc_end)
|
||||
*(.dynamic)
|
||||
*(.gnu.version_d)
|
||||
. = ALIGN(4); /* this table MUST be 4-byte aligned */
|
||||
_bss_table_start = ABSOLUTE(.);
|
||||
LONG(_bss_start)
|
||||
LONG(_bss_end)
|
||||
_bss_table_end = ABSOLUTE(.);
|
||||
_rodata_end = ABSOLUTE(.);
|
||||
} >dram0_0_seg :dram0_0_phdr
|
||||
|
||||
.bss ALIGN(8) (NOLOAD) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN (8);
|
||||
_bss_start = ABSOLUTE(.);
|
||||
*(.dynsbss)
|
||||
*(.sbss)
|
||||
*(.sbss.*)
|
||||
*(.gnu.linkonce.sb.*)
|
||||
*(.scommon)
|
||||
*(.sbss2)
|
||||
*(.sbss2.*)
|
||||
*(.gnu.linkonce.sb2.*)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN (8);
|
||||
_bss_end = ABSOLUTE(.);
|
||||
_heap_start = ABSOLUTE(.);
|
||||
/* _stack_sentry = ALIGN(0x8); */
|
||||
} >dram0_0_seg :dram0_0_bss_phdr
|
||||
/* __stack = 0x3ffc8000; */
|
||||
|
||||
.irom0.text : ALIGN(4)
|
||||
{
|
||||
_irom0_text_start = ABSOLUTE(.);
|
||||
*core_esp8266_*.o(.literal*, .text*)
|
||||
*spiffs*.o(.literal*, .text*)
|
||||
*.cpp.o(.literal*, .text*)
|
||||
*libm.a:(.literal .text .literal.* .text.*)
|
||||
*libsmartconfig.a:(.literal .text .literal.* .text.*)
|
||||
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
|
||||
_irom0_text_end = ABSOLUTE(.);
|
||||
_flash_code_end = ABSOLUTE(.);
|
||||
} >irom0_0_seg :irom0_0_phdr
|
||||
|
||||
.text : ALIGN(4)
|
||||
{
|
||||
_stext = .;
|
||||
_text_start = ABSOLUTE(.);
|
||||
*(.entry.text)
|
||||
*(.init.literal)
|
||||
*(.init)
|
||||
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
_text_end = ABSOLUTE(.);
|
||||
_etext = .;
|
||||
} >iram1_0_seg :iram1_0_phdr
|
||||
|
||||
.lit4 : ALIGN(4)
|
||||
{
|
||||
_lit4_start = ABSOLUTE(.);
|
||||
*(*.lit4)
|
||||
*(.lit4.*)
|
||||
*(.gnu.linkonce.lit4.*)
|
||||
_lit4_end = ABSOLUTE(.);
|
||||
} >iram1_0_seg :iram1_0_phdr
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* get ROM code address */
|
||||
INCLUDE "../ld/eagle.rom.addr.v6.ld"
|
17
tools/sdk/ld/eagle.flash.1m128.ld
Normal file
17
tools/sdk/ld/eagle.flash.1m128.ld
Normal file
@ -0,0 +1,17 @@
|
||||
/* Flash Split for 1M chips */
|
||||
/* irom0 812KB */
|
||||
/* spiffs 128KB */
|
||||
/* eeprom 20KB */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40210000, len = 0xCB000
|
||||
}
|
||||
|
||||
PROVIDE ( _SPIFFS_start = 0x402DB000 );
|
||||
PROVIDE ( _SPIFFS_end = 0x402FB000 );
|
||||
|
||||
INCLUDE "../ld/eagle.app.v6.common.ld"
|
17
tools/sdk/ld/eagle.flash.1m256.ld
Normal file
17
tools/sdk/ld/eagle.flash.1m256.ld
Normal file
@ -0,0 +1,17 @@
|
||||
/* Flash Split for 1M chips */
|
||||
/* irom0 684KB */
|
||||
/* spiffs 256KB */
|
||||
/* eeprom 20KB */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40210000, len = 0xAB000
|
||||
}
|
||||
|
||||
PROVIDE ( _SPIFFS_start = 0x402BB000 );
|
||||
PROVIDE ( _SPIFFS_end = 0x402FB000 );
|
||||
|
||||
INCLUDE "../ld/eagle.app.v6.common.ld"
|
17
tools/sdk/ld/eagle.flash.1m512.ld
Normal file
17
tools/sdk/ld/eagle.flash.1m512.ld
Normal file
@ -0,0 +1,17 @@
|
||||
/* Flash Split for 1M chips */
|
||||
/* irom0 428KB */
|
||||
/* spiffs 512KB */
|
||||
/* eeprom 20KB */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40210000, len = 0x6B000
|
||||
}
|
||||
|
||||
PROVIDE ( _SPIFFS_start = 0x4027B000 );
|
||||
PROVIDE ( _SPIFFS_end = 0x402FB000 );
|
||||
|
||||
INCLUDE "../ld/eagle.app.v6.common.ld"
|
17
tools/sdk/ld/eagle.flash.1m64.ld
Normal file
17
tools/sdk/ld/eagle.flash.1m64.ld
Normal file
@ -0,0 +1,17 @@
|
||||
/* Flash Split for 1M chips */
|
||||
/* irom0 876KB */
|
||||
/* spiffs 64KB */
|
||||
/* eeprom 20KB */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40210000, len = 0xDB000
|
||||
}
|
||||
|
||||
PROVIDE ( _SPIFFS_start = 0x402EB000 );
|
||||
PROVIDE ( _SPIFFS_end = 0x402FB000 );
|
||||
|
||||
INCLUDE "../ld/eagle.app.v6.common.ld"
|
17
tools/sdk/ld/eagle.flash.2m.ld
Normal file
17
tools/sdk/ld/eagle.flash.2m.ld
Normal file
@ -0,0 +1,17 @@
|
||||
/* Flash Split for 2M chips */
|
||||
/* irom0 960KB */
|
||||
/* spiffs 1004KB */
|
||||
/* eeprom 20KB */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40210000, len = 0xF0000
|
||||
}
|
||||
|
||||
PROVIDE ( _SPIFFS_start = 0x40300000 );
|
||||
PROVIDE ( _SPIFFS_end = 0x403FB000 );
|
||||
|
||||
INCLUDE "../ld/eagle.app.v6.common.ld"
|
17
tools/sdk/ld/eagle.flash.4m.ld
Normal file
17
tools/sdk/ld/eagle.flash.4m.ld
Normal file
@ -0,0 +1,17 @@
|
||||
/* Flash Split for 4M chips */
|
||||
/* irom0 960KB */
|
||||
/* spiffs 3052KB */
|
||||
/* eeprom 20KB */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40210000, len = 0xF0000
|
||||
}
|
||||
|
||||
PROVIDE ( _SPIFFS_start = 0x40300000 );
|
||||
PROVIDE ( _SPIFFS_end = 0x405FB000 );
|
||||
|
||||
INCLUDE "../ld/eagle.app.v6.common.ld"
|
17
tools/sdk/ld/eagle.flash.512k.ld
Normal file
17
tools/sdk/ld/eagle.flash.512k.ld
Normal file
@ -0,0 +1,17 @@
|
||||
/* Flash Split for 512K chips */
|
||||
/* irom0 364KB */
|
||||
/* spiffs 64KB */
|
||||
/* eeprom 20KB */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||
irom0_0_seg : org = 0x40210000, len = 0x5B000
|
||||
}
|
||||
|
||||
PROVIDE ( _SPIFFS_start = 0x4026B000 );
|
||||
PROVIDE ( _SPIFFS_end = 0x4027B000 );
|
||||
|
||||
INCLUDE "../ld/eagle.app.v6.common.ld"
|
347
tools/sdk/ld/eagle.rom.addr.v6.ld
Normal file
347
tools/sdk/ld/eagle.rom.addr.v6.ld
Normal file
@ -0,0 +1,347 @@
|
||||
PROVIDE ( Cache_Read_Disable = 0x400047f0 );
|
||||
PROVIDE ( Cache_Read_Enable = 0x40004678 );
|
||||
PROVIDE ( FilePacketSendReqMsgProc = 0x400035a0 );
|
||||
PROVIDE ( FlashDwnLdParamCfgMsgProc = 0x4000368c );
|
||||
PROVIDE ( FlashDwnLdStartMsgProc = 0x40003538 );
|
||||
PROVIDE ( FlashDwnLdStopReqMsgProc = 0x40003658 );
|
||||
PROVIDE ( GetUartDevice = 0x40003f4c );
|
||||
PROVIDE ( MD5Final = 0x40009900 );
|
||||
PROVIDE ( MD5Init = 0x40009818 );
|
||||
PROVIDE ( MD5Update = 0x40009834 );
|
||||
PROVIDE ( MemDwnLdStartMsgProc = 0x400036c4 );
|
||||
PROVIDE ( MemDwnLdStopReqMsgProc = 0x4000377c );
|
||||
PROVIDE ( MemPacketSendReqMsgProc = 0x400036f0 );
|
||||
PROVIDE ( RcvMsg = 0x40003eac );
|
||||
PROVIDE ( SHA1Final = 0x4000b648 );
|
||||
PROVIDE ( SHA1Init = 0x4000b584 );
|
||||
PROVIDE ( SHA1Transform = 0x4000a364 );
|
||||
PROVIDE ( SHA1Update = 0x4000b5a8 );
|
||||
PROVIDE ( SPI_read_status = 0x400043c8 );
|
||||
PROVIDE ( SPI_write_status = 0x40004400 );
|
||||
PROVIDE ( SPI_write_enable = 0x4000443c );
|
||||
PROVIDE ( Wait_SPI_Idle = 0x4000448c );
|
||||
PROVIDE ( SPIEraseArea = 0x40004b44 );
|
||||
PROVIDE ( SPIEraseBlock = 0x400049b4 );
|
||||
PROVIDE ( SPIEraseChip = 0x40004984 );
|
||||
PROVIDE ( SPIEraseSector = 0x40004a00 );
|
||||
PROVIDE ( SPILock = 0x400048a8 );
|
||||
PROVIDE ( SPIParamCfg = 0x40004c2c );
|
||||
PROVIDE ( SPIRead = 0x40004b1c );
|
||||
PROVIDE ( SPIReadModeCnfig = 0x400048ec );
|
||||
PROVIDE ( SPIUnlock = 0x40004878 );
|
||||
PROVIDE ( SPIWrite = 0x40004a4c );
|
||||
PROVIDE ( SelectSpiFunction = 0x40003f58 );
|
||||
PROVIDE ( SendMsg = 0x40003cf4 );
|
||||
PROVIDE ( UartConnCheck = 0x40003230 );
|
||||
PROVIDE ( UartConnectProc = 0x400037a0 );
|
||||
PROVIDE ( UartDwnLdProc = 0x40003368 );
|
||||
PROVIDE ( UartGetCmdLn = 0x40003ef4 );
|
||||
PROVIDE ( UartRegReadProc = 0x4000381c );
|
||||
PROVIDE ( UartRegWriteProc = 0x400037ac );
|
||||
PROVIDE ( UartRxString = 0x40003c30 );
|
||||
PROVIDE ( Uart_Init = 0x40003a14 );
|
||||
PROVIDE ( _DebugExceptionVector = 0x40000010 );
|
||||
PROVIDE ( _DoubleExceptionVector = 0x40000070 );
|
||||
PROVIDE ( _KernelExceptionVector = 0x40000030 );
|
||||
PROVIDE ( _NMIExceptionVector = 0x40000020 );
|
||||
PROVIDE ( _ResetHandler = 0x400000a4 );
|
||||
PROVIDE ( _ResetVector = 0x40000080 );
|
||||
PROVIDE ( _UserExceptionVector = 0x40000050 );
|
||||
PROVIDE ( __adddf3 = 0x4000c538 );
|
||||
PROVIDE ( __addsf3 = 0x4000c180 );
|
||||
PROVIDE ( __divdf3 = 0x4000cb94 );
|
||||
PROVIDE ( __divdi3 = 0x4000ce60 );
|
||||
PROVIDE ( __divsi3 = 0x4000dc88 );
|
||||
PROVIDE ( __extendsfdf2 = 0x4000cdfc );
|
||||
PROVIDE ( __fixdfsi = 0x4000ccb8 );
|
||||
PROVIDE ( __fixunsdfsi = 0x4000cd00 );
|
||||
PROVIDE ( __fixunssfsi = 0x4000c4c4 );
|
||||
PROVIDE ( __floatsidf = 0x4000e2f0 );
|
||||
PROVIDE ( __floatsisf = 0x4000e2ac );
|
||||
PROVIDE ( __floatunsidf = 0x4000e2e8 );
|
||||
PROVIDE ( __floatunsisf = 0x4000e2a4 );
|
||||
PROVIDE ( __muldf3 = 0x4000c8f0 );
|
||||
PROVIDE ( __muldi3 = 0x40000650 );
|
||||
PROVIDE ( __mulsf3 = 0x4000c3dc );
|
||||
PROVIDE ( __subdf3 = 0x4000c688 );
|
||||
PROVIDE ( __subsf3 = 0x4000c268 );
|
||||
PROVIDE ( __truncdfsf2 = 0x4000cd5c );
|
||||
PROVIDE ( __udivdi3 = 0x4000d310 );
|
||||
PROVIDE ( __udivsi3 = 0x4000e21c );
|
||||
PROVIDE ( __umoddi3 = 0x4000d770 );
|
||||
PROVIDE ( __umodsi3 = 0x4000e268 );
|
||||
PROVIDE ( __umulsidi3 = 0x4000dcf0 );
|
||||
PROVIDE ( _rom_store = 0x4000e388 );
|
||||
PROVIDE ( _rom_store_table = 0x4000e328 );
|
||||
PROVIDE ( _start = 0x4000042c );
|
||||
PROVIDE ( _xtos_alloca_handler = 0x4000dbe0 );
|
||||
PROVIDE ( _xtos_c_wrapper_handler = 0x40000598 );
|
||||
PROVIDE ( _xtos_cause3_handler = 0x40000590 );
|
||||
PROVIDE ( _xtos_ints_off = 0x4000bda4 );
|
||||
PROVIDE ( _xtos_ints_on = 0x4000bd84 );
|
||||
PROVIDE ( _xtos_l1int_handler = 0x4000048c );
|
||||
PROVIDE ( _xtos_p_none = 0x4000dbf8 );
|
||||
PROVIDE ( _xtos_restore_intlevel = 0x4000056c );
|
||||
PROVIDE ( _xtos_return_from_exc = 0x4000dc54 );
|
||||
PROVIDE ( _xtos_set_exception_handler = 0x40000454 );
|
||||
PROVIDE ( _xtos_set_interrupt_handler = 0x4000bd70 );
|
||||
PROVIDE ( _xtos_set_interrupt_handler_arg = 0x4000bd28 );
|
||||
PROVIDE ( _xtos_set_intlevel = 0x4000dbfc );
|
||||
PROVIDE ( _xtos_set_min_intlevel = 0x4000dc18 );
|
||||
PROVIDE ( _xtos_set_vpri = 0x40000574 );
|
||||
PROVIDE ( _xtos_syscall_handler = 0x4000dbe4 );
|
||||
PROVIDE ( _xtos_unhandled_exception = 0x4000dc44 );
|
||||
PROVIDE ( _xtos_unhandled_interrupt = 0x4000dc3c );
|
||||
PROVIDE ( aes_decrypt = 0x400092d4 );
|
||||
PROVIDE ( aes_decrypt_deinit = 0x400092e4 );
|
||||
PROVIDE ( aes_decrypt_init = 0x40008ea4 );
|
||||
PROVIDE ( aes_unwrap = 0x40009410 );
|
||||
PROVIDE ( base64_decode = 0x40009648 );
|
||||
PROVIDE ( base64_encode = 0x400094fc );
|
||||
PROVIDE ( bzero = 0x4000de84 );
|
||||
PROVIDE ( cmd_parse = 0x40000814 );
|
||||
PROVIDE ( conv_str_decimal = 0x40000b24 );
|
||||
PROVIDE ( conv_str_hex = 0x40000cb8 );
|
||||
PROVIDE ( convert_para_str = 0x40000a60 );
|
||||
PROVIDE ( dtm_get_intr_mask = 0x400026d0 );
|
||||
PROVIDE ( dtm_params_init = 0x4000269c );
|
||||
PROVIDE ( dtm_set_intr_mask = 0x400026c8 );
|
||||
PROVIDE ( dtm_set_params = 0x400026dc );
|
||||
PROVIDE ( eprintf = 0x40001d14 );
|
||||
PROVIDE ( eprintf_init_buf = 0x40001cb8 );
|
||||
PROVIDE ( eprintf_to_host = 0x40001d48 );
|
||||
PROVIDE ( est_get_printf_buf_remain_len = 0x40002494 );
|
||||
PROVIDE ( est_reset_printf_buf_len = 0x4000249c );
|
||||
PROVIDE ( ets_bzero = 0x40002ae8 );
|
||||
PROVIDE ( ets_char2xdigit = 0x40002b74 );
|
||||
PROVIDE ( ets_delay_us = 0x40002ecc );
|
||||
PROVIDE ( ets_enter_sleep = 0x400027b8 );
|
||||
PROVIDE ( ets_external_printf = 0x40002578 );
|
||||
PROVIDE ( ets_get_cpu_frequency = 0x40002f0c );
|
||||
PROVIDE ( ets_getc = 0x40002bcc );
|
||||
PROVIDE ( ets_install_external_printf = 0x40002450 );
|
||||
PROVIDE ( ets_install_putc1 = 0x4000242c );
|
||||
PROVIDE ( ets_install_putc2 = 0x4000248c );
|
||||
PROVIDE ( ets_install_uart_printf = 0x40002438 );
|
||||
PROVIDE ( ets_intr_lock = 0x40000f74 );
|
||||
PROVIDE ( ets_intr_unlock = 0x40000f80 );
|
||||
PROVIDE ( ets_isr_attach = 0x40000f88 );
|
||||
PROVIDE ( ets_isr_mask = 0x40000f98 );
|
||||
PROVIDE ( ets_isr_unmask = 0x40000fa8 );
|
||||
PROVIDE ( ets_memcmp = 0x400018d4 );
|
||||
PROVIDE ( ets_memcpy = 0x400018b4 );
|
||||
PROVIDE ( ets_memmove = 0x400018c4 );
|
||||
PROVIDE ( ets_memset = 0x400018a4 );
|
||||
PROVIDE ( ets_post = 0x40000e24 );
|
||||
PROVIDE ( ets_printf = 0x400024cc );
|
||||
PROVIDE ( ets_putc = 0x40002be8 );
|
||||
PROVIDE ( ets_rtc_int_register = 0x40002a40 );
|
||||
PROVIDE ( ets_run = 0x40000e04 );
|
||||
PROVIDE ( ets_set_idle_cb = 0x40000dc0 );
|
||||
PROVIDE ( ets_set_user_start = 0x40000fbc );
|
||||
PROVIDE ( ets_str2macaddr = 0x40002af8 );
|
||||
PROVIDE ( ets_strcmp = 0x40002aa8 );
|
||||
PROVIDE ( ets_strcpy = 0x40002a88 );
|
||||
PROVIDE ( ets_strlen = 0x40002ac8 );
|
||||
PROVIDE ( ets_strncmp = 0x40002ab8 );
|
||||
PROVIDE ( ets_strncpy = 0x40002a98 );
|
||||
PROVIDE ( ets_strstr = 0x40002ad8 );
|
||||
PROVIDE ( ets_task = 0x40000dd0 );
|
||||
PROVIDE ( ets_timer_arm = 0x40002cc4 );
|
||||
PROVIDE ( ets_timer_disarm = 0x40002d40 );
|
||||
PROVIDE ( ets_timer_done = 0x40002d80 );
|
||||
PROVIDE ( ets_timer_handler_isr = 0x40002da8 );
|
||||
PROVIDE ( ets_timer_init = 0x40002e68 );
|
||||
PROVIDE ( ets_timer_setfn = 0x40002c48 );
|
||||
PROVIDE ( ets_uart_printf = 0x40002544 );
|
||||
PROVIDE ( ets_update_cpu_frequency = 0x40002f04 );
|
||||
PROVIDE ( ets_vprintf = 0x40001f00 );
|
||||
PROVIDE ( ets_wdt_disable = 0x400030f0 );
|
||||
PROVIDE ( ets_wdt_enable = 0x40002fa0 );
|
||||
PROVIDE ( ets_wdt_get_mode = 0x40002f34 );
|
||||
PROVIDE ( ets_wdt_init = 0x40003170 );
|
||||
PROVIDE ( ets_wdt_restore = 0x40003158 );
|
||||
PROVIDE ( ets_write_char = 0x40001da0 );
|
||||
PROVIDE ( get_first_seg = 0x4000091c );
|
||||
PROVIDE ( gpio_init = 0x40004c50 );
|
||||
PROVIDE ( gpio_input_get = 0x40004cf0 );
|
||||
PROVIDE ( gpio_intr_ack = 0x40004dcc );
|
||||
PROVIDE ( gpio_intr_handler_register = 0x40004e28 );
|
||||
PROVIDE ( gpio_intr_pending = 0x40004d88 );
|
||||
PROVIDE ( gpio_intr_test = 0x40004efc );
|
||||
PROVIDE ( gpio_output_set = 0x40004cd0 );
|
||||
PROVIDE ( gpio_pin_intr_state_set = 0x40004d90 );
|
||||
PROVIDE ( gpio_pin_wakeup_disable = 0x40004ed4 );
|
||||
PROVIDE ( gpio_pin_wakeup_enable = 0x40004e90 );
|
||||
PROVIDE ( gpio_register_get = 0x40004d5c );
|
||||
PROVIDE ( gpio_register_set = 0x40004d04 );
|
||||
PROVIDE ( hmac_md5 = 0x4000a2cc );
|
||||
PROVIDE ( hmac_md5_vector = 0x4000a160 );
|
||||
PROVIDE ( hmac_sha1 = 0x4000ba28 );
|
||||
PROVIDE ( hmac_sha1_vector = 0x4000b8b4 );
|
||||
PROVIDE ( lldesc_build_chain = 0x40004f40 );
|
||||
PROVIDE ( lldesc_num2link = 0x40005050 );
|
||||
PROVIDE ( lldesc_set_owner = 0x4000507c );
|
||||
PROVIDE ( main = 0x40000fec );
|
||||
PROVIDE ( md5_vector = 0x400097ac );
|
||||
PROVIDE ( mem_calloc = 0x40001c2c );
|
||||
PROVIDE ( mem_free = 0x400019e0 );
|
||||
PROVIDE ( mem_init = 0x40001998 );
|
||||
PROVIDE ( mem_malloc = 0x40001b40 );
|
||||
PROVIDE ( mem_realloc = 0x40001c6c );
|
||||
PROVIDE ( mem_trim = 0x40001a14 );
|
||||
PROVIDE ( mem_zalloc = 0x40001c58 );
|
||||
PROVIDE ( memcmp = 0x4000dea8 );
|
||||
PROVIDE ( memcpy = 0x4000df48 );
|
||||
PROVIDE ( memmove = 0x4000e04c );
|
||||
PROVIDE ( memset = 0x4000e190 );
|
||||
PROVIDE ( multofup = 0x400031c0 );
|
||||
PROVIDE ( pbkdf2_sha1 = 0x4000b840 );
|
||||
PROVIDE ( phy_get_romfuncs = 0x40006b08 );
|
||||
PROVIDE ( rand = 0x40000600 );
|
||||
PROVIDE ( rc4_skip = 0x4000dd68 );
|
||||
PROVIDE ( recv_packet = 0x40003d08 );
|
||||
PROVIDE ( remove_head_space = 0x40000a04 );
|
||||
PROVIDE ( rijndaelKeySetupDec = 0x40008dd0 );
|
||||
PROVIDE ( rijndaelKeySetupEnc = 0x40009300 );
|
||||
PROVIDE ( rom_abs_temp = 0x400060c0 );
|
||||
PROVIDE ( rom_ana_inf_gating_en = 0x40006b10 );
|
||||
PROVIDE ( rom_cal_tos_v50 = 0x40007a28 );
|
||||
PROVIDE ( rom_chip_50_set_channel = 0x40006f84 );
|
||||
PROVIDE ( rom_chip_v5_disable_cca = 0x400060d0 );
|
||||
PROVIDE ( rom_chip_v5_enable_cca = 0x400060ec );
|
||||
PROVIDE ( rom_chip_v5_rx_init = 0x4000711c );
|
||||
PROVIDE ( rom_chip_v5_sense_backoff = 0x4000610c );
|
||||
PROVIDE ( rom_chip_v5_tx_init = 0x4000718c );
|
||||
PROVIDE ( rom_dc_iq_est = 0x4000615c );
|
||||
PROVIDE ( rom_en_pwdet = 0x400061b8 );
|
||||
PROVIDE ( rom_get_bb_atten = 0x40006238 );
|
||||
PROVIDE ( rom_get_corr_power = 0x40006260 );
|
||||
PROVIDE ( rom_get_fm_sar_dout = 0x400062dc );
|
||||
PROVIDE ( rom_get_noisefloor = 0x40006394 );
|
||||
PROVIDE ( rom_get_power_db = 0x400063b0 );
|
||||
PROVIDE ( rom_i2c_readReg = 0x40007268 );
|
||||
PROVIDE ( rom_i2c_readReg_Mask = 0x4000729c );
|
||||
PROVIDE ( rom_i2c_writeReg = 0x400072d8 );
|
||||
PROVIDE ( rom_i2c_writeReg_Mask = 0x4000730c );
|
||||
PROVIDE ( rom_iq_est_disable = 0x40006400 );
|
||||
PROVIDE ( rom_iq_est_enable = 0x40006430 );
|
||||
PROVIDE ( rom_linear_to_db = 0x40006484 );
|
||||
PROVIDE ( rom_mhz2ieee = 0x400065a4 );
|
||||
PROVIDE ( rom_pbus_dco___SA2 = 0x40007bf0 );
|
||||
PROVIDE ( rom_pbus_debugmode = 0x4000737c );
|
||||
PROVIDE ( rom_pbus_enter_debugmode = 0x40007410 );
|
||||
PROVIDE ( rom_pbus_exit_debugmode = 0x40007448 );
|
||||
PROVIDE ( rom_pbus_force_test = 0x4000747c );
|
||||
PROVIDE ( rom_pbus_rd = 0x400074d8 );
|
||||
PROVIDE ( rom_pbus_set_rxgain = 0x4000754c );
|
||||
PROVIDE ( rom_pbus_set_txgain = 0x40007610 );
|
||||
PROVIDE ( rom_pbus_workmode = 0x40007648 );
|
||||
PROVIDE ( rom_pbus_xpd_rx_off = 0x40007688 );
|
||||
PROVIDE ( rom_pbus_xpd_rx_on = 0x400076cc );
|
||||
PROVIDE ( rom_pbus_xpd_tx_off = 0x400076fc );
|
||||
PROVIDE ( rom_pbus_xpd_tx_on = 0x40007740 );
|
||||
PROVIDE ( rom_pbus_xpd_tx_on__low_gain = 0x400077a0 );
|
||||
PROVIDE ( rom_phy_reset_req = 0x40007804 );
|
||||
PROVIDE ( rom_restart_cal = 0x4000781c );
|
||||
PROVIDE ( rom_rfcal_pwrctrl = 0x40007eb4 );
|
||||
PROVIDE ( rom_rfcal_rxiq = 0x4000804c );
|
||||
PROVIDE ( rom_rfcal_rxiq_set_reg = 0x40008264 );
|
||||
PROVIDE ( rom_rfcal_txcap = 0x40008388 );
|
||||
PROVIDE ( rom_rfcal_txiq = 0x40008610 );
|
||||
PROVIDE ( rom_rfcal_txiq_cover = 0x400088b8 );
|
||||
PROVIDE ( rom_rfcal_txiq_set_reg = 0x40008a70 );
|
||||
PROVIDE ( rom_rfpll_reset = 0x40007868 );
|
||||
PROVIDE ( rom_rfpll_set_freq = 0x40007968 );
|
||||
PROVIDE ( rom_rxiq_cover_mg_mp = 0x40008b6c );
|
||||
PROVIDE ( rom_rxiq_get_mis = 0x40006628 );
|
||||
PROVIDE ( rom_sar_init = 0x40006738 );
|
||||
PROVIDE ( rom_set_ana_inf_tx_scale = 0x4000678c );
|
||||
PROVIDE ( rom_set_channel_freq = 0x40006c50 );
|
||||
PROVIDE ( rom_set_loopback_gain = 0x400067c8 );
|
||||
PROVIDE ( rom_set_noise_floor = 0x40006830 );
|
||||
PROVIDE ( rom_set_rxclk_en = 0x40006550 );
|
||||
PROVIDE ( rom_set_txbb_atten = 0x40008c6c );
|
||||
PROVIDE ( rom_set_txclk_en = 0x4000650c );
|
||||
PROVIDE ( rom_set_txiq_cal = 0x40008d34 );
|
||||
PROVIDE ( rom_start_noisefloor = 0x40006874 );
|
||||
PROVIDE ( rom_start_tx_tone = 0x400068b4 );
|
||||
PROVIDE ( rom_stop_tx_tone = 0x4000698c );
|
||||
PROVIDE ( rom_tx_mac_disable = 0x40006a98 );
|
||||
PROVIDE ( rom_tx_mac_enable = 0x40006ad4 );
|
||||
PROVIDE ( rom_txtone_linear_pwr = 0x40006a1c );
|
||||
PROVIDE ( rom_write_rfpll_sdm = 0x400078dc );
|
||||
PROVIDE ( roundup2 = 0x400031b4 );
|
||||
PROVIDE ( rtc_enter_sleep = 0x40002870 );
|
||||
PROVIDE ( rtc_get_reset_reason = 0x400025e0 );
|
||||
PROVIDE ( rtc_intr_handler = 0x400029ec );
|
||||
PROVIDE ( rtc_set_sleep_mode = 0x40002668 );
|
||||
PROVIDE ( save_rxbcn_mactime = 0x400027a4 );
|
||||
PROVIDE ( save_tsf_us = 0x400027ac );
|
||||
PROVIDE ( send_packet = 0x40003c80 );
|
||||
PROVIDE ( sha1_prf = 0x4000ba48 );
|
||||
PROVIDE ( sha1_vector = 0x4000a2ec );
|
||||
PROVIDE ( sip_alloc_to_host_evt = 0x40005180 );
|
||||
PROVIDE ( sip_get_ptr = 0x400058a8 );
|
||||
PROVIDE ( sip_get_state = 0x40005668 );
|
||||
PROVIDE ( sip_init_attach = 0x4000567c );
|
||||
PROVIDE ( sip_install_rx_ctrl_cb = 0x4000544c );
|
||||
PROVIDE ( sip_install_rx_data_cb = 0x4000545c );
|
||||
PROVIDE ( sip_post = 0x400050fc );
|
||||
PROVIDE ( sip_post_init = 0x400056c4 );
|
||||
PROVIDE ( sip_reclaim_from_host_cmd = 0x4000534c );
|
||||
PROVIDE ( sip_reclaim_tx_data_pkt = 0x400052c0 );
|
||||
PROVIDE ( sip_send = 0x40005808 );
|
||||
PROVIDE ( sip_to_host_chain_append = 0x40005864 );
|
||||
PROVIDE ( sip_to_host_evt_send_done = 0x40005234 );
|
||||
PROVIDE ( slc_add_credits = 0x400060ac );
|
||||
PROVIDE ( slc_enable = 0x40005d90 );
|
||||
PROVIDE ( slc_from_host_chain_fetch = 0x40005f24 );
|
||||
PROVIDE ( slc_from_host_chain_recycle = 0x40005e94 );
|
||||
PROVIDE ( slc_init_attach = 0x40005c50 );
|
||||
PROVIDE ( slc_init_credit = 0x4000608c );
|
||||
PROVIDE ( slc_pause_from_host = 0x40006014 );
|
||||
PROVIDE ( slc_reattach = 0x40005c1c );
|
||||
PROVIDE ( slc_resume_from_host = 0x4000603c );
|
||||
PROVIDE ( slc_select_tohost_gpio = 0x40005dc0 );
|
||||
PROVIDE ( slc_select_tohost_gpio_mode = 0x40005db8 );
|
||||
PROVIDE ( slc_send_to_host_chain = 0x40005de4 );
|
||||
PROVIDE ( slc_set_host_io_max_window = 0x40006068 );
|
||||
PROVIDE ( slc_to_host_chain_recycle = 0x40005f10 );
|
||||
PROVIDE ( software_reset = 0x4000264c );
|
||||
PROVIDE ( spi_flash_attach = 0x40004644 );
|
||||
PROVIDE ( srand = 0x400005f0 );
|
||||
PROVIDE ( strcmp = 0x4000bdc8 );
|
||||
PROVIDE ( strcpy = 0x4000bec8 );
|
||||
PROVIDE ( strlen = 0x4000bf4c );
|
||||
PROVIDE ( strncmp = 0x4000bfa8 );
|
||||
PROVIDE ( strncpy = 0x4000c0a0 );
|
||||
PROVIDE ( strstr = 0x4000e1e0 );
|
||||
PROVIDE ( timer_insert = 0x40002c64 );
|
||||
PROVIDE ( uartAttach = 0x4000383c );
|
||||
PROVIDE ( uart_baudrate_detect = 0x40003924 );
|
||||
PROVIDE ( uart_buff_switch = 0x400038a4 );
|
||||
PROVIDE ( uart_div_modify = 0x400039d8 );
|
||||
PROVIDE ( uart_rx_intr_handler = 0x40003bbc );
|
||||
PROVIDE ( uart_rx_one_char = 0x40003b8c );
|
||||
PROVIDE ( uart_rx_one_char_block = 0x40003b64 );
|
||||
PROVIDE ( uart_rx_readbuff = 0x40003ec8 );
|
||||
PROVIDE ( uart_tx_one_char = 0x40003b30 );
|
||||
PROVIDE ( wepkey_128 = 0x4000bc40 );
|
||||
PROVIDE ( wepkey_64 = 0x4000bb3c );
|
||||
PROVIDE ( xthal_bcopy = 0x40000688 );
|
||||
PROVIDE ( xthal_copy123 = 0x4000074c );
|
||||
PROVIDE ( xthal_get_ccompare = 0x4000dd4c );
|
||||
PROVIDE ( xthal_get_ccount = 0x4000dd38 );
|
||||
PROVIDE ( xthal_get_interrupt = 0x4000dd58 );
|
||||
PROVIDE ( xthal_get_intread = 0x4000dd58 );
|
||||
PROVIDE ( xthal_memcpy = 0x400006c4 );
|
||||
PROVIDE ( xthal_set_ccompare = 0x4000dd40 );
|
||||
PROVIDE ( xthal_set_intclear = 0x4000dd60 );
|
||||
PROVIDE ( xthal_spill_registers_into_stack_nw = 0x4000e320 );
|
||||
PROVIDE ( xthal_window_spill = 0x4000e324 );
|
||||
PROVIDE ( xthal_window_spill_nw = 0x4000e320 );
|
||||
|
||||
PROVIDE ( Te0 = 0x3fffccf0 );
|
||||
PROVIDE ( UartDev = 0x3fffde10 );
|
||||
PROVIDE ( flashchip = 0x3fffc714);
|
BIN
tools/sdk/lib/libhal.a
Normal file
BIN
tools/sdk/lib/libhal.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libjson.a
Executable file
BIN
tools/sdk/lib/libjson.a
Executable file
Binary file not shown.
BIN
tools/sdk/lib/liblwip.a
Normal file
BIN
tools/sdk/lib/liblwip.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libmain.a
Normal file
BIN
tools/sdk/lib/libmain.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libnet80211.a
Normal file
BIN
tools/sdk/lib/libnet80211.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libphy.a
Normal file
BIN
tools/sdk/lib/libphy.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libpp.a
Normal file
BIN
tools/sdk/lib/libpp.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libsmartconfig.a
Normal file
BIN
tools/sdk/lib/libsmartconfig.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libssc.a
Executable file
BIN
tools/sdk/lib/libssc.a
Executable file
Binary file not shown.
BIN
tools/sdk/lib/libssl.a
Normal file
BIN
tools/sdk/lib/libssl.a
Normal file
Binary file not shown.
BIN
tools/sdk/lib/libupgrade.a
Executable file
BIN
tools/sdk/lib/libupgrade.a
Executable file
Binary file not shown.
BIN
tools/sdk/lib/libwpa.a
Normal file
BIN
tools/sdk/lib/libwpa.a
Normal file
Binary file not shown.
1
tools/sdk/version
Normal file
1
tools/sdk/version
Normal file
@ -0,0 +1 @@
|
||||
1.0.1_15_05_04_p1
|
Loading…
x
Reference in New Issue
Block a user