Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,15 @@
[submodule ".\\avnet_rsl10_2devices\\HardwareDefinitions"]
path = .\\avnet_rsl10_2devices\\HardwareDefinitions
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.HardwareDefinitions.git
[submodule "avnet_lightranger5/AzureSphereDevX"]
path = avnet_lightranger5/AzureSphereDevX
[submodule "avnet_sensors_converge/avnet_lightranger5/AzureSphereDevX"]
path = avnet_sensors_converge/avnet_lightranger5/AzureSphereDevX
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.git
[submodule "avnet_lightranger5/HardwareDefinitions"]
path = avnet_lightranger5/HardwareDefinitions
[submodule "avnet_sensors_converge/avnet_lightranger5/HardwareDefinitions"]
path = avnet_sensors_converge/avnet_lightranger5/HardwareDefinitions
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.HardwareDefinitions.git
[submodule "avnet_sensors_converge/avnet_tempHum13/AzureSphereDevX"]
path = avnet_sensors_converge/avnet_tempHum13/AzureSphereDevX
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.git
[submodule "avnet_sensors_converge/avnet_tempHum13/HardwareDefinitions"]
path = avnet_sensors_converge/avnet_tempHum13/HardwareDefinitions
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.HardwareDefinitions.git
1 change: 1 addition & 0 deletions avnet_sensors_converge/avnet_lightranger5/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/*
Binary file not shown.
Binary file not shown.
Submodule HardwareDefinitions added at 871149
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions avnet_sensors_converge/avnet_tempHum13/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/*
27 changes: 27 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// 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,
"partnerComponents": [ "f6768b9a-e086-4f5a-8219-5ffe9684b001" ],
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
15 changes: 15 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cmake.generator": "Ninja",
"cmake.buildDirectory": "${workspaceRoot}/out/ARM-${buildType}",
"cmake.buildToolArgs": [ "-v" ],
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereToolchain.cmake",
"AZURE_SPHERE_TARGET_API_SET": "latest-lts"
},
"cmake.configureOnOpen": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"files.associations": {
"dx_avnet_iot_connect.h": "c",
"dx_json_serializer.h": "c"
}
}
1 change: 1 addition & 0 deletions avnet_sensors_converge/avnet_tempHum13/AzureSphereDevX
Submodule AzureSphereDevX added at 32fb21
64 changes: 64 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

cmake_minimum_required (VERSION 3.10)

project (avnet_TEMPHUM_TMF8801_HLApp-V1 C)

# Check if there is a global azsphere_board.cmake file
get_filename_component(PARENT_DIR ${PROJECT_SOURCE_DIR} DIRECTORY)

if (EXISTS "${PARENT_DIR}/azsphere_board.global.txt")
include("${PARENT_DIR}/azsphere_board.global.txt")
else()
include(azsphere_board.txt)
endif()

if (EXISTS "${PARENT_DIR}/tools/cmake/azsphere_config.cmake")
include(../tools/cmake/azsphere_config.cmake)
auto_generate_azsphere_config()
else()

# For information on setting tools revision and target api set see
# https://docs.microsoft.com/en-us/azure-sphere/app-development/using-cmake-functions

azsphere_configure_tools(TOOLS_REVISION "21.07")
azsphere_configure_api(TARGET_API_SET "12")

endif()

add_subdirectory("AzureSphereDevX" out)

# Create executable
add_executable (${PROJECT_NAME} main.c)
target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c azure_sphere_devx)
target_include_directories(${PROJECT_NAME} PUBLIC AzureSphereDevX/include )


set(BOARD_COUNTER 0)

if(AVNET)
MATH(EXPR BOARD_COUNTER "${BOARD_COUNTER}+1")
add_definitions( -DOEM_AVNET=TRUE )
azsphere_target_hardware_definition(${PROJECT_NAME} TARGET_DIRECTORY "HardwareDefinitions/avnet_mt3620_sk" TARGET_DEFINITION "sample_appliance.json")
message(STATUS "Azure Sphere board selected: AVNET REV 1")
endif(AVNET)

if(AVNET_REV_2)
MATH(EXPR BOARD_COUNTER "${BOARD_COUNTER}+1")
add_definitions( -DOEM_AVNET=TRUE )
azsphere_target_hardware_definition(${PROJECT_NAME} TARGET_DIRECTORY "HardwareDefinitions/avnet_mt3620_sk_rev2" TARGET_DEFINITION "sample_appliance.json")
message(STATUS "Azure Sphere board selected: AVNET REV 2")
endif(AVNET_REV_2)


if(BOARD_COUNTER EQUAL 0)
message(FATAL_ERROR "No Azure Sphere boards selected. Ensure one board set")
endif()

if(BOARD_COUNTER GREATER 1)
message(FATAL_ERROR "Multiple (${BOARD_COUNTER}) Azure Sphere boards selected. Ensure only one board set")
endif()


azsphere_target_add_image_package(${PROJECT_NAME})
47 changes: 47 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"environments": [
{
"environment": "AzureSphere"
}
],
"configurations": [
{
"name": "ARM-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"AzureSphere"
],
"buildRoot": "${projectDir}\\out\\${name}",
"installRoot": "${projectDir}\\out\\${name}",
"cmakeToolchain": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": [
{
"name": "AZURE_SPHERE_TARGET_API_SET",
"value": "latest-lts"
}
]
},
{
"name": "ARM-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"AzureSphere"
],
"buildRoot": "${projectDir}\\out\\${name}",
"installRoot": "${projectDir}\\out\\${name}",
"cmakeToolchain": "${env.AzureSphereDefaultSDKDir}CMakeFiles\\AzureSphereToolchain.cmake",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": [
{
"name": "AZURE_SPHERE_TARGET_API_SET",
"value": "latest-lts"
}
]
}
]
}
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions avnet_sensors_converge/avnet_tempHum13/HardwareDefinitions
Submodule HardwareDefinitions added at 871149
17 changes: 17 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Azure IoT Starter Project (empty)

This is an empty (starter) project that can be used for new Azure Sphere applications based on the DevX library. The project connects to an Azure IoTHub,
IoTCentral, or Avnet's IoTConnect and nothing more. Use the other examples in this folder to help you see how to build out the project to meet your requirements. Search the project for "TODO" to see where to add definitions, declarations and code.
## Config app_manifest.json sample

1. Set ID Scope
1. Set Allowed connections
1. Set DeviceAuthentication

For more information refer to:

1. [Adding the Azure Sphere DevX library](https://github.com/gloveboxes/AzureSphereDevX/wiki/Adding-the-DevX-Library)
1. [Azure Messaging](https://github.com/gloveboxes/AzureSphereDevX/wiki/IoT-Hub-Sending-messages)
1. [Device Twins](https://github.com/gloveboxes/AzureSphereDevX/wiki/IoT-Hub-Device-Twins)
1. [Direct Methods](https://github.com/gloveboxes/AzureSphereDevX/wiki/IoT-Hub-Direct-Methods)
1. [GPIO](https://github.com/gloveboxes/AzureSphereDevX/wiki/Working-with-GPIO)
14 changes: 14 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/app_exit_codes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

/* Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. */

