Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
if(NOT IDF_TARGET)
|
||||
set(IDF_TARGET "esp32s3" CACHE STRING "ESP-IDF target")
|
||||
endif()
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../components"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../../dali_cpp"
|
||||
)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(gateway_app)
|
||||
@@ -0,0 +1,34 @@
|
||||
dependencies:
|
||||
espressif/cjson:
|
||||
component_hash:
|
||||
e788323270d90738662d66fffa910bfe1fba019bba087f01557e70c40485b469
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.0'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.7.19~2
|
||||
espressif/mqtt:
|
||||
component_hash:
|
||||
ffdad5659706b4dc14bc63f8eb73ef765efa015bf7e9adf71c813d52a2dc9342
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.3'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.0.0
|
||||
idf:
|
||||
source:
|
||||
type: idf
|
||||
version: 5.5.4
|
||||
direct_dependencies:
|
||||
- espressif/cjson
|
||||
- espressif/mqtt
|
||||
- idf
|
||||
manifest_hash: 9cb68c165ea4256d19cf45872db2feae2aad30a985b77b20da75d7dfa6eeab36
|
||||
target: esp32s3
|
||||
version: 2.0.0
|
||||
@@ -0,0 +1,6 @@
|
||||
idf_component_register(
|
||||
SRCS "app_main.cpp"
|
||||
REQUIRES gateway_core dali_domain gateway_runtime log
|
||||
)
|
||||
|
||||
set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
|
||||
@@ -0,0 +1,237 @@
|
||||
menu "Gateway App"
|
||||
|
||||
config GATEWAY_CHANNEL_COUNT
|
||||
int "Gateway channel count"
|
||||
range 1 2
|
||||
default 2
|
||||
help
|
||||
Number of logical DALI gateway channels exposed by the native gateway.
|
||||
|
||||
menu "Gateway Channel 1"
|
||||
|
||||
config GATEWAY_CHANNEL1_GW_ID
|
||||
int "Gateway id"
|
||||
range 0 255
|
||||
default 3
|
||||
help
|
||||
Lua-compatible gateway id for the first DALI channel.
|
||||
|
||||
choice GATEWAY_CHANNEL1_PHY
|
||||
prompt "Channel 1 PHY"
|
||||
default GATEWAY_CHANNEL1_PHY_DISABLED
|
||||
help
|
||||
Select the physical transport used by channel 1.
|
||||
|
||||
config GATEWAY_CHANNEL1_PHY_DISABLED
|
||||
bool "Disabled"
|
||||
|
||||
config GATEWAY_CHANNEL1_PHY_NATIVE
|
||||
bool "Native DALI GPIO"
|
||||
|
||||
config GATEWAY_CHANNEL1_PHY_UART1
|
||||
bool "Serial PHY on UART1"
|
||||
|
||||
config GATEWAY_CHANNEL1_PHY_UART2
|
||||
bool "Serial PHY on UART2"
|
||||
|
||||
endchoice
|
||||
|
||||
config GATEWAY_CHANNEL1_NATIVE_BUS_ID
|
||||
int "Native DALI bus id"
|
||||
depends on GATEWAY_CHANNEL1_PHY_NATIVE
|
||||
range 0 15
|
||||
default 0
|
||||
help
|
||||
Logical DALI HAL bus index for channel 1.
|
||||
|
||||
config GATEWAY_CHANNEL1_NATIVE_TX_PIN
|
||||
int "Native DALI TX pin"
|
||||
depends on GATEWAY_CHANNEL1_PHY_NATIVE
|
||||
range 0 48
|
||||
default 18
|
||||
help
|
||||
ESP32-S3 GPIO used for channel 1 native DALI transmit.
|
||||
|
||||
config GATEWAY_CHANNEL1_NATIVE_RX_PIN
|
||||
int "Native DALI RX pin"
|
||||
depends on GATEWAY_CHANNEL1_PHY_NATIVE
|
||||
range 0 48
|
||||
default 8
|
||||
help
|
||||
ESP32-S3 GPIO used for channel 1 native DALI receive.
|
||||
|
||||
config GATEWAY_CHANNEL1_NATIVE_BAUDRATE
|
||||
int "Native DALI baudrate"
|
||||
depends on GATEWAY_CHANNEL1_PHY_NATIVE
|
||||
range 400 2400
|
||||
default 1200
|
||||
help
|
||||
Runtime baudrate used for channel 1 native DALI timing.
|
||||
|
||||
config GATEWAY_CHANNEL1_SERIAL_TX_PIN
|
||||
int "Serial PHY TX pin"
|
||||
depends on GATEWAY_CHANNEL1_PHY_UART1 || GATEWAY_CHANNEL1_PHY_UART2
|
||||
range 0 48
|
||||
default 1
|
||||
help
|
||||
ESP32-S3 GPIO used by the channel 1 serial PHY transmit pin.
|
||||
|
||||
config GATEWAY_CHANNEL1_SERIAL_RX_PIN
|
||||
int "Serial PHY RX pin"
|
||||
depends on GATEWAY_CHANNEL1_PHY_UART1 || GATEWAY_CHANNEL1_PHY_UART2
|
||||
range 0 48
|
||||
default 2
|
||||
help
|
||||
ESP32-S3 GPIO used by the channel 1 serial PHY receive pin.
|
||||
|
||||
config GATEWAY_CHANNEL1_SERIAL_BAUDRATE
|
||||
int "Serial PHY baudrate"
|
||||
depends on GATEWAY_CHANNEL1_PHY_UART1 || GATEWAY_CHANNEL1_PHY_UART2
|
||||
range 1200 921600
|
||||
default 9600
|
||||
help
|
||||
UART baudrate used by the channel 1 serial PHY.
|
||||
|
||||
config GATEWAY_CHANNEL1_SERIAL_RX_BUFFER
|
||||
int "Serial PHY RX buffer bytes"
|
||||
depends on GATEWAY_CHANNEL1_PHY_UART1 || GATEWAY_CHANNEL1_PHY_UART2
|
||||
range 128 4096
|
||||
default 512
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Gateway Channel 2"
|
||||
|
||||
config GATEWAY_CHANNEL2_GW_ID
|
||||
int "Gateway id"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2
|
||||
range 0 255
|
||||
default 4
|
||||
help
|
||||
Lua-compatible gateway id for the second DALI channel.
|
||||
|
||||
choice GATEWAY_CHANNEL2_PHY
|
||||
prompt "Channel 2 PHY"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2
|
||||
default GATEWAY_CHANNEL2_PHY_DISABLED
|
||||
help
|
||||
Select the physical transport used by channel 2.
|
||||
|
||||
config GATEWAY_CHANNEL2_PHY_DISABLED
|
||||
bool "Disabled"
|
||||
|
||||
config GATEWAY_CHANNEL2_PHY_NATIVE
|
||||
bool "Native DALI GPIO"
|
||||
|
||||
config GATEWAY_CHANNEL2_PHY_UART1
|
||||
bool "Serial PHY on UART1"
|
||||
|
||||
config GATEWAY_CHANNEL2_PHY_UART2
|
||||
bool "Serial PHY on UART2"
|
||||
|
||||
endchoice
|
||||
|
||||
config GATEWAY_CHANNEL2_NATIVE_BUS_ID
|
||||
int "Native DALI bus id"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && GATEWAY_CHANNEL2_PHY_NATIVE
|
||||
range 0 15
|
||||
default 1
|
||||
help
|
||||
Logical DALI HAL bus index for channel 2.
|
||||
|
||||
config GATEWAY_CHANNEL2_NATIVE_TX_PIN
|
||||
int "Native DALI TX pin"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && GATEWAY_CHANNEL2_PHY_NATIVE
|
||||
range 0 48
|
||||
default 19
|
||||
help
|
||||
ESP32-S3 GPIO used for channel 2 native DALI transmit.
|
||||
|
||||
config GATEWAY_CHANNEL2_NATIVE_RX_PIN
|
||||
int "Native DALI RX pin"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && GATEWAY_CHANNEL2_PHY_NATIVE
|
||||
range 0 48
|
||||
default 9
|
||||
help
|
||||
ESP32-S3 GPIO used for channel 2 native DALI receive.
|
||||
|
||||
config GATEWAY_CHANNEL2_NATIVE_BAUDRATE
|
||||
int "Native DALI baudrate"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && GATEWAY_CHANNEL2_PHY_NATIVE
|
||||
range 400 2400
|
||||
default 1200
|
||||
help
|
||||
Runtime baudrate used for channel 2 native DALI timing.
|
||||
|
||||
config GATEWAY_CHANNEL2_SERIAL_TX_PIN
|
||||
int "Serial PHY TX pin"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && (GATEWAY_CHANNEL2_PHY_UART1 || GATEWAY_CHANNEL2_PHY_UART2)
|
||||
range 0 48
|
||||
default 6
|
||||
help
|
||||
ESP32-S3 GPIO used by the channel 2 serial PHY transmit pin.
|
||||
|
||||
config GATEWAY_CHANNEL2_SERIAL_RX_PIN
|
||||
int "Serial PHY RX pin"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && (GATEWAY_CHANNEL2_PHY_UART1 || GATEWAY_CHANNEL2_PHY_UART2)
|
||||
range 0 48
|
||||
default 7
|
||||
help
|
||||
ESP32-S3 GPIO used by the channel 2 serial PHY receive pin.
|
||||
|
||||
config GATEWAY_CHANNEL2_SERIAL_BAUDRATE
|
||||
int "Serial PHY baudrate"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && (GATEWAY_CHANNEL2_PHY_UART1 || GATEWAY_CHANNEL2_PHY_UART2)
|
||||
range 1200 921600
|
||||
default 9600
|
||||
help
|
||||
UART baudrate used by the channel 2 serial PHY.
|
||||
|
||||
config GATEWAY_CHANNEL2_SERIAL_RX_BUFFER
|
||||
int "Serial PHY RX buffer bytes"
|
||||
depends on GATEWAY_CHANNEL_COUNT >= 2 && (GATEWAY_CHANNEL2_PHY_UART1 || GATEWAY_CHANNEL2_PHY_UART2)
|
||||
range 128 4096
|
||||
default 512
|
||||
|
||||
endmenu
|
||||
|
||||
config GATEWAY_ENABLE_DALI_BUS
|
||||
bool "Legacy single local DALI bus switch"
|
||||
default n
|
||||
help
|
||||
Legacy compatibility option retained for existing sdkconfig files. New code uses the
|
||||
per-channel PHY selectors above.
|
||||
|
||||
config GATEWAY_DALI_BUS_ID
|
||||
int "DALI bus id"
|
||||
depends on GATEWAY_ENABLE_DALI_BUS
|
||||
range 0 15
|
||||
default 0
|
||||
help
|
||||
Logical DALI bus index used by the HAL queue set.
|
||||
|
||||
config GATEWAY_DALI_TX_PIN
|
||||
int "DALI TX pin"
|
||||
depends on GATEWAY_ENABLE_DALI_BUS
|
||||
range 0 48
|
||||
default 18
|
||||
help
|
||||
ESP32-S3 GPIO used for the DALI transmit pin.
|
||||
|
||||
config GATEWAY_DALI_RX_PIN
|
||||
int "DALI RX pin"
|
||||
depends on GATEWAY_ENABLE_DALI_BUS
|
||||
range 0 48
|
||||
default 8
|
||||
help
|
||||
ESP32-S3 GPIO used for the DALI receive pin.
|
||||
|
||||
config GATEWAY_DALI_BAUDRATE
|
||||
int "DALI baudrate"
|
||||
depends on GATEWAY_ENABLE_DALI_BUS
|
||||
range 400 2400
|
||||
default 1200
|
||||
help
|
||||
Runtime baudrate used when initializing the local DALI bus.
|
||||
|
||||
endmenu
|
||||
@@ -0,0 +1,126 @@
|
||||
#include "dali_domain.hpp"
|
||||
#include "gateway_core.hpp"
|
||||
#include "gateway_runtime.hpp"
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#ifndef CONFIG_GATEWAY_CHANNEL_COUNT
|
||||
#define CONFIG_GATEWAY_CHANNEL_COUNT 2
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
constexpr const char* kProjectName = "DALI_485_Gateway";
|
||||
constexpr const char* kProjectVersion = "0.1.0";
|
||||
|
||||
[[maybe_unused]] void LogBindError(const char* channel_name, esp_err_t err) {
|
||||
if (err != ESP_OK) {
|
||||
std::printf("gateway_main: failed to bind %s err=%d\n", channel_name, err);
|
||||
}
|
||||
}
|
||||
|
||||
void BindConfiguredChannels(gateway::DaliDomainService& dali_domain,
|
||||
const gateway::GatewayRuntime& runtime) {
|
||||
#if CONFIG_GATEWAY_CHANNEL1_PHY_NATIVE
|
||||
gateway::DaliHardwareBusConfig channel1{};
|
||||
channel1.channel_index = 0;
|
||||
channel1.gateway_id = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL1_GW_ID);
|
||||
channel1.bus_id = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL1_NATIVE_BUS_ID);
|
||||
channel1.tx_pin = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL1_NATIVE_TX_PIN);
|
||||
channel1.rx_pin = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL1_NATIVE_RX_PIN);
|
||||
channel1.baudrate = static_cast<uint32_t>(CONFIG_GATEWAY_CHANNEL1_NATIVE_BAUDRATE);
|
||||
channel1.name = runtime.gatewayName(channel1.gateway_id);
|
||||
LogBindError("channel1 native DALI", dali_domain.bindHardwareBus(channel1));
|
||||
#elif CONFIG_GATEWAY_CHANNEL1_PHY_UART1 || CONFIG_GATEWAY_CHANNEL1_PHY_UART2
|
||||
gateway::DaliSerialBusConfig channel1{};
|
||||
channel1.channel_index = 0;
|
||||
channel1.gateway_id = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL1_GW_ID);
|
||||
#if CONFIG_GATEWAY_CHANNEL1_PHY_UART1
|
||||
channel1.uart_port = 1;
|
||||
#else
|
||||
channel1.uart_port = 2;
|
||||
#endif
|
||||
channel1.tx_pin = CONFIG_GATEWAY_CHANNEL1_SERIAL_TX_PIN;
|
||||
channel1.rx_pin = CONFIG_GATEWAY_CHANNEL1_SERIAL_RX_PIN;
|
||||
channel1.baudrate = static_cast<uint32_t>(CONFIG_GATEWAY_CHANNEL1_SERIAL_BAUDRATE);
|
||||
channel1.rx_buffer_size = static_cast<size_t>(CONFIG_GATEWAY_CHANNEL1_SERIAL_RX_BUFFER);
|
||||
channel1.tx_buffer_size = static_cast<size_t>(CONFIG_GATEWAY_CHANNEL1_SERIAL_RX_BUFFER);
|
||||
channel1.name = runtime.gatewayName(channel1.gateway_id);
|
||||
LogBindError("channel1 serial DALI", dali_domain.bindSerialBus(channel1));
|
||||
#endif
|
||||
|
||||
#if CONFIG_GATEWAY_CHANNEL_COUNT >= 2
|
||||
#if CONFIG_GATEWAY_CHANNEL2_PHY_NATIVE
|
||||
gateway::DaliHardwareBusConfig channel2{};
|
||||
channel2.channel_index = 1;
|
||||
channel2.gateway_id = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL2_GW_ID);
|
||||
channel2.bus_id = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL2_NATIVE_BUS_ID);
|
||||
channel2.tx_pin = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL2_NATIVE_TX_PIN);
|
||||
channel2.rx_pin = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL2_NATIVE_RX_PIN);
|
||||
channel2.baudrate = static_cast<uint32_t>(CONFIG_GATEWAY_CHANNEL2_NATIVE_BAUDRATE);
|
||||
channel2.name = runtime.gatewayName(channel2.gateway_id);
|
||||
LogBindError("channel2 native DALI", dali_domain.bindHardwareBus(channel2));
|
||||
#elif CONFIG_GATEWAY_CHANNEL2_PHY_UART1 || CONFIG_GATEWAY_CHANNEL2_PHY_UART2
|
||||
gateway::DaliSerialBusConfig channel2{};
|
||||
channel2.channel_index = 1;
|
||||
channel2.gateway_id = static_cast<uint8_t>(CONFIG_GATEWAY_CHANNEL2_GW_ID);
|
||||
#if CONFIG_GATEWAY_CHANNEL2_PHY_UART1
|
||||
channel2.uart_port = 1;
|
||||
#else
|
||||
channel2.uart_port = 2;
|
||||
#endif
|
||||
channel2.tx_pin = CONFIG_GATEWAY_CHANNEL2_SERIAL_TX_PIN;
|
||||
channel2.rx_pin = CONFIG_GATEWAY_CHANNEL2_SERIAL_RX_PIN;
|
||||
channel2.baudrate = static_cast<uint32_t>(CONFIG_GATEWAY_CHANNEL2_SERIAL_BAUDRATE);
|
||||
channel2.rx_buffer_size = static_cast<size_t>(CONFIG_GATEWAY_CHANNEL2_SERIAL_RX_BUFFER);
|
||||
channel2.tx_buffer_size = static_cast<size_t>(CONFIG_GATEWAY_CHANNEL2_SERIAL_RX_BUFFER);
|
||||
channel2.name = runtime.gatewayName(channel2.gateway_id);
|
||||
LogBindError("channel2 serial DALI", dali_domain.bindSerialBus(channel2));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" void app_main(void) {
|
||||
ESP_ERROR_CHECK(gateway::InitializeRuntimeNvs());
|
||||
|
||||
const gateway::BootProfile profile{
|
||||
gateway::AppRole::kGateway,
|
||||
"gateway",
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
};
|
||||
|
||||
gateway::GatewayCore core(profile);
|
||||
core.start();
|
||||
|
||||
gateway::DaliDomainService dali_domain;
|
||||
gateway::GatewayRuntime runtime(
|
||||
profile,
|
||||
gateway::GatewayRuntimeConfig{
|
||||
kProjectName,
|
||||
kProjectVersion,
|
||||
gateway::ReadRuntimeSerialId(),
|
||||
},
|
||||
&dali_domain);
|
||||
ESP_ERROR_CHECK(runtime.start());
|
||||
runtime.setGatewayCount(CONFIG_GATEWAY_CHANNEL_COUNT);
|
||||
BindConfiguredChannels(dali_domain, runtime);
|
||||
|
||||
const auto device_info = runtime.deviceInfo();
|
||||
std::printf("gateway_main: dali domain implementation=%s bound=%d channels=%u\n",
|
||||
dali_domain.implementationName(), dali_domain.isBound(),
|
||||
static_cast<unsigned>(dali_domain.channelCount()));
|
||||
for (const auto& channel : dali_domain.channelInfo()) {
|
||||
std::printf("gateway_main: channel=%u gateway=%u name=%s\n", channel.channel_index,
|
||||
channel.gateway_id, channel.name.c_str());
|
||||
}
|
||||
std::printf("gateway_main: runtime device type=%s serial=%s project=%s version=%s\n",
|
||||
device_info.type.c_str(), device_info.serial_id.c_str(),
|
||||
device_info.project.c_str(), device_info.version.c_str());
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, 0x9000, 0x6000,
|
||||
otadata, data, ota, 0xf000, 0x2000,
|
||||
phy_init, data, phy, 0x11000, 0x1000,
|
||||
factory, app, factory, 0x20000, 0x180000,
|
||||
ota_0, app, ota_0, 0x1a0000, 0x180000,
|
||||
ota_1, app, ota_1, 0x320000, 0x180000,
|
||||
storage, data, spiffs, 0x4a0000, 0xb60000,
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
|
||||
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
CONFIG_PARTITION_TABLE_MD5=y
|
||||
|
||||
CONFIG_BT_ENABLED=y
|
||||
CONFIG_BT_NIMBLE_ENABLED=y
|
||||
|
||||
CONFIG_ETH_ENABLED=y
|
||||
CONFIG_ETH_USE_SPI_ETHERNET=y
|
||||
CONFIG_ETH_SPI_ETHERNET_W5500=y
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
if(NOT IDF_TARGET)
|
||||
set(IDF_TARGET "esp32s3" CACHE STRING "ESP-IDF target")
|
||||
endif()
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../components"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../../dali_cpp"
|
||||
)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(receiver_app)
|
||||
@@ -0,0 +1,34 @@
|
||||
dependencies:
|
||||
espressif/cjson:
|
||||
component_hash:
|
||||
e788323270d90738662d66fffa910bfe1fba019bba087f01557e70c40485b469
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.0'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.7.19~2
|
||||
espressif/mqtt:
|
||||
component_hash:
|
||||
ffdad5659706b4dc14bc63f8eb73ef765efa015bf7e9adf71c813d52a2dc9342
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.3'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.0.0
|
||||
idf:
|
||||
source:
|
||||
type: idf
|
||||
version: 5.5.4
|
||||
direct_dependencies:
|
||||
- espressif/cjson
|
||||
- espressif/mqtt
|
||||
- idf
|
||||
manifest_hash: c84936cd9495d1229bcfb1c42ee403b1c8858c73866e5ccacb7bf36de2b929c2
|
||||
target: esp32s3
|
||||
version: 2.0.0
|
||||
@@ -0,0 +1,6 @@
|
||||
idf_component_register(
|
||||
SRCS "app_main.cpp"
|
||||
REQUIRES gateway_core gateway_runtime
|
||||
)
|
||||
|
||||
set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
|
||||
@@ -0,0 +1,38 @@
|
||||
#include "gateway_core.hpp"
|
||||
#include "gateway_runtime.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr const char* kProjectName = "UartRelayer";
|
||||
constexpr const char* kProjectVersion = "0.1.0";
|
||||
|
||||
gateway::BootProfile ReceiverProfile() {
|
||||
return gateway::BootProfile{
|
||||
gateway::AppRole::kReceiver,
|
||||
"receiver",
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" void app_main(void) {
|
||||
ESP_ERROR_CHECK(gateway::InitializeRuntimeNvs());
|
||||
|
||||
gateway::GatewayCore core(ReceiverProfile());
|
||||
core.start();
|
||||
|
||||
gateway::GatewayRuntime runtime(
|
||||
core.profile(),
|
||||
gateway::GatewayRuntimeConfig{
|
||||
kProjectName,
|
||||
kProjectVersion,
|
||||
gateway::ReadRuntimeSerialId(),
|
||||
},
|
||||
nullptr);
|
||||
ESP_ERROR_CHECK(runtime.start());
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, 0x9000, 0x6000,
|
||||
otadata, data, ota, 0xf000, 0x2000,
|
||||
phy_init, data, phy, 0x11000, 0x1000,
|
||||
factory, app, factory, 0x20000, 0x180000,
|
||||
ota_0, app, ota_0, 0x1a0000, 0x180000,
|
||||
ota_1, app, ota_1, 0x320000, 0x180000,
|
||||
storage, data, spiffs, 0x4a0000, 0xb60000,
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
|
||||
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
CONFIG_PARTITION_TABLE_MD5=y
|
||||
@@ -0,0 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
if(NOT IDF_TARGET)
|
||||
set(IDF_TARGET "esp32s3" CACHE STRING "ESP-IDF target")
|
||||
endif()
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../components"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../../dali_cpp"
|
||||
)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(telemetry_app)
|
||||
@@ -0,0 +1,34 @@
|
||||
dependencies:
|
||||
espressif/cjson:
|
||||
component_hash:
|
||||
e788323270d90738662d66fffa910bfe1fba019bba087f01557e70c40485b469
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.0'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.7.19~2
|
||||
espressif/mqtt:
|
||||
component_hash:
|
||||
ffdad5659706b4dc14bc63f8eb73ef765efa015bf7e9adf71c813d52a2dc9342
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.3'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.0.0
|
||||
idf:
|
||||
source:
|
||||
type: idf
|
||||
version: 5.5.4
|
||||
direct_dependencies:
|
||||
- espressif/cjson
|
||||
- espressif/mqtt
|
||||
- idf
|
||||
manifest_hash: c84936cd9495d1229bcfb1c42ee403b1c8858c73866e5ccacb7bf36de2b929c2
|
||||
target: esp32s3
|
||||
version: 2.0.0
|
||||
@@ -0,0 +1,6 @@
|
||||
idf_component_register(
|
||||
SRCS "app_main.cpp"
|
||||
REQUIRES gateway_core gateway_runtime
|
||||
)
|
||||
|
||||
set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
|
||||
@@ -0,0 +1,38 @@
|
||||
#include "gateway_core.hpp"
|
||||
#include "gateway_runtime.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr const char* kProjectName = "TelemetryReceiver";
|
||||
constexpr const char* kProjectVersion = "0.1.0";
|
||||
|
||||
gateway::BootProfile TelemetryProfile() {
|
||||
return gateway::BootProfile{
|
||||
gateway::AppRole::kTelemetry,
|
||||
"telemetry",
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" void app_main(void) {
|
||||
ESP_ERROR_CHECK(gateway::InitializeRuntimeNvs());
|
||||
|
||||
gateway::GatewayCore core(TelemetryProfile());
|
||||
core.start();
|
||||
|
||||
gateway::GatewayRuntime runtime(
|
||||
core.profile(),
|
||||
gateway::GatewayRuntimeConfig{
|
||||
kProjectName,
|
||||
kProjectVersion,
|
||||
gateway::ReadRuntimeSerialId(),
|
||||
},
|
||||
nullptr);
|
||||
ESP_ERROR_CHECK(runtime.start());
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, 0x9000, 0x6000,
|
||||
otadata, data, ota, 0xf000, 0x2000,
|
||||
phy_init, data, phy, 0x11000, 0x1000,
|
||||
factory, app, factory, 0x20000, 0x180000,
|
||||
ota_0, app, ota_0, 0x1a0000, 0x180000,
|
||||
ota_1, app, ota_1, 0x320000, 0x180000,
|
||||
storage, data, spiffs, 0x4a0000, 0xb60000,
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
|
||||
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
CONFIG_PARTITION_TABLE_MD5=y
|
||||
Reference in New Issue
Block a user