mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Merge pull request #150 from valeros/develop
Initial support for ESP8266 // Issue #119
This commit is contained in:
21
examples/espressif/esp8266-native/README.rst
Normal file
21
examples/espressif/esp8266-native/README.rst
Normal file
@ -0,0 +1,21 @@
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/espressif/esp8266-native/
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
22
examples/espressif/esp8266-native/platformio.ini
Normal file
22
examples/espressif/esp8266-native/platformio.ini
Normal file
@ -0,0 +1,22 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:esp01_8266]
|
||||
platform = espressif
|
||||
board = esp01
|
288
examples/espressif/esp8266-native/src/at_upgrade.c
Normal file
288
examples/espressif/esp8266-native/src/at_upgrade.c
Normal file
@ -0,0 +1,288 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2015-2018 Espressif Systems (Wuxi)
|
||||
*
|
||||
* FileName: user_main.c
|
||||
*
|
||||
* Description: entry file of user application
|
||||
*
|
||||
* Modification history:
|
||||
* 2015/3/06, v1.0 create this file.
|
||||
*******************************************************************************/
|
||||
#include "c_types.h"
|
||||
#include "user_interface.h"
|
||||
#include "espconn.h"
|
||||
#include "mem.h"
|
||||
#include "osapi.h"
|
||||
#include "upgrade.h"
|
||||
|
||||
#ifdef AT_CUSTOM_UPGRADE
|
||||
|
||||
#define UPGRADE_FRAME "{\"path\": \"/v1/messages/\", \"method\": \"POST\", \"meta\": {\"Authorization\": \"token %s\"},\
|
||||
\"get\":{\"action\":\"%s\"},\"body\":{\"pre_rom_version\":\"%s\",\"rom_version\":\"%s\"}}\n"
|
||||
|
||||
#define pheadbuffer "Connection: keep-alive\r\n\
|
||||
Cache-Control: no-cache\r\n\
|
||||
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 \r\n\
|
||||
Accept: */*\r\n\
|
||||
Accept-Encoding: gzip,deflate\r\n\
|
||||
Accept-Language: zh-CN,eb-US;q=0.8\r\n\r\n"
|
||||
|
||||
/**/
|
||||
|
||||
|
||||
struct espconn *pespconn = NULL;
|
||||
struct upgrade_server_info *upServer = NULL;
|
||||
|
||||
static os_timer_t at_delay_check;
|
||||
static struct espconn *pTcpServer = NULL;
|
||||
static ip_addr_t host_ip;
|
||||
/******************************************************************************
|
||||
* FunctionName : user_esp_platform_upgrade_cb
|
||||
* Description : Processing the downloaded data from the server
|
||||
* Parameters : pespconn -- the espconn used to connetion with the host
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
at_upDate_rsp(void *arg)
|
||||
{
|
||||
struct upgrade_server_info *server = arg;
|
||||
|
||||
|
||||
if(server->upgrade_flag == true)
|
||||
{
|
||||
os_printf("device_upgrade_success\r\n");
|
||||
at_response_ok();
|
||||
system_upgrade_reboot();
|
||||
}
|
||||
else
|
||||
{
|
||||
os_printf("device_upgrade_failed\r\n");
|
||||
at_response_error();
|
||||
}
|
||||
|
||||
os_free(server->url);
|
||||
server->url = NULL;
|
||||
os_free(server);
|
||||
server = NULL;
|
||||
}
|
||||
/**
|
||||
* @brief Tcp client disconnect success callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @retval None
|
||||
*/
|
||||
static void ICACHE_FLASH_ATTR
|
||||
at_upDate_discon_cb(void *arg)
|
||||
{
|
||||
struct espconn *pespconn = (struct espconn *)arg;
|
||||
uint8_t idTemp = 0;
|
||||
|
||||
if(pespconn->proto.tcp != NULL)
|
||||
{
|
||||
os_free(pespconn->proto.tcp);
|
||||
}
|
||||
if(pespconn != NULL)
|
||||
{
|
||||
os_free(pespconn);
|
||||
}
|
||||
|
||||
os_printf("disconnect\r\n");
|
||||
|
||||
if(system_upgrade_start(upServer) == false)
|
||||
{
|
||||
at_response_error();
|
||||
}
|
||||
else
|
||||
{
|
||||
at_port_print("+CIPUPDATE:4\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Udp server receive data callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @retval None
|
||||
*/
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
at_upDate_recv(void *arg, char *pusrdata, unsigned short len)
|
||||
{
|
||||
struct espconn *pespconn = (struct espconn *)arg;
|
||||
char temp[32] = {0};
|
||||
uint8_t user_bin[12] = {0};
|
||||
uint8_t i = 0;
|
||||
|
||||
os_timer_disarm(&at_delay_check);
|
||||
at_port_print("+CIPUPDATE:3\r\n");
|
||||
|
||||
upServer = (struct upgrade_server_info *)os_zalloc(sizeof(struct upgrade_server_info));
|
||||
|
||||
upServer->upgrade_version[5] = '\0';
|
||||
|
||||
upServer->pespconn = pespconn;
|
||||
|
||||
os_memcpy(upServer->ip, pespconn->proto.tcp->remote_ip, 4);
|
||||
|
||||
upServer->port = 80;
|
||||
|
||||
upServer->check_cb = at_upDate_rsp;
|
||||
upServer->check_times = 60000;
|
||||
|
||||
if(upServer->url == NULL)
|
||||
{
|
||||
upServer->url = (uint8 *) os_zalloc(1024);
|
||||
}
|
||||
|
||||
if(system_upgrade_userbin_check() == UPGRADE_FW_BIN1)
|
||||
{
|
||||
os_memcpy(user_bin, "user2.bin", 10);
|
||||
}
|
||||
else if(system_upgrade_userbin_check() == UPGRADE_FW_BIN2)
|
||||
{
|
||||
os_memcpy(user_bin, "user1.bin", 10);
|
||||
}
|
||||
|
||||
os_sprintf(upServer->url,
|
||||
"GET /%s HTTP/1.1\r\nHost: "IPSTR"\r\n"pheadbuffer"",
|
||||
user_bin, IP2STR(upServer->ip));
|
||||
}
|
||||
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
at_upDate_wait(void *arg)
|
||||
{
|
||||
struct espconn *pespconn = arg;
|
||||
os_timer_disarm(&at_delay_check);
|
||||
if(pespconn != NULL)
|
||||
{
|
||||
espconn_disconnect(pespconn);
|
||||
}
|
||||
else
|
||||
{
|
||||
at_response_error();
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : user_esp_platform_sent_cb
|
||||
* Description : Data has been sent successfully and acknowledged by the remote host.
|
||||
* Parameters : arg -- Additional argument to pass to the callback function
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
at_upDate_sent_cb(void *arg)
|
||||
{
|
||||
struct espconn *pespconn = arg;
|
||||
os_timer_disarm(&at_delay_check);
|
||||
os_timer_setfn(&at_delay_check, (os_timer_func_t *)at_upDate_wait, pespconn);
|
||||
os_timer_arm(&at_delay_check, 5000, 0);
|
||||
os_printf("at_upDate_sent_cb\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tcp client connect success callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @retval None
|
||||
*/
|
||||
static void ICACHE_FLASH_ATTR
|
||||
at_upDate_connect_cb(void *arg)
|
||||
{
|
||||
struct espconn *pespconn = (struct espconn *)arg;
|
||||
uint8_t user_bin[9] = {0};
|
||||
char *temp = NULL;
|
||||
|
||||
at_port_print("+CIPUPDATE:2\r\n");
|
||||
|
||||
|
||||
espconn_regist_disconcb(pespconn, at_upDate_discon_cb);
|
||||
espconn_regist_recvcb(pespconn, at_upDate_recv);////////
|
||||
espconn_regist_sentcb(pespconn, at_upDate_sent_cb);
|
||||
|
||||
temp = (uint8 *) os_zalloc(512);
|
||||
|
||||
os_sprintf(temp,"GET /v1/device/rom/?is_format_simple=true HTTP/1.0\r\nHost: "IPSTR"\r\n"pheadbuffer"",
|
||||
IP2STR(pespconn->proto.tcp->remote_ip));
|
||||
|
||||
espconn_sent(pespconn, temp, os_strlen(temp));
|
||||
os_free(temp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tcp client connect repeat callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @retval None
|
||||
*/
|
||||
static void ICACHE_FLASH_ATTR
|
||||
at_upDate_recon_cb(void *arg, sint8 errType)
|
||||
{
|
||||
struct espconn *pespconn = (struct espconn *)arg;
|
||||
|
||||
at_response_error();
|
||||
if(pespconn->proto.tcp != NULL)
|
||||
{
|
||||
os_free(pespconn->proto.tcp);
|
||||
}
|
||||
os_free(pespconn);
|
||||
os_printf("disconnect\r\n");
|
||||
|
||||
if(upServer != NULL)
|
||||
{
|
||||
os_free(upServer);
|
||||
upServer = NULL;
|
||||
}
|
||||
at_response_error();
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : upServer_dns_found
|
||||
* Description : dns found callback
|
||||
* 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
|
||||
* Returns : none
|
||||
*******************************************************************************/
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
upServer_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
|
||||
{
|
||||
struct espconn *pespconn = (struct espconn *) arg;
|
||||
// char temp[32];
|
||||
|
||||
if(ipaddr == NULL)
|
||||
{
|
||||
at_response_error();
|
||||
return;
|
||||
}
|
||||
at_port_print("+CIPUPDATE:1\r\n");
|
||||
|
||||
|
||||
if(host_ip.addr == 0 && ipaddr->addr != 0)
|
||||
{
|
||||
if(pespconn->type == ESPCONN_TCP)
|
||||
{
|
||||
os_memcpy(pespconn->proto.tcp->remote_ip, &ipaddr->addr, 4);
|
||||
espconn_regist_connectcb(pespconn, at_upDate_connect_cb);
|
||||
espconn_regist_reconcb(pespconn, at_upDate_recon_cb);
|
||||
espconn_connect(pespconn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
at_exeCmdCiupdate(uint8_t id)
|
||||
{
|
||||
pespconn = (struct espconn *)os_zalloc(sizeof(struct espconn));
|
||||
pespconn->type = ESPCONN_TCP;
|
||||
pespconn->state = ESPCONN_NONE;
|
||||
pespconn->proto.tcp = (esp_tcp *)os_zalloc(sizeof(esp_tcp));
|
||||
pespconn->proto.tcp->local_port = espconn_port();
|
||||
pespconn->proto.tcp->remote_port = 80;
|
||||
|
||||
host_ip.addr = ipaddr_addr("192.168.10.9");
|
||||
at_port_print("+CIPUPDATE:1\r\n");
|
||||
os_memcpy(pespconn->proto.tcp->remote_ip, &host_ip.addr, 4);
|
||||
espconn_regist_connectcb(pespconn, at_upDate_connect_cb);
|
||||
espconn_regist_reconcb(pespconn, at_upDate_recon_cb);
|
||||
espconn_connect(pespconn);
|
||||
}
|
||||
#endif
|
6
examples/espressif/esp8266-native/src/user_config.h
Normal file
6
examples/espressif/esp8266-native/src/user_config.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef __USER_CONFIG_H__
|
||||
#define __USER_CONFIG_H__
|
||||
|
||||
#define AT_CUSTOM_UPGRADE
|
||||
|
||||
#endif
|
113
examples/espressif/esp8266-native/src/user_main.c
Normal file
113
examples/espressif/esp8266-native/src/user_main.c
Normal file
@ -0,0 +1,113 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2013-2014 Espressif Systems (Wuxi)
|
||||
*
|
||||
* FileName: user_main.c
|
||||
*
|
||||
* Description: entry file of user application
|
||||
*
|
||||
* Modification history:
|
||||
* 2015/1/23, v1.0 create this file.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "osapi.h"
|
||||
#include "at_custom.h"
|
||||
#include "user_interface.h"
|
||||
|
||||
// test :AT+TEST=1,"abc"<,3>
|
||||
void ICACHE_FLASH_ATTR
|
||||
at_setupCmdTest(uint8_t id, char *pPara)
|
||||
{
|
||||
int result = 0, err = 0, flag = 0;
|
||||
uint8 buffer[32] = {0};
|
||||
pPara++; // skip '='
|
||||
|
||||
//get the first parameter
|
||||
// digit
|
||||
flag = at_get_next_int_dec(&pPara, &result, &err);
|
||||
|
||||
// flag must be ture because there are more parameter
|
||||
if (flag == FALSE) {
|
||||
at_response_error();
|
||||
return;
|
||||
}
|
||||
|
||||
if (*pPara++ != ',') { // skip ','
|
||||
at_response_error();
|
||||
return;
|
||||
}
|
||||
|
||||
os_sprintf(buffer, "the first parameter:%d\r\n", result);
|
||||
at_port_print(buffer);
|
||||
|
||||
//get the second parameter
|
||||
// string
|
||||
at_data_str_copy(buffer, &pPara, 10);
|
||||
at_port_print("the second parameter:");
|
||||
at_port_print(buffer);
|
||||
at_port_print("\r\n");
|
||||
|
||||
if (*pPara == ',') {
|
||||
pPara++; // skip ','
|
||||
result = 0;
|
||||
//there is the third parameter
|
||||
// digit
|
||||
flag = at_get_next_int_dec(&pPara, &result, &err);
|
||||
// we donot care of flag
|
||||
os_sprintf(buffer, "the third parameter:%d\r\n", result);
|
||||
at_port_print(buffer);
|
||||
}
|
||||
|
||||
if (*pPara != '\r') {
|
||||
at_response_error();
|
||||
return;
|
||||
}
|
||||
|
||||
at_response_ok();
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
at_testCmdTest(uint8_t id)
|
||||
{
|
||||
uint8 buffer[32] = {0};
|
||||
|
||||
os_sprintf(buffer, "%s\r\n", "at_testCmdTest");
|
||||
at_port_print(buffer);
|
||||
at_response_ok();
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
at_queryCmdTest(uint8_t id)
|
||||
{
|
||||
uint8 buffer[32] = {0};
|
||||
|
||||
os_sprintf(buffer, "%s\r\n", "at_queryCmdTest");
|
||||
at_port_print(buffer);
|
||||
at_response_ok();
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
at_exeCmdTest(uint8_t id)
|
||||
{
|
||||
uint8 buffer[32] = {0};
|
||||
|
||||
os_sprintf(buffer, "%s\r\n", "at_exeCmdTest");
|
||||
at_port_print(buffer);
|
||||
at_response_ok();
|
||||
}
|
||||
|
||||
extern void at_exeCmdCiupdate(uint8_t id);
|
||||
at_funcationType at_custom_cmd[] = {
|
||||
{"+TEST", 5, at_testCmdTest, at_queryCmdTest, at_setupCmdTest, at_exeCmdTest},
|
||||
{"+CIUPDATE", 9, NULL, NULL, NULL, at_exeCmdCiupdate}
|
||||
};
|
||||
|
||||
void user_init(void)
|
||||
{
|
||||
char buf[64] = {0};
|
||||
at_customLinkMax = 5;
|
||||
at_init();
|
||||
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
|
||||
at_set_custom_info(buf);
|
||||
at_port_print("\r\nready\r\n");
|
||||
at_cmd_array_regist(&at_custom_cmd[0], sizeof(at_custom_cmd)/sizeof(at_custom_cmd[0]));
|
||||
}
|
21
examples/espressif/esp8266-webserver/README.rst
Normal file
21
examples/espressif/esp8266-webserver/README.rst
Normal file
@ -0,0 +1,21 @@
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/espressif/esp8266-webserver
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
23
examples/espressif/esp8266-webserver/platformio.ini
Normal file
23
examples/espressif/esp8266-webserver/platformio.ini
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:esp01_8266]
|
||||
platform = espressif
|
||||
framework = arduino
|
||||
board = esp01
|
54
examples/espressif/esp8266-webserver/src/HelloServer.ino
Normal file
54
examples/espressif/esp8266-webserver/src/HelloServer.ino
Normal file
@ -0,0 +1,54 @@
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
const char* ssid = "*****";
|
||||
const char* password = "*****";
|
||||
|
||||
|
||||
ESP8266WebServer server(80);
|
||||
|
||||
const int led = 13;
|
||||
|
||||
void handle_root() {
|
||||
digitalWrite(led, 1);
|
||||
server.send(200, "text/plain", "hello from esp8266!");
|
||||
delay(100);
|
||||
digitalWrite(led, 0);
|
||||
}
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
Serial.begin(115200);
|
||||
pinMode(led, OUTPUT);
|
||||
digitalWrite(led, 0);
|
||||
|
||||
// Connect to WiFi network
|
||||
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());
|
||||
|
||||
server.on("/", handle_root);
|
||||
|
||||
server.on("/inline", [](){
|
||||
server.send(200, "text/plain", "this works as well");
|
||||
});
|
||||
|
||||
server.begin();
|
||||
Serial.println("HTTP server started");
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
server.handleClient();
|
||||
}
|
21
examples/espressif/esp8266-wifiscan/README.rst
Normal file
21
examples/espressif/esp8266-wifiscan/README.rst
Normal file
@ -0,0 +1,21 @@
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/espressif/esp8266-wifiscan
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
23
examples/espressif/esp8266-wifiscan/platformio.ini
Normal file
23
examples/espressif/esp8266-wifiscan/platformio.ini
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:esp01_8266]
|
||||
platform = espressif
|
||||
framework = arduino
|
||||
board = esp01
|
48
examples/espressif/esp8266-wifiscan/src/WiFiScan.ino
Normal file
48
examples/espressif/esp8266-wifiscan/src/WiFiScan.ino
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This sketch demonstrates how to scan WiFi networks.
|
||||
* The API is almost the same as with the WiFi Shield library,
|
||||
* the most obvious difference being the different file you need to include:
|
||||
*/
|
||||
#include "ESP8266WiFi.h"
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Set WiFi to station mode and disconnect from an AP if it was previously connected
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.disconnect();
|
||||
delay(100);
|
||||
|
||||
Serial.println("Setup done");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println("scan start");
|
||||
|
||||
// WiFi.scanNetworks will return the number of networks found
|
||||
int n = WiFi.scanNetworks();
|
||||
Serial.println("scan done");
|
||||
if (n == 0)
|
||||
Serial.println("no networks found");
|
||||
else
|
||||
{
|
||||
Serial.print(n);
|
||||
Serial.println(" networks found");
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
// Print SSID and RSSI for each network found
|
||||
Serial.print(i + 1);
|
||||
Serial.print(": ");
|
||||
Serial.print(WiFi.SSID(i));
|
||||
Serial.print(" (");
|
||||
Serial.print(WiFi.RSSI(i));
|
||||
Serial.print(")");
|
||||
Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*");
|
||||
delay(10);
|
||||
}
|
||||
}
|
||||
Serial.println("");
|
||||
|
||||
// Wait a bit before scanning again
|
||||
delay(5000);
|
||||
}
|
25
platformio/boards/espressif.json
Normal file
25
platformio/boards/espressif.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"esp01": {
|
||||
"build": {
|
||||
"core": "esp8266",
|
||||
"extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266",
|
||||
"f_cpu": "80000000L",
|
||||
"ldscript": "esp8266.ld",
|
||||
"mcu": "esp8266",
|
||||
"variant": "esp01"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Espressif ESP8266 board",
|
||||
"platform": "espressif",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 524288,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200,
|
||||
"wait_for_upload_port": true
|
||||
},
|
||||
"url": "https://nurdspace.nl/ESP8266",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
}
|
@ -226,5 +226,272 @@
|
||||
},
|
||||
"url": "https://code.google.com/p/sanguino/",
|
||||
"vendor": "Sanguino"
|
||||
},
|
||||
|
||||
"tinyduino": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_LILYPAD",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "TinyCircuits TinyDuino Processor Board",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600
|
||||
},
|
||||
"url": "https://tiny-circuits.com/tinyduino-processor-board.html",
|
||||
"vendor": "TinyCircuits"
|
||||
},
|
||||
|
||||
"wildfirev3": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev3"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "WickedDevice WildFire v3 [optiboot]",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/",
|
||||
"vendor": "WickedDevice"
|
||||
},
|
||||
|
||||
"wildfirev2": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev2"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "WickedDevice WildFire v2 [stk500]",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 122878,
|
||||
"protocol": "wiring",
|
||||
"require_upload_port" : true,
|
||||
"speed": 38400
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup",
|
||||
"vendor": "WickedDevice"
|
||||
},
|
||||
|
||||
"blend": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8036",
|
||||
"usb_product": "RedBearLab Blend",
|
||||
"variant": "leonardo",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "RedBearLab Blend",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
},
|
||||
"url": "http://redbearlab.com/blend/",
|
||||
"vendor": "RedBearLab"
|
||||
},
|
||||
|
||||
"blendmicro8": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x2404",
|
||||
"usb_product": "RedBearLab Blend",
|
||||
"variant": "micro",
|
||||
"vid": "0x03EB"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "RedBearLab Blend Micro 3.3V/8MHz",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
},
|
||||
"url": "http://redbearlab.com/blendmicro/",
|
||||
"vendor": "RedBearLab"
|
||||
},
|
||||
|
||||
"blendmicro16": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x2404",
|
||||
"usb_product": "RedBearLab Blend",
|
||||
"variant": "micro",
|
||||
"vid": "0x03EB"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "RedBearLab Blend Micro 3.3V/16MHz (overclock)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
},
|
||||
"url": "http://redbearlab.com/blendmicro/",
|
||||
"vendor": "RedBearLab"
|
||||
},
|
||||
|
||||
"tinylily": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_LILYPAD",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "TinyCircuits TinyLily Mini Processor",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600
|
||||
},
|
||||
"url": "https://tiny-circuits.com/tiny-lily-mini-processor.html",
|
||||
"vendor": "TinyCircuits"
|
||||
},
|
||||
|
||||
"lightup": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_LEONARDO",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x6096",
|
||||
"usb_product": "LightUp",
|
||||
"variant": "leonardo",
|
||||
"vid": "0x1d50"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "LightUp",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
},
|
||||
"url": "https://www.lightup.io/",
|
||||
"vendor": "LightUp"
|
||||
},
|
||||
|
||||
"moteino": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_MOTEINO",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "LowPowerLab Moteino",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 31744,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://lowpowerlab.com/shop/moteino-r4",
|
||||
"vendor": "LowPowerLab"
|
||||
},
|
||||
|
||||
"moteinomega": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_MOTEINOMEGA",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "moteinoMega"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "LowPowerLab MoteinoMEGA",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://lowpowerlab.com/blog/2014/08/09/moteinomega-available-now/",
|
||||
"vendor": "LowPowerLab"
|
||||
},
|
||||
|
||||
"zumbt328": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_BT",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "BQ ZUM BT-328 board",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 19200
|
||||
},
|
||||
"url": "http://www.bq.com/gb/products/zum.html",
|
||||
"vendor": "BQ"
|
||||
}
|
||||
}
|
||||
|
@ -187,5 +187,48 @@
|
||||
},
|
||||
"url": "https://www.sparkfun.com/products/10743",
|
||||
"vendor": "SparkFun"
|
||||
},
|
||||
"sparkfun_digitalsandbox": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "SparkFun Digital Sandbox",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://www.sparkfun.com/products/12651",
|
||||
"vendor": "SparkFun"
|
||||
},
|
||||
|
||||
"uview": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "SparkFun MicroView",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://www.sparkfun.com/products/12923",
|
||||
"vendor": "SparkFun"
|
||||
}
|
||||
}
|
161
platformio/builder/scripts/espressif.py
Normal file
161
platformio/builder/scripts/espressif.py
Normal file
@ -0,0 +1,161 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
"""
|
||||
Builder for Espressif MCUs
|
||||
"""
|
||||
|
||||
from os.path import join
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
|
||||
DefaultEnvironment)
|
||||
|
||||
|
||||
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
||||
env.AutodetectUploadPort()
|
||||
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
env.Replace(
|
||||
AR="xtensa-lx106-elf-ar",
|
||||
AS="xtensa-lx106-elf-as",
|
||||
CC="xtensa-lx106-elf-gcc",
|
||||
CXX="xtensa-lx106-elf-g++",
|
||||
OBJCOPY="xtensa-lx106-elf-objcopy",
|
||||
RANLIB="xtensa-lx106-elf-ranlib",
|
||||
SIZETOOL="xtensa-lx106-elf-size",
|
||||
|
||||
ARFLAGS=["rcs"],
|
||||
|
||||
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CFLAGS=[
|
||||
"-std=c99",
|
||||
"-Wpointer-arith",
|
||||
"-Wno-implicit-function-declaration",
|
||||
"-Wl,-EL",
|
||||
"-nostdlib"
|
||||
],
|
||||
|
||||
CPPFLAGS=[
|
||||
"-Os", # optimize for size
|
||||
"-mlongcalls",
|
||||
"-mtext-section-literals",
|
||||
"-MMD" # output dependancy info
|
||||
],
|
||||
|
||||
CXXFLAGS=[
|
||||
"-fno-rtti",
|
||||
"-fno-exceptions",
|
||||
"-std=c++11"
|
||||
],
|
||||
|
||||
CPPDEFINES=[
|
||||
"F_CPU=$BOARD_F_CPU",
|
||||
"__ets__",
|
||||
"ICACHE_FLASH"
|
||||
],
|
||||
|
||||
LINKFLAGS=[
|
||||
"-nostdlib",
|
||||
"-Wl,--no-check-section",
|
||||
"-u", "call_user_start",
|
||||
"-Wl,-static"
|
||||
],
|
||||
|
||||
LIBS=["c", "gcc"],
|
||||
|
||||
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
|
||||
|
||||
UPLOADER=join("$PIOPACKAGES_DIR", "tool-esptool", "esptool"),
|
||||
UPLOADERFLAGS=[
|
||||
"-vv",
|
||||
"-cd", "none",
|
||||
"-cb", "$UPLOAD_SPEED",
|
||||
"-cp", "$UPLOAD_PORT",
|
||||
"-ca", "0x00000",
|
||||
"-cf", "${SOURCES[0]}",
|
||||
"-ca", "0x40000",
|
||||
"-cf", "${SOURCES[1]}"
|
||||
],
|
||||
UPLOADCMD='$UPLOADER $UPLOADERFLAGS'
|
||||
)
|
||||
|
||||
env.Append(
|
||||
BUILDERS=dict(
|
||||
ElfToBin=Builder(
|
||||
action=" ".join([
|
||||
"$UPLOADER",
|
||||
"-eo", "$SOURCES",
|
||||
"-bo", "${TARGETS[0]}",
|
||||
"-bs", ".text",
|
||||
"-bs", ".data",
|
||||
"-bs", ".rodata",
|
||||
"-bc", "-ec",
|
||||
"-eo", "$SOURCES",
|
||||
"-es", ".irom0.text", "${TARGETS[1]}",
|
||||
"-ec", "-v"
|
||||
]),
|
||||
suffix=".bin"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
#
|
||||
# Configure SDK
|
||||
#
|
||||
|
||||
if "FRAMEWORK" not in env:
|
||||
env.Append(
|
||||
CPPPATH=[
|
||||
join("$PIOPACKAGES_DIR", "sdk-esp8266", "include"),
|
||||
"$PROJECTSRC_DIR"
|
||||
],
|
||||
LIBPATH=[join("$PIOPACKAGES_DIR", "sdk-esp8266", "lib")],
|
||||
LIBS=["at", "json", "lwip", "main", "net80211", "phy", "pp",
|
||||
"smartconfig", "ssl", "upgrade", "wpa"]
|
||||
)
|
||||
env.Replace(
|
||||
LDSCRIPT_PATH=join(
|
||||
"$PIOPACKAGES_DIR", "sdk-esp8266", "ld", "eagle.app.v6.ld")
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Target: Build executable and linkable firmware
|
||||
#
|
||||
|
||||
target_elf = env.BuildFirmware()
|
||||
|
||||
#
|
||||
# Target: Build the .hex
|
||||
#
|
||||
|
||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
||||
else:
|
||||
target_firm = env.ElfToBin(
|
||||
[join("$BUILD_DIR", "firmware_00000"),
|
||||
join("$BUILD_DIR", "firmware_40000")], target_elf)
|
||||
|
||||
#
|
||||
# Target: Print binary size
|
||||
#
|
||||
|
||||
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
|
||||
AlwaysBuild(target_size)
|
||||
|
||||
#
|
||||
# Target: Upload firmware
|
||||
#
|
||||
|
||||
upload = env.Alias(["upload", "uploadlazy"], target_firm,
|
||||
[BeforeUpload, "$UPLOADCMD"])
|
||||
AlwaysBuild(upload)
|
||||
|
||||
#
|
||||
# Target: Define targets
|
||||
#
|
||||
|
||||
Default([target_firm, target_size])
|
@ -42,6 +42,14 @@ elif env.get("PLATFORM") == "timsp430":
|
||||
"$PIOPACKAGES_DIR",
|
||||
"framework-arduinomsp430"
|
||||
)
|
||||
elif env.get("PLATFORM") == "espressif":
|
||||
PLATFORMFW_DIR = join(
|
||||
"$PIOPACKAGES_DIR",
|
||||
"framework-arduinoespressif"
|
||||
)
|
||||
env.Append(
|
||||
CPPPATH=[join("$PLATFORMFW_DIR", "sdk", "include")]
|
||||
)
|
||||
|
||||
env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR)
|
||||
|
||||
@ -210,4 +218,10 @@ if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
||||
)
|
||||
libs.append("sam_sam3x8e_gcc_rel")
|
||||
|
||||
elif env.get("PLATFORM") == "espressif":
|
||||
env.Append(
|
||||
LIBPATH=[join("$PLATFORMFW_DIR", "sdk", "lib")]
|
||||
)
|
||||
libs.extend(["hal", "phy", "net80211", "lwip", "wpa", "main", "pp"])
|
||||
|
||||
env.Append(LIBS=libs)
|
||||
|
@ -30,6 +30,10 @@ PLATFORM_PACKAGES = {
|
||||
("Arduino Wiring-based Framework (MSP430 Core)",
|
||||
"http://arduino.cc/en/Reference/HomePage")
|
||||
],
|
||||
"framework-arduinoespressif": [
|
||||
("Arduino Wiring-based Framework (ESP8266 Core)",
|
||||
"https://github.com/esp8266/Arduino")
|
||||
],
|
||||
"framework-energiamsp430": [
|
||||
("Energia Wiring-based Framework (MSP430 Core)",
|
||||
"http://energia.nu/reference/")
|
||||
@ -55,6 +59,9 @@ PLATFORM_PACKAGES = {
|
||||
"framework-mbed": [
|
||||
("mbed Framework", "http://mbed.org")
|
||||
],
|
||||
"sdk-esp8266": [
|
||||
("ESP8266 SDK", "http://bbs.espressif.com")
|
||||
],
|
||||
"ldscripts": [
|
||||
("Linker Scripts",
|
||||
"https://sourceware.org/binutils/docs/ld/Scripts.html")
|
||||
@ -69,6 +76,10 @@ PLATFORM_PACKAGES = {
|
||||
("gcc-arm-embedded", "https://launchpad.net/gcc-arm-embedded"),
|
||||
("GDB", "http://www.gnu.org/software/gdb/")
|
||||
],
|
||||
"toolchain-xtensa": [
|
||||
("xtensa-gcc", "https://github.com/jcmvbkbc/gcc-xtensa"),
|
||||
("GDB", "http://www.gnu.org/software/gdb/")
|
||||
],
|
||||
"toolchain-timsp430": [
|
||||
("msp-gcc", "http://sourceforge.net/projects/mspgcc/"),
|
||||
("GDB", "http://www.gnu.org/software/gdb/")
|
||||
@ -93,6 +104,9 @@ PLATFORM_PACKAGES = {
|
||||
],
|
||||
"tool-mspdebug": [
|
||||
("MSPDebug", "http://mspdebug.sourceforge.net/")
|
||||
],
|
||||
"tool-esptool": [
|
||||
("esptool-ck", "https://github.com/igrr/esptool-ck")
|
||||
]
|
||||
}
|
||||
|
||||
|
39
platformio/platforms/espressif.py
Normal file
39
platformio/platforms/espressif.py
Normal file
@ -0,0 +1,39 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
from platformio.platforms.base import BasePlatform
|
||||
|
||||
|
||||
class EspressifPlatform(BasePlatform):
|
||||
|
||||
"""
|
||||
Espressif Systems is a privately held fabless semiconductor company.
|
||||
They provide wireless communications and Wi-Fi chips which are widely
|
||||
used in mobile devices and the Internet of Things applications.
|
||||
|
||||
https://espressif.com/
|
||||
"""
|
||||
|
||||
PACKAGES = {
|
||||
|
||||
"toolchain-xtensa": {
|
||||
"alias": "toolchain",
|
||||
"default": True
|
||||
},
|
||||
|
||||
"tool-esptool": {
|
||||
"alias": "uploader",
|
||||
"default": True
|
||||
},
|
||||
|
||||
"sdk-esp8266": {
|
||||
"default": True
|
||||
},
|
||||
|
||||
"framework-arduinoespressif": {
|
||||
"default": True
|
||||
}
|
||||
}
|
||||
|
||||
def get_name(self):
|
||||
return "Espressif"
|
Reference in New Issue
Block a user