-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hank
committed
Jan 24, 2017
1 parent
534cd28
commit 7e5765e
Showing
14 changed files
with
1,622 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> | ||
<storageModule moduleId="org.eclipse.cdt.core.settings"> | ||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.1555716806"> | ||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.1555716806" moduleId="org.eclipse.cdt.core.settings" name="Default"> | ||
<externalSettings/> | ||
<extensions> | ||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> | ||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
</extensions> | ||
</storageModule> | ||
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> | ||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.1555716806" name="Default" parent="org.eclipse.cdt.build.core.emptycfg"> | ||
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.1555716806.967939093" name="/" resourcePath=""> | ||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1319754512" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base"> | ||
<option id="cdt.managedbuild.option.gnu.cross.prefix.633552295" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/> | ||
<option id="cdt.managedbuild.option.gnu.cross.path.265564155" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/> | ||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.196815318" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> | ||
<builder arguments="${IDF_PATH}/tools/windows/eclipse_make.sh" command="bash" id="cdt.managedbuild.builder.gnu.cross.1029313584" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/> | ||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1927133587" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"> | ||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.43294451" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> | ||
</tool> | ||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1660286162" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"> | ||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.820954268" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> | ||
</tool> | ||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1212827042" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/> | ||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1277555933" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"> | ||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1610527716" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> | ||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> | ||
<additionalInput kind="additionalinput" paths="$(LIBS)"/> | ||
</inputType> | ||
</tool> | ||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.778122286" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/> | ||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1083626409" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler"> | ||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.412667753" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> | ||
</tool> | ||
</toolChain> | ||
</folderInfo> | ||
</configuration> | ||
</storageModule> | ||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | ||
</cconfiguration> | ||
</storageModule> | ||
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> | ||
<project id="04_https_request.null.273121365" name="04_https_request"/> | ||
</storageModule> | ||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> | ||
<storageModule moduleId="refreshScope" versionNumber="2"> | ||
<configuration configurationName="Default"> | ||
<resource resourceType="PROJECT" workspacePath="/04_https_request"/> | ||
</configuration> | ||
</storageModule> | ||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> | ||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> | ||
<storageModule moduleId="scannerConfiguration"> | ||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> | ||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1555716806;cdt.managedbuild.toolchain.gnu.cross.base.1555716806.967939093;cdt.managedbuild.tool.gnu.cross.c.compiler.1927133587;cdt.managedbuild.tool.gnu.c.compiler.input.43294451"> | ||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> | ||
</scannerConfigBuildInfo> | ||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1555716806;cdt.managedbuild.toolchain.gnu.cross.base.1555716806.967939093;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1660286162;cdt.managedbuild.tool.gnu.cpp.compiler.input.820954268"> | ||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> | ||
</scannerConfigBuildInfo> | ||
</storageModule> | ||
</cproject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>04_https_request</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | ||
<triggers>clean,full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | ||
<triggers>full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.cdt.core.cnature</nature> | ||
<nature>org.eclipse.cdt.core.ccnature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# This is a project Makefile. It is assumed the directory this Makefile resides in is a | ||
# project subdirectory. | ||
# | ||
|
||
PROJECT_NAME := Huan | ||
|
||
include $(IDF_PATH)/make/project.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# HTTPS Request Example | ||
|
||
Uses an mbedTLS socket to make a very simple HTTPS request over a secure connection, including verifying the server TLS certificate. | ||
|
||
See the README.md file in the upper level 'examples' directory for more information about examples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* DriverUtil.c | ||
* | ||
* Created on: 2017.1.23 | ||
* Author: Jack | ||
*/ | ||
#include "driver/i2c.h" | ||
#include "freertos/FreeRTOS.h" | ||
#include "esp_log.h" | ||
|
||
const char *DU_TAG = "WM8978"; | ||
|
||
#define WRITE_BIT I2C_MASTER_WRITE /*!< I2C master write */ | ||
#define READ_BIT I2C_MASTER_READ /*!< I2C master read */ | ||
#define ACK_CHECK_EN 0x1 /*!< I2C master will check ack from slave*/ | ||
#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */ | ||
#define ACK_VAL 0x0 /*!< I2C ack value */ | ||
#define NACK_VAL 0x1 /*!< I2C nack value */ | ||
|
||
|
||
/* | ||
* DevAddr Æ÷¼þµÄ7λµØÖ· | ||
*/ | ||
uint8_t IIC_Write_One_Byte(uint8_t DevAddr,uint8_t RegAddr,uint8_t Data) | ||
{ | ||
i2c_cmd_handle_t cmd = i2c_cmd_link_create(); | ||
|
||
int ret; | ||
|
||
ret = i2c_master_start(cmd); | ||
|
||
if (ret != ESP_OK) { | ||
ESP_LOGE(DU_TAG, "i2c_master_start failed! ret:%d", ret); | ||
|
||
return ret; | ||
} | ||
|
||
ret = i2c_master_write_byte(cmd, DevAddr & 0xFE, ACK_CHECK_EN); | ||
|
||
if (ret != ESP_OK) { | ||
ESP_LOGE(DU_TAG, "i2c_master_write_byte failed! ret:%d" , ret); | ||
|
||
return ret; | ||
} | ||
|
||
//i2c_master_write_byte(cmd, DevAddr << 1 | WRITE_BIT, ACK_CHECK_EN); | ||
i2c_master_write_byte(cmd, RegAddr, ACK_CHECK_EN); | ||
|
||
|
||
if (ret != ESP_OK) { | ||
ESP_LOGE(DU_TAG, "i2c_master_write_byte failed 2! ret:%d" , ret); | ||
|
||
return ret; | ||
} | ||
|
||
i2c_master_write_byte(cmd, Data, ACK_CHECK_EN); | ||
|
||
if (ret != ESP_OK) { | ||
ESP_LOGE(DU_TAG, "i2c_master_write_byte failed 3! ret:%d" , ret); | ||
|
||
return ret; | ||
} | ||
|
||
ret = i2c_master_stop(cmd); | ||
|
||
if (ret != ESP_OK) { | ||
ESP_LOGE(DU_TAG, "i2c_master_stop failed! ret:%d" , ret); | ||
|
||
return ret; | ||
} | ||
|
||
ret = i2c_master_cmd_begin(I2C_NUM_1, cmd, 1000 / portTICK_RATE_MS); | ||
|
||
if (ret != ESP_OK) { | ||
ESP_LOGE(DU_TAG, "i2c_master_cmd_begin failed! ret:%d" , ret); | ||
|
||
return ret; | ||
} | ||
|
||
i2c_cmd_link_delete(cmd); | ||
|
||
// if (ret != ESP_OK) { | ||
// ESP_LOGE(DU_TAG, "I2C write failed! DevAddr:%x regAddr:%d, ret:%d!", DevAddr & 0xFE, RegAddr, ret); | ||
// | ||
// return ret; | ||
// } | ||
|
||
return ESP_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* DriverUtil.h | ||
* | ||
* Created on: 2017.1.23 | ||
* Author: Jack | ||
*/ | ||
|
||
|
||
#ifndef __DRIVER_UTIL_H | ||
#define __DRIVER_UTIL_H | ||
|
||
#include "stdint.h" | ||
|
||
uint8_t IIC_Write_One_Byte(uint8_t DevAddr,uint8_t RegAddr,uint8_t Data); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
menu "Example Configuration" | ||
|
||
config WIFI_SSID | ||
string "WiFi SSID" | ||
default "myssid" | ||
help | ||
SSID (network name) for the example to connect to. | ||
|
||
config WIFI_PASSWORD | ||
string "WiFi Password" | ||
default "myssid" | ||
help | ||
WiFi password (WPA or WPA2) for the example to use. | ||
|
||
Can be left blank if the network has no security set. | ||
|
||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# "main" pseudo-component makefile. | ||
# | ||
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) | ||
|
||
# embed files from the "certs" directory as binary data symbols | ||
# in the app | ||
COMPONENT_EMBED_TXTFILES := server_root_cert.pem | ||
|
||
|
Oops, something went wrong.