/// <summary>
/// Exit codes for this application. Application exit codes
/// must be between 1 and 149, where 0 is reserved for successful
// termination. dx_exit_codes.h owns/defines exit codes 0 and
/// 150 - 254.
/// </summary>
typedef enum {
APP_ExitCode_Telemetry_Buffer_Too_Small = 1
} App_Exit_Code;
16 changes: 16 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/app_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"SchemaVersion": 1,
"Name": "avnet_TEMPHUM_TMF8801_HLApp-V1",
"ComponentId": "b8f5931e-173a-40f5-a4f8-3d98240f53ec",
"EntryPoint": "/bin/app",
"CmdArgs": [ "--ScopeID", "0ne00000000" ],
"Capabilities": {
"Gpio": ["$SAMPLE_BUTTON_1", "$SAMPLE_BUTTON_2"],
"Pwm": [ "$SAMPLE_LED_PWM_CONTROLLER" ],
"AllowedConnections": [ "global.azure-devices-provisioning.net",
"YOUR_IOT_HUB-HOSTNAME.azure-devices.net"],
"DeviceAuthentication": "00000000-0000-0000-0000-000000000000",
"AllowedApplicationConnections": [ "f6768b9a-e086-4f5a-8219-5ffe9684b001" ]
},
"ApplicationType": "Default"
}
25 changes: 25 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/applibs_versions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

/// <summary>
/// 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.
/// </summary>
#define NETWORKING_STRUCTS_VERSION 1

/// <summary>
/// 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.
/// </summary>
#define WIFICONFIG_STRUCTS_VERSION 1

/// <summary>
/// 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.
/// </summary>
#define UART_STRUCTS_VERSION 1

/// <summary>
/// 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.
/// </summary>
#define SPI_STRUCTS_VERSION 1
7 changes: 7 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/azsphere_board.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Select your developer board by removing the # tag from the beginning of the line
# If you are NOT using the AVNET Revision 1 board be sure to comment out the AVNET board

# set(AVNET TRUE "AVNET Azure Sphere Starter Kit Revision 1")
set(AVNET_REV_2 TRUE "AVNET Azure Sphere Starter Kit Revision 2")
# set(SEEED_STUDIO_RDB TRUE "Seeed Studio Azure Sphere MT3620 Development Kit (aka Reference Design Board or RDB)")
# set(SEEED_STUDIO_MINI TRUE "Seeed Studio Azure Sphere MT3620 Mini Dev Board")
43 changes: 43 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/htu21d_rtapp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Copyright (c) Avnet Incorporated. All rights reserved.
Licensed under the MIT License. */

#pragma once

#define JSON_STRING_MAX_SIZE 100

// Define the different messages IDs we can send to real time applications
// If this enum is changed, it also needs to be changed for the high level application
typedef enum __attribute__((packed))
{
IC_TEMPHUM_UNKNOWN,
IC_TEMPHUM_HEARTBEAT,
IC_TEMPHUM_READ_SENSOR_RESPOND_WITH_TELEMETRY,
IC_TEMPHUM_SET_TELEMETRY_SEND_RATE,
/////////////////////////////////////////////////////////////////////////////////
// Don't change the enums above or the generic RTApp implementation will break //
/////////////////////////////////////////////////////////////////////////////////
IC_TEMPHUM_READ_SENSOR

} INTER_CORE_CMD_TEMPHUM;

// Define the expected data structure.
typedef struct __attribute__((packed))
{
INTER_CORE_CMD_TEMPHUM cmd;
uint32_t telemtrySendRate;
////////////////////////////////////////////////////////////////////////////////////////
// Don't change the declarations above or the generic RTApp implementation will break //
////////////////////////////////////////////////////////////////////////////////////////
} IC_COMMAND_BLOCK_TEMPHUM_HL_TO_RT;

typedef struct __attribute__((packed))
{
INTER_CORE_CMD_TEMPHUM cmd;
uint32_t telemtrySendRate;
char telemetryJSON[JSON_STRING_MAX_SIZE];
////////////////////////////////////////////////////////////////////////////////////////
// Don't change the declarations above or the generic RTApp implementation will break //
////////////////////////////////////////////////////////////////////////////////////////
float temp;
float hum;
} IC_COMMAND_BLOCK_TEMPHUM_RT_TO_HL;
21 changes: 21 additions & 0 deletions avnet_sensors_converge/avnet_tempHum13/launch.vs.json
Original file line number Diff line number Diff line change
@@ -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": [ "f6768b9a-e086-4f5a-8219-5ffe9684b001" ]
}
]
}
Loading