Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
4911d2db
Commit
4911d2db
authored
Jun 03, 2016
by
Arnim Läuger
Browse files
Merge pull request #1336 from nodemcu/dev
1.5.1 master drop
parents
c8037568
2e109686
Changes
396
Hide whitespace changes
Inline
Side-by-side
sdk/esp_iot_sdk_v1.4.0/bin/boot_v1.4(b1).bin
deleted
100644 → 0
View file @
c8037568
File deleted
sdk/esp_iot_sdk_v1.4.0/bin/esp_init_data_default.bin
deleted
100644 → 0
View file @
c8037568
File deleted
sdk/esp_iot_sdk_v1.4.0/document/readme.txt
deleted
100644 → 0
View file @
c8037568
English version:
SDK Development Guide @ http://bbs.espressif.com/viewtopic.php?f=51&t=1024
AT Commands User Guide @ http://bbs.espressif.com/viewtopic.php?f=51&t=1022
All documentations @ http://bbs.espressif.com/viewforum.php?f=51
中文文档:
SDK 编程手册 @ http://bbs.espressif.com/viewtopic.php?f=51&t=1024
AT 指令集 @ http://bbs.espressif.com/viewtopic.php?f=51&t=1022
全部开发文档 @ http://bbs.espressif.com/viewforum.php?f=51
\ No newline at end of file
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/Makefile
deleted
100644 → 0
View file @
c8037568
#############################################################
# Required variables for each makefile
# Discard this section from all parent makefiles
# Expected variables (with automatic defaults):
# CSRCS (all "C" files in the dir)
# SUBDIRS (all subdirs with a Makefile)
# GEN_LIBS - list of libs to be generated ()
# GEN_IMAGES - list of object file images to be generated ()
# GEN_BINS - list of binaries to be generated ()
# COMPONENTS_xxx - a list of libs/objs in the form
# subdir/lib to be extracted and rolled up into
# a generated lib/image xxx.a ()
#
TARGET
=
eagle
#FLAVOR = release
FLAVOR
=
debug
#EXTRA_CCFLAGS += -u
ifndef
PDIR
# {
GEN_IMAGES
=
eagle.app.v6.out
GEN_BINS
=
eagle.app.v6.bin
SPECIAL_MKTARGETS
=
$(APP_MKTARGETS)
SUBDIRS
=
\
user
\
driver
endif
# } PDIR
APPDIR
=
.
LDDIR
=
../ld
CCFLAGS
+=
-Os
TARGET_LDFLAGS
=
\
-nostdlib
\
-Wl,-EL
\
--longcalls
\
--text-section-literals
ifeq
($(FLAVOR),debug)
TARGET_LDFLAGS
+=
-g
-O2
endif
ifeq
($(FLAVOR),release)
TARGET_LDFLAGS
+=
-g
-O0
endif
COMPONENTS_eagle.app.v6
=
\
user/libuser.a
\
driver/libdriver.a
LINKFLAGS_eagle.app.v6
=
\
-L../lib
\
-nostdlib
\
-T$(LD_FILE)
\
-Wl,--no-check-sections
\
-u
call_user_start
\
-Wl,-static
\
-Wl,--start-group
\
-lc
\
-lgcc
\
-lhal
\
-lphy
\
-lpp
\
-lnet80211
\
-llwip
\
-lwpa
\
-lmain
\
-ljson
\
-lupgrade\
-lssl
\
-lpwm
\
-lsmartconfig
\
$(DEP_LIBS_eagle.app.v6)
\
-Wl,--end-group
DEPENDS_eagle.app.v6
=
\
$(LD_FILE)
\
$(LDDIR)/eagle.rom.addr.v6.ld
#############################################################
# Configuration i.e. compile options etc.
# Target specific stuff (defines etc.) goes in here!
# Generally values applying to a tree are captured in the
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#
#UNIVERSAL_TARGET_DEFINES = \
# Other potential configuration flags include:
# -DTXRX_TXBUF_DEBUG
# -DTXRX_RXBUF_DEBUG
# -DWLAN_CONFIG_CCX
CONFIGURATION_DEFINES
=
-DICACHE_FLASH
DEFINES
+=
\
$(UNIVERSAL_TARGET_DEFINES)
\
$(CONFIGURATION_DEFINES)
DDEFINES
+=
\
$(UNIVERSAL_TARGET_DEFINES)
\
$(CONFIGURATION_DEFINES)
#############################################################
# Recursion Magic - Don't touch this!!
#
# Each subtree potentially has an include directory
# corresponding to the common APIs applicable to modules
# rooted at that subtree. Accordingly, the INCLUDE PATH
# of a module can only contain the include directories up
# its parent path, and not its siblings
#
# Required for each makefile to inherit from the parent
#
INCLUDES
:=
$(INCLUDES)
-I
$(PDIR)
include
PDIR
:=
../
$(PDIR)
sinclude
$(PDIR)Makefile
.PHONY
:
FORCE
FORCE
:
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/driver/Makefile
deleted
100644 → 0
View file @
c8037568
#############################################################
# Required variables for each makefile
# Discard this section from all parent makefiles
# Expected variables (with automatic defaults):
# CSRCS (all "C" files in the dir)
# SUBDIRS (all subdirs with a Makefile)
# GEN_LIBS - list of libs to be generated ()
# GEN_IMAGES - list of images to be generated ()
# COMPONENTS_xxx - a list of libs/objs in the form
# subdir/lib to be extracted and rolled up into
# a generated lib/image xxx.a ()
#
ifndef
PDIR
GEN_LIBS
=
libdriver.a
endif
#############################################################
# Configuration i.e. compile options etc.
# Target specific stuff (defines etc.) goes in here!
# Generally values applying to a tree are captured in the
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#
#DEFINES +=
#############################################################
# Recursion Magic - Don't touch this!!
#
# Each subtree potentially has an include directory
# corresponding to the common APIs applicable to modules
# rooted at that subtree. Accordingly, the INCLUDE PATH
# of a module can only contain the include directories up
# its parent path, and not its siblings
#
# Required for each makefile to inherit from the parent
#
INCLUDES
:=
$(INCLUDES)
-I
$(PDIR)
include
INCLUDES
+=
-I
./
PDIR
:=
../
$(PDIR)
sinclude
$(PDIR)Makefile
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/driver/i2c_master.c
deleted
100644 → 0
View file @
c8037568
/******************************************************************************
* Copyright 2013-2014 Espressif Systems (Wuxi)
*
* FileName: i2c_master.c
*
* Description: i2c master API
*
* Modification history:
* 2014/3/12, v1.0 create this file.
*******************************************************************************/
#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "driver/i2c_master.h"
LOCAL
uint8
m_nLastSDA
;
LOCAL
uint8
m_nLastSCL
;
/******************************************************************************
* FunctionName : i2c_master_setDC
* Description : Internal used function -
* set i2c SDA and SCL bit value for half clk cycle
* Parameters : uint8 SDA
* uint8 SCL
* Returns : NONE
*******************************************************************************/
LOCAL
void
ICACHE_FLASH_ATTR
i2c_master_setDC
(
uint8
SDA
,
uint8
SCL
)
{
SDA
&=
0x01
;
SCL
&=
0x01
;
m_nLastSDA
=
SDA
;
m_nLastSCL
=
SCL
;
if
((
0
==
SDA
)
&&
(
0
==
SCL
))
{
I2C_MASTER_SDA_LOW_SCL_LOW
();
}
else
if
((
0
==
SDA
)
&&
(
1
==
SCL
))
{
I2C_MASTER_SDA_LOW_SCL_HIGH
();
}
else
if
((
1
==
SDA
)
&&
(
0
==
SCL
))
{
I2C_MASTER_SDA_HIGH_SCL_LOW
();
}
else
{
I2C_MASTER_SDA_HIGH_SCL_HIGH
();
}
}
/******************************************************************************
* FunctionName : i2c_master_getDC
* Description : Internal used function -
* get i2c SDA bit value
* Parameters : NONE
* Returns : uint8 - SDA bit value
*******************************************************************************/
LOCAL
uint8
ICACHE_FLASH_ATTR
i2c_master_getDC
(
void
)
{
uint8
sda_out
;
sda_out
=
GPIO_INPUT_GET
(
GPIO_ID_PIN
(
I2C_MASTER_SDA_GPIO
));
return
sda_out
;
}
/******************************************************************************
* FunctionName : i2c_master_init
* Description : initilize I2C bus to enable i2c operations
* Parameters : NONE
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_init
(
void
)
{
uint8
i
;
i2c_master_setDC
(
1
,
0
);
i2c_master_wait
(
5
);
// when SCL = 0, toggle SDA to clear up
i2c_master_setDC
(
0
,
0
)
;
i2c_master_wait
(
5
);
i2c_master_setDC
(
1
,
0
)
;
i2c_master_wait
(
5
);
// set data_cnt to max value
for
(
i
=
0
;
i
<
28
;
i
++
)
{
i2c_master_setDC
(
1
,
0
);
i2c_master_wait
(
5
);
// sda 1, scl 0
i2c_master_setDC
(
1
,
1
);
i2c_master_wait
(
5
);
// sda 1, scl 1
}
// reset all
i2c_master_stop
();
return
;
}
/******************************************************************************
* FunctionName : i2c_master_gpio_init
* Description : config SDA and SCL gpio to open-drain output mode,
* mux and gpio num defined in i2c_master.h
* Parameters : NONE
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_gpio_init
(
void
)
{
ETS_GPIO_INTR_DISABLE
()
;
// ETS_INTR_LOCK();
PIN_FUNC_SELECT
(
I2C_MASTER_SDA_MUX
,
I2C_MASTER_SDA_FUNC
);
PIN_FUNC_SELECT
(
I2C_MASTER_SCL_MUX
,
I2C_MASTER_SCL_FUNC
);
GPIO_REG_WRITE
(
GPIO_PIN_ADDR
(
GPIO_ID_PIN
(
I2C_MASTER_SDA_GPIO
)),
GPIO_REG_READ
(
GPIO_PIN_ADDR
(
GPIO_ID_PIN
(
I2C_MASTER_SDA_GPIO
)))
|
GPIO_PIN_PAD_DRIVER_SET
(
GPIO_PAD_DRIVER_ENABLE
));
//open drain;
GPIO_REG_WRITE
(
GPIO_ENABLE_ADDRESS
,
GPIO_REG_READ
(
GPIO_ENABLE_ADDRESS
)
|
(
1
<<
I2C_MASTER_SDA_GPIO
));
GPIO_REG_WRITE
(
GPIO_PIN_ADDR
(
GPIO_ID_PIN
(
I2C_MASTER_SCL_GPIO
)),
GPIO_REG_READ
(
GPIO_PIN_ADDR
(
GPIO_ID_PIN
(
I2C_MASTER_SCL_GPIO
)))
|
GPIO_PIN_PAD_DRIVER_SET
(
GPIO_PAD_DRIVER_ENABLE
));
//open drain;
GPIO_REG_WRITE
(
GPIO_ENABLE_ADDRESS
,
GPIO_REG_READ
(
GPIO_ENABLE_ADDRESS
)
|
(
1
<<
I2C_MASTER_SCL_GPIO
));
I2C_MASTER_SDA_HIGH_SCL_HIGH
();
ETS_GPIO_INTR_ENABLE
()
;
// ETS_INTR_UNLOCK();
i2c_master_init
();
}
/******************************************************************************
* FunctionName : i2c_master_start
* Description : set i2c to send state
* Parameters : NONE
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_start
(
void
)
{
i2c_master_setDC
(
1
,
m_nLastSCL
);
i2c_master_wait
(
5
);
i2c_master_setDC
(
1
,
1
);
i2c_master_wait
(
5
);
// sda 1, scl 1
i2c_master_setDC
(
0
,
1
);
i2c_master_wait
(
5
);
// sda 0, scl 1
}
/******************************************************************************
* FunctionName : i2c_master_stop
* Description : set i2c to stop sending state
* Parameters : NONE
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_stop
(
void
)
{
i2c_master_wait
(
5
);
i2c_master_setDC
(
0
,
m_nLastSCL
);
i2c_master_wait
(
5
);
// sda 0
i2c_master_setDC
(
0
,
1
);
i2c_master_wait
(
5
);
// sda 0, scl 1
i2c_master_setDC
(
1
,
1
);
i2c_master_wait
(
5
);
// sda 1, scl 1
}
/******************************************************************************
* FunctionName : i2c_master_setAck
* Description : set ack to i2c bus as level value
* Parameters : uint8 level - 0 or 1
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_setAck
(
uint8
level
)
{
i2c_master_setDC
(
m_nLastSDA
,
0
);
i2c_master_wait
(
5
);
i2c_master_setDC
(
level
,
0
);
i2c_master_wait
(
5
);
// sda level, scl 0
i2c_master_setDC
(
level
,
1
);
i2c_master_wait
(
8
);
// sda level, scl 1
i2c_master_setDC
(
level
,
0
);
i2c_master_wait
(
5
);
// sda level, scl 0
i2c_master_setDC
(
1
,
0
);
i2c_master_wait
(
5
);
}
/******************************************************************************
* FunctionName : i2c_master_getAck
* Description : confirm if peer send ack
* Parameters : NONE
* Returns : uint8 - ack value, 0 or 1
*******************************************************************************/
uint8
ICACHE_FLASH_ATTR
i2c_master_getAck
(
void
)
{
uint8
retVal
;
i2c_master_setDC
(
m_nLastSDA
,
0
);
i2c_master_wait
(
5
);
i2c_master_setDC
(
1
,
0
);
i2c_master_wait
(
5
);
i2c_master_setDC
(
1
,
1
);
i2c_master_wait
(
5
);
retVal
=
i2c_master_getDC
();
i2c_master_wait
(
5
);
i2c_master_setDC
(
1
,
0
);
i2c_master_wait
(
5
);
return
retVal
;
}
/******************************************************************************
* FunctionName : i2c_master_checkAck
* Description : get dev response
* Parameters : NONE
* Returns : true : get ack ; false : get nack
*******************************************************************************/
bool
ICACHE_FLASH_ATTR
i2c_master_checkAck
(
void
)
{
if
(
i2c_master_getAck
()){
return
FALSE
;
}
else
{
return
TRUE
;
}
}
/******************************************************************************
* FunctionName : i2c_master_send_ack
* Description : response ack
* Parameters : NONE
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_send_ack
(
void
)
{
i2c_master_setAck
(
0x0
);
}
/******************************************************************************
* FunctionName : i2c_master_send_nack
* Description : response nack
* Parameters : NONE
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_send_nack
(
void
)
{
i2c_master_setAck
(
0x1
);
}
/******************************************************************************
* FunctionName : i2c_master_readByte
* Description : read Byte from i2c bus
* Parameters : NONE
* Returns : uint8 - readed value
*******************************************************************************/
uint8
ICACHE_FLASH_ATTR
i2c_master_readByte
(
void
)
{
uint8
retVal
=
0
;
uint8
k
,
i
;
i2c_master_wait
(
5
);
i2c_master_setDC
(
m_nLastSDA
,
0
);
i2c_master_wait
(
5
);
// sda 1, scl 0
for
(
i
=
0
;
i
<
8
;
i
++
)
{
i2c_master_wait
(
5
);
i2c_master_setDC
(
1
,
0
);
i2c_master_wait
(
5
);
// sda 1, scl 0
i2c_master_setDC
(
1
,
1
);
i2c_master_wait
(
5
);
// sda 1, scl 1
k
=
i2c_master_getDC
();
i2c_master_wait
(
5
);
if
(
i
==
7
)
{
i2c_master_wait
(
3
);
////
}
k
<<=
(
7
-
i
);
retVal
|=
k
;
}
i2c_master_setDC
(
1
,
0
);
i2c_master_wait
(
5
);
// sda 1, scl 0
return
retVal
;
}
/******************************************************************************
* FunctionName : i2c_master_writeByte
* Description : write wrdata value(one byte) into i2c
* Parameters : uint8 wrdata - write value
* Returns : NONE
*******************************************************************************/
void
ICACHE_FLASH_ATTR
i2c_master_writeByte
(
uint8
wrdata
)
{
uint8
dat
;
sint8
i
;
i2c_master_wait
(
5
);
i2c_master_setDC
(
m_nLastSDA
,
0
);
i2c_master_wait
(
5
);
for
(
i
=
7
;
i
>=
0
;
i
--
)
{
dat
=
wrdata
>>
i
;
i2c_master_setDC
(
dat
,
0
);
i2c_master_wait
(
5
);
i2c_master_setDC
(
dat
,
1
);
i2c_master_wait
(
5
);
if
(
i
==
0
)
{
i2c_master_wait
(
3
);
////
}
i2c_master_setDC
(
dat
,
0
);
i2c_master_wait
(
5
);
}
}
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/driver/key.c
deleted
100644 → 0
View file @
c8037568
/******************************************************************************
* Copyright 2013-2014 Espressif Systems (Wuxi)
*
* FileName: key.c
*
* Description: key driver, now can use different gpio and install different function
*
* Modification history:
* 2014/5/1, v1.0 create this file.
*******************************************************************************/
#include "ets_sys.h"
#include "os_type.h"
#include "osapi.h"
#include "mem.h"
#include "gpio.h"
#include "user_interface.h"
#include "driver/key.h"
LOCAL
void
key_intr_handler
(
struct
keys_param
*
keys
);
/******************************************************************************
* FunctionName : key_init_single
* Description : init single key's gpio and register function
* Parameters : uint8 gpio_id - which gpio to use
* uint32 gpio_name - gpio mux name
* uint32 gpio_func - gpio function
* key_function long_press - long press function, needed to install
* key_function short_press - short press function, needed to install
* Returns : single_key_param - single key parameter, needed by key init
*******************************************************************************/
struct
single_key_param
*
ICACHE_FLASH_ATTR
key_init_single
(
uint8
gpio_id
,
uint32
gpio_name
,
uint8
gpio_func
,
key_function
long_press
,
key_function
short_press
)
{
struct
single_key_param
*
single_key
=
(
struct
single_key_param
*
)
os_zalloc
(
sizeof
(
struct
single_key_param
));
single_key
->
gpio_id
=
gpio_id
;
single_key
->
gpio_name
=
gpio_name
;
single_key
->
gpio_func
=
gpio_func
;
single_key
->
long_press
=
long_press
;
single_key
->
short_press
=
short_press
;
return
single_key
;
}
/******************************************************************************
* FunctionName : key_init
* Description : init keys
* Parameters : key_param *keys - keys parameter, which inited by key_init_single
* Returns : none
*******************************************************************************/
void
ICACHE_FLASH_ATTR
key_init
(
struct
keys_param
*
keys
)
{
uint8
i
;
ETS_GPIO_INTR_ATTACH
(
key_intr_handler
,
keys
);
ETS_GPIO_INTR_DISABLE
();
for
(
i
=
0
;
i
<
keys
->
key_num
;
i
++
)
{
keys
->
single_key
[
i
]
->
key_level
=
1
;
PIN_FUNC_SELECT
(
keys
->
single_key
[
i
]
->
gpio_name
,
keys
->
single_key
[
i
]
->
gpio_func
);
gpio_output_set
(
0
,
0
,
0
,
GPIO_ID_PIN
(
keys
->
single_key
[
i
]
->
gpio_id
));
gpio_register_set
(
GPIO_PIN_ADDR
(
keys
->
single_key
[
i
]
->
gpio_id
),
GPIO_PIN_INT_TYPE_SET
(
GPIO_PIN_INTR_DISABLE
)
|
GPIO_PIN_PAD_DRIVER_SET
(
GPIO_PAD_DRIVER_DISABLE
)
|
GPIO_PIN_SOURCE_SET
(
GPIO_AS_PIN_SOURCE
));
//clear gpio14 status
GPIO_REG_WRITE
(
GPIO_STATUS_W1TC_ADDRESS
,
BIT
(
keys
->
single_key
[
i
]
->
gpio_id
));
//enable interrupt
gpio_pin_intr_state_set
(
GPIO_ID_PIN
(
keys
->
single_key
[
i
]
->
gpio_id
),
GPIO_PIN_INTR_NEGEDGE
);
}
ETS_GPIO_INTR_ENABLE
();
}
/******************************************************************************
* FunctionName : key_5s_cb
* Description : long press 5s timer callback
* Parameters : single_key_param *single_key - single key parameter
* Returns : none
*******************************************************************************/
LOCAL
void
ICACHE_FLASH_ATTR
key_5s_cb
(
struct
single_key_param
*
single_key
)
{
os_timer_disarm
(
&
single_key
->
key_5s
);
// low, then restart
if
(
0
==
GPIO_INPUT_GET
(
GPIO_ID_PIN
(
single_key
->
gpio_id
)))
{
if
(
single_key
->
long_press
)
{
single_key
->
long_press
();
}
}
}
/******************************************************************************
* FunctionName : key_50ms_cb
* Description : 50ms timer callback to check it's a real key push
* Parameters : single_key_param *single_key - single key parameter
* Returns : none
*******************************************************************************/
LOCAL
void
ICACHE_FLASH_ATTR
key_50ms_cb
(
struct
single_key_param
*
single_key
)
{
os_timer_disarm
(
&
single_key
->
key_50ms
);
// high, then key is up
if
(
1
==
GPIO_INPUT_GET
(
GPIO_ID_PIN
(
single_key
->
gpio_id
)))
{
os_timer_disarm
(
&
single_key
->
key_5s
);
single_key
->
key_level
=
1
;
gpio_pin_intr_state_set
(
GPIO_ID_PIN
(
single_key
->
gpio_id
),
GPIO_PIN_INTR_NEGEDGE
);
if
(
single_key
->
short_press
)
{
single_key
->
short_press
();
}
}
else
{
gpio_pin_intr_state_set
(
GPIO_ID_PIN
(
single_key
->
gpio_id
),
GPIO_PIN_INTR_POSEDGE
);
}
}
/******************************************************************************
* FunctionName : key_intr_handler
* Description : key interrupt handler
* Parameters : key_param *keys - keys parameter, which inited by key_init_single
* Returns : none
*******************************************************************************/
LOCAL
void
key_intr_handler
(
struct
keys_param
*
keys
)
{
uint8
i
;
uint32
gpio_status
=
GPIO_REG_READ
(
GPIO_STATUS_ADDRESS
);
for
(
i
=
0
;
i
<
keys
->
key_num
;
i
++
)
{
if
(
gpio_status
&
BIT
(
keys
->
single_key
[
i
]
->
gpio_id
))
{
//disable interrupt
gpio_pin_intr_state_set
(
GPIO_ID_PIN
(
keys
->
single_key
[
i
]
->
gpio_id
),
GPIO_PIN_INTR_DISABLE
);
//clear interrupt status
GPIO_REG_WRITE
(
GPIO_STATUS_W1TC_ADDRESS
,
gpio_status
&
BIT
(
keys
->
single_key
[
i
]
->
gpio_id
));
if
(
keys
->
single_key
[
i
]
->
key_level
==
1
)
{
// 5s, restart & enter softap mode
os_timer_disarm
(
&
keys
->
single_key
[
i
]
->
key_5s
);
os_timer_setfn
(
&
keys
->
single_key
[
i
]
->
key_5s
,
(
os_timer_func_t
*
)
key_5s_cb
,
keys
->
single_key
[
i
]);
os_timer_arm
(
&
keys
->
single_key
[
i
]
->
key_5s
,
5000
,
0
);
keys
->
single_key
[
i
]
->
key_level
=
0
;
gpio_pin_intr_state_set
(
GPIO_ID_PIN
(
keys
->
single_key
[
i
]
->
gpio_id
),
GPIO_PIN_INTR_POSEDGE
);
}
else
{
// 50ms, check if this is a real key up
os_timer_disarm
(
&
keys
->
single_key
[
i
]
->
key_50ms
);
os_timer_setfn
(
&
keys
->
single_key
[
i
]
->
key_50ms
,
(
os_timer_func_t
*
)
key_50ms_cb
,
keys
->
single_key
[
i
]);
os_timer_arm
(
&
keys
->
single_key
[
i
]
->
key_50ms
,
50
,
0
);
}
}
}
}
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/gen_misc.bat
deleted
100644 → 0
View file @
c8037568
@echo
off
echo
gen_misc
.bat
version
20150511
echo
.
echo
Please
follow
below
steps
(
1
-
5
)
to
generate
specific
bin
(
s
)
:
echo
STEP
1
:
choose
boot
version
(
0
=
boot_v1
.1
,
1
=
boot_v1
.2
+,
2
=
none
)
set
input
=
default
set
/p
input
=
enter
(
0
/1/2
,
default
2
)
:
if
%input%
equ
0
(
set
boot
=
old
)
else
(
if
%input%
equ
1
(
set
boot
=
new
)
else
(
set
boot
=
none
)
)
echo
boot
mode
:
%boot%
echo
.
echo
STEP
2
:
choose
bin
generate
(
0
=
eagle
.flash.bin
+eagle
.irom0text.bin
,
1
=
user1
.bin
,
2
=
user2
.bin
)
set
input
=
default
set
/p
input
=
enter
(
0
/1/2
,
default
0
)
:
if
%input%
equ
1
(
if
%boot%
equ
none
(
set
app
=
0
echo
choose
no
boot
before
echo
generate
bin
:
eagle
.flash.bin
+eagle
.irom0text.bin
)
else
(
set
app
=
1
echo
generate
bin
:
user1
.bin
)
)
else
(
if
%input%
equ
2
(
if
%boot%
equ
none
(
set
app
=
0
echo
choose
no
boot
before
echo
generate
bin
:
eagle
.flash.bin
+eagle
.irom0text.bin
)
else
(
set
app
=
2
echo
generate
bin
:
user2
.bin
)
)
else
(
if
%boot%
neq
none
(
set
boot
=
none
echo
ignore
boot
)
set
app
=
0
echo
generate
bin
:
eagle
.flash.bin
+eagle
.irom0text.bin
))
echo
.
echo
STEP
3
:
choose
spi
speed
(
0
=
20
MHz
,
1
=
26
.7MHz
,
2
=
40
MHz
,
3
=
80
MHz
)
set
input
=
default
set
/p
input
=
enter
(
0
/1/2/3
,
default
2
)
:
if
%input%
equ
0
(
set
spi_speed
=
20
)
else
(
if
%input%
equ
1
(
set
spi_speed
=
26
.7
)
else
(
if
%input%
equ
3
(
set
spi_speed
=
80
)
else
(
set
spi_speed
=
40
)))
echo
spi
speed
:
%spi_speed%
MHz
echo
.
echo
STEP
4
:
choose
spi
mode
(
0
=
QIO
,
1
=
QOUT
,
2
=
DIO
,
3
=
DOUT
)
set
input
=
default
set
/p
input
=
enter
(
0
/1/2/3
,
default
0
)
:
if
%input%
equ
1
(
set
spi_mode
=
QOUT
)
else
(
if
%input%
equ
2
(
set
spi_mode
=
DIO
)
else
(
if
%input%
equ
3
(
set
spi_mode
=
DOUT
)
else
(
set
spi_mode
=
QIO
)))
echo
spi
mode
:
%spi_mode%
echo
.
echo
STEP
5
:
choose
flash
size
and
map
echo
0
=
512
KB
(
256
KB
+
256
KB
)
echo
2
=
1024
KB
(
512
KB
+
512
KB
)
echo
3
=
2048
KB
(
512
KB
+
512
KB
)
echo
4
=
4096
KB
(
512
KB
+
512
KB
)
echo
5
=
2048
KB
(
1024
KB
+
1024
KB
)
echo
6
=
4096
KB
(
1024
KB
+
1024
KB
)
set
input
=
default
set
/p
input
=
enter
(
0
/1/2/3/4/5/6
,
default
0
)
:
if
%input%
equ
2
(
set
spi_size_map
=
2
echo
spi
size
:
1024
KB
echo
spi
ota
map
:
512
KB
+
512
KB
)
else
(
if
%input%
equ
3
(
set
spi_size_map
=
3
echo
spi
size
:
2048
KB
echo
spi
ota
map
:
512
KB
+
512
KB
)
else
(
if
%input%
equ
4
(
set
spi_size_map
=
4
echo
spi
size
:
4096
KB
echo
spi
ota
map
:
512
KB
+
512
KB
)
else
(
if
%input%
equ
5
(
set
spi_size_map
=
5
echo
spi
size
:
2048
KB
echo
spi
ota
map
:
1024
KB
+
1024
KB
)
else
(
if
%input%
equ
6
(
set
spi_size_map
=
6
echo
spi
size
:
4096
KB
echo
spi
ota
map
:
1024
KB
+
1024
KB
)
else
(
set
spi_size_map
=
0
echo
spi
size
:
512
KB
echo
spi
ota
map
:
256
KB
+
256
KB
)
)
)
)
)
touch
user
/user
_main.c
echo
.
echo
start
...
echo
.
make
BOOT
=
%boot%
APP
=
%app%
SPI_SPEED
=
%spi_speed%
SPI_MODE
=
%spi_mode%
SPI_SIZE
=
%spi_size_map%
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/gen_misc.sh
deleted
100644 → 0
View file @
c8037568
#!/bin/bash
echo
"gen_misc.sh version 20150511"
echo
""
echo
"Please follow below steps(1-5) to generate specific bin(s):"
echo
"STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)"
echo
"enter(0/1/2, default 2):"
read
input
if
[
-z
"
$input
"
]
;
then
boot
=
none
elif
[
$input
==
0
]
;
then
boot
=
old
elif
[
$input
==
1
]
;
then
boot
=
new
else
boot
=
none
fi
echo
"boot mode:
$boot
"
echo
""
echo
"STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)"
echo
"enter (0/1/2, default 0):"
read
input
if
[
-z
"
$input
"
]
;
then
if
[
$boot
!=
none
]
;
then
boot
=
none
echo
"ignore boot"
fi
app
=
0
echo
"generate bin: eagle.flash.bin+eagle.irom0text.bin"
elif
[
$input
==
1
]
;
then
if
[
$boot
==
none
]
;
then
app
=
0
echo
"choose no boot before"
echo
"generate bin: eagle.flash.bin+eagle.irom0text.bin"
else
app
=
1
echo
"generate bin: user1.bin"
fi
elif
[
$input
==
2
]
;
then
if
[
$boot
==
none
]
;
then
app
=
0
echo
"choose no boot before"
echo
"generate bin: eagle.flash.bin+eagle.irom0text.bin"
else
app
=
2
echo
"generate bin: user2.bin"
fi
else
if
[
$boot
!=
none
]
;
then
boot
=
none
echo
"ignore boot"
fi
app
=
0
echo
"generate bin: eagle.flash.bin+eagle.irom0text.bin"
fi
echo
""
echo
"STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)"
echo
"enter (0/1/2/3, default 2):"
read
input
if
[
-z
"
$input
"
]
;
then
spi_speed
=
40
elif
[
$input
==
0
]
;
then
spi_speed
=
20
elif
[
$input
==
1
]
;
then
spi_speed
=
26.7
elif
[
$input
==
3
]
;
then
spi_speed
=
80
else
spi_speed
=
40
fi
echo
"spi speed:
$spi_speed
MHz"
echo
""
echo
"STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)"
echo
"enter (0/1/2/3, default 0):"
read
input
if
[
-z
"
$input
"
]
;
then
spi_mode
=
QIO
elif
[
$input
==
1
]
;
then
spi_mode
=
QOUT
elif
[
$input
==
2
]
;
then
spi_mode
=
DIO
elif
[
$input
==
3
]
;
then
spi_mode
=
DOUT
else
spi_mode
=
QIO
fi
echo
"spi mode:
$spi_mode
"
echo
""
echo
"STEP 5: choose spi size and map"
echo
" 0= 512KB( 256KB+ 256KB)"
echo
" 2=1024KB( 512KB+ 512KB)"
echo
" 3=2048KB( 512KB+ 512KB)"
echo
" 4=4096KB( 512KB+ 512KB)"
echo
" 5=2048KB(1024KB+1024KB)"
echo
" 6=4096KB(1024KB+1024KB)"
echo
"enter (0/2/3/4/5/6, default 0):"
read
input
if
[
-z
"
$input
"
]
;
then
spi_size_map
=
0
echo
"spi size: 512KB"
echo
"spi ota map: 256KB + 256KB"
elif
[
$input
==
2
]
;
then
spi_size_map
=
2
echo
"spi size: 1024KB"
echo
"spi ota map: 512KB + 512KB"
elif
[
$input
==
3
]
;
then
spi_size_map
=
3
echo
"spi size: 2048KB"
echo
"spi ota map: 512KB + 512KB"
elif
[
$input
==
4
]
;
then
spi_size_map
=
4
echo
"spi size: 4096KB"
echo
"spi ota map: 512KB + 512KB"
elif
[
$input
==
5
]
;
then
spi_size_map
=
5
echo
"spi size: 2048KB"
echo
"spi ota map: 1024KB + 1024KB"
elif
[
$input
==
6
]
;
then
spi_size_map
=
6
echo
"spi size: 4096KB"
echo
"spi ota map: 1024KB + 1024KB"
else
spi_size_map
=
0
echo
"spi size: 512KB"
echo
"spi ota map: 256KB + 256KB"
fi
echo
""
touch
user/user_main.c
echo
""
echo
"start..."
echo
""
make
COMPILE
=
gcc
BOOT
=
$boot
APP
=
$app
SPI_SPEED
=
$spi_speed
SPI_MODE
=
$spi_mode
SPI_SIZE_MAP
=
$spi_size_map
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/driver/i2c_master.h
deleted
100644 → 0
View file @
c8037568
#ifndef __I2C_MASTER_H__
#define __I2C_MASTER_H__
#define I2C_MASTER_SDA_MUX PERIPHS_IO_MUX_GPIO2_U
#define I2C_MASTER_SCL_MUX PERIPHS_IO_MUX_MTMS_U
#define I2C_MASTER_SDA_GPIO 2
#define I2C_MASTER_SCL_GPIO 14
#define I2C_MASTER_SDA_FUNC FUNC_GPIO2
#define I2C_MASTER_SCL_FUNC FUNC_GPIO14
//#define I2C_MASTER_SDA_MUX PERIPHS_IO_MUX_GPIO2_U
//#define I2C_MASTER_SCL_MUX PERIPHS_IO_MUX_GPIO0_U
//#define I2C_MASTER_SDA_GPIO 2
//#define I2C_MASTER_SCL_GPIO 0
//#define I2C_MASTER_SDA_FUNC FUNC_GPIO2
//#define I2C_MASTER_SCL_FUNC FUNC_GPIO0
#if 0
#define I2C_MASTER_GPIO_SET(pin) \
gpio_output_set(1<<pin,0,1<<pin,0)
#define I2C_MASTER_GPIO_CLR(pin) \
gpio_output_set(0,1<<pin,1<<pin,0)
#define I2C_MASTER_GPIO_OUT(pin,val) \
if(val) I2C_MASTER_GPIO_SET(pin);\
else I2C_MASTER_GPIO_CLR(pin)
#endif
#define I2C_MASTER_SDA_HIGH_SCL_HIGH() \
gpio_output_set
(
1
<<
I2C_MASTER_SDA_GPIO
|
1
<<
I2C_MASTER_SCL_GPIO
,
0
,
1
<<
I2C_MASTER_SDA_GPIO
|
1
<<
I2C_MASTER_SCL_GPIO
,
0
)
#define I2C_MASTER_SDA_HIGH_SCL_LOW() \
gpio_output_set
(
1
<<
I2C_MASTER_SDA_GPIO
,
1
<<
I2C_MASTER_SCL_GPIO
,
1
<<
I2C_MASTER_SDA_GPIO
|
1
<<
I2C_MASTER_SCL_GPIO
,
0
)
#define I2C_MASTER_SDA_LOW_SCL_HIGH() \
gpio_output_set
(
1
<<
I2C_MASTER_SCL_GPIO
,
1
<<
I2C_MASTER_SDA_GPIO
,
1
<<
I2C_MASTER_SDA_GPIO
|
1
<<
I2C_MASTER_SCL_GPIO
,
0
)
#define I2C_MASTER_SDA_LOW_SCL_LOW() \
gpio_output_set
(
0
,
1
<<
I2C_MASTER_SDA_GPIO
|
1
<<
I2C_MASTER_SCL_GPIO
,
1
<<
I2C_MASTER_SDA_GPIO
|
1
<<
I2C_MASTER_SCL_GPIO
,
0
)
void
i2c_master_gpio_init
(
void
);
void
i2c_master_init
(
void
);
#define i2c_master_wait os_delay_us
void
i2c_master_stop
(
void
);
void
i2c_master_start
(
void
);
void
i2c_master_setAck
(
uint8
level
);
uint8
i2c_master_getAck
(
void
);
uint8
i2c_master_readByte
(
void
);
void
i2c_master_writeByte
(
uint8
wrdata
);
bool
i2c_master_checkAck
(
void
);
void
i2c_master_send_ack
(
void
);
void
i2c_master_send_nack
(
void
);
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/driver/key.h
deleted
100644 → 0
View file @
c8037568
#ifndef __KEY_H__
#define __KEY_H__
#include "gpio.h"
typedef
void
(
*
key_function
)(
void
);
struct
single_key_param
{
uint8
key_level
;
uint8
gpio_id
;
uint8
gpio_func
;
uint32
gpio_name
;
os_timer_t
key_5s
;
os_timer_t
key_50ms
;
key_function
short_press
;
key_function
long_press
;
};
struct
keys_param
{
uint8
key_num
;
struct
single_key_param
**
single_key
;
};
struct
single_key_param
*
key_init_single
(
uint8
gpio_id
,
uint32
gpio_name
,
uint8
gpio_func
,
key_function
long_press
,
key_function
short_press
);
void
key_init
(
struct
keys_param
*
key
);
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/ssl/cert.h
deleted
100644 → 0
View file @
c8037568
unsigned
char
default_certificate
[]
=
{
0x30
,
0x82
,
0x01
,
0x82
,
0x30
,
0x81
,
0xec
,
0x02
,
0x09
,
0x00
,
0x88
,
0xf2
,
0x5f
,
0x46
,
0x12
,
0x2e
,
0x3d
,
0x3a
,
0x30
,
0x0d
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x01
,
0x05
,
0x05
,
0x00
,
0x30
,
0x1c
,
0x31
,
0x1a
,
0x30
,
0x18
,
0x06
,
0x03
,
0x55
,
0x04
,
0x0a
,
0x13
,
0x11
,
0x77
,
0x77
,
0x77
,
0x2e
,
0x65
,
0x73
,
0x70
,
0x72
,
0x65
,
0x73
,
0x73
,
0x69
,
0x66
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x30
,
0x1e
,
0x17
,
0x0d
,
0x31
,
0x34
,
0x30
,
0x36
,
0x32
,
0x34
,
0x31
,
0x30
,
0x32
,
0x32
,
0x33
,
0x33
,
0x5a
,
0x17
,
0x0d
,
0x32
,
0x38
,
0x30
,
0x33
,
0x30
,
0x32
,
0x31
,
0x30
,
0x32
,
0x32
,
0x33
,
0x33
,
0x5a
,
0x30
,
0x34
,
0x31
,
0x12
,
0x30
,
0x10
,
0x06
,
0x03
,
0x55
,
0x04
,
0x0a
,
0x13
,
0x09
,
0x65
,
0x73
,
0x70
,
0x72
,
0x65
,
0x73
,
0x73
,
0x69
,
0x66
,
0x31
,
0x1e
,
0x30
,
0x1c
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x15
,
0x65
,
0x73
,
0x70
,
0x72
,
0x65
,
0x73
,
0x73
,
0x69
,
0x66
,
0x20
,
0x49
,
0x6f
,
0x54
,
0x20
,
0x70
,
0x72
,
0x6f
,
0x6a
,
0x65
,
0x63
,
0x74
,
0x30
,
0x5c
,
0x30
,
0x0d
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x01
,
0x01
,
0x05
,
0x00
,
0x03
,
0x4b
,
0x00
,
0x30
,
0x48
,
0x02
,
0x41
,
0x00
,
0xb9
,
0x83
,
0x30
,
0xca
,
0xfb
,
0xec
,
0x11
,
0x9e
,
0x94
,
0xb7
,
0x89
,
0xf2
,
0x84
,
0x2c
,
0xda
,
0xe1
,
0x9a
,
0x53
,
0x3a
,
0x1b
,
0x6e
,
0xc9
,
0x85
,
0x81
,
0xf9
,
0xa3
,
0x41
,
0xdb
,
0xe2
,
0x82
,
0x3b
,
0xfa
,
0x80
,
0x22
,
0x3b
,
0x81
,
0x6d
,
0x25
,
0x73
,
0x7e
,
0xf6
,
0x49
,
0xcc
,
0x69
,
0x3c
,
0x6c
,
0xd8
,
0x05
,
0xfb
,
0x92
,
0x02
,
0xcf
,
0x19
,
0x2a
,
0x10
,
0x7d
,
0x69
,
0x7a
,
0xd8
,
0x9d
,
0xd3
,
0xcf
,
0x6c
,
0xef
,
0x02
,
0x03
,
0x01
,
0x00
,
0x01
,
0x30
,
0x0d
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x01
,
0x05
,
0x05
,
0x00
,
0x03
,
0x81
,
0x81
,
0x00
,
0x2d
,
0x63
,
0x58
,
0x21
,
0xe3
,
0x8b
,
0x37
,
0x0d
,
0x28
,
0x68
,
0x11
,
0x0e
,
0x4d
,
0xdd
,
0xf3
,
0xea
,
0xdb
,
0xec
,
0xd7
,
0x09
,
0x47
,
0x2c
,
0xa1
,
0xd8
,
0xd1
,
0x71
,
0x83
,
0x11
,
0xb4
,
0x17
,
0xbc
,
0x83
,
0xea
,
0x5a
,
0xd6
,
0x73
,
0x02
,
0x25
,
0x87
,
0x01
,
0x76
,
0xfc
,
0x59
,
0x1a
,
0xcf
,
0xd9
,
0x49
,
0xc9
,
0xf9
,
0x1f
,
0x5c
,
0x3b
,
0x24
,
0x6a
,
0x5c
,
0xa5
,
0xca
,
0xe6
,
0x5d
,
0x34
,
0x5b
,
0x5f
,
0xcf
,
0x56
,
0x9c
,
0x71
,
0xd2
,
0x6b
,
0xdd
,
0x1f
,
0x15
,
0xae
,
0x4d
,
0xf1
,
0xca
,
0x35
,
0xc8
,
0xdd
,
0x93
,
0x1b
,
0x58
,
0x1e
,
0x94
,
0x08
,
0xcf
,
0xa0
,
0x20
,
0xb9
,
0x75
,
0xa5
,
0x4c
,
0x77
,
0xf5
,
0x7f
,
0xed
,
0xd5
,
0xcd
,
0x53
,
0xaa
,
0x87
,
0xa6
,
0x3c
,
0xf5
,
0x72
,
0xd8
,
0xd2
,
0xb0
,
0xf7
,
0x11
,
0xb0
,
0x0e
,
0xe9
,
0x41
,
0xd6
,
0x8e
,
0xd9
,
0x07
,
0xf8
,
0xed
,
0xf8
,
0x67
,
0x7f
,
0x28
,
0x18
,
0xf0
,
0x1b
,
0x29
,
0x11
};
unsigned
int
default_certificate_len
=
390
;
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/ssl/private_key.h
deleted
100644 → 0
View file @
c8037568
unsigned
char
default_private_key
[]
=
{
0x30
,
0x82
,
0x01
,
0x3a
,
0x02
,
0x01
,
0x00
,
0x02
,
0x41
,
0x00
,
0xb9
,
0x83
,
0x30
,
0xca
,
0xfb
,
0xec
,
0x11
,
0x9e
,
0x94
,
0xb7
,
0x89
,
0xf2
,
0x84
,
0x2c
,
0xda
,
0xe1
,
0x9a
,
0x53
,
0x3a
,
0x1b
,
0x6e
,
0xc9
,
0x85
,
0x81
,
0xf9
,
0xa3
,
0x41
,
0xdb
,
0xe2
,
0x82
,
0x3b
,
0xfa
,
0x80
,
0x22
,
0x3b
,
0x81
,
0x6d
,
0x25
,
0x73
,
0x7e
,
0xf6
,
0x49
,
0xcc
,
0x69
,
0x3c
,
0x6c
,
0xd8
,
0x05
,
0xfb
,
0x92
,
0x02
,
0xcf
,
0x19
,
0x2a
,
0x10
,
0x7d
,
0x69
,
0x7a
,
0xd8
,
0x9d
,
0xd3
,
0xcf
,
0x6c
,
0xef
,
0x02
,
0x03
,
0x01
,
0x00
,
0x01
,
0x02
,
0x40
,
0x1d
,
0x13
,
0x92
,
0xf2
,
0x3d
,
0xca
,
0x22
,
0x78
,
0xd8
,
0x96
,
0x6b
,
0xe8
,
0xb7
,
0x0e
,
0xd0
,
0xbf
,
0xcb
,
0x90
,
0x7f
,
0xeb
,
0x0c
,
0xd2
,
0x49
,
0x3a
,
0xb6
,
0x06
,
0x00
,
0xac
,
0x96
,
0x34
,
0x13
,
0x72
,
0x4b
,
0x8c
,
0xd2
,
0xb9
,
0x35
,
0xf5
,
0x64
,
0x18
,
0xb2
,
0x47
,
0x5b
,
0x9f
,
0xbb
,
0xf2
,
0x5b
,
0x2f
,
0x66
,
0x78
,
0x2d
,
0x0a
,
0x76
,
0x44
,
0xc5
,
0x4f
,
0xdb
,
0x7d
,
0x13
,
0xcf
,
0xa5
,
0x08
,
0xdc
,
0x01
,
0x02
,
0x21
,
0x00
,
0xdf
,
0x9a
,
0x89
,
0xd0
,
0xef
,
0x23
,
0xcf
,
0x12
,
0xac
,
0x8a
,
0x63
,
0x1a
,
0x8c
,
0xc0
,
0x3f
,
0xf4
,
0x38
,
0x52
,
0x3c
,
0x9f
,
0x19
,
0x0a
,
0x37
,
0xd2
,
0xcb
,
0x5d
,
0xeb
,
0xb6
,
0x2a
,
0x33
,
0xb0
,
0x91
,
0x02
,
0x21
,
0x00
,
0xd4
,
0x63
,
0xd9
,
0x6a
,
0x18
,
0x5b
,
0xe8
,
0xa8
,
0x57
,
0x4d
,
0xd1
,
0x9a
,
0xa8
,
0xd7
,
0xe1
,
0x65
,
0x75
,
0xb3
,
0xb9
,
0x5c
,
0x94
,
0x14
,
0xca
,
0x98
,
0x41
,
0x47
,
0x9c
,
0x0a
,
0x22
,
0x38
,
0x05
,
0x7f
,
0x02
,
0x20
,
0x6a
,
0xce
,
0xfd
,
0xef
,
0xe0
,
0x9b
,
0x61
,
0x49
,
0x91
,
0x43
,
0x95
,
0x6d
,
0x54
,
0x38
,
0x6d
,
0x14
,
0x32
,
0x67
,
0x0d
,
0xf0
,
0x0d
,
0x5c
,
0xf5
,
0x27
,
0x6a
,
0xdf
,
0x55
,
0x3d
,
0xb1
,
0xd0
,
0xf9
,
0x11
,
0x02
,
0x21
,
0x00
,
0xba
,
0x94
,
0xa0
,
0xf9
,
0xb0
,
0x3e
,
0x85
,
0x8b
,
0xe5
,
0x6e
,
0x4a
,
0x95
,
0x88
,
0x80
,
0x65
,
0xd5
,
0x00
,
0xea
,
0x8b
,
0x0b
,
0x46
,
0x57
,
0x61
,
0x87
,
0x11
,
0xc9
,
0xfb
,
0xcd
,
0x77
,
0x34
,
0x29
,
0xb7
,
0x02
,
0x20
,
0x06
,
0x8d
,
0x41
,
0x11
,
0x47
,
0x93
,
0xcb
,
0xad
,
0xda
,
0x5d
,
0xe1
,
0x9d
,
0x49
,
0x8d
,
0xe0
,
0xab
,
0x48
,
0xe6
,
0x18
,
0x28
,
0x4a
,
0x94
,
0xae
,
0xf9
,
0xad
,
0xc5
,
0x5b
,
0x0b
,
0x15
,
0xc6
,
0x73
,
0x17
};
unsigned
int
default_private_key_len
=
318
;
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/user_config.h
deleted
100644 → 0
View file @
c8037568
#ifndef __USER_CONFIG_H__
#define __USER_CONFIG_H__
#define ESP_PLATFORM 1
#define LEWEI_PLATFORM 0
#define USE_OPTIMIZE_PRINTF
#if ESP_PLATFORM
#define PLUG_DEVICE 0
#define LIGHT_DEVICE 1
#define SENSOR_DEVICE 0
#if SENSOR_DEVICE
#define HUMITURE_SUB_DEVICE 1
#define FLAMMABLE_GAS_SUB_DEVICE 0
#endif
//#define SERVER_SSL_ENABLE
//#define CLIENT_SSL_ENABLE
//#define UPGRADE_SSL_ENABLE
#define USE_DNS
#ifdef USE_DNS
#define ESP_DOMAIN "iot.espressif.cn"
#endif
//#define SOFTAP_ENCRYPT
#ifdef SOFTAP_ENCRYPT
#define PASSWORD "v*%W>L<@i&Nxe!"
#endif
#if SENSOR_DEVICE
#define SENSOR_DEEP_SLEEP
#if HUMITURE_SUB_DEVICE
#define SENSOR_DEEP_SLEEP_TIME 30000000
#elif FLAMMABLE_GAS_SUB_DEVICE
#define SENSOR_DEEP_SLEEP_TIME 60000000
#endif
#endif
#if LIGHT_DEVICE
#define USE_US_TIMER
#endif
#if PLUG_DEVICE || LIGHT_DEVICE
#define BEACON_TIMEOUT 150000000
#define BEACON_TIME 50000
#endif
#define AP_CACHE 1
#if AP_CACHE
#define AP_CACHE_NUMBER 5
#endif
#elif LEWEI_PLATFORM
#endif
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/user_devicefind.h
deleted
100644 → 0
View file @
c8037568
#ifndef __USER_DEVICEFIND_H__
#define __USER_DEVICEFIND_H__
void
user_devicefind_init
(
void
);
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/user_esp_platform.h
deleted
100644 → 0
View file @
c8037568
#ifndef __USER_DEVICE_H__
#define __USER_DEVICE_H__
/* NOTICE---this is for 512KB spi flash.
* you can change to other sector if you use other size spi flash. */
#define ESP_PARAM_START_SEC 0x3D
#define packet_size (2 * 1024)
#define token_size 41
struct
esp_platform_saved_param
{
uint8
devkey
[
40
];
uint8
token
[
40
];
uint8
activeflag
;
uint8
pad
[
3
];
};
enum
{
DEVICE_CONNECTING
=
40
,
DEVICE_ACTIVE_DONE
,
DEVICE_ACTIVE_FAIL
,
DEVICE_CONNECT_SERVER_FAIL
};
struct
dhcp_client_info
{
ip_addr_t
ip_addr
;
ip_addr_t
netmask
;
ip_addr_t
gw
;
uint8
flag
;
uint8
pad
[
3
];
};
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/user_esp_platform_timer.h
deleted
100644 → 0
View file @
c8037568
#ifndef __USER_DEVICEFIND_H__
#define __USER_DEVICEFIND_H__
void
user_platform_timer_start
(
char
*
pbuffer
,
struct
espconn
*
pespconn
);
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/user_iot_version.h
deleted
100644 → 0
View file @
c8037568
#ifndef __USER_IOT_VERSION_H__
#define __USER_IOT_VERSION_H__
#include "user_config.h"
#define IOT_VERSION_MAJOR 1U
#define IOT_VERSION_MINOR 0U
#define IOT_VERSION_REVISION 5U
#define VERSION_NUM (IOT_VERSION_MAJOR * 1000 + IOT_VERSION_MINOR * 100 + IOT_VERSION_REVISION)
//#define VERSION_TYPE "b"
#define VERSION_TYPE "v"
#if LIGHT_DEVICE
#define device_type 45772
#elif PLUG_DEVICE
#define device_type 23701
#elif SENSOR_DEVICE
#define device_type 12335
#endif
#define ONLINE_UPGRADE 0
#define LOCAL_UPGRADE 0
#define ALL_UPGRADE 1
#define NONE_UPGRADE 0
#if ONLINE_UPGRADE
#define UPGRADE_FALG "O"
#elif LOCAL_UPGRADE
#define UPGRADE_FALG "l"
#elif ALL_UPGRADE
#define UPGRADE_FALG "a"
#elif NONE_UPGRADE
#define UPGRADE_FALG "n"
#endif
#define IOT_VERSION
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/user_json.h
deleted
100644 → 0
View file @
c8037568
#ifndef __USER_JSON_H__
#define __USER_JSON_H__
#include "json/jsonparse.h"
#include "json/jsontree.h"
#define jsonSize 2*1024
void
json_parse
(
struct
jsontree_context
*
json
,
char
*
ptrJSONMessage
);
void
json_ws_send
(
struct
jsontree_value
*
tree
,
const
char
*
path
,
char
*
pbuf
);
int
json_putchar
(
int
c
);
struct
jsontree_value
*
find_json_path
(
struct
jsontree_context
*
json
,
const
char
*
path
);
#endif
sdk/esp_iot_sdk_v1.4.0/examples/IoT_Demo/include/user_light.h
deleted
100644 → 0
View file @
c8037568
#ifndef __USER_LIGHT_H__
#define __USER_LIGHT_H__
/*pwm.h: function and macro definition of PWM API , driver level */
/*user_light.h: user interface for light API, user level*/
/*user_light_adj: API for color changing and lighting effects, user level*/
#include "pwm.h"
/* NOTICE !!! ---this is for 512KB spi flash.*/
/* You can change to other sector if you use other size spi flash. */
/* Refer to the documentation about OTA support and flash mapping*/
#define PRIV_PARAM_START_SEC 0x3C
#define PRIV_PARAM_SAVE 0
/*Define the channel number of PWM*/
/*In this demo, we can set 3 for 3 PWM channels: RED, GREEN, BLUE*/
/*Or , we can choose 5 channels : RED,GREEN,BLUE,COLD-WHITE,WARM-WHITE*/
#define PWM_CHANNEL 5 // 5:5channel ; 3:3channel
#define LIGHT_RED 0
#define LIGHT_GREEN 1
#define LIGHT_BLUE 2
#define LIGHT_COLD_WHITE 3
#define LIGHT_WARM_WHITE 4
/*Definition of GPIO PIN params, for GPIO initialization*/
#define PWM_0_OUT_IO_MUX PERIPHS_IO_MUX_MTDI_U
#define PWM_0_OUT_IO_NUM 12
#define PWM_0_OUT_IO_FUNC FUNC_GPIO12
#define PWM_1_OUT_IO_MUX PERIPHS_IO_MUX_MTDO_U
#define PWM_1_OUT_IO_NUM 15
#define PWM_1_OUT_IO_FUNC FUNC_GPIO15
#define PWM_2_OUT_IO_MUX PERIPHS_IO_MUX_MTCK_U
#define PWM_2_OUT_IO_NUM 13
#define PWM_2_OUT_IO_FUNC FUNC_GPIO13
#define PWM_3_OUT_IO_MUX PERIPHS_IO_MUX_MTMS_U
#define PWM_3_OUT_IO_NUM 14
#define PWM_3_OUT_IO_FUNC FUNC_GPIO14
#define PWM_4_OUT_IO_MUX PERIPHS_IO_MUX_GPIO5_U
#define PWM_4_OUT_IO_NUM 5
#define PWM_4_OUT_IO_FUNC FUNC_GPIO5
struct
light_saved_param
{
uint32
pwm_period
;
uint32
pwm_duty
[
PWM_CHANNEL
];
};
void
user_light_init
(
void
);
uint32
user_light_get_duty
(
uint8
channel
);
void
user_light_set_duty
(
uint32
duty
,
uint8
channel
);
uint32
user_light_get_period
(
void
);
void
user_light_set_period
(
uint32
period
);
#endif
Prev
1
…
10
11
12
13
14
15
16
17
18
…
20
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment