From 50869fccf7e9f693c0950c594466a3fc00b47bc0 Mon Sep 17 00:00:00 2001 From: Baozhu Zuo Date: Sat, 28 Dec 2019 09:43:22 +0800 Subject: [PATCH] megrge gloveboxes code (#8) * Update to CMake for Azure Sphere SDK 19.11 * added support for VS Code/Ubuntu * updated samples for vs, vs code, windows, ubuntu * refactored directory structure --- .gitignore | 60 +------ MT3620_Grove_Shield_Library.sln | 24 --- MT3620_Grove_Shield_Library/CMakeLists.txt | 101 +++++++++++ .../CMakeSettings.json | 56 ++++++ .../MT3620_Grove_Shield_Library.vcxproj | 97 ----------- ...T3620_Grove_Shield_Library.vcxproj.filters | 99 ----------- README.md | 40 ++--- Samples/GroveLEDButton/.gitignore | 3 + .../.vscode/c_cpp_properties.json | 18 ++ Samples/GroveLEDButton/.vscode/launch.json | 28 +++ Samples/GroveLEDButton/.vscode/settings.json | 11 ++ Samples/GroveLEDButton/CMakeLists.txt | 13 ++ Samples/GroveLEDButton/CMakeSettings.json | 57 ++++++ Samples/GroveLEDButton/GroveLEDButton.sln | 31 ---- .../GroveLEDButton/GroveLEDButton.vcxproj | 59 ------- .../GroveLEDButton.vcxproj.filters | 28 --- .../GroveLEDButton/applibs_versions.h | 4 - .../GroveLEDButton/mt3620_rdb.h | 162 ------------------ .../{GroveLEDButton => }/app_manifest.json | 13 +- Samples/GroveLEDButton/applibs_versions.h | 25 +++ Samples/GroveLEDButton/launch.vs.json | 21 +++ .../{GroveLEDButton => }/main.c | 8 +- Samples/GroveLightSensor/.gitignore | 3 + .../.vscode/c_cpp_properties.json | 18 ++ Samples/GroveLightSensor/.vscode/launch.json | 28 +++ .../GroveLightSensor/.vscode/settings.json | 11 ++ Samples/GroveLightSensor/CMakeLists.txt | 13 ++ Samples/GroveLightSensor/CMakeSettings.json | 57 ++++++ Samples/GroveLightSensor/GroveLightSensor.sln | 31 ---- .../GroveLightSensor/GroveLightSensor.vcxproj | 59 ------- .../GroveLightSensor.vcxproj.filters | 28 --- .../GroveLightSensor/applibs_versions.h | 4 - .../GroveLightSensor/mt3620_rdb.h | 162 ------------------ .../{GroveLightSensor => }/app_manifest.json | 13 +- Samples/GroveLightSensor/applibs_versions.h | 25 +++ Samples/GroveLightSensor/launch.vs.json | 21 +++ .../{GroveLightSensor => }/main.c | 12 +- Samples/GroveRotaryAngleSensor/.gitignore | 3 + .../.vscode/c_cpp_properties.json | 18 ++ .../.vscode/launch.json | 28 +++ .../.vscode/settings.json | 11 ++ Samples/GroveRotaryAngleSensor/CMakeLists.txt | 13 ++ .../GroveRotaryAngleSensor/CMakeSettings.json | 57 ++++++ .../GroveRotaryAngleSensor.sln | 31 ---- .../GroveRotaryAngleSensor.vcxproj | 59 ------- .../GroveRotaryAngleSensor.vcxproj.filters | 28 --- .../GroveRotaryAngleSensor/applibs_versions.h | 4 - .../GroveRotaryAngleSensor/mt3620_rdb.h | 162 ------------------ .../app_manifest.json | 13 +- .../GroveRotaryAngleSensor/applibs_versions.h | 25 +++ Samples/GroveRotaryAngleSensor/launch.vs.json | 21 +++ .../{GroveRotaryAngleSensor => }/main.c | 8 +- Samples/Grove_4_Digital_Display/.gitignore | 3 + .../.vscode/c_cpp_properties.json | 18 ++ .../.vscode/launch.json | 28 +++ .../.vscode/settings.json | 11 ++ .../Grove_4_Digital_Display/CMakeLists.txt | 13 ++ .../CMakeSettings.json | 57 ++++++ .../Grove_4_Digital_Display.sln | 31 ---- .../Grove_4_Digital_Display.vcxproj | 59 ------- .../Grove_4_Digital_Display.vcxproj.filters | 28 --- .../Grove_4_Digital_Display/app_manifest.json | 14 -- .../applibs_versions.h | 4 - .../Grove_4_Digital_Display/mt3620_rdb.h | 162 ------------------ .../Grove_4_Digital_Display/app_manifest.json | 13 ++ .../applibs_versions.h | 25 +++ .../Grove_4_Digital_Display/launch.vs.json | 21 +++ .../{Grove_4_Digital_Display => }/main.c | 10 +- Samples/Grove_Buzzer/.gitignore | 3 + .../.vscode/c_cpp_properties.json | 18 ++ Samples/Grove_Buzzer/.vscode/launch.json | 28 +++ Samples/Grove_Buzzer/.vscode/settings.json | 11 ++ Samples/Grove_Buzzer/CMakeLists.txt | 13 ++ Samples/Grove_Buzzer/CMakeSettings.json | 57 ++++++ Samples/Grove_Buzzer/Grove_Buzzer.sln | 31 ---- .../Grove_Buzzer/Grove_Buzzer.vcxproj | 59 ------- .../Grove_Buzzer/Grove_Buzzer.vcxproj.filters | 28 --- .../Grove_Buzzer/app_manifest.json | 14 -- .../Grove_Buzzer/applibs_versions.h | 4 - .../Grove_Buzzer/Grove_Buzzer/mt3620_rdb.h | 162 ------------------ Samples/Grove_Buzzer/app_manifest.json | 13 ++ Samples/Grove_Buzzer/applibs_versions.h | 25 +++ Samples/Grove_Buzzer/launch.vs.json | 21 +++ .../Grove_Buzzer/{Grove_Buzzer => }/main.c | 9 +- Samples/Grove_OLED_Display/.gitignore | 3 + .../.vscode/c_cpp_properties.json | 18 ++ .../Grove_OLED_Display/.vscode/launch.json | 28 +++ .../Grove_OLED_Display/.vscode/settings.json | 11 ++ Samples/Grove_OLED_Display/CMakeLists.txt | 13 ++ Samples/Grove_OLED_Display/CMakeSettings.json | 57 ++++++ .../Grove_OLED_Display/GroveOledDisplay.sln | 31 ---- .../GroveOledDisplay/GroveOledDisplay.vcxproj | 62 ------- .../GroveOledDisplay.vcxproj.filters | 28 --- .../GroveOledDisplay/app_manifest.json | 14 -- .../GroveOledDisplay/applibs_versions.h | 4 - .../GroveOledDisplay/mt3620_rdb.h | 162 ------------------ Samples/Grove_OLED_Display/app_manifest.json | 13 ++ Samples/Grove_OLED_Display/applibs_versions.h | 25 +++ Samples/Grove_OLED_Display/launch.vs.json | 21 +++ .../{GroveOledDisplay => }/main.c | 10 +- Samples/Temp_and_Humidity_SHT31/.gitignore | 3 + .../.vscode/c_cpp_properties.json | 18 ++ .../.vscode/launch.json | 28 +++ .../.vscode/settings.json | 11 ++ .../Temp_and_Humidity_SHT31/CMakeLists.txt | 13 ++ .../CMakeSettings.json | 57 ++++++ .../Temp_and_Humidity_SHT31.sln | 31 ---- .../Temp_and_Humidity_SHT31.vcxproj | 59 ------- .../Temp_and_Humidity_SHT31.vcxproj.filters | 28 --- .../Temp_and_Humidity_SHT31/app_manifest.json | 14 -- .../applibs_versions.h | 4 - .../Temp_and_Humidity_SHT31/mt3620_rdb.h | 162 ------------------ .../Temp_and_Humidity_SHT31/app_manifest.json | 13 ++ .../applibs_versions.h | 25 +++ .../Temp_and_Humidity_SHT31/launch.vs.json | 21 +++ .../{Temp_and_Humidity_SHT31 => }/main.c | 9 +- 116 files changed, 1499 insertions(+), 2414 deletions(-) delete mode 100644 MT3620_Grove_Shield_Library.sln create mode 100644 MT3620_Grove_Shield_Library/CMakeLists.txt create mode 100644 MT3620_Grove_Shield_Library/CMakeSettings.json delete mode 100644 MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj delete mode 100644 MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj.filters create mode 100644 Samples/GroveLEDButton/.gitignore create mode 100644 Samples/GroveLEDButton/.vscode/c_cpp_properties.json create mode 100644 Samples/GroveLEDButton/.vscode/launch.json create mode 100644 Samples/GroveLEDButton/.vscode/settings.json create mode 100644 Samples/GroveLEDButton/CMakeLists.txt create mode 100644 Samples/GroveLEDButton/CMakeSettings.json delete mode 100644 Samples/GroveLEDButton/GroveLEDButton.sln delete mode 100644 Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj delete mode 100644 Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj.filters delete mode 100644 Samples/GroveLEDButton/GroveLEDButton/applibs_versions.h delete mode 100644 Samples/GroveLEDButton/GroveLEDButton/mt3620_rdb.h rename Samples/GroveLEDButton/{GroveLEDButton => }/app_manifest.json (53%) create mode 100644 Samples/GroveLEDButton/applibs_versions.h create mode 100644 Samples/GroveLEDButton/launch.vs.json rename Samples/GroveLEDButton/{GroveLEDButton => }/main.c (90%) create mode 100644 Samples/GroveLightSensor/.gitignore create mode 100644 Samples/GroveLightSensor/.vscode/c_cpp_properties.json create mode 100644 Samples/GroveLightSensor/.vscode/launch.json create mode 100644 Samples/GroveLightSensor/.vscode/settings.json create mode 100644 Samples/GroveLightSensor/CMakeLists.txt create mode 100644 Samples/GroveLightSensor/CMakeSettings.json delete mode 100644 Samples/GroveLightSensor/GroveLightSensor.sln delete mode 100644 Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj delete mode 100644 Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj.filters delete mode 100644 Samples/GroveLightSensor/GroveLightSensor/applibs_versions.h delete mode 100644 Samples/GroveLightSensor/GroveLightSensor/mt3620_rdb.h rename Samples/GroveLightSensor/{GroveLightSensor => }/app_manifest.json (52%) create mode 100644 Samples/GroveLightSensor/applibs_versions.h create mode 100644 Samples/GroveLightSensor/launch.vs.json rename Samples/GroveLightSensor/{GroveLightSensor => }/main.c (86%) create mode 100644 Samples/GroveRotaryAngleSensor/.gitignore create mode 100644 Samples/GroveRotaryAngleSensor/.vscode/c_cpp_properties.json create mode 100644 Samples/GroveRotaryAngleSensor/.vscode/launch.json create mode 100644 Samples/GroveRotaryAngleSensor/.vscode/settings.json create mode 100644 Samples/GroveRotaryAngleSensor/CMakeLists.txt create mode 100644 Samples/GroveRotaryAngleSensor/CMakeSettings.json delete mode 100644 Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor.sln delete mode 100644 Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj delete mode 100644 Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj.filters delete mode 100644 Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/applibs_versions.h delete mode 100644 Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/mt3620_rdb.h rename Samples/GroveRotaryAngleSensor/{GroveRotaryAngleSensor => }/app_manifest.json (52%) create mode 100644 Samples/GroveRotaryAngleSensor/applibs_versions.h create mode 100644 Samples/GroveRotaryAngleSensor/launch.vs.json rename Samples/GroveRotaryAngleSensor/{GroveRotaryAngleSensor => }/main.c (89%) create mode 100644 Samples/Grove_4_Digital_Display/.gitignore create mode 100644 Samples/Grove_4_Digital_Display/.vscode/c_cpp_properties.json create mode 100644 Samples/Grove_4_Digital_Display/.vscode/launch.json create mode 100644 Samples/Grove_4_Digital_Display/.vscode/settings.json create mode 100644 Samples/Grove_4_Digital_Display/CMakeLists.txt create mode 100644 Samples/Grove_4_Digital_Display/CMakeSettings.json delete mode 100644 Samples/Grove_4_Digital_Display/Grove_4_Digital_Display.sln delete mode 100644 Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj delete mode 100644 Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj.filters delete mode 100644 Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/app_manifest.json delete mode 100644 Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/applibs_versions.h delete mode 100644 Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/mt3620_rdb.h create mode 100644 Samples/Grove_4_Digital_Display/app_manifest.json create mode 100644 Samples/Grove_4_Digital_Display/applibs_versions.h create mode 100644 Samples/Grove_4_Digital_Display/launch.vs.json rename Samples/Grove_4_Digital_Display/{Grove_4_Digital_Display => }/main.c (84%) create mode 100644 Samples/Grove_Buzzer/.gitignore create mode 100644 Samples/Grove_Buzzer/.vscode/c_cpp_properties.json create mode 100644 Samples/Grove_Buzzer/.vscode/launch.json create mode 100644 Samples/Grove_Buzzer/.vscode/settings.json create mode 100644 Samples/Grove_Buzzer/CMakeLists.txt create mode 100644 Samples/Grove_Buzzer/CMakeSettings.json delete mode 100644 Samples/Grove_Buzzer/Grove_Buzzer.sln delete mode 100644 Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj delete mode 100644 Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj.filters delete mode 100644 Samples/Grove_Buzzer/Grove_Buzzer/app_manifest.json delete mode 100644 Samples/Grove_Buzzer/Grove_Buzzer/applibs_versions.h delete mode 100644 Samples/Grove_Buzzer/Grove_Buzzer/mt3620_rdb.h create mode 100644 Samples/Grove_Buzzer/app_manifest.json create mode 100644 Samples/Grove_Buzzer/applibs_versions.h create mode 100644 Samples/Grove_Buzzer/launch.vs.json rename Samples/Grove_Buzzer/{Grove_Buzzer => }/main.c (89%) create mode 100644 Samples/Grove_OLED_Display/.gitignore create mode 100644 Samples/Grove_OLED_Display/.vscode/c_cpp_properties.json create mode 100644 Samples/Grove_OLED_Display/.vscode/launch.json create mode 100644 Samples/Grove_OLED_Display/.vscode/settings.json create mode 100644 Samples/Grove_OLED_Display/CMakeLists.txt create mode 100644 Samples/Grove_OLED_Display/CMakeSettings.json delete mode 100644 Samples/Grove_OLED_Display/GroveOledDisplay.sln delete mode 100644 Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj delete mode 100644 Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj.filters delete mode 100644 Samples/Grove_OLED_Display/GroveOledDisplay/app_manifest.json delete mode 100644 Samples/Grove_OLED_Display/GroveOledDisplay/applibs_versions.h delete mode 100644 Samples/Grove_OLED_Display/GroveOledDisplay/mt3620_rdb.h create mode 100644 Samples/Grove_OLED_Display/app_manifest.json create mode 100644 Samples/Grove_OLED_Display/applibs_versions.h create mode 100644 Samples/Grove_OLED_Display/launch.vs.json rename Samples/Grove_OLED_Display/{GroveOledDisplay => }/main.c (98%) create mode 100644 Samples/Temp_and_Humidity_SHT31/.gitignore create mode 100644 Samples/Temp_and_Humidity_SHT31/.vscode/c_cpp_properties.json create mode 100644 Samples/Temp_and_Humidity_SHT31/.vscode/launch.json create mode 100644 Samples/Temp_and_Humidity_SHT31/.vscode/settings.json create mode 100644 Samples/Temp_and_Humidity_SHT31/CMakeLists.txt create mode 100644 Samples/Temp_and_Humidity_SHT31/CMakeSettings.json delete mode 100644 Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.sln delete mode 100644 Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj delete mode 100644 Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj.filters delete mode 100644 Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/app_manifest.json delete mode 100644 Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/applibs_versions.h delete mode 100644 Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/mt3620_rdb.h create mode 100644 Samples/Temp_and_Humidity_SHT31/app_manifest.json create mode 100644 Samples/Temp_and_Humidity_SHT31/applibs_versions.h create mode 100644 Samples/Temp_and_Humidity_SHT31/launch.vs.json rename Samples/Temp_and_Humidity_SHT31/{Temp_and_Humidity_SHT31 => }/main.c (89%) diff --git a/.gitignore b/.gitignore index 1fa02f5..204e9e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,56 +1,4 @@ -# Prerequisites -*.d - -# Object files -*.o -*.ko -*.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf - -/.vs -/MT3620_Grove_Shield_Library/obj -/MT3620_Grove_Shield_Library/*.user +# Ignore output directories +/out/ +/install/ +.vs/ diff --git a/MT3620_Grove_Shield_Library.sln b/MT3620_Grove_Shield_Library.sln deleted file mode 100644 index 980d81c..0000000 --- a/MT3620_Grove_Shield_Library.sln +++ /dev/null @@ -1,24 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C4E13FF9-FAAB-418E-ABF7-42877A4BEB96} - EndGlobalSection -EndGlobal diff --git a/MT3620_Grove_Shield_Library/CMakeLists.txt b/MT3620_Grove_Shield_Library/CMakeLists.txt new file mode 100644 index 0000000..a6b227b --- /dev/null +++ b/MT3620_Grove_Shield_Library/CMakeLists.txt @@ -0,0 +1,101 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.8) +PROJECT(MT3620_Grove_Shield_Library C) + +################################################################################ +# Source groups +################################################################################ +set(no_group_source_files + "applibs_versions.h" + "Grove.h" + "mt3620_rdb.h" +) +source_group("" FILES ${no_group_source_files}) + +set(Common + "Common/Delay.c" + "Common/Delay.h" +) +source_group("Common" FILES ${Common}) + +set(HAL + "HAL/GroveI2C.c" + "HAL/GroveI2C.h" + "HAL/GroveShield.c" + "HAL/GroveShield.h" + "HAL/GroveUART.c" + "HAL/GroveUART.h" +) +source_group("HAL" FILES ${HAL}) + +set(Sensors + "Sensors/Grove4DigitDisplay.c" + "Sensors/Grove4DigitDisplay.h" + "Sensors/GroveAD7992.c" + "Sensors/GroveAD7992.h" + "Sensors/GroveLEDButton.c" + "Sensors/GroveLEDButton.h" + "Sensors/GroveLightSensor.c" + "Sensors/GroveLightSensor.h" + "Sensors/GroveOledDisplay96x96.c" + "Sensors/GroveOledDisplay96x96.h" + "Sensors/GroveRelay.c" + "Sensors/GroveRelay.h" + "Sensors/GroveRotaryAngleSensor.c" + "Sensors/GroveRotaryAngleSensor.h" + "Sensors/GroveTempHumiBaroBME280.c" + "Sensors/GroveTempHumiBaroBME280.h" + "Sensors/GroveTempHumiSHT31.c" + "Sensors/GroveTempHumiSHT31.h" +) +source_group("Sensors" FILES ${Sensors}) + +set(ALL_FILES + ${no_group_source_files} + ${Common} + ${HAL} + ${Sensors} +) + +################################################################################ +# Target +################################################################################ +add_library(${PROJECT_NAME} STATIC ${ALL_FILES}) + + +set(ROOT_NAMESPACE MT3620_Grove_Shield_Library) + +set_target_properties(${PROJECT_NAME} PROPERTIES + VS_GLOBAL_KEYWORD "AzureSphere" +) + + +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c) + +################################################################################ +# Compile definitions +################################################################################ + +################################################################################ +# Compile and link options +################################################################################ +#if(MSVC) +# target_compile_options(${PROJECT_NAME} PRIVATE +# $<$: +# /showIncludes; +# ${DEFAULT_CXX_DEBUG_RUNTIME_LIBRARY} +# > +# $<$: +# ${DEFAULT_CXX_RUNTIME_LIBRARY} +# > +# ${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT}; +# ${DEFAULT_CXX_EXCEPTION_HANDLING} +# ) +#endif() + +################################################################################ +# Dependencies +################################################################################ +#target_link_directories(${PROJECT_NAME} PUBLIC +# "${CMAKE_CURRENT_SOURCE_DIR}/./azureiot/lib" +#) + diff --git a/MT3620_Grove_Shield_Library/CMakeSettings.json b/MT3620_Grove_Shield_Library/CMakeSettings.json new file mode 100644 index 0000000..97ccffe --- /dev/null +++ b/MT3620_Grove_Shield_Library/CMakeSettings.json @@ -0,0 +1,56 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} \ No newline at end of file diff --git a/MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj b/MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj deleted file mode 100644 index 89bf0e1..0000000 --- a/MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - AzureSphere - MT3620_Grove_Shield_Library - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - $(MSBuildProjectDirectory)\Inc\Public - $(MSBuildProjectDirectory)\Inc\Public - - - - true - StaticLibrary - 1 - - - false - StaticLibrary - - - - - - - - $(IncludePath) - $(LibraryPath) - - - - -Werror=implicit-function-declaration -D AZURE_IOT_HUB_CONFIGURED -D AZURE_IOT_HUB_CONFIGURED %(AdditionalOptions) - $(SysRoot)\usr\include\azureiot;%(AdditionalIncludeDirectories) - $(SysRoot)\usr\include\azureiot;%(AdditionalIncludeDirectories) - true - - - .\azureiot\lib;%(AdditionalLibraryDirectories) - -lm;-lazureiot;%(AdditionalDependencies) - - - .\azureiot\lib;%(AdditionalLibraryDirectories) - -lm;-lazureiot;%(AdditionalDependencies) - - - - - \ No newline at end of file diff --git a/MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj.filters b/MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj.filters deleted file mode 100644 index 4c9d49b..0000000 --- a/MT3620_Grove_Shield_Library/MT3620_Grove_Shield_Library.vcxproj.filters +++ /dev/null @@ -1,99 +0,0 @@ - - - - - {eb316990-e081-44c6-ac44-2dc9d97c1dc6} - - - {bbca52e0-9f72-40ee-a241-4b9fe71337a1} - - - {ef48ba23-6d86-4c60-92ab-46de8e17d35a} - - - - - HAL - - - HAL - - - HAL - - - Sensors - - - Sensors - - - Sensors - - - Sensors - - - Sensors - - - Sensors - - - Common - - - Sensors - - - Sensors - - - Sensors - - - - - HAL - - - HAL - - - - - - HAL - - - Sensors - - - Sensors - - - Sensors - - - Sensors - - - Sensors - - - Sensors - - - Common - - - Sensors - - - Sensors - - - Sensors - - - \ No newline at end of file diff --git a/README.md b/README.md index a46b891..f539355 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,31 @@ -## About MT3620 Grove Shield Library +# About Azure Sphere MT3620 Grove Shield Library This is library for Azure Sphere MT3620 Grove Shield, the shield enhences Azure Sphere by adding I2C interface and Analog input. -### Requirements +## Requirements -- Operation System - Final version of Windows 10 -- [Visual Studio 2017 Community/Professional/Enterprise](https://visualstudio.microsoft.com/downloads/) -- [Azure Sphere SDK Preview for Visual Studio](https://aka.ms/AzureSphereSDKDownload) +- Operation Systems - Windows 10 or Ubuntu 18.04 +- Developer Tools: Visual Studio [Visual Studio Community/Professional/Enterprise](https://visualstudio.microsoft.com/downloads/) or [Visual Studio Code](https://code.visualstudio.com/) - Hardware - [Azure Sphere](https://www.seeedstudio.com/Azure-Sphere-MT3620-Development-Kit-US-Version-p-3052.html), [MT3620 Grove Shield](https://www.seeedstudio.com/MT3620-Grove-Shield-p-3145.html) -### Create a MT3620 application with Visual Studio 2017 +## Create a MT3620 application -1. Open Visual Studio 2017 -2. Select __File > New > Project__ -3. Select __Installed > Visual C++ > Cross Platform > Azure Sphere__ at the left side +Review the [Azure Sphere documentation]https://docs.microsoft.com/en-au/azure-sphere/ for the guide to setting up the developer tools and Azure Sphere SDK on Windows 10 or Ubuntu 18.04. -There are some templates for MT3620, select __Blank Application for MT3620 RDB (Azure Sphere)__ to create a blank project, or if you want to use __Azure IoT Hub__ then select __Azure IoT Hub Sample for MT3620 RDB(Azure Sphere)__. -4. Select __Blank Application for MT3620 RDB (Azure Sphere)__ and type a project name, select a project location then click __OK__. +## MT3620 Grove Shield App Manifest -### Import MT3620_Grove_Shield_Library to the project - -1. Right-Click the solution title In __Solution Explorer__ window on the right side -2. Select __Add > Existing Project__ -3. Select __MT3620_Grove_Shield_Library > MT3620_Grove_Shield_Library.vcxproj__, then click __Open__ -4. Now MT3620_Grove_Shield_Library has been added to the solution. -5. Right-Click the project name of your application, select __Properties > C/C++ > General > Additional Include Directories__ -6. Click the __down arraw > Edit... > New Line__ icons, add the path of __MT3620_Grove_Shield_Library__ to the blank item, click __Select Folder__ > __OK__ > __OK__ -7. Go to the application project Right-Click __References__ > __Add References__, select __Projects__, click the check box of __MT3620_Grove_Shield_Library__, then click __OK__ -8. Select __app_manifest.json__ in the application project, add the below attributions, so that we can use the peripherals that MT3620 Grove Shield would use. +Select __app_manifest.json__ in the application project, add the below attributions, so that we can use the peripherals that MT3620 Grove Shield would use. ```JSON "Capabilities": { - "AllowedConnections": [], "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": false + "AllowedApplicationConnections": [] } ``` -9. Now you can edit main.c file in __Source Files__, to include __Grove.h__ and __Sensor/xxx.h__ to drive the MT3620 Grove Shield. - -### Some available header files +## Some available header files - Grove.h - Sensors/Grove4DigitDisplay.h @@ -54,9 +38,9 @@ There are some templates for MT3620, select __Blank Application for MT3620 RDB ( - Sensors/GroveRotaryAngleSensor.h - Sensors/GroveLEDButton.h - Sensors/GroveLightSensor.h -- -### Usage of the library, see Example - Temp and Huminidy SHT31 + +## Usage of the library, see Example - Temp and Huminidy SHT31 1. Add headers diff --git a/Samples/GroveLEDButton/.gitignore b/Samples/GroveLEDButton/.gitignore new file mode 100644 index 0000000..f60a954 --- /dev/null +++ b/Samples/GroveLEDButton/.gitignore @@ -0,0 +1,3 @@ +# Ignore output directories +/out/ +/install/ diff --git a/Samples/GroveLEDButton/.vscode/c_cpp_properties.json b/Samples/GroveLEDButton/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..393fe20 --- /dev/null +++ b/Samples/GroveLEDButton/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64", + "configurationProvider": "vector-of-bool.cmake-tools", + "compileCommands": "${workspaceFolder}/out/Debug-3/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Samples/GroveLEDButton/.vscode/launch.json b/Samples/GroveLEDButton/.vscode/launch.json new file mode 100644 index 0000000..dae7c0c --- /dev/null +++ b/Samples/GroveLEDButton/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch for Azure Sphere High-Level Applications (gdb)", + "type": "azurespheredbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "targetCore": "HLCore", + "partnerComponents": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Samples/GroveLEDButton/.vscode/settings.json b/Samples/GroveLEDButton/.vscode/settings.json new file mode 100644 index 0000000..7615f4f --- /dev/null +++ b/Samples/GroveLEDButton/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cmake.generator": "Ninja", + "cmake.buildDirectory": "${workspaceRoot}/out/${buildType}-${command:azuresphere.AzureSphereTargetApiSet}", + "cmake.buildToolArgs": [ "-v" ], + "cmake.configureArgs": [ "--no-warn-unused-cli" ], + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake", + "AZURE_SPHERE_TARGET_API_SET": "3" + }, + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/Samples/GroveLEDButton/CMakeLists.txt b/Samples/GroveLEDButton/CMakeLists.txt new file mode 100644 index 0000000..c5f5231 --- /dev/null +++ b/Samples/GroveLEDButton/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.8) +project (grove-led-button C) + +add_subdirectory("../../MT3620_Grove_Shield_Library" out) +# Create executable +add_executable (${PROJECT_NAME} main.c) +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c MT3620_Grove_Shield_Library) + +# Add MakeImage post-build command +include (${AZURE_SPHERE_MAKE_IMAGE_FILE}) diff --git a/Samples/GroveLEDButton/CMakeSettings.json b/Samples/GroveLEDButton/CMakeSettings.json new file mode 100644 index 0000000..c7a8671 --- /dev/null +++ b/Samples/GroveLEDButton/CMakeSettings.json @@ -0,0 +1,57 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} diff --git a/Samples/GroveLEDButton/GroveLEDButton.sln b/Samples/GroveLEDButton/GroveLEDButton.sln deleted file mode 100644 index 280634e..0000000 --- a/Samples/GroveLEDButton/GroveLEDButton.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GroveLEDButton", "GroveLEDButton\GroveLEDButton.vcxproj", "{645E5FCA-2649-47DD-8FDA-EE9B785EF3E5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "..\..\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {645E5FCA-2649-47DD-8FDA-EE9B785EF3E5}.Debug|ARM.ActiveCfg = Debug|ARM - {645E5FCA-2649-47DD-8FDA-EE9B785EF3E5}.Debug|ARM.Build.0 = Debug|ARM - {645E5FCA-2649-47DD-8FDA-EE9B785EF3E5}.Release|ARM.ActiveCfg = Release|ARM - {645E5FCA-2649-47DD-8FDA-EE9B785EF3E5}.Release|ARM.Build.0 = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.Build.0 = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {1C988763-B1AC-41EE-B393-067A689A6E04} - EndGlobalSection -EndGlobal diff --git a/Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj b/Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj deleted file mode 100644 index 5c768bc..0000000 --- a/Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - {645e5fca-2649-47dd-8fda-ee9b785ef3e5} - AzureSphere - GroveLEDButton - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - - - - true - - - false - - - - - - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - - - - - - - -Werror=implicit-function-declaration %(AdditionalOptions) - E:\workspace\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library;%(AdditionalIncludeDirectories) - - - applibs;pthread;gcc_s;c - -Wl,--no-undefined -nodefaultlibs %(AdditionalOptions) - - - \ No newline at end of file diff --git a/Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj.filters b/Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj.filters deleted file mode 100644 index ad59245..0000000 --- a/Samples/GroveLEDButton/GroveLEDButton/GroveLEDButton.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - - Header Files - - - \ No newline at end of file diff --git a/Samples/GroveLEDButton/GroveLEDButton/applibs_versions.h b/Samples/GroveLEDButton/GroveLEDButton/applibs_versions.h deleted file mode 100644 index 670fcb4..0000000 --- a/Samples/GroveLEDButton/GroveLEDButton/applibs_versions.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -// This header defines which struct versions will be used for applibs APIs. -#define WIFICONFIG_STRUCTS_VERSION 1 -#define UART_STRUCTS_VERSION 1 \ No newline at end of file diff --git a/Samples/GroveLEDButton/GroveLEDButton/mt3620_rdb.h b/Samples/GroveLEDButton/GroveLEDButton/mt3620_rdb.h deleted file mode 100644 index 6c5b2f0..0000000 --- a/Samples/GroveLEDButton/GroveLEDButton/mt3620_rdb.h +++ /dev/null @@ -1,162 +0,0 @@ -/// This header contains the peripheral pinout definitions for the -/// MT3620 Reference Development Board (RDB) -#pragma once - -#include -#include - -/// LED 1 Red channel is GPIO8. -#define MT3620_RDB_LED1_RED MT3620_GPIO8 - -/// LED 1 Green channel is GPIO9. -#define MT3620_RDB_LED1_GREEN MT3620_GPIO9 - -/// LED 1 Blue channel is GPIO10. -#define MT3620_RDB_LED1_BLUE MT3620_GPIO10 - -/// LED 2 Red channel is GPIO15. -#define MT3620_RDB_LED2_RED MT3620_GPIO15 - -/// LED 2 Green channel is GPIO16. -#define MT3620_RDB_LED2_GREEN MT3620_GPIO16 - -/// LED 2 Blue channel is GPIO17. -#define MT3620_RDB_LED2_BLUE MT3620_GPIO17 - -/// LED 3 Red channel is GPIO18. -#define MT3620_RDB_LED3_RED MT3620_GPIO18 - -/// LED 3 Green channel is GPIO19. -#define MT3620_RDB_LED3_GREEN MT3620_GPIO19 - -/// LED 3 Blue channel is GPIO20. -#define MT3620_RDB_LED3_BLUE MT3620_GPIO20 - -/// LED 4 Red channel is GPIO21. -#define MT3620_RDB_LED4_RED MT3620_GPIO21 - -/// LED 4 Green channel is GPIO22. -#define MT3620_RDB_LED4_GREEN MT3620_GPIO22 - -/// LED 4 Blue channel is GPIO23. -#define MT3620_RDB_LED4_BLUE MT3620_GPIO23 - -/// Status LED Red channel is GPIO45. -#define MT3620_RDB_STATUS_LED_RED MT3620_GPIO45 - -/// Status LED Green channel is GPIO46. -#define MT3620_RDB_STATUS_LED_GREEN MT3620_GPIO46 - -/// Status LED Blue channel is GPIO47. -#define MT3620_RDB_STATUS_LED_BLUE MT3620_GPIO47 - -/// Networking LED Red channel is GPIO48. -#define MT3620_RDB_NETWORKING_LED_RED MT3620_GPIO48 - -/// Networking LED Green channel is GPIO14. -#define MT3620_RDB_NETWORKING_LED_GREEN MT3620_GPIO14 - -/// Networking LED Blue channel is GPIO11. -#define MT3620_RDB_NETWORKING_LED_BLUE MT3620_GPIO11 - -/// Button A is GPIO12. -#define MT3620_RDB_BUTTON_A MT3620_GPIO12 - -/// Button B is GPIO13. -#define MT3620_RDB_BUTTON_B MT3620_GPIO13 - -// Header 1, pin 1 is SYS_RST -// Header 1, pin 2 is GND - -/// GPIO59 is exposed on header 1, pin 3 -#define MT3620_RDB_HEADER1_PIN3_GPIO MT3620_GPIO59 - -/// GPIO0 is exposed on header 1, pin 4 -#define MT3620_RDB_HEADER1_PIN4_GPIO MT3620_GPIO0 - -/// GPIO56 is exposed on header 1, pin 5 -#define MT3620_RDB_HEADER1_PIN5_GPIO MT3620_GPIO56 - -/// GPIO1 is exposed on header 1, pin 6 -#define MT3620_RDB_HEADER1_PIN6_GPIO MT3620_GPIO1 - -/// GPIO58 is exposed on header 1, pin 7 -#define MT3620_RDB_HEADER1_PIN7_GPIO MT3620_GPIO58 - -/// GPIO2 is exposed on header 1, pin 8 -#define MT3620_RDB_HEADER1_PIN8_GPIO MT3620_GPIO2 - -/// GPIO57 is exposed on header 1, pin 9 -#define MT3620_RDB_HEADER1_PIN9_GPIO MT3620_GPIO57 - -/// GPIO3 is exposed on header 1, pin 10 -#define MT3620_RDB_HEADER1_PIN10_GPIO MT3620_GPIO3 - -/// GPIO60 is exposed on header 1, pin 11 -#define MT3620_RDB_HEADER1_PIN11_GPIO MT3620_GPIO60 - -/// GPIO4 is exposed on header 1, pin 12 -#define MT3620_RDB_HEADER1_PIN12_GPIO MT3620_GPIO4 - -// Header 2, pins 1, 3, 5, 7 are only supported as the ISU0 UART -#define MT3620_RDB_HEADER2_ISU0_UART MT3620_UART_ISU0 - -// Header 2, pin 2 is GND - -/// GPIO5 is exposed on header 2, pin 4 -#define MT3620_RDB_HEADER2_PIN4_GPIO MT3620_GPIO5 - -/// GPIO6 is exposed on header 2, pin 6 -#define MT3620_RDB_HEADER2_PIN6_GPIO MT3620_GPIO6 - -/// GPIO7 is exposed on header 2, pin 8 -#define MT3620_RDB_HEADER2_PIN8_GPIO MT3620_GPIO7 - -/// GPIO30 is exposed on header 2, pin 9 -#define MT3620_RDB_HEADER2_PIN9_GPIO MT3620_GPIO30 - -// Header 2, pin 10 is ADC VREF - -/// GPIO41 is exposed on header 2, pin 11 -#define MT3620_RDB_HEADER2_PIN11_GPIO MT3620_GPIO41 - -/// GPIO43 is exposed on header 2, pin 12 -#define MT3620_RDB_HEADER2_PIN12_GPIO MT3620_GPIO43 - -/// GPIO42 is exposed on header 2, pin 13 -#define MT3620_RDB_HEADER2_PIN13_GPIO MT3620_GPIO42 - -/// GPIO44 is exposed on header 2, pin 14 -#define MT3620_RDB_HEADER2_PIN14_GPIO MT3620_GPIO44 - -// Header 3, pin 1 is 5V -// Header 3, pin 2 is GND -// Header 3, pin 3 is 3V3 -// Header 3, pin 4 is RTC_WAKEUP - -// Header 3, pin 6 is IO0 UART TX -// Header 3, pin 8 is IO1 UART TX -// Header 3, pin 10 is PMU EN - -// Header 3, pins 5, 7, 9, 11 are only supported as the ISU3 UART -#define MT3620_RDB_HEADER3_ISU3_UART MT3620_UART_ISU3 - -/// GPIO70 is exposed on header 3, pin 12 -#define MT3620_RDB_HEADER3_PIN12_GPIO MT3620_GPIO70 - -// Header 4, pin 1 is SWDIO -// Header 4, pin 2 is GND -// Header 4, pin 3 is SWCLK -// Header 4, pin 4 is SWO - -// Header 4, pins 5, 7, 9, 11 are only supported as the ISU1 UART -#define MT3620_RDB_HEADER4_ISU1_UART MT3620_UART_ISU1 - -// Header 4, pins 6, 8, 10, 12 are only supported as the ISU2 UART -#define MT3620_RDB_HEADER4_ISU2_UART MT3620_UART_ISU2 - -/// GPIO35 is exposed on header 4, pin 13 -#define MT3620_RDB_HEADER4_PIN13_GPIO MT3620_GPIO35 - -/// GPIO40 is exposed on header 4, pin 14 -#define MT3620_RDB_HEADER4_PIN14_GPIO MT3620_GPIO40 diff --git a/Samples/GroveLEDButton/GroveLEDButton/app_manifest.json b/Samples/GroveLEDButton/app_manifest.json similarity index 53% rename from Samples/GroveLEDButton/GroveLEDButton/app_manifest.json rename to Samples/GroveLEDButton/app_manifest.json index 6f9806e..4bb0fd8 100644 --- a/Samples/GroveLEDButton/GroveLEDButton/app_manifest.json +++ b/Samples/GroveLEDButton/app_manifest.json @@ -1,14 +1,13 @@ { "SchemaVersion": 1, - "Name" : "GroveLEDButton", - "ComponentId" : "fda1b0a6-e2f0-47b1-b0bd-161933bd3479", + "Name": "GroveLEDButton", + "ComponentId": "fda1b0a6-e2f0-47b1-b0bd-161933bd3479", "EntryPoint": "/bin/app", "CmdArgs": [], - "TargetApplicationRuntimeVersion": 1, "Capabilities": { - "AllowedConnections": [], "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": false - } -} \ No newline at end of file + "AllowedApplicationConnections": [] + }, + "ApplicationType": "Default" +} diff --git a/Samples/GroveLEDButton/applibs_versions.h b/Samples/GroveLEDButton/applibs_versions.h new file mode 100644 index 0000000..4078fb7 --- /dev/null +++ b/Samples/GroveLEDButton/applibs_versions.h @@ -0,0 +1,25 @@ +#pragma once + +/// +/// This identifier should be defined before including any of the networking-related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define NETWORKING_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the Wi-Fi related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define WIFICONFIG_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the UART-related header files. +/// It indicates which version of the UART data structures the application uses. +/// +#define UART_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the SPI-related header files. +/// It indicates which version of the SPI data structures the application uses. +/// +#define SPI_STRUCTS_VERSION 1 diff --git a/Samples/GroveLEDButton/launch.vs.json b/Samples/GroveLEDButton/launch.vs.json new file mode 100644 index 0000000..4dcc310 --- /dev/null +++ b/Samples/GroveLEDButton/launch.vs.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "azurespheredbg", + "name": "GDB Debugger (HLCore)", + "project": "CMakeLists.txt", + "inheritEnvironments": [ + "AzureSphere" + ], + "customLauncher": "AzureSphereLaunchOptions", + "workingDirectory": "${workspaceRoot}", + "applicationPath": "${debugInfo.target}", + "imagePath": "${debugInfo.targetImage}", + "targetCore": "HLCore", + "targetApiSet": "${env.AzureSphereTargetApiSet}", + "partnerComponents": [] + } + ] +} diff --git a/Samples/GroveLEDButton/GroveLEDButton/main.c b/Samples/GroveLEDButton/main.c similarity index 90% rename from Samples/GroveLEDButton/GroveLEDButton/main.c rename to Samples/GroveLEDButton/main.c index 0d96057..450af52 100644 --- a/Samples/GroveLEDButton/GroveLEDButton/main.c +++ b/Samples/GroveLEDButton/main.c @@ -4,14 +4,12 @@ #include #include -// applibs_versions.h defines the API struct versions to use for applibs APIs. -#include "applibs_versions.h" #include +#include -#include "mt3620_rdb.h" +#include "../../MT3620_Grove_Shield_Library/Grove.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/GroveLEDButton.h" -#include "Grove.h" -#include "Sensors/GroveLEDButton.h" // This C application for the MT3620 Reference Development Board (Azure Sphere) // outputs a string every second to Visual Studio's Device Output window diff --git a/Samples/GroveLightSensor/.gitignore b/Samples/GroveLightSensor/.gitignore new file mode 100644 index 0000000..f60a954 --- /dev/null +++ b/Samples/GroveLightSensor/.gitignore @@ -0,0 +1,3 @@ +# Ignore output directories +/out/ +/install/ diff --git a/Samples/GroveLightSensor/.vscode/c_cpp_properties.json b/Samples/GroveLightSensor/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..393fe20 --- /dev/null +++ b/Samples/GroveLightSensor/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64", + "configurationProvider": "vector-of-bool.cmake-tools", + "compileCommands": "${workspaceFolder}/out/Debug-3/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Samples/GroveLightSensor/.vscode/launch.json b/Samples/GroveLightSensor/.vscode/launch.json new file mode 100644 index 0000000..dae7c0c --- /dev/null +++ b/Samples/GroveLightSensor/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch for Azure Sphere High-Level Applications (gdb)", + "type": "azurespheredbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "targetCore": "HLCore", + "partnerComponents": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Samples/GroveLightSensor/.vscode/settings.json b/Samples/GroveLightSensor/.vscode/settings.json new file mode 100644 index 0000000..7615f4f --- /dev/null +++ b/Samples/GroveLightSensor/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cmake.generator": "Ninja", + "cmake.buildDirectory": "${workspaceRoot}/out/${buildType}-${command:azuresphere.AzureSphereTargetApiSet}", + "cmake.buildToolArgs": [ "-v" ], + "cmake.configureArgs": [ "--no-warn-unused-cli" ], + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake", + "AZURE_SPHERE_TARGET_API_SET": "3" + }, + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/Samples/GroveLightSensor/CMakeLists.txt b/Samples/GroveLightSensor/CMakeLists.txt new file mode 100644 index 0000000..6bb7d0e --- /dev/null +++ b/Samples/GroveLightSensor/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.8) +project (grove-light-sensor C) + +add_subdirectory("../../MT3620_Grove_Shield_Library" out) +# Create executable +add_executable (${PROJECT_NAME} main.c) +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c MT3620_Grove_Shield_Library) + +# Add MakeImage post-build command +include (${AZURE_SPHERE_MAKE_IMAGE_FILE}) diff --git a/Samples/GroveLightSensor/CMakeSettings.json b/Samples/GroveLightSensor/CMakeSettings.json new file mode 100644 index 0000000..c7a8671 --- /dev/null +++ b/Samples/GroveLightSensor/CMakeSettings.json @@ -0,0 +1,57 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} diff --git a/Samples/GroveLightSensor/GroveLightSensor.sln b/Samples/GroveLightSensor/GroveLightSensor.sln deleted file mode 100644 index 51ab905..0000000 --- a/Samples/GroveLightSensor/GroveLightSensor.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GroveLightSensor", "GroveLightSensor\GroveLightSensor.vcxproj", "{B36B85F7-18EA-4E87-B41A-404F6F78DA1F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "..\..\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B36B85F7-18EA-4E87-B41A-404F6F78DA1F}.Debug|ARM.ActiveCfg = Debug|ARM - {B36B85F7-18EA-4E87-B41A-404F6F78DA1F}.Debug|ARM.Build.0 = Debug|ARM - {B36B85F7-18EA-4E87-B41A-404F6F78DA1F}.Release|ARM.ActiveCfg = Release|ARM - {B36B85F7-18EA-4E87-B41A-404F6F78DA1F}.Release|ARM.Build.0 = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.Build.0 = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {5640A944-3D67-4FDD-9E53-104DAD7739E7} - EndGlobalSection -EndGlobal diff --git a/Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj b/Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj deleted file mode 100644 index 3fea49c..0000000 --- a/Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - {b36b85f7-18ea-4e87-b41a-404f6f78da1f} - AzureSphere - GroveLightSensor - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - - - - true - - - false - - - - - - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - - - - - - - -Werror=implicit-function-declaration %(AdditionalOptions) - E:\workspace\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library;%(AdditionalIncludeDirectories) - - - applibs;pthread;gcc_s;c - -Wl,--no-undefined -nodefaultlibs %(AdditionalOptions) - - - \ No newline at end of file diff --git a/Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj.filters b/Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj.filters deleted file mode 100644 index ad59245..0000000 --- a/Samples/GroveLightSensor/GroveLightSensor/GroveLightSensor.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - - Header Files - - - \ No newline at end of file diff --git a/Samples/GroveLightSensor/GroveLightSensor/applibs_versions.h b/Samples/GroveLightSensor/GroveLightSensor/applibs_versions.h deleted file mode 100644 index 670fcb4..0000000 --- a/Samples/GroveLightSensor/GroveLightSensor/applibs_versions.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -// This header defines which struct versions will be used for applibs APIs. -#define WIFICONFIG_STRUCTS_VERSION 1 -#define UART_STRUCTS_VERSION 1 \ No newline at end of file diff --git a/Samples/GroveLightSensor/GroveLightSensor/mt3620_rdb.h b/Samples/GroveLightSensor/GroveLightSensor/mt3620_rdb.h deleted file mode 100644 index 6c5b2f0..0000000 --- a/Samples/GroveLightSensor/GroveLightSensor/mt3620_rdb.h +++ /dev/null @@ -1,162 +0,0 @@ -/// This header contains the peripheral pinout definitions for the -/// MT3620 Reference Development Board (RDB) -#pragma once - -#include -#include - -/// LED 1 Red channel is GPIO8. -#define MT3620_RDB_LED1_RED MT3620_GPIO8 - -/// LED 1 Green channel is GPIO9. -#define MT3620_RDB_LED1_GREEN MT3620_GPIO9 - -/// LED 1 Blue channel is GPIO10. -#define MT3620_RDB_LED1_BLUE MT3620_GPIO10 - -/// LED 2 Red channel is GPIO15. -#define MT3620_RDB_LED2_RED MT3620_GPIO15 - -/// LED 2 Green channel is GPIO16. -#define MT3620_RDB_LED2_GREEN MT3620_GPIO16 - -/// LED 2 Blue channel is GPIO17. -#define MT3620_RDB_LED2_BLUE MT3620_GPIO17 - -/// LED 3 Red channel is GPIO18. -#define MT3620_RDB_LED3_RED MT3620_GPIO18 - -/// LED 3 Green channel is GPIO19. -#define MT3620_RDB_LED3_GREEN MT3620_GPIO19 - -/// LED 3 Blue channel is GPIO20. -#define MT3620_RDB_LED3_BLUE MT3620_GPIO20 - -/// LED 4 Red channel is GPIO21. -#define MT3620_RDB_LED4_RED MT3620_GPIO21 - -/// LED 4 Green channel is GPIO22. -#define MT3620_RDB_LED4_GREEN MT3620_GPIO22 - -/// LED 4 Blue channel is GPIO23. -#define MT3620_RDB_LED4_BLUE MT3620_GPIO23 - -/// Status LED Red channel is GPIO45. -#define MT3620_RDB_STATUS_LED_RED MT3620_GPIO45 - -/// Status LED Green channel is GPIO46. -#define MT3620_RDB_STATUS_LED_GREEN MT3620_GPIO46 - -/// Status LED Blue channel is GPIO47. -#define MT3620_RDB_STATUS_LED_BLUE MT3620_GPIO47 - -/// Networking LED Red channel is GPIO48. -#define MT3620_RDB_NETWORKING_LED_RED MT3620_GPIO48 - -/// Networking LED Green channel is GPIO14. -#define MT3620_RDB_NETWORKING_LED_GREEN MT3620_GPIO14 - -/// Networking LED Blue channel is GPIO11. -#define MT3620_RDB_NETWORKING_LED_BLUE MT3620_GPIO11 - -/// Button A is GPIO12. -#define MT3620_RDB_BUTTON_A MT3620_GPIO12 - -/// Button B is GPIO13. -#define MT3620_RDB_BUTTON_B MT3620_GPIO13 - -// Header 1, pin 1 is SYS_RST -// Header 1, pin 2 is GND - -/// GPIO59 is exposed on header 1, pin 3 -#define MT3620_RDB_HEADER1_PIN3_GPIO MT3620_GPIO59 - -/// GPIO0 is exposed on header 1, pin 4 -#define MT3620_RDB_HEADER1_PIN4_GPIO MT3620_GPIO0 - -/// GPIO56 is exposed on header 1, pin 5 -#define MT3620_RDB_HEADER1_PIN5_GPIO MT3620_GPIO56 - -/// GPIO1 is exposed on header 1, pin 6 -#define MT3620_RDB_HEADER1_PIN6_GPIO MT3620_GPIO1 - -/// GPIO58 is exposed on header 1, pin 7 -#define MT3620_RDB_HEADER1_PIN7_GPIO MT3620_GPIO58 - -/// GPIO2 is exposed on header 1, pin 8 -#define MT3620_RDB_HEADER1_PIN8_GPIO MT3620_GPIO2 - -/// GPIO57 is exposed on header 1, pin 9 -#define MT3620_RDB_HEADER1_PIN9_GPIO MT3620_GPIO57 - -/// GPIO3 is exposed on header 1, pin 10 -#define MT3620_RDB_HEADER1_PIN10_GPIO MT3620_GPIO3 - -/// GPIO60 is exposed on header 1, pin 11 -#define MT3620_RDB_HEADER1_PIN11_GPIO MT3620_GPIO60 - -/// GPIO4 is exposed on header 1, pin 12 -#define MT3620_RDB_HEADER1_PIN12_GPIO MT3620_GPIO4 - -// Header 2, pins 1, 3, 5, 7 are only supported as the ISU0 UART -#define MT3620_RDB_HEADER2_ISU0_UART MT3620_UART_ISU0 - -// Header 2, pin 2 is GND - -/// GPIO5 is exposed on header 2, pin 4 -#define MT3620_RDB_HEADER2_PIN4_GPIO MT3620_GPIO5 - -/// GPIO6 is exposed on header 2, pin 6 -#define MT3620_RDB_HEADER2_PIN6_GPIO MT3620_GPIO6 - -/// GPIO7 is exposed on header 2, pin 8 -#define MT3620_RDB_HEADER2_PIN8_GPIO MT3620_GPIO7 - -/// GPIO30 is exposed on header 2, pin 9 -#define MT3620_RDB_HEADER2_PIN9_GPIO MT3620_GPIO30 - -// Header 2, pin 10 is ADC VREF - -/// GPIO41 is exposed on header 2, pin 11 -#define MT3620_RDB_HEADER2_PIN11_GPIO MT3620_GPIO41 - -/// GPIO43 is exposed on header 2, pin 12 -#define MT3620_RDB_HEADER2_PIN12_GPIO MT3620_GPIO43 - -/// GPIO42 is exposed on header 2, pin 13 -#define MT3620_RDB_HEADER2_PIN13_GPIO MT3620_GPIO42 - -/// GPIO44 is exposed on header 2, pin 14 -#define MT3620_RDB_HEADER2_PIN14_GPIO MT3620_GPIO44 - -// Header 3, pin 1 is 5V -// Header 3, pin 2 is GND -// Header 3, pin 3 is 3V3 -// Header 3, pin 4 is RTC_WAKEUP - -// Header 3, pin 6 is IO0 UART TX -// Header 3, pin 8 is IO1 UART TX -// Header 3, pin 10 is PMU EN - -// Header 3, pins 5, 7, 9, 11 are only supported as the ISU3 UART -#define MT3620_RDB_HEADER3_ISU3_UART MT3620_UART_ISU3 - -/// GPIO70 is exposed on header 3, pin 12 -#define MT3620_RDB_HEADER3_PIN12_GPIO MT3620_GPIO70 - -// Header 4, pin 1 is SWDIO -// Header 4, pin 2 is GND -// Header 4, pin 3 is SWCLK -// Header 4, pin 4 is SWO - -// Header 4, pins 5, 7, 9, 11 are only supported as the ISU1 UART -#define MT3620_RDB_HEADER4_ISU1_UART MT3620_UART_ISU1 - -// Header 4, pins 6, 8, 10, 12 are only supported as the ISU2 UART -#define MT3620_RDB_HEADER4_ISU2_UART MT3620_UART_ISU2 - -/// GPIO35 is exposed on header 4, pin 13 -#define MT3620_RDB_HEADER4_PIN13_GPIO MT3620_GPIO35 - -/// GPIO40 is exposed on header 4, pin 14 -#define MT3620_RDB_HEADER4_PIN14_GPIO MT3620_GPIO40 diff --git a/Samples/GroveLightSensor/GroveLightSensor/app_manifest.json b/Samples/GroveLightSensor/app_manifest.json similarity index 52% rename from Samples/GroveLightSensor/GroveLightSensor/app_manifest.json rename to Samples/GroveLightSensor/app_manifest.json index 8afb20e..855a31f 100644 --- a/Samples/GroveLightSensor/GroveLightSensor/app_manifest.json +++ b/Samples/GroveLightSensor/app_manifest.json @@ -1,14 +1,13 @@ { "SchemaVersion": 1, - "Name" : "GroveLightSensor", - "ComponentId" : "b0435fed-fb3d-4518-9158-6fe47fd49754", + "Name": "GroveLightSensor", + "ComponentId": "b0435fed-fb3d-4518-9158-6fe47fd49754", "EntryPoint": "/bin/app", "CmdArgs": [], - "TargetApplicationRuntimeVersion": 1, "Capabilities": { - "AllowedConnections": [], "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": false - } -} \ No newline at end of file + "AllowedApplicationConnections": [] + }, + "ApplicationType": "Default" +} diff --git a/Samples/GroveLightSensor/applibs_versions.h b/Samples/GroveLightSensor/applibs_versions.h new file mode 100644 index 0000000..4078fb7 --- /dev/null +++ b/Samples/GroveLightSensor/applibs_versions.h @@ -0,0 +1,25 @@ +#pragma once + +/// +/// This identifier should be defined before including any of the networking-related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define NETWORKING_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the Wi-Fi related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define WIFICONFIG_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the UART-related header files. +/// It indicates which version of the UART data structures the application uses. +/// +#define UART_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the SPI-related header files. +/// It indicates which version of the SPI data structures the application uses. +/// +#define SPI_STRUCTS_VERSION 1 diff --git a/Samples/GroveLightSensor/launch.vs.json b/Samples/GroveLightSensor/launch.vs.json new file mode 100644 index 0000000..4dcc310 --- /dev/null +++ b/Samples/GroveLightSensor/launch.vs.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "azurespheredbg", + "name": "GDB Debugger (HLCore)", + "project": "CMakeLists.txt", + "inheritEnvironments": [ + "AzureSphere" + ], + "customLauncher": "AzureSphereLaunchOptions", + "workingDirectory": "${workspaceRoot}", + "applicationPath": "${debugInfo.target}", + "imagePath": "${debugInfo.targetImage}", + "targetCore": "HLCore", + "targetApiSet": "${env.AzureSphereTargetApiSet}", + "partnerComponents": [] + } + ] +} diff --git a/Samples/GroveLightSensor/GroveLightSensor/main.c b/Samples/GroveLightSensor/main.c similarity index 86% rename from Samples/GroveLightSensor/GroveLightSensor/main.c rename to Samples/GroveLightSensor/main.c index 555159a..4074392 100644 --- a/Samples/GroveLightSensor/GroveLightSensor/main.c +++ b/Samples/GroveLightSensor/main.c @@ -4,15 +4,13 @@ #include #include -// applibs_versions.h defines the API struct versions to use for applibs APIs. -#include "applibs_versions.h" #include +#include -#include "mt3620_rdb.h" +#include "../../MT3620_Grove_Shield_Library/Grove.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/GroveLightSensor.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/GroveAD7992.h" -#include "Grove.h" -#include "Sensors/GroveLightSensor.h" -#include "Sensors/GroveAD7992.h" // This C application for the MT3620 Reference Development Board (Azure Sphere) // outputs a string every second to Visual Studio's Device Output window @@ -46,7 +44,7 @@ int main(int argc, char *argv[]) // Initialize Grove Shield int i2cFd; - GroveShield_Initialize(&i2cFd, 9600); + GroveShield_Initialize(&i2cFd, 115200); // Initialize Light Sensor void *light = GroveLightSensor_Init(i2cFd, 0); diff --git a/Samples/GroveRotaryAngleSensor/.gitignore b/Samples/GroveRotaryAngleSensor/.gitignore new file mode 100644 index 0000000..f60a954 --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/.gitignore @@ -0,0 +1,3 @@ +# Ignore output directories +/out/ +/install/ diff --git a/Samples/GroveRotaryAngleSensor/.vscode/c_cpp_properties.json b/Samples/GroveRotaryAngleSensor/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..393fe20 --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64", + "configurationProvider": "vector-of-bool.cmake-tools", + "compileCommands": "${workspaceFolder}/out/Debug-3/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Samples/GroveRotaryAngleSensor/.vscode/launch.json b/Samples/GroveRotaryAngleSensor/.vscode/launch.json new file mode 100644 index 0000000..dae7c0c --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch for Azure Sphere High-Level Applications (gdb)", + "type": "azurespheredbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "targetCore": "HLCore", + "partnerComponents": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Samples/GroveRotaryAngleSensor/.vscode/settings.json b/Samples/GroveRotaryAngleSensor/.vscode/settings.json new file mode 100644 index 0000000..7615f4f --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cmake.generator": "Ninja", + "cmake.buildDirectory": "${workspaceRoot}/out/${buildType}-${command:azuresphere.AzureSphereTargetApiSet}", + "cmake.buildToolArgs": [ "-v" ], + "cmake.configureArgs": [ "--no-warn-unused-cli" ], + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake", + "AZURE_SPHERE_TARGET_API_SET": "3" + }, + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/Samples/GroveRotaryAngleSensor/CMakeLists.txt b/Samples/GroveRotaryAngleSensor/CMakeLists.txt new file mode 100644 index 0000000..8a7b49f --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.8) +project (grove-4rotart-angle-sensor C) + +add_subdirectory("../../MT3620_Grove_Shield_Library" out) +# Create executable +add_executable (${PROJECT_NAME} main.c) +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c MT3620_Grove_Shield_Library) + +# Add MakeImage post-build command +include (${AZURE_SPHERE_MAKE_IMAGE_FILE}) diff --git a/Samples/GroveRotaryAngleSensor/CMakeSettings.json b/Samples/GroveRotaryAngleSensor/CMakeSettings.json new file mode 100644 index 0000000..c7a8671 --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/CMakeSettings.json @@ -0,0 +1,57 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} diff --git a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor.sln b/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor.sln deleted file mode 100644 index a93e564..0000000 --- a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GroveRotaryAngleSensor", "GroveRotaryAngleSensor\GroveRotaryAngleSensor.vcxproj", "{8CC219E5-71FB-4313-9F02-7B7BB06FB8C1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "..\..\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8CC219E5-71FB-4313-9F02-7B7BB06FB8C1}.Debug|ARM.ActiveCfg = Debug|ARM - {8CC219E5-71FB-4313-9F02-7B7BB06FB8C1}.Debug|ARM.Build.0 = Debug|ARM - {8CC219E5-71FB-4313-9F02-7B7BB06FB8C1}.Release|ARM.ActiveCfg = Release|ARM - {8CC219E5-71FB-4313-9F02-7B7BB06FB8C1}.Release|ARM.Build.0 = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.Build.0 = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {5C200927-2433-40A5-9577-840A17E78B95} - EndGlobalSection -EndGlobal diff --git a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj b/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj deleted file mode 100644 index f51e126..0000000 --- a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - {8cc219e5-71fb-4313-9f02-7b7bb06fb8c1} - AzureSphere - GroveRotaryAngleSensor - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - - - - true - - - false - - - - - - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - - - - - - - -Werror=implicit-function-declaration %(AdditionalOptions) - E:\workspace\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library;%(AdditionalIncludeDirectories) - - - applibs;pthread;gcc_s;c - -Wl,--no-undefined -nodefaultlibs %(AdditionalOptions) - - - \ No newline at end of file diff --git a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj.filters b/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj.filters deleted file mode 100644 index ad59245..0000000 --- a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/GroveRotaryAngleSensor.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - - Header Files - - - \ No newline at end of file diff --git a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/applibs_versions.h b/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/applibs_versions.h deleted file mode 100644 index 670fcb4..0000000 --- a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/applibs_versions.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -// This header defines which struct versions will be used for applibs APIs. -#define WIFICONFIG_STRUCTS_VERSION 1 -#define UART_STRUCTS_VERSION 1 \ No newline at end of file diff --git a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/mt3620_rdb.h b/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/mt3620_rdb.h deleted file mode 100644 index 6c5b2f0..0000000 --- a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/mt3620_rdb.h +++ /dev/null @@ -1,162 +0,0 @@ -/// This header contains the peripheral pinout definitions for the -/// MT3620 Reference Development Board (RDB) -#pragma once - -#include -#include - -/// LED 1 Red channel is GPIO8. -#define MT3620_RDB_LED1_RED MT3620_GPIO8 - -/// LED 1 Green channel is GPIO9. -#define MT3620_RDB_LED1_GREEN MT3620_GPIO9 - -/// LED 1 Blue channel is GPIO10. -#define MT3620_RDB_LED1_BLUE MT3620_GPIO10 - -/// LED 2 Red channel is GPIO15. -#define MT3620_RDB_LED2_RED MT3620_GPIO15 - -/// LED 2 Green channel is GPIO16. -#define MT3620_RDB_LED2_GREEN MT3620_GPIO16 - -/// LED 2 Blue channel is GPIO17. -#define MT3620_RDB_LED2_BLUE MT3620_GPIO17 - -/// LED 3 Red channel is GPIO18. -#define MT3620_RDB_LED3_RED MT3620_GPIO18 - -/// LED 3 Green channel is GPIO19. -#define MT3620_RDB_LED3_GREEN MT3620_GPIO19 - -/// LED 3 Blue channel is GPIO20. -#define MT3620_RDB_LED3_BLUE MT3620_GPIO20 - -/// LED 4 Red channel is GPIO21. -#define MT3620_RDB_LED4_RED MT3620_GPIO21 - -/// LED 4 Green channel is GPIO22. -#define MT3620_RDB_LED4_GREEN MT3620_GPIO22 - -/// LED 4 Blue channel is GPIO23. -#define MT3620_RDB_LED4_BLUE MT3620_GPIO23 - -/// Status LED Red channel is GPIO45. -#define MT3620_RDB_STATUS_LED_RED MT3620_GPIO45 - -/// Status LED Green channel is GPIO46. -#define MT3620_RDB_STATUS_LED_GREEN MT3620_GPIO46 - -/// Status LED Blue channel is GPIO47. -#define MT3620_RDB_STATUS_LED_BLUE MT3620_GPIO47 - -/// Networking LED Red channel is GPIO48. -#define MT3620_RDB_NETWORKING_LED_RED MT3620_GPIO48 - -/// Networking LED Green channel is GPIO14. -#define MT3620_RDB_NETWORKING_LED_GREEN MT3620_GPIO14 - -/// Networking LED Blue channel is GPIO11. -#define MT3620_RDB_NETWORKING_LED_BLUE MT3620_GPIO11 - -/// Button A is GPIO12. -#define MT3620_RDB_BUTTON_A MT3620_GPIO12 - -/// Button B is GPIO13. -#define MT3620_RDB_BUTTON_B MT3620_GPIO13 - -// Header 1, pin 1 is SYS_RST -// Header 1, pin 2 is GND - -/// GPIO59 is exposed on header 1, pin 3 -#define MT3620_RDB_HEADER1_PIN3_GPIO MT3620_GPIO59 - -/// GPIO0 is exposed on header 1, pin 4 -#define MT3620_RDB_HEADER1_PIN4_GPIO MT3620_GPIO0 - -/// GPIO56 is exposed on header 1, pin 5 -#define MT3620_RDB_HEADER1_PIN5_GPIO MT3620_GPIO56 - -/// GPIO1 is exposed on header 1, pin 6 -#define MT3620_RDB_HEADER1_PIN6_GPIO MT3620_GPIO1 - -/// GPIO58 is exposed on header 1, pin 7 -#define MT3620_RDB_HEADER1_PIN7_GPIO MT3620_GPIO58 - -/// GPIO2 is exposed on header 1, pin 8 -#define MT3620_RDB_HEADER1_PIN8_GPIO MT3620_GPIO2 - -/// GPIO57 is exposed on header 1, pin 9 -#define MT3620_RDB_HEADER1_PIN9_GPIO MT3620_GPIO57 - -/// GPIO3 is exposed on header 1, pin 10 -#define MT3620_RDB_HEADER1_PIN10_GPIO MT3620_GPIO3 - -/// GPIO60 is exposed on header 1, pin 11 -#define MT3620_RDB_HEADER1_PIN11_GPIO MT3620_GPIO60 - -/// GPIO4 is exposed on header 1, pin 12 -#define MT3620_RDB_HEADER1_PIN12_GPIO MT3620_GPIO4 - -// Header 2, pins 1, 3, 5, 7 are only supported as the ISU0 UART -#define MT3620_RDB_HEADER2_ISU0_UART MT3620_UART_ISU0 - -// Header 2, pin 2 is GND - -/// GPIO5 is exposed on header 2, pin 4 -#define MT3620_RDB_HEADER2_PIN4_GPIO MT3620_GPIO5 - -/// GPIO6 is exposed on header 2, pin 6 -#define MT3620_RDB_HEADER2_PIN6_GPIO MT3620_GPIO6 - -/// GPIO7 is exposed on header 2, pin 8 -#define MT3620_RDB_HEADER2_PIN8_GPIO MT3620_GPIO7 - -/// GPIO30 is exposed on header 2, pin 9 -#define MT3620_RDB_HEADER2_PIN9_GPIO MT3620_GPIO30 - -// Header 2, pin 10 is ADC VREF - -/// GPIO41 is exposed on header 2, pin 11 -#define MT3620_RDB_HEADER2_PIN11_GPIO MT3620_GPIO41 - -/// GPIO43 is exposed on header 2, pin 12 -#define MT3620_RDB_HEADER2_PIN12_GPIO MT3620_GPIO43 - -/// GPIO42 is exposed on header 2, pin 13 -#define MT3620_RDB_HEADER2_PIN13_GPIO MT3620_GPIO42 - -/// GPIO44 is exposed on header 2, pin 14 -#define MT3620_RDB_HEADER2_PIN14_GPIO MT3620_GPIO44 - -// Header 3, pin 1 is 5V -// Header 3, pin 2 is GND -// Header 3, pin 3 is 3V3 -// Header 3, pin 4 is RTC_WAKEUP - -// Header 3, pin 6 is IO0 UART TX -// Header 3, pin 8 is IO1 UART TX -// Header 3, pin 10 is PMU EN - -// Header 3, pins 5, 7, 9, 11 are only supported as the ISU3 UART -#define MT3620_RDB_HEADER3_ISU3_UART MT3620_UART_ISU3 - -/// GPIO70 is exposed on header 3, pin 12 -#define MT3620_RDB_HEADER3_PIN12_GPIO MT3620_GPIO70 - -// Header 4, pin 1 is SWDIO -// Header 4, pin 2 is GND -// Header 4, pin 3 is SWCLK -// Header 4, pin 4 is SWO - -// Header 4, pins 5, 7, 9, 11 are only supported as the ISU1 UART -#define MT3620_RDB_HEADER4_ISU1_UART MT3620_UART_ISU1 - -// Header 4, pins 6, 8, 10, 12 are only supported as the ISU2 UART -#define MT3620_RDB_HEADER4_ISU2_UART MT3620_UART_ISU2 - -/// GPIO35 is exposed on header 4, pin 13 -#define MT3620_RDB_HEADER4_PIN13_GPIO MT3620_GPIO35 - -/// GPIO40 is exposed on header 4, pin 14 -#define MT3620_RDB_HEADER4_PIN14_GPIO MT3620_GPIO40 diff --git a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/app_manifest.json b/Samples/GroveRotaryAngleSensor/app_manifest.json similarity index 52% rename from Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/app_manifest.json rename to Samples/GroveRotaryAngleSensor/app_manifest.json index 4dad443..c422ae7 100644 --- a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/app_manifest.json +++ b/Samples/GroveRotaryAngleSensor/app_manifest.json @@ -1,14 +1,13 @@ { "SchemaVersion": 1, - "Name" : "GroveRotaryAngleSensor", - "ComponentId" : "1525a362-27a9-43f2-97ac-de8931beb8aa", + "Name": "GroveRotaryAngleSensor", + "ComponentId": "1525a362-27a9-43f2-97ac-de8931beb8aa", "EntryPoint": "/bin/app", "CmdArgs": [], - "TargetApplicationRuntimeVersion": 1, "Capabilities": { - "AllowedConnections": [], "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": false - } -} \ No newline at end of file + "AllowedApplicationConnections": [] + }, + "ApplicationType": "Default" +} diff --git a/Samples/GroveRotaryAngleSensor/applibs_versions.h b/Samples/GroveRotaryAngleSensor/applibs_versions.h new file mode 100644 index 0000000..4078fb7 --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/applibs_versions.h @@ -0,0 +1,25 @@ +#pragma once + +/// +/// This identifier should be defined before including any of the networking-related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define NETWORKING_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the Wi-Fi related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define WIFICONFIG_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the UART-related header files. +/// It indicates which version of the UART data structures the application uses. +/// +#define UART_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the SPI-related header files. +/// It indicates which version of the SPI data structures the application uses. +/// +#define SPI_STRUCTS_VERSION 1 diff --git a/Samples/GroveRotaryAngleSensor/launch.vs.json b/Samples/GroveRotaryAngleSensor/launch.vs.json new file mode 100644 index 0000000..4dcc310 --- /dev/null +++ b/Samples/GroveRotaryAngleSensor/launch.vs.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "azurespheredbg", + "name": "GDB Debugger (HLCore)", + "project": "CMakeLists.txt", + "inheritEnvironments": [ + "AzureSphere" + ], + "customLauncher": "AzureSphereLaunchOptions", + "workingDirectory": "${workspaceRoot}", + "applicationPath": "${debugInfo.target}", + "imagePath": "${debugInfo.targetImage}", + "targetCore": "HLCore", + "targetApiSet": "${env.AzureSphereTargetApiSet}", + "partnerComponents": [] + } + ] +} diff --git a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/main.c b/Samples/GroveRotaryAngleSensor/main.c similarity index 89% rename from Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/main.c rename to Samples/GroveRotaryAngleSensor/main.c index 0f2889d..8515597 100644 --- a/Samples/GroveRotaryAngleSensor/GroveRotaryAngleSensor/main.c +++ b/Samples/GroveRotaryAngleSensor/main.c @@ -4,14 +4,12 @@ #include #include -// applibs_versions.h defines the API struct versions to use for applibs APIs. -#include "applibs_versions.h" #include +#include -#include "mt3620_rdb.h" +#include "../../MT3620_Grove_Shield_Library/Grove.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/GroveRotaryAngleSensor.h" -#include "Grove.h" -#include "Sensors/GroveRotaryAngleSensor.h" // This C application for the MT3620 Reference Development Board (Azure Sphere) // outputs a string every second to Visual Studio's Device Output window diff --git a/Samples/Grove_4_Digital_Display/.gitignore b/Samples/Grove_4_Digital_Display/.gitignore new file mode 100644 index 0000000..5b7a82c --- /dev/null +++ b/Samples/Grove_4_Digital_Display/.gitignore @@ -0,0 +1,3 @@ +# Ignore output directories +out/ +install/ diff --git a/Samples/Grove_4_Digital_Display/.vscode/c_cpp_properties.json b/Samples/Grove_4_Digital_Display/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..393fe20 --- /dev/null +++ b/Samples/Grove_4_Digital_Display/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64", + "configurationProvider": "vector-of-bool.cmake-tools", + "compileCommands": "${workspaceFolder}/out/Debug-3/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Samples/Grove_4_Digital_Display/.vscode/launch.json b/Samples/Grove_4_Digital_Display/.vscode/launch.json new file mode 100644 index 0000000..dae7c0c --- /dev/null +++ b/Samples/Grove_4_Digital_Display/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch for Azure Sphere High-Level Applications (gdb)", + "type": "azurespheredbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "targetCore": "HLCore", + "partnerComponents": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Samples/Grove_4_Digital_Display/.vscode/settings.json b/Samples/Grove_4_Digital_Display/.vscode/settings.json new file mode 100644 index 0000000..7615f4f --- /dev/null +++ b/Samples/Grove_4_Digital_Display/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cmake.generator": "Ninja", + "cmake.buildDirectory": "${workspaceRoot}/out/${buildType}-${command:azuresphere.AzureSphereTargetApiSet}", + "cmake.buildToolArgs": [ "-v" ], + "cmake.configureArgs": [ "--no-warn-unused-cli" ], + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake", + "AZURE_SPHERE_TARGET_API_SET": "3" + }, + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/Samples/Grove_4_Digital_Display/CMakeLists.txt b/Samples/Grove_4_Digital_Display/CMakeLists.txt new file mode 100644 index 0000000..c234188 --- /dev/null +++ b/Samples/Grove_4_Digital_Display/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.8) +project (grove-4-digital-display C) + +add_subdirectory("../../MT3620_Grove_Shield_Library" out) +# Create executable +add_executable (${PROJECT_NAME} main.c) +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c MT3620_Grove_Shield_Library) + +# Add MakeImage post-build command +include (${AZURE_SPHERE_MAKE_IMAGE_FILE}) diff --git a/Samples/Grove_4_Digital_Display/CMakeSettings.json b/Samples/Grove_4_Digital_Display/CMakeSettings.json new file mode 100644 index 0000000..c7a8671 --- /dev/null +++ b/Samples/Grove_4_Digital_Display/CMakeSettings.json @@ -0,0 +1,57 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} diff --git a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display.sln b/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display.sln deleted file mode 100644 index 5bd7c0c..0000000 --- a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Grove_4_Digital_Display", "Grove_4_Digital_Display\Grove_4_Digital_Display.vcxproj", "{1EDF7A18-76C7-4759-87B6-B5819A1360C8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "..\..\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1EDF7A18-76C7-4759-87B6-B5819A1360C8}.Debug|ARM.ActiveCfg = Debug|ARM - {1EDF7A18-76C7-4759-87B6-B5819A1360C8}.Debug|ARM.Build.0 = Debug|ARM - {1EDF7A18-76C7-4759-87B6-B5819A1360C8}.Release|ARM.ActiveCfg = Release|ARM - {1EDF7A18-76C7-4759-87B6-B5819A1360C8}.Release|ARM.Build.0 = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.Build.0 = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {296F75DA-4531-4E9F-80C5-073DEE3FCB69} - EndGlobalSection -EndGlobal diff --git a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj b/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj deleted file mode 100644 index abc90b2..0000000 --- a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - {1edf7a18-76c7-4759-87b6-b5819a1360c8} - AzureSphere - Grove_4_Digital_Display - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - - - - true - - - false - - - - - - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - - - - - - - -Werror=implicit-function-declaration %(AdditionalOptions) - E:\workspace\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library;%(AdditionalIncludeDirectories) - - - applibs;pthread;gcc_s;c - -Wl,--no-undefined -nodefaultlibs %(AdditionalOptions) - - - \ No newline at end of file diff --git a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj.filters b/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj.filters deleted file mode 100644 index ad59245..0000000 --- a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/Grove_4_Digital_Display.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - - Header Files - - - \ No newline at end of file diff --git a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/app_manifest.json b/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/app_manifest.json deleted file mode 100644 index f1d79fd..0000000 --- a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/app_manifest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "SchemaVersion": 1, - "Name" : "Grove_4_Digital_Display", - "ComponentId" : "559650e1-b386-4891-9eb3-a31522bd7489", - "EntryPoint": "/bin/app", - "CmdArgs": [], - "TargetApplicationRuntimeVersion": 1, - "Capabilities": { - "AllowedConnections": [], - "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 4, 5, 57, 58, 11, 14, 48 ], - "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": false - } -} \ No newline at end of file diff --git a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/applibs_versions.h b/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/applibs_versions.h deleted file mode 100644 index 670fcb4..0000000 --- a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/applibs_versions.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -// This header defines which struct versions will be used for applibs APIs. -#define WIFICONFIG_STRUCTS_VERSION 1 -#define UART_STRUCTS_VERSION 1 \ No newline at end of file diff --git a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/mt3620_rdb.h b/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/mt3620_rdb.h deleted file mode 100644 index 6c5b2f0..0000000 --- a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/mt3620_rdb.h +++ /dev/null @@ -1,162 +0,0 @@ -/// This header contains the peripheral pinout definitions for the -/// MT3620 Reference Development Board (RDB) -#pragma once - -#include -#include - -/// LED 1 Red channel is GPIO8. -#define MT3620_RDB_LED1_RED MT3620_GPIO8 - -/// LED 1 Green channel is GPIO9. -#define MT3620_RDB_LED1_GREEN MT3620_GPIO9 - -/// LED 1 Blue channel is GPIO10. -#define MT3620_RDB_LED1_BLUE MT3620_GPIO10 - -/// LED 2 Red channel is GPIO15. -#define MT3620_RDB_LED2_RED MT3620_GPIO15 - -/// LED 2 Green channel is GPIO16. -#define MT3620_RDB_LED2_GREEN MT3620_GPIO16 - -/// LED 2 Blue channel is GPIO17. -#define MT3620_RDB_LED2_BLUE MT3620_GPIO17 - -/// LED 3 Red channel is GPIO18. -#define MT3620_RDB_LED3_RED MT3620_GPIO18 - -/// LED 3 Green channel is GPIO19. -#define MT3620_RDB_LED3_GREEN MT3620_GPIO19 - -/// LED 3 Blue channel is GPIO20. -#define MT3620_RDB_LED3_BLUE MT3620_GPIO20 - -/// LED 4 Red channel is GPIO21. -#define MT3620_RDB_LED4_RED MT3620_GPIO21 - -/// LED 4 Green channel is GPIO22. -#define MT3620_RDB_LED4_GREEN MT3620_GPIO22 - -/// LED 4 Blue channel is GPIO23. -#define MT3620_RDB_LED4_BLUE MT3620_GPIO23 - -/// Status LED Red channel is GPIO45. -#define MT3620_RDB_STATUS_LED_RED MT3620_GPIO45 - -/// Status LED Green channel is GPIO46. -#define MT3620_RDB_STATUS_LED_GREEN MT3620_GPIO46 - -/// Status LED Blue channel is GPIO47. -#define MT3620_RDB_STATUS_LED_BLUE MT3620_GPIO47 - -/// Networking LED Red channel is GPIO48. -#define MT3620_RDB_NETWORKING_LED_RED MT3620_GPIO48 - -/// Networking LED Green channel is GPIO14. -#define MT3620_RDB_NETWORKING_LED_GREEN MT3620_GPIO14 - -/// Networking LED Blue channel is GPIO11. -#define MT3620_RDB_NETWORKING_LED_BLUE MT3620_GPIO11 - -/// Button A is GPIO12. -#define MT3620_RDB_BUTTON_A MT3620_GPIO12 - -/// Button B is GPIO13. -#define MT3620_RDB_BUTTON_B MT3620_GPIO13 - -// Header 1, pin 1 is SYS_RST -// Header 1, pin 2 is GND - -/// GPIO59 is exposed on header 1, pin 3 -#define MT3620_RDB_HEADER1_PIN3_GPIO MT3620_GPIO59 - -/// GPIO0 is exposed on header 1, pin 4 -#define MT3620_RDB_HEADER1_PIN4_GPIO MT3620_GPIO0 - -/// GPIO56 is exposed on header 1, pin 5 -#define MT3620_RDB_HEADER1_PIN5_GPIO MT3620_GPIO56 - -/// GPIO1 is exposed on header 1, pin 6 -#define MT3620_RDB_HEADER1_PIN6_GPIO MT3620_GPIO1 - -/// GPIO58 is exposed on header 1, pin 7 -#define MT3620_RDB_HEADER1_PIN7_GPIO MT3620_GPIO58 - -/// GPIO2 is exposed on header 1, pin 8 -#define MT3620_RDB_HEADER1_PIN8_GPIO MT3620_GPIO2 - -/// GPIO57 is exposed on header 1, pin 9 -#define MT3620_RDB_HEADER1_PIN9_GPIO MT3620_GPIO57 - -/// GPIO3 is exposed on header 1, pin 10 -#define MT3620_RDB_HEADER1_PIN10_GPIO MT3620_GPIO3 - -/// GPIO60 is exposed on header 1, pin 11 -#define MT3620_RDB_HEADER1_PIN11_GPIO MT3620_GPIO60 - -/// GPIO4 is exposed on header 1, pin 12 -#define MT3620_RDB_HEADER1_PIN12_GPIO MT3620_GPIO4 - -// Header 2, pins 1, 3, 5, 7 are only supported as the ISU0 UART -#define MT3620_RDB_HEADER2_ISU0_UART MT3620_UART_ISU0 - -// Header 2, pin 2 is GND - -/// GPIO5 is exposed on header 2, pin 4 -#define MT3620_RDB_HEADER2_PIN4_GPIO MT3620_GPIO5 - -/// GPIO6 is exposed on header 2, pin 6 -#define MT3620_RDB_HEADER2_PIN6_GPIO MT3620_GPIO6 - -/// GPIO7 is exposed on header 2, pin 8 -#define MT3620_RDB_HEADER2_PIN8_GPIO MT3620_GPIO7 - -/// GPIO30 is exposed on header 2, pin 9 -#define MT3620_RDB_HEADER2_PIN9_GPIO MT3620_GPIO30 - -// Header 2, pin 10 is ADC VREF - -/// GPIO41 is exposed on header 2, pin 11 -#define MT3620_RDB_HEADER2_PIN11_GPIO MT3620_GPIO41 - -/// GPIO43 is exposed on header 2, pin 12 -#define MT3620_RDB_HEADER2_PIN12_GPIO MT3620_GPIO43 - -/// GPIO42 is exposed on header 2, pin 13 -#define MT3620_RDB_HEADER2_PIN13_GPIO MT3620_GPIO42 - -/// GPIO44 is exposed on header 2, pin 14 -#define MT3620_RDB_HEADER2_PIN14_GPIO MT3620_GPIO44 - -// Header 3, pin 1 is 5V -// Header 3, pin 2 is GND -// Header 3, pin 3 is 3V3 -// Header 3, pin 4 is RTC_WAKEUP - -// Header 3, pin 6 is IO0 UART TX -// Header 3, pin 8 is IO1 UART TX -// Header 3, pin 10 is PMU EN - -// Header 3, pins 5, 7, 9, 11 are only supported as the ISU3 UART -#define MT3620_RDB_HEADER3_ISU3_UART MT3620_UART_ISU3 - -/// GPIO70 is exposed on header 3, pin 12 -#define MT3620_RDB_HEADER3_PIN12_GPIO MT3620_GPIO70 - -// Header 4, pin 1 is SWDIO -// Header 4, pin 2 is GND -// Header 4, pin 3 is SWCLK -// Header 4, pin 4 is SWO - -// Header 4, pins 5, 7, 9, 11 are only supported as the ISU1 UART -#define MT3620_RDB_HEADER4_ISU1_UART MT3620_UART_ISU1 - -// Header 4, pins 6, 8, 10, 12 are only supported as the ISU2 UART -#define MT3620_RDB_HEADER4_ISU2_UART MT3620_UART_ISU2 - -/// GPIO35 is exposed on header 4, pin 13 -#define MT3620_RDB_HEADER4_PIN13_GPIO MT3620_GPIO35 - -/// GPIO40 is exposed on header 4, pin 14 -#define MT3620_RDB_HEADER4_PIN14_GPIO MT3620_GPIO40 diff --git a/Samples/Grove_4_Digital_Display/app_manifest.json b/Samples/Grove_4_Digital_Display/app_manifest.json new file mode 100644 index 0000000..9359d99 --- /dev/null +++ b/Samples/Grove_4_Digital_Display/app_manifest.json @@ -0,0 +1,13 @@ +{ + "SchemaVersion": 1, + "Name": "Grove_4_Digital_Display", + "ComponentId": "559650e1-b386-4891-9eb3-a31522bd7489", + "EntryPoint": "/bin/app", + "CmdArgs": [], + "Capabilities": { + "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], + "Uart": [ "ISU0", "ISU3" ], + "AllowedApplicationConnections": [] + }, + "ApplicationType": "Default" +} diff --git a/Samples/Grove_4_Digital_Display/applibs_versions.h b/Samples/Grove_4_Digital_Display/applibs_versions.h new file mode 100644 index 0000000..4078fb7 --- /dev/null +++ b/Samples/Grove_4_Digital_Display/applibs_versions.h @@ -0,0 +1,25 @@ +#pragma once + +/// +/// This identifier should be defined before including any of the networking-related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define NETWORKING_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the Wi-Fi related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define WIFICONFIG_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the UART-related header files. +/// It indicates which version of the UART data structures the application uses. +/// +#define UART_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the SPI-related header files. +/// It indicates which version of the SPI data structures the application uses. +/// +#define SPI_STRUCTS_VERSION 1 diff --git a/Samples/Grove_4_Digital_Display/launch.vs.json b/Samples/Grove_4_Digital_Display/launch.vs.json new file mode 100644 index 0000000..4dcc310 --- /dev/null +++ b/Samples/Grove_4_Digital_Display/launch.vs.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "azurespheredbg", + "name": "GDB Debugger (HLCore)", + "project": "CMakeLists.txt", + "inheritEnvironments": [ + "AzureSphere" + ], + "customLauncher": "AzureSphereLaunchOptions", + "workingDirectory": "${workspaceRoot}", + "applicationPath": "${debugInfo.target}", + "imagePath": "${debugInfo.targetImage}", + "targetCore": "HLCore", + "targetApiSet": "${env.AzureSphereTargetApiSet}", + "partnerComponents": [] + } + ] +} diff --git a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/main.c b/Samples/Grove_4_Digital_Display/main.c similarity index 84% rename from Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/main.c rename to Samples/Grove_4_Digital_Display/main.c index 2b6ff46..3563f76 100644 --- a/Samples/Grove_4_Digital_Display/Grove_4_Digital_Display/main.c +++ b/Samples/Grove_4_Digital_Display/main.c @@ -4,14 +4,12 @@ #include #include -// applibs_versions.h defines the API struct versions to use for applibs APIs. -#include "applibs_versions.h" #include +#include -#include "mt3620_rdb.h" +#include "../../MT3620_Grove_Shield_Library/Grove.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/Grove4DigitDisplay.h" -#include "Grove.h" -#include "Sensors/Grove4DigitDisplay.h" static volatile sig_atomic_t terminationRequested = false; @@ -48,7 +46,7 @@ int main(int argc, char *argv[]) // Main loop while (!terminationRequested) { - // Disaplay increasing number + // Display increasing number Grove4DigitDisplay_DisplayValue(dev, number++); usleep(1000000); } diff --git a/Samples/Grove_Buzzer/.gitignore b/Samples/Grove_Buzzer/.gitignore new file mode 100644 index 0000000..f60a954 --- /dev/null +++ b/Samples/Grove_Buzzer/.gitignore @@ -0,0 +1,3 @@ +# Ignore output directories +/out/ +/install/ diff --git a/Samples/Grove_Buzzer/.vscode/c_cpp_properties.json b/Samples/Grove_Buzzer/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..393fe20 --- /dev/null +++ b/Samples/Grove_Buzzer/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64", + "configurationProvider": "vector-of-bool.cmake-tools", + "compileCommands": "${workspaceFolder}/out/Debug-3/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Samples/Grove_Buzzer/.vscode/launch.json b/Samples/Grove_Buzzer/.vscode/launch.json new file mode 100644 index 0000000..dae7c0c --- /dev/null +++ b/Samples/Grove_Buzzer/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch for Azure Sphere High-Level Applications (gdb)", + "type": "azurespheredbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "targetCore": "HLCore", + "partnerComponents": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Samples/Grove_Buzzer/.vscode/settings.json b/Samples/Grove_Buzzer/.vscode/settings.json new file mode 100644 index 0000000..7615f4f --- /dev/null +++ b/Samples/Grove_Buzzer/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cmake.generator": "Ninja", + "cmake.buildDirectory": "${workspaceRoot}/out/${buildType}-${command:azuresphere.AzureSphereTargetApiSet}", + "cmake.buildToolArgs": [ "-v" ], + "cmake.configureArgs": [ "--no-warn-unused-cli" ], + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake", + "AZURE_SPHERE_TARGET_API_SET": "3" + }, + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/Samples/Grove_Buzzer/CMakeLists.txt b/Samples/Grove_Buzzer/CMakeLists.txt new file mode 100644 index 0000000..1971106 --- /dev/null +++ b/Samples/Grove_Buzzer/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.8) +project (grove-buzzer C) + +add_subdirectory("../../MT3620_Grove_Shield_Library" out) +# Create executable +add_executable (${PROJECT_NAME} main.c) +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c MT3620_Grove_Shield_Library) + +# Add MakeImage post-build command +include (${AZURE_SPHERE_MAKE_IMAGE_FILE}) diff --git a/Samples/Grove_Buzzer/CMakeSettings.json b/Samples/Grove_Buzzer/CMakeSettings.json new file mode 100644 index 0000000..c7a8671 --- /dev/null +++ b/Samples/Grove_Buzzer/CMakeSettings.json @@ -0,0 +1,57 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} diff --git a/Samples/Grove_Buzzer/Grove_Buzzer.sln b/Samples/Grove_Buzzer/Grove_Buzzer.sln deleted file mode 100644 index 95c638e..0000000 --- a/Samples/Grove_Buzzer/Grove_Buzzer.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Grove_Buzzer", "Grove_Buzzer\Grove_Buzzer.vcxproj", "{DD3A171B-FCCB-4C1B-9EEA-858DD0EC41E3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "..\..\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DD3A171B-FCCB-4C1B-9EEA-858DD0EC41E3}.Debug|ARM.ActiveCfg = Debug|ARM - {DD3A171B-FCCB-4C1B-9EEA-858DD0EC41E3}.Debug|ARM.Build.0 = Debug|ARM - {DD3A171B-FCCB-4C1B-9EEA-858DD0EC41E3}.Release|ARM.ActiveCfg = Release|ARM - {DD3A171B-FCCB-4C1B-9EEA-858DD0EC41E3}.Release|ARM.Build.0 = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.Build.0 = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C16B2D45-6285-48A6-8343-076CD8581E59} - EndGlobalSection -EndGlobal diff --git a/Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj b/Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj deleted file mode 100644 index 928788a..0000000 --- a/Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - {dd3a171b-fccb-4c1b-9eea-858dd0ec41e3} - AzureSphere - Grove_Buzzer - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - - - - true - - - false - - - - - - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - - - - - - - -Werror=implicit-function-declaration %(AdditionalOptions) - E:\workspace\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library;%(AdditionalIncludeDirectories) - - - applibs;pthread;gcc_s;c - -Wl,--no-undefined -nodefaultlibs %(AdditionalOptions) - - - \ No newline at end of file diff --git a/Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj.filters b/Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj.filters deleted file mode 100644 index ad59245..0000000 --- a/Samples/Grove_Buzzer/Grove_Buzzer/Grove_Buzzer.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - - Header Files - - - \ No newline at end of file diff --git a/Samples/Grove_Buzzer/Grove_Buzzer/app_manifest.json b/Samples/Grove_Buzzer/Grove_Buzzer/app_manifest.json deleted file mode 100644 index acdd9b6..0000000 --- a/Samples/Grove_Buzzer/Grove_Buzzer/app_manifest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "SchemaVersion": 1, - "Name" : "Grove_Buzzer", - "ComponentId" : "ee01d1da-de2c-428d-b5f9-4ad8dd9e6151", - "EntryPoint": "/bin/app", - "CmdArgs": [], - "TargetApplicationRuntimeVersion": 1, - "Capabilities": { - "AllowedConnections": [], - "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 4, 5, 57, 58, 11, 14, 48 ], - "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": false - } -} \ No newline at end of file diff --git a/Samples/Grove_Buzzer/Grove_Buzzer/applibs_versions.h b/Samples/Grove_Buzzer/Grove_Buzzer/applibs_versions.h deleted file mode 100644 index 670fcb4..0000000 --- a/Samples/Grove_Buzzer/Grove_Buzzer/applibs_versions.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -// This header defines which struct versions will be used for applibs APIs. -#define WIFICONFIG_STRUCTS_VERSION 1 -#define UART_STRUCTS_VERSION 1 \ No newline at end of file diff --git a/Samples/Grove_Buzzer/Grove_Buzzer/mt3620_rdb.h b/Samples/Grove_Buzzer/Grove_Buzzer/mt3620_rdb.h deleted file mode 100644 index 6c5b2f0..0000000 --- a/Samples/Grove_Buzzer/Grove_Buzzer/mt3620_rdb.h +++ /dev/null @@ -1,162 +0,0 @@ -/// This header contains the peripheral pinout definitions for the -/// MT3620 Reference Development Board (RDB) -#pragma once - -#include -#include - -/// LED 1 Red channel is GPIO8. -#define MT3620_RDB_LED1_RED MT3620_GPIO8 - -/// LED 1 Green channel is GPIO9. -#define MT3620_RDB_LED1_GREEN MT3620_GPIO9 - -/// LED 1 Blue channel is GPIO10. -#define MT3620_RDB_LED1_BLUE MT3620_GPIO10 - -/// LED 2 Red channel is GPIO15. -#define MT3620_RDB_LED2_RED MT3620_GPIO15 - -/// LED 2 Green channel is GPIO16. -#define MT3620_RDB_LED2_GREEN MT3620_GPIO16 - -/// LED 2 Blue channel is GPIO17. -#define MT3620_RDB_LED2_BLUE MT3620_GPIO17 - -/// LED 3 Red channel is GPIO18. -#define MT3620_RDB_LED3_RED MT3620_GPIO18 - -/// LED 3 Green channel is GPIO19. -#define MT3620_RDB_LED3_GREEN MT3620_GPIO19 - -/// LED 3 Blue channel is GPIO20. -#define MT3620_RDB_LED3_BLUE MT3620_GPIO20 - -/// LED 4 Red channel is GPIO21. -#define MT3620_RDB_LED4_RED MT3620_GPIO21 - -/// LED 4 Green channel is GPIO22. -#define MT3620_RDB_LED4_GREEN MT3620_GPIO22 - -/// LED 4 Blue channel is GPIO23. -#define MT3620_RDB_LED4_BLUE MT3620_GPIO23 - -/// Status LED Red channel is GPIO45. -#define MT3620_RDB_STATUS_LED_RED MT3620_GPIO45 - -/// Status LED Green channel is GPIO46. -#define MT3620_RDB_STATUS_LED_GREEN MT3620_GPIO46 - -/// Status LED Blue channel is GPIO47. -#define MT3620_RDB_STATUS_LED_BLUE MT3620_GPIO47 - -/// Networking LED Red channel is GPIO48. -#define MT3620_RDB_NETWORKING_LED_RED MT3620_GPIO48 - -/// Networking LED Green channel is GPIO14. -#define MT3620_RDB_NETWORKING_LED_GREEN MT3620_GPIO14 - -/// Networking LED Blue channel is GPIO11. -#define MT3620_RDB_NETWORKING_LED_BLUE MT3620_GPIO11 - -/// Button A is GPIO12. -#define MT3620_RDB_BUTTON_A MT3620_GPIO12 - -/// Button B is GPIO13. -#define MT3620_RDB_BUTTON_B MT3620_GPIO13 - -// Header 1, pin 1 is SYS_RST -// Header 1, pin 2 is GND - -/// GPIO59 is exposed on header 1, pin 3 -#define MT3620_RDB_HEADER1_PIN3_GPIO MT3620_GPIO59 - -/// GPIO0 is exposed on header 1, pin 4 -#define MT3620_RDB_HEADER1_PIN4_GPIO MT3620_GPIO0 - -/// GPIO56 is exposed on header 1, pin 5 -#define MT3620_RDB_HEADER1_PIN5_GPIO MT3620_GPIO56 - -/// GPIO1 is exposed on header 1, pin 6 -#define MT3620_RDB_HEADER1_PIN6_GPIO MT3620_GPIO1 - -/// GPIO58 is exposed on header 1, pin 7 -#define MT3620_RDB_HEADER1_PIN7_GPIO MT3620_GPIO58 - -/// GPIO2 is exposed on header 1, pin 8 -#define MT3620_RDB_HEADER1_PIN8_GPIO MT3620_GPIO2 - -/// GPIO57 is exposed on header 1, pin 9 -#define MT3620_RDB_HEADER1_PIN9_GPIO MT3620_GPIO57 - -/// GPIO3 is exposed on header 1, pin 10 -#define MT3620_RDB_HEADER1_PIN10_GPIO MT3620_GPIO3 - -/// GPIO60 is exposed on header 1, pin 11 -#define MT3620_RDB_HEADER1_PIN11_GPIO MT3620_GPIO60 - -/// GPIO4 is exposed on header 1, pin 12 -#define MT3620_RDB_HEADER1_PIN12_GPIO MT3620_GPIO4 - -// Header 2, pins 1, 3, 5, 7 are only supported as the ISU0 UART -#define MT3620_RDB_HEADER2_ISU0_UART MT3620_UART_ISU0 - -// Header 2, pin 2 is GND - -/// GPIO5 is exposed on header 2, pin 4 -#define MT3620_RDB_HEADER2_PIN4_GPIO MT3620_GPIO5 - -/// GPIO6 is exposed on header 2, pin 6 -#define MT3620_RDB_HEADER2_PIN6_GPIO MT3620_GPIO6 - -/// GPIO7 is exposed on header 2, pin 8 -#define MT3620_RDB_HEADER2_PIN8_GPIO MT3620_GPIO7 - -/// GPIO30 is exposed on header 2, pin 9 -#define MT3620_RDB_HEADER2_PIN9_GPIO MT3620_GPIO30 - -// Header 2, pin 10 is ADC VREF - -/// GPIO41 is exposed on header 2, pin 11 -#define MT3620_RDB_HEADER2_PIN11_GPIO MT3620_GPIO41 - -/// GPIO43 is exposed on header 2, pin 12 -#define MT3620_RDB_HEADER2_PIN12_GPIO MT3620_GPIO43 - -/// GPIO42 is exposed on header 2, pin 13 -#define MT3620_RDB_HEADER2_PIN13_GPIO MT3620_GPIO42 - -/// GPIO44 is exposed on header 2, pin 14 -#define MT3620_RDB_HEADER2_PIN14_GPIO MT3620_GPIO44 - -// Header 3, pin 1 is 5V -// Header 3, pin 2 is GND -// Header 3, pin 3 is 3V3 -// Header 3, pin 4 is RTC_WAKEUP - -// Header 3, pin 6 is IO0 UART TX -// Header 3, pin 8 is IO1 UART TX -// Header 3, pin 10 is PMU EN - -// Header 3, pins 5, 7, 9, 11 are only supported as the ISU3 UART -#define MT3620_RDB_HEADER3_ISU3_UART MT3620_UART_ISU3 - -/// GPIO70 is exposed on header 3, pin 12 -#define MT3620_RDB_HEADER3_PIN12_GPIO MT3620_GPIO70 - -// Header 4, pin 1 is SWDIO -// Header 4, pin 2 is GND -// Header 4, pin 3 is SWCLK -// Header 4, pin 4 is SWO - -// Header 4, pins 5, 7, 9, 11 are only supported as the ISU1 UART -#define MT3620_RDB_HEADER4_ISU1_UART MT3620_UART_ISU1 - -// Header 4, pins 6, 8, 10, 12 are only supported as the ISU2 UART -#define MT3620_RDB_HEADER4_ISU2_UART MT3620_UART_ISU2 - -/// GPIO35 is exposed on header 4, pin 13 -#define MT3620_RDB_HEADER4_PIN13_GPIO MT3620_GPIO35 - -/// GPIO40 is exposed on header 4, pin 14 -#define MT3620_RDB_HEADER4_PIN14_GPIO MT3620_GPIO40 diff --git a/Samples/Grove_Buzzer/app_manifest.json b/Samples/Grove_Buzzer/app_manifest.json new file mode 100644 index 0000000..a779f00 --- /dev/null +++ b/Samples/Grove_Buzzer/app_manifest.json @@ -0,0 +1,13 @@ +{ + "SchemaVersion": 1, + "Name": "Grove_Buzzer", + "ComponentId": "ee01d1da-de2c-428d-b5f9-4ad8dd9e6151", + "EntryPoint": "/bin/app", + "CmdArgs": [], + "Capabilities": { + "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], + "Uart": [ "ISU0", "ISU3" ], + "AllowedApplicationConnections": [] + }, + "ApplicationType": "Default" +} diff --git a/Samples/Grove_Buzzer/applibs_versions.h b/Samples/Grove_Buzzer/applibs_versions.h new file mode 100644 index 0000000..4078fb7 --- /dev/null +++ b/Samples/Grove_Buzzer/applibs_versions.h @@ -0,0 +1,25 @@ +#pragma once + +/// +/// This identifier should be defined before including any of the networking-related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define NETWORKING_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the Wi-Fi related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define WIFICONFIG_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the UART-related header files. +/// It indicates which version of the UART data structures the application uses. +/// +#define UART_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the SPI-related header files. +/// It indicates which version of the SPI data structures the application uses. +/// +#define SPI_STRUCTS_VERSION 1 diff --git a/Samples/Grove_Buzzer/launch.vs.json b/Samples/Grove_Buzzer/launch.vs.json new file mode 100644 index 0000000..4dcc310 --- /dev/null +++ b/Samples/Grove_Buzzer/launch.vs.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "azurespheredbg", + "name": "GDB Debugger (HLCore)", + "project": "CMakeLists.txt", + "inheritEnvironments": [ + "AzureSphere" + ], + "customLauncher": "AzureSphereLaunchOptions", + "workingDirectory": "${workspaceRoot}", + "applicationPath": "${debugInfo.target}", + "imagePath": "${debugInfo.targetImage}", + "targetCore": "HLCore", + "targetApiSet": "${env.AzureSphereTargetApiSet}", + "partnerComponents": [] + } + ] +} diff --git a/Samples/Grove_Buzzer/Grove_Buzzer/main.c b/Samples/Grove_Buzzer/main.c similarity index 89% rename from Samples/Grove_Buzzer/Grove_Buzzer/main.c rename to Samples/Grove_Buzzer/main.c index 2bb3d42..cf66d46 100644 --- a/Samples/Grove_Buzzer/Grove_Buzzer/main.c +++ b/Samples/Grove_Buzzer/main.c @@ -4,14 +4,11 @@ #include #include -// applibs_versions.h defines the API struct versions to use for applibs APIs. -#include "applibs_versions.h" #include +#include -#include "mt3620_rdb.h" - -#include "Grove.h" -#include "Sensors/GroveRelay.h" +#include "../../MT3620_Grove_Shield_Library/Grove.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/GroveRelay.h" // This C application for the MT3620 Reference Development Board (Azure Sphere) // outputs a string every second to Visual Studio's Device Output window diff --git a/Samples/Grove_OLED_Display/.gitignore b/Samples/Grove_OLED_Display/.gitignore new file mode 100644 index 0000000..f60a954 --- /dev/null +++ b/Samples/Grove_OLED_Display/.gitignore @@ -0,0 +1,3 @@ +# Ignore output directories +/out/ +/install/ diff --git a/Samples/Grove_OLED_Display/.vscode/c_cpp_properties.json b/Samples/Grove_OLED_Display/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..393fe20 --- /dev/null +++ b/Samples/Grove_OLED_Display/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64", + "configurationProvider": "vector-of-bool.cmake-tools", + "compileCommands": "${workspaceFolder}/out/Debug-3/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Samples/Grove_OLED_Display/.vscode/launch.json b/Samples/Grove_OLED_Display/.vscode/launch.json new file mode 100644 index 0000000..dae7c0c --- /dev/null +++ b/Samples/Grove_OLED_Display/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch for Azure Sphere High-Level Applications (gdb)", + "type": "azurespheredbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "targetCore": "HLCore", + "partnerComponents": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Samples/Grove_OLED_Display/.vscode/settings.json b/Samples/Grove_OLED_Display/.vscode/settings.json new file mode 100644 index 0000000..7615f4f --- /dev/null +++ b/Samples/Grove_OLED_Display/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cmake.generator": "Ninja", + "cmake.buildDirectory": "${workspaceRoot}/out/${buildType}-${command:azuresphere.AzureSphereTargetApiSet}", + "cmake.buildToolArgs": [ "-v" ], + "cmake.configureArgs": [ "--no-warn-unused-cli" ], + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake", + "AZURE_SPHERE_TARGET_API_SET": "3" + }, + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/Samples/Grove_OLED_Display/CMakeLists.txt b/Samples/Grove_OLED_Display/CMakeLists.txt new file mode 100644 index 0000000..4162ef1 --- /dev/null +++ b/Samples/Grove_OLED_Display/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.8) +project (grove-oled-display C) + +add_subdirectory("../../MT3620_Grove_Shield_Library" out) +# Create executable +add_executable (${PROJECT_NAME} main.c) +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c MT3620_Grove_Shield_Library) + +# Add MakeImage post-build command +include (${AZURE_SPHERE_MAKE_IMAGE_FILE}) diff --git a/Samples/Grove_OLED_Display/CMakeSettings.json b/Samples/Grove_OLED_Display/CMakeSettings.json new file mode 100644 index 0000000..c7a8671 --- /dev/null +++ b/Samples/Grove_OLED_Display/CMakeSettings.json @@ -0,0 +1,57 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} diff --git a/Samples/Grove_OLED_Display/GroveOledDisplay.sln b/Samples/Grove_OLED_Display/GroveOledDisplay.sln deleted file mode 100644 index ad8d889..0000000 --- a/Samples/Grove_OLED_Display/GroveOledDisplay.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2003 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GroveOledDisplay", "GroveOledDisplay\GroveOledDisplay.vcxproj", "{32599BB6-74AA-451A-A708-ED98D15DBDA1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "..\..\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {32599BB6-74AA-451A-A708-ED98D15DBDA1}.Debug|ARM.ActiveCfg = Debug|ARM - {32599BB6-74AA-451A-A708-ED98D15DBDA1}.Debug|ARM.Build.0 = Debug|ARM - {32599BB6-74AA-451A-A708-ED98D15DBDA1}.Release|ARM.ActiveCfg = Release|ARM - {32599BB6-74AA-451A-A708-ED98D15DBDA1}.Release|ARM.Build.0 = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.Build.0 = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E2249499-D0BB-43A6-8664-7B3FFF2583FB} - EndGlobalSection -EndGlobal diff --git a/Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj b/Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj deleted file mode 100644 index 5dba09e..0000000 --- a/Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj +++ /dev/null @@ -1,62 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - {32599bb6-74aa-451a-a708-ed98d15dbda1} - AzureSphere - GroveOledDisplay - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - - - - true - - - false - - - - - - - - E:\workspace\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library;$(IncludePath) - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - - - - - - - -Werror=implicit-function-declaration %(AdditionalOptions) - %(AdditionalIncludeDirectories) - - - applibs;pthread;gcc_s;c - -Wl,--no-undefined -nodefaultlibs %(AdditionalOptions) - - - \ No newline at end of file diff --git a/Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj.filters b/Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj.filters deleted file mode 100644 index ad59245..0000000 --- a/Samples/Grove_OLED_Display/GroveOledDisplay/GroveOledDisplay.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - - Header Files - - - \ No newline at end of file diff --git a/Samples/Grove_OLED_Display/GroveOledDisplay/app_manifest.json b/Samples/Grove_OLED_Display/GroveOledDisplay/app_manifest.json deleted file mode 100644 index 49002a0..0000000 --- a/Samples/Grove_OLED_Display/GroveOledDisplay/app_manifest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "SchemaVersion": 1, - "Name" : "GroveOledDisplay", - "ComponentId" : "cee8898f-372c-4444-942b-56a5378e985d", - "EntryPoint": "/bin/app", - "CmdArgs": [], - "TargetApplicationRuntimeVersion": 1, - "Capabilities": { - "AllowedConnections": [], - "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 4, 5, 57, 58, 11, 14, 48 ], - "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": false - } -} \ No newline at end of file diff --git a/Samples/Grove_OLED_Display/GroveOledDisplay/applibs_versions.h b/Samples/Grove_OLED_Display/GroveOledDisplay/applibs_versions.h deleted file mode 100644 index 670fcb4..0000000 --- a/Samples/Grove_OLED_Display/GroveOledDisplay/applibs_versions.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -// This header defines which struct versions will be used for applibs APIs. -#define WIFICONFIG_STRUCTS_VERSION 1 -#define UART_STRUCTS_VERSION 1 \ No newline at end of file diff --git a/Samples/Grove_OLED_Display/GroveOledDisplay/mt3620_rdb.h b/Samples/Grove_OLED_Display/GroveOledDisplay/mt3620_rdb.h deleted file mode 100644 index 6c5b2f0..0000000 --- a/Samples/Grove_OLED_Display/GroveOledDisplay/mt3620_rdb.h +++ /dev/null @@ -1,162 +0,0 @@ -/// This header contains the peripheral pinout definitions for the -/// MT3620 Reference Development Board (RDB) -#pragma once - -#include -#include - -/// LED 1 Red channel is GPIO8. -#define MT3620_RDB_LED1_RED MT3620_GPIO8 - -/// LED 1 Green channel is GPIO9. -#define MT3620_RDB_LED1_GREEN MT3620_GPIO9 - -/// LED 1 Blue channel is GPIO10. -#define MT3620_RDB_LED1_BLUE MT3620_GPIO10 - -/// LED 2 Red channel is GPIO15. -#define MT3620_RDB_LED2_RED MT3620_GPIO15 - -/// LED 2 Green channel is GPIO16. -#define MT3620_RDB_LED2_GREEN MT3620_GPIO16 - -/// LED 2 Blue channel is GPIO17. -#define MT3620_RDB_LED2_BLUE MT3620_GPIO17 - -/// LED 3 Red channel is GPIO18. -#define MT3620_RDB_LED3_RED MT3620_GPIO18 - -/// LED 3 Green channel is GPIO19. -#define MT3620_RDB_LED3_GREEN MT3620_GPIO19 - -/// LED 3 Blue channel is GPIO20. -#define MT3620_RDB_LED3_BLUE MT3620_GPIO20 - -/// LED 4 Red channel is GPIO21. -#define MT3620_RDB_LED4_RED MT3620_GPIO21 - -/// LED 4 Green channel is GPIO22. -#define MT3620_RDB_LED4_GREEN MT3620_GPIO22 - -/// LED 4 Blue channel is GPIO23. -#define MT3620_RDB_LED4_BLUE MT3620_GPIO23 - -/// Status LED Red channel is GPIO45. -#define MT3620_RDB_STATUS_LED_RED MT3620_GPIO45 - -/// Status LED Green channel is GPIO46. -#define MT3620_RDB_STATUS_LED_GREEN MT3620_GPIO46 - -/// Status LED Blue channel is GPIO47. -#define MT3620_RDB_STATUS_LED_BLUE MT3620_GPIO47 - -/// Networking LED Red channel is GPIO48. -#define MT3620_RDB_NETWORKING_LED_RED MT3620_GPIO48 - -/// Networking LED Green channel is GPIO14. -#define MT3620_RDB_NETWORKING_LED_GREEN MT3620_GPIO14 - -/// Networking LED Blue channel is GPIO11. -#define MT3620_RDB_NETWORKING_LED_BLUE MT3620_GPIO11 - -/// Button A is GPIO12. -#define MT3620_RDB_BUTTON_A MT3620_GPIO12 - -/// Button B is GPIO13. -#define MT3620_RDB_BUTTON_B MT3620_GPIO13 - -// Header 1, pin 1 is SYS_RST -// Header 1, pin 2 is GND - -/// GPIO59 is exposed on header 1, pin 3 -#define MT3620_RDB_HEADER1_PIN3_GPIO MT3620_GPIO59 - -/// GPIO0 is exposed on header 1, pin 4 -#define MT3620_RDB_HEADER1_PIN4_GPIO MT3620_GPIO0 - -/// GPIO56 is exposed on header 1, pin 5 -#define MT3620_RDB_HEADER1_PIN5_GPIO MT3620_GPIO56 - -/// GPIO1 is exposed on header 1, pin 6 -#define MT3620_RDB_HEADER1_PIN6_GPIO MT3620_GPIO1 - -/// GPIO58 is exposed on header 1, pin 7 -#define MT3620_RDB_HEADER1_PIN7_GPIO MT3620_GPIO58 - -/// GPIO2 is exposed on header 1, pin 8 -#define MT3620_RDB_HEADER1_PIN8_GPIO MT3620_GPIO2 - -/// GPIO57 is exposed on header 1, pin 9 -#define MT3620_RDB_HEADER1_PIN9_GPIO MT3620_GPIO57 - -/// GPIO3 is exposed on header 1, pin 10 -#define MT3620_RDB_HEADER1_PIN10_GPIO MT3620_GPIO3 - -/// GPIO60 is exposed on header 1, pin 11 -#define MT3620_RDB_HEADER1_PIN11_GPIO MT3620_GPIO60 - -/// GPIO4 is exposed on header 1, pin 12 -#define MT3620_RDB_HEADER1_PIN12_GPIO MT3620_GPIO4 - -// Header 2, pins 1, 3, 5, 7 are only supported as the ISU0 UART -#define MT3620_RDB_HEADER2_ISU0_UART MT3620_UART_ISU0 - -// Header 2, pin 2 is GND - -/// GPIO5 is exposed on header 2, pin 4 -#define MT3620_RDB_HEADER2_PIN4_GPIO MT3620_GPIO5 - -/// GPIO6 is exposed on header 2, pin 6 -#define MT3620_RDB_HEADER2_PIN6_GPIO MT3620_GPIO6 - -/// GPIO7 is exposed on header 2, pin 8 -#define MT3620_RDB_HEADER2_PIN8_GPIO MT3620_GPIO7 - -/// GPIO30 is exposed on header 2, pin 9 -#define MT3620_RDB_HEADER2_PIN9_GPIO MT3620_GPIO30 - -// Header 2, pin 10 is ADC VREF - -/// GPIO41 is exposed on header 2, pin 11 -#define MT3620_RDB_HEADER2_PIN11_GPIO MT3620_GPIO41 - -/// GPIO43 is exposed on header 2, pin 12 -#define MT3620_RDB_HEADER2_PIN12_GPIO MT3620_GPIO43 - -/// GPIO42 is exposed on header 2, pin 13 -#define MT3620_RDB_HEADER2_PIN13_GPIO MT3620_GPIO42 - -/// GPIO44 is exposed on header 2, pin 14 -#define MT3620_RDB_HEADER2_PIN14_GPIO MT3620_GPIO44 - -// Header 3, pin 1 is 5V -// Header 3, pin 2 is GND -// Header 3, pin 3 is 3V3 -// Header 3, pin 4 is RTC_WAKEUP - -// Header 3, pin 6 is IO0 UART TX -// Header 3, pin 8 is IO1 UART TX -// Header 3, pin 10 is PMU EN - -// Header 3, pins 5, 7, 9, 11 are only supported as the ISU3 UART -#define MT3620_RDB_HEADER3_ISU3_UART MT3620_UART_ISU3 - -/// GPIO70 is exposed on header 3, pin 12 -#define MT3620_RDB_HEADER3_PIN12_GPIO MT3620_GPIO70 - -// Header 4, pin 1 is SWDIO -// Header 4, pin 2 is GND -// Header 4, pin 3 is SWCLK -// Header 4, pin 4 is SWO - -// Header 4, pins 5, 7, 9, 11 are only supported as the ISU1 UART -#define MT3620_RDB_HEADER4_ISU1_UART MT3620_UART_ISU1 - -// Header 4, pins 6, 8, 10, 12 are only supported as the ISU2 UART -#define MT3620_RDB_HEADER4_ISU2_UART MT3620_UART_ISU2 - -/// GPIO35 is exposed on header 4, pin 13 -#define MT3620_RDB_HEADER4_PIN13_GPIO MT3620_GPIO35 - -/// GPIO40 is exposed on header 4, pin 14 -#define MT3620_RDB_HEADER4_PIN14_GPIO MT3620_GPIO40 diff --git a/Samples/Grove_OLED_Display/app_manifest.json b/Samples/Grove_OLED_Display/app_manifest.json new file mode 100644 index 0000000..ab05502 --- /dev/null +++ b/Samples/Grove_OLED_Display/app_manifest.json @@ -0,0 +1,13 @@ +{ + "SchemaVersion": 1, + "Name": "GroveOledDisplay", + "ComponentId": "cee8898f-372c-4444-942b-56a5378e985d", + "EntryPoint": "/bin/app", + "CmdArgs": [], + "Capabilities": { + "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], + "Uart": [ "ISU0", "ISU3" ], + "AllowedApplicationConnections": [] + }, + "ApplicationType": "Default" +} diff --git a/Samples/Grove_OLED_Display/applibs_versions.h b/Samples/Grove_OLED_Display/applibs_versions.h new file mode 100644 index 0000000..4078fb7 --- /dev/null +++ b/Samples/Grove_OLED_Display/applibs_versions.h @@ -0,0 +1,25 @@ +#pragma once + +/// +/// This identifier should be defined before including any of the networking-related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define NETWORKING_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the Wi-Fi related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define WIFICONFIG_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the UART-related header files. +/// It indicates which version of the UART data structures the application uses. +/// +#define UART_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the SPI-related header files. +/// It indicates which version of the SPI data structures the application uses. +/// +#define SPI_STRUCTS_VERSION 1 diff --git a/Samples/Grove_OLED_Display/launch.vs.json b/Samples/Grove_OLED_Display/launch.vs.json new file mode 100644 index 0000000..4dcc310 --- /dev/null +++ b/Samples/Grove_OLED_Display/launch.vs.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "azurespheredbg", + "name": "GDB Debugger (HLCore)", + "project": "CMakeLists.txt", + "inheritEnvironments": [ + "AzureSphere" + ], + "customLauncher": "AzureSphereLaunchOptions", + "workingDirectory": "${workspaceRoot}", + "applicationPath": "${debugInfo.target}", + "imagePath": "${debugInfo.targetImage}", + "targetCore": "HLCore", + "targetApiSet": "${env.AzureSphereTargetApiSet}", + "partnerComponents": [] + } + ] +} diff --git a/Samples/Grove_OLED_Display/GroveOledDisplay/main.c b/Samples/Grove_OLED_Display/main.c similarity index 98% rename from Samples/Grove_OLED_Display/GroveOledDisplay/main.c rename to Samples/Grove_OLED_Display/main.c index 66e2b5e..7ebeb98 100644 --- a/Samples/Grove_OLED_Display/GroveOledDisplay/main.c +++ b/Samples/Grove_OLED_Display/main.c @@ -3,16 +3,12 @@ #include #include #include -#include -// applibs_versions.h defines the API struct versions to use for applibs APIs. -#include "applibs_versions.h" #include +#include -#include "mt3620_rdb.h" - -#include "Grove.h" -#include "Sensors/GroveOledDisplay96x96.h" +#include "../../MT3620_Grove_Shield_Library/Grove.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/GroveOledDisplay96x96.h" // This C application for the MT3620 Reference Development Board (Azure Sphere) // outputs a string every second to Visual Studio's Device Output window diff --git a/Samples/Temp_and_Humidity_SHT31/.gitignore b/Samples/Temp_and_Humidity_SHT31/.gitignore new file mode 100644 index 0000000..f60a954 --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/.gitignore @@ -0,0 +1,3 @@ +# Ignore output directories +/out/ +/install/ diff --git a/Samples/Temp_and_Humidity_SHT31/.vscode/c_cpp_properties.json b/Samples/Temp_and_Humidity_SHT31/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..393fe20 --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64", + "configurationProvider": "vector-of-bool.cmake-tools", + "compileCommands": "${workspaceFolder}/out/Debug-3/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Samples/Temp_and_Humidity_SHT31/.vscode/launch.json b/Samples/Temp_and_Humidity_SHT31/.vscode/launch.json new file mode 100644 index 0000000..dae7c0c --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch for Azure Sphere High-Level Applications (gdb)", + "type": "azurespheredbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "targetCore": "HLCore", + "partnerComponents": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Samples/Temp_and_Humidity_SHT31/.vscode/settings.json b/Samples/Temp_and_Humidity_SHT31/.vscode/settings.json new file mode 100644 index 0000000..7615f4f --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cmake.generator": "Ninja", + "cmake.buildDirectory": "${workspaceRoot}/out/${buildType}-${command:azuresphere.AzureSphereTargetApiSet}", + "cmake.buildToolArgs": [ "-v" ], + "cmake.configureArgs": [ "--no-warn-unused-cli" ], + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake", + "AZURE_SPHERE_TARGET_API_SET": "3" + }, + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/Samples/Temp_and_Humidity_SHT31/CMakeLists.txt b/Samples/Temp_and_Humidity_SHT31/CMakeLists.txt new file mode 100644 index 0000000..4d4724f --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.8) +project (grove-temp-humidity-sht31 C) + +add_subdirectory("../../MT3620_Grove_Shield_Library" out) +# Create executable +add_executable (${PROJECT_NAME} main.c) +target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c MT3620_Grove_Shield_Library) + +# Add MakeImage post-build command +include (${AZURE_SPHERE_MAKE_IMAGE_FILE}) diff --git a/Samples/Temp_and_Humidity_SHT31/CMakeSettings.json b/Samples/Temp_and_Humidity_SHT31/CMakeSettings.json new file mode 100644 index 0000000..c7a8671 --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/CMakeSettings.json @@ -0,0 +1,57 @@ +{ + "environments": [ + { + "environment": "AzureSphere", + + "AzureSphereTargetApiSet": "3" + } + ], + "configurations": [ + { + "name": "ARM-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + }, + { + "name": "ARM-Release", + "generator": "Ninja", + "configurationType": "Release", + "inheritEnvironments": [ + "AzureSphere" + ], + "buildRoot": "${projectDir}\\out\\${name}-${env.AzureSphereTargetApiSet}", + "installRoot": "${projectDir}\\install\\${name}-${env.AzureSphereTargetApiSet}", + "cmakeCommandArgs": "--no-warn-unused-cli", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake" + }, + { + "name": "AZURE_SPHERE_TARGET_API_SET", + "value": "${env.AzureSphereTargetApiSet}" + } + ] + } + ] +} diff --git a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.sln b/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.sln deleted file mode 100644 index 5600b66..0000000 --- a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Temp_and_Humidity_SHT31", "Temp_and_Humidity_SHT31\Temp_and_Humidity_SHT31.vcxproj", "{E455FF0F-EA74-4E2C-9C8A-5DBA1268BE88}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT3620_Grove_Shield_Library", "..\..\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library.vcxproj", "{A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Release|ARM = Release|ARM - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E455FF0F-EA74-4E2C-9C8A-5DBA1268BE88}.Debug|ARM.ActiveCfg = Debug|ARM - {E455FF0F-EA74-4E2C-9C8A-5DBA1268BE88}.Debug|ARM.Build.0 = Debug|ARM - {E455FF0F-EA74-4E2C-9C8A-5DBA1268BE88}.Release|ARM.ActiveCfg = Release|ARM - {E455FF0F-EA74-4E2C-9C8A-5DBA1268BE88}.Release|ARM.Build.0 = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.ActiveCfg = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Debug|ARM.Build.0 = Debug|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.ActiveCfg = Release|ARM - {A4F0A16D-B28D-4249-9B0A-EEEC5090F21D}.Release|ARM.Build.0 = Release|ARM - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7C871C66-7375-40D5-8E80-84BB7157DB05} - EndGlobalSection -EndGlobal diff --git a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj b/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj deleted file mode 100644 index 6a62d7b..0000000 --- a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - - {e455ff0f-ea74-4e2c-9c8a-5dba1268be88} - AzureSphere - Temp_and_Humidity_SHT31 - 15.0 - Linux - 1.0 - Generic - {D51BCBC9-82E9-4017-911E-C93873C4EA2B} - Device - GCC_AzureSphere_1_0 - - - - true - - - false - - - - - - - - - - - - - - {a4f0a16d-b28d-4249-9b0a-eeec5090f21d} - - - - - - - -Werror=implicit-function-declaration %(AdditionalOptions) - E:\workspace\MT3620_Grove_Shield_Library\MT3620_Grove_Shield_Library;%(AdditionalIncludeDirectories) - - - applibs;pthread;gcc_s;c - -Wl,--no-undefined -nodefaultlibs %(AdditionalOptions) - - - \ No newline at end of file diff --git a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj.filters b/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj.filters deleted file mode 100644 index ad59245..0000000 --- a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - - Header Files - - - \ No newline at end of file diff --git a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/app_manifest.json b/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/app_manifest.json deleted file mode 100644 index c857c1f..0000000 --- a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/app_manifest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "SchemaVersion": 1, - "Name" : "Temp_and_Humidity_SHT31", - "ComponentId" : "16cf357f-d34e-4e47-ac3b-37eeaef09c1a", - "EntryPoint": "/bin/app", - "CmdArgs": [], - "TargetApplicationRuntimeVersion": 1, - "Capabilities": { - "AllowedConnections": [], - "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 4, 5, 57, 58, 11, 14, 48 ], - "Uart": [ "ISU0", "ISU3" ], - "WifiConfig": true - } -} \ No newline at end of file diff --git a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/applibs_versions.h b/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/applibs_versions.h deleted file mode 100644 index 670fcb4..0000000 --- a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/applibs_versions.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -// This header defines which struct versions will be used for applibs APIs. -#define WIFICONFIG_STRUCTS_VERSION 1 -#define UART_STRUCTS_VERSION 1 \ No newline at end of file diff --git a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/mt3620_rdb.h b/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/mt3620_rdb.h deleted file mode 100644 index 6c5b2f0..0000000 --- a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/mt3620_rdb.h +++ /dev/null @@ -1,162 +0,0 @@ -/// This header contains the peripheral pinout definitions for the -/// MT3620 Reference Development Board (RDB) -#pragma once - -#include -#include - -/// LED 1 Red channel is GPIO8. -#define MT3620_RDB_LED1_RED MT3620_GPIO8 - -/// LED 1 Green channel is GPIO9. -#define MT3620_RDB_LED1_GREEN MT3620_GPIO9 - -/// LED 1 Blue channel is GPIO10. -#define MT3620_RDB_LED1_BLUE MT3620_GPIO10 - -/// LED 2 Red channel is GPIO15. -#define MT3620_RDB_LED2_RED MT3620_GPIO15 - -/// LED 2 Green channel is GPIO16. -#define MT3620_RDB_LED2_GREEN MT3620_GPIO16 - -/// LED 2 Blue channel is GPIO17. -#define MT3620_RDB_LED2_BLUE MT3620_GPIO17 - -/// LED 3 Red channel is GPIO18. -#define MT3620_RDB_LED3_RED MT3620_GPIO18 - -/// LED 3 Green channel is GPIO19. -#define MT3620_RDB_LED3_GREEN MT3620_GPIO19 - -/// LED 3 Blue channel is GPIO20. -#define MT3620_RDB_LED3_BLUE MT3620_GPIO20 - -/// LED 4 Red channel is GPIO21. -#define MT3620_RDB_LED4_RED MT3620_GPIO21 - -/// LED 4 Green channel is GPIO22. -#define MT3620_RDB_LED4_GREEN MT3620_GPIO22 - -/// LED 4 Blue channel is GPIO23. -#define MT3620_RDB_LED4_BLUE MT3620_GPIO23 - -/// Status LED Red channel is GPIO45. -#define MT3620_RDB_STATUS_LED_RED MT3620_GPIO45 - -/// Status LED Green channel is GPIO46. -#define MT3620_RDB_STATUS_LED_GREEN MT3620_GPIO46 - -/// Status LED Blue channel is GPIO47. -#define MT3620_RDB_STATUS_LED_BLUE MT3620_GPIO47 - -/// Networking LED Red channel is GPIO48. -#define MT3620_RDB_NETWORKING_LED_RED MT3620_GPIO48 - -/// Networking LED Green channel is GPIO14. -#define MT3620_RDB_NETWORKING_LED_GREEN MT3620_GPIO14 - -/// Networking LED Blue channel is GPIO11. -#define MT3620_RDB_NETWORKING_LED_BLUE MT3620_GPIO11 - -/// Button A is GPIO12. -#define MT3620_RDB_BUTTON_A MT3620_GPIO12 - -/// Button B is GPIO13. -#define MT3620_RDB_BUTTON_B MT3620_GPIO13 - -// Header 1, pin 1 is SYS_RST -// Header 1, pin 2 is GND - -/// GPIO59 is exposed on header 1, pin 3 -#define MT3620_RDB_HEADER1_PIN3_GPIO MT3620_GPIO59 - -/// GPIO0 is exposed on header 1, pin 4 -#define MT3620_RDB_HEADER1_PIN4_GPIO MT3620_GPIO0 - -/// GPIO56 is exposed on header 1, pin 5 -#define MT3620_RDB_HEADER1_PIN5_GPIO MT3620_GPIO56 - -/// GPIO1 is exposed on header 1, pin 6 -#define MT3620_RDB_HEADER1_PIN6_GPIO MT3620_GPIO1 - -/// GPIO58 is exposed on header 1, pin 7 -#define MT3620_RDB_HEADER1_PIN7_GPIO MT3620_GPIO58 - -/// GPIO2 is exposed on header 1, pin 8 -#define MT3620_RDB_HEADER1_PIN8_GPIO MT3620_GPIO2 - -/// GPIO57 is exposed on header 1, pin 9 -#define MT3620_RDB_HEADER1_PIN9_GPIO MT3620_GPIO57 - -/// GPIO3 is exposed on header 1, pin 10 -#define MT3620_RDB_HEADER1_PIN10_GPIO MT3620_GPIO3 - -/// GPIO60 is exposed on header 1, pin 11 -#define MT3620_RDB_HEADER1_PIN11_GPIO MT3620_GPIO60 - -/// GPIO4 is exposed on header 1, pin 12 -#define MT3620_RDB_HEADER1_PIN12_GPIO MT3620_GPIO4 - -// Header 2, pins 1, 3, 5, 7 are only supported as the ISU0 UART -#define MT3620_RDB_HEADER2_ISU0_UART MT3620_UART_ISU0 - -// Header 2, pin 2 is GND - -/// GPIO5 is exposed on header 2, pin 4 -#define MT3620_RDB_HEADER2_PIN4_GPIO MT3620_GPIO5 - -/// GPIO6 is exposed on header 2, pin 6 -#define MT3620_RDB_HEADER2_PIN6_GPIO MT3620_GPIO6 - -/// GPIO7 is exposed on header 2, pin 8 -#define MT3620_RDB_HEADER2_PIN8_GPIO MT3620_GPIO7 - -/// GPIO30 is exposed on header 2, pin 9 -#define MT3620_RDB_HEADER2_PIN9_GPIO MT3620_GPIO30 - -// Header 2, pin 10 is ADC VREF - -/// GPIO41 is exposed on header 2, pin 11 -#define MT3620_RDB_HEADER2_PIN11_GPIO MT3620_GPIO41 - -/// GPIO43 is exposed on header 2, pin 12 -#define MT3620_RDB_HEADER2_PIN12_GPIO MT3620_GPIO43 - -/// GPIO42 is exposed on header 2, pin 13 -#define MT3620_RDB_HEADER2_PIN13_GPIO MT3620_GPIO42 - -/// GPIO44 is exposed on header 2, pin 14 -#define MT3620_RDB_HEADER2_PIN14_GPIO MT3620_GPIO44 - -// Header 3, pin 1 is 5V -// Header 3, pin 2 is GND -// Header 3, pin 3 is 3V3 -// Header 3, pin 4 is RTC_WAKEUP - -// Header 3, pin 6 is IO0 UART TX -// Header 3, pin 8 is IO1 UART TX -// Header 3, pin 10 is PMU EN - -// Header 3, pins 5, 7, 9, 11 are only supported as the ISU3 UART -#define MT3620_RDB_HEADER3_ISU3_UART MT3620_UART_ISU3 - -/// GPIO70 is exposed on header 3, pin 12 -#define MT3620_RDB_HEADER3_PIN12_GPIO MT3620_GPIO70 - -// Header 4, pin 1 is SWDIO -// Header 4, pin 2 is GND -// Header 4, pin 3 is SWCLK -// Header 4, pin 4 is SWO - -// Header 4, pins 5, 7, 9, 11 are only supported as the ISU1 UART -#define MT3620_RDB_HEADER4_ISU1_UART MT3620_UART_ISU1 - -// Header 4, pins 6, 8, 10, 12 are only supported as the ISU2 UART -#define MT3620_RDB_HEADER4_ISU2_UART MT3620_UART_ISU2 - -/// GPIO35 is exposed on header 4, pin 13 -#define MT3620_RDB_HEADER4_PIN13_GPIO MT3620_GPIO35 - -/// GPIO40 is exposed on header 4, pin 14 -#define MT3620_RDB_HEADER4_PIN14_GPIO MT3620_GPIO40 diff --git a/Samples/Temp_and_Humidity_SHT31/app_manifest.json b/Samples/Temp_and_Humidity_SHT31/app_manifest.json new file mode 100644 index 0000000..fe5e43d --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/app_manifest.json @@ -0,0 +1,13 @@ +{ + "SchemaVersion": 1, + "Name": "Temp_and_Humidity_SHT31", + "ComponentId": "16cf357f-d34e-4e47-ac3b-37eeaef09c1a", + "EntryPoint": "/bin/app", + "CmdArgs": [], + "Capabilities": { + "Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ], + "Uart": [ "ISU0", "ISU3" ], + "AllowedApplicationConnections": [] + }, + "ApplicationType": "Default" +} diff --git a/Samples/Temp_and_Humidity_SHT31/applibs_versions.h b/Samples/Temp_and_Humidity_SHT31/applibs_versions.h new file mode 100644 index 0000000..4078fb7 --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/applibs_versions.h @@ -0,0 +1,25 @@ +#pragma once + +/// +/// This identifier should be defined before including any of the networking-related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define NETWORKING_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the Wi-Fi related header files. +/// It indicates which version of the Wi-Fi data structures the application uses. +/// +#define WIFICONFIG_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the UART-related header files. +/// It indicates which version of the UART data structures the application uses. +/// +#define UART_STRUCTS_VERSION 1 + +/// +/// This identifier must be defined before including any of the SPI-related header files. +/// It indicates which version of the SPI data structures the application uses. +/// +#define SPI_STRUCTS_VERSION 1 diff --git a/Samples/Temp_and_Humidity_SHT31/launch.vs.json b/Samples/Temp_and_Humidity_SHT31/launch.vs.json new file mode 100644 index 0000000..4dcc310 --- /dev/null +++ b/Samples/Temp_and_Humidity_SHT31/launch.vs.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "azurespheredbg", + "name": "GDB Debugger (HLCore)", + "project": "CMakeLists.txt", + "inheritEnvironments": [ + "AzureSphere" + ], + "customLauncher": "AzureSphereLaunchOptions", + "workingDirectory": "${workspaceRoot}", + "applicationPath": "${debugInfo.target}", + "imagePath": "${debugInfo.targetImage}", + "targetCore": "HLCore", + "targetApiSet": "${env.AzureSphereTargetApiSet}", + "partnerComponents": [] + } + ] +} diff --git a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/main.c b/Samples/Temp_and_Humidity_SHT31/main.c similarity index 89% rename from Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/main.c rename to Samples/Temp_and_Humidity_SHT31/main.c index 79e15ea..21444fb 100644 --- a/Samples/Temp_and_Humidity_SHT31/Temp_and_Humidity_SHT31/main.c +++ b/Samples/Temp_and_Humidity_SHT31/main.c @@ -4,14 +4,11 @@ #include #include -// applibs_versions.h defines the API struct versions to use for applibs APIs. -#include "applibs_versions.h" #include +#include -#include "mt3620_rdb.h" - -#include "Grove.h" -#include "Sensors/GroveTempHumiSHT31.h" +#include "../../MT3620_Grove_Shield_Library/Grove.h" +#include "../../MT3620_Grove_Shield_Library/Sensors/GroveTempHumiSHT31.h" // This C application for the MT3620 Reference Development Board (Azure Sphere) // outputs a string every second to Visual Studio's Device Output window