Skip to content

Commit d80f62d

Browse files
marekmaskarinechubmartin
authored andcommitted
application: meteo: Update to Cloud v2
1 parent 1ffa251 commit d80f62d

38 files changed

+2872
-1548
lines changed

applications/meteo/CMakeLists.txt

+24-18
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
11
#
2-
# Copyright (c) 2023 HARDWARIO a.s.
2+
# Copyright (c) 2024 HARDWARIO a.s.
33
#
4-
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
4+
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
55
#
66

77
cmake_minimum_required(VERSION 3.20.0)
88

9-
# Supported shields: ctr_barometer_tag ctr_ds18b20 ctr_lte ctr_s2 ctr_meteo_a ctr_z
10-
set(SHIELD ctr_lte ctr_x2_modbus_a)
9+
set(ENV{FW_BUNDLE} "com.hardwario.chester.app.meteo")
10+
set(ENV{FW_VERSION} "v3.0.0")
11+
set(ENV{FW_NAME} "CHESTER Meteo")
1112

1213
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
13-
project(meteo)
14+
15+
project(chester-meteo)
1416

1517
add_custom_command(
16-
COMMAND ../../../scripts/gen-msg-key.py ../codec/cbor-decoder.yaml ../src/msg_key.h
17-
OUTPUT ../src/msg_key.h
18-
MAIN_DEPENDENCY ../codec/cbor-decoder.yaml
18+
COMMAND west gen-codec -d ../codec/cbor-decoder.yaml -e ../codec/cbor-encoder.yaml -o ../src/app_codec.h
19+
OUTPUT ../src/app_codec.h
20+
DEPENDS ../codec/cbor-decoder.yaml
1921
)
2022

21-
target_sources(app PRIVATE src/app_backup.c)
22-
target_sources(app PRIVATE src/app_cbor.c)
23-
target_sources(app PRIVATE src/app_config.c)
2423
target_sources(app PRIVATE src/app_data.c)
25-
target_sources(app PRIVATE src/app_handler.c)
26-
target_sources(app PRIVATE src/app_init.c)
24+
target_sources(app PRIVATE src/app_shell.c)
2725
target_sources(app PRIVATE src/app_lambrecht.c)
26+
target_sources(app PRIVATE src/app_codec.h)
2827
target_sources(app PRIVATE src/app_power.c)
29-
target_sources(app PRIVATE src/app_send.c)
30-
target_sources(app PRIVATE src/app_sensor.c)
31-
target_sources(app PRIVATE src/app_shell.c)
28+
target_sources(app PRIVATE src/main.c)
29+
target_sources(app PRIVATE src/app_cbor.c)
3230
target_sources(app PRIVATE src/app_work.c)
31+
target_sources(app PRIVATE src/app_sensor.c)
32+
target_sources(app PRIVATE src/app_init.c)
33+
target_sources(app PRIVATE src/app_backup.c)
34+
target_sources(app PRIVATE src/app_send.c)
35+
target_sources(app PRIVATE src/app_handler.c)
36+
target_sources(app PRIVATE src/app_config.c)
3337

34-
target_sources(app PRIVATE src/main.c)
38+
target_precompile_headers(app PRIVATE src/feature.h)
39+
target_precompile_headers(app PRIVATE src/variant.h)
3540

36-
target_sources(app PRIVATE src/msg_key.h)
41+
# ### Preserved code "cmake" (begin)
42+
# ^^^ Preserved code "cmake" (end)

applications/meteo/Kconfig

+59-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,69 @@
11
#
2-
# Copyright (c) 2023 HARDWARIO a.s.
2+
# Copyright (c) 2024 HARDWARIO a.s.
33
#
44
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
55
#
66

77
menu "Application"
88

9-
config APP_LAMBRECHT
10-
bool "Enable Modbus weather station from Lambrecht meteo"
11-
depends on SHIELD_CTR_X2_MODBUS_A
9+
# HARDWARE-CHESTER-BAROMETER-TAG
10+
config SHIELD_CTR_BAROMETER_TAG
11+
bool "Enable SHIELD_CTR_BAROMETER_TAG"
12+
default y
13+
14+
config I2C
15+
default y
16+
17+
config SENSOR
18+
default y
19+
20+
config MPL3115A2
21+
default y
22+
# HARDWARE-CHESTER-METEO-A
23+
config SHIELD_CTR_A
24+
bool "Enable SHIELD_CTR_METEO_A"
25+
default y
26+
27+
config SHIELD_CTR_X0_A
28+
bool "Enable SHIELD_CTR_X0_A"
29+
default y
30+
31+
config CTR_METEO
32+
default y
33+
34+
config CTR_X0
35+
default y
36+
# HARDWARE-CHESTER-S2
37+
config SHIELD_CTR_S2
38+
bool "Enable SHIELD_CTR_S2"
39+
default y
40+
41+
config CTR_HYGRO
42+
default y
43+
# SUBSYSTEM-DS18B20
44+
config SHIELD_CTR_DS18B20
45+
bool "Enable SHIELD_CTR_DS18B20"
46+
default y
47+
48+
config CTR_DS18B20
49+
default y
50+
# SUBSYSTEM-LTE-V2
51+
config SHIELD_CTR_LTE_V2
52+
bool "Enable SHIELD_CTR_LTE_V2"
53+
default y
54+
55+
config CTR_LTE_V2
56+
default y
57+
# SUBSYSTEM-SOIL-SENSOR
58+
config SHIELD_CTR_SOIL_SENSOR
59+
bool "Enable SHIELD_CTR_SOIL_SENSOR"
60+
default y
61+
62+
config CTR_SOIL_SENSOR
63+
default y
64+
65+
# ### Preserved code "k_config" (begin)
66+
# ^^^ Preserved code "k_config" (end)
1267

1368
endmenu
1469

applications/meteo/VERSION

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
VERSION_MAJOR = 3
2+
VERSION_MINOR = 0
3+
PATCHLEVEL = 0
4+
VERSION_TWEAK = 0
5+
EXTRAVERSION = dev

applications/meteo/app.overlay

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
/*
2+
* Copyright (c) 2024 HARDWARIO a.s.
3+
*
4+
* SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
5+
*/
6+
7+
/* HARDWARE-CHESTER-BAROMETER-TAG */
8+
&ctr_barometer_tag {
9+
status = "okay";
10+
};
11+
/* HARDWARE-CHESTER-METEO-A */
12+
&ctr_x0_a {
13+
status = "okay";
14+
15+
ctr_meteo_a: ctr_meteo_a {
16+
compatible = "hardwario,ctr-meteo";
17+
slot = "A";
18+
status = "okay";
19+
};
20+
};
21+
22+
&ctr_x0_pcal6416a_a {
23+
status = "okay";
24+
};
25+
/* HARDWARE-CHESTER-S2 */
26+
&sht30_ext {
27+
status = "okay";
28+
};
29+
/* SUBSYSTEM-CLOUD */
30+
/ {
31+
chosen {
32+
nordic,pm-ext-flash = &spi_flash0;
33+
};
34+
};
35+
36+
&spi_flash0 {
37+
partitions {
38+
compatible = "fixed-partitions";
39+
#address-cells = <1>;
40+
#size-cells = <1>;
41+
42+
littlefs_storage: partition@0 {
43+
label = "littlefs_storage";
44+
45+
/*
46+
* This size doesn't matter due to Nordic's partition
47+
* manager; For the sake of consistency this should
48+
* match the configured size
49+
*/
50+
reg = <0x00000000 0x730000>;
51+
};
52+
};
53+
};
54+
55+
/ {
56+
fstab {
57+
compatible = "zephyr,fstab";
58+
lfs1: lfs1 {
59+
compatible = "zephyr,fstab,littlefs";
60+
mount-point = "/lfs1";
61+
partition = <&littlefs_storage>;
62+
automount;
63+
read-size = <16>;
64+
prog-size = <16>;
65+
cache-size = <64>;
66+
lookahead-size = <32>;
67+
block-cycles = <512>;
68+
};
69+
};
70+
};
71+
/* SUBSYSTEM-DS18B20 */
72+
&ds2484 {
73+
ds18b20_0: ds18b20_0 {
74+
compatible = "maxim,ds18b20";
75+
resolution = <12>;
76+
family-code = <0x28>;
77+
};
78+
79+
ds18b20_1: ds18b20_1 {
80+
compatible = "maxim,ds18b20";
81+
resolution = <12>;
82+
family-code = <0x28>;
83+
};
84+
85+
ds18b20_2: ds18b20_2 {
86+
compatible = "maxim,ds18b20";
87+
resolution = <12>;
88+
family-code = <0x28>;
89+
};
90+
91+
ds18b20_3: ds18b20_3 {
92+
compatible = "maxim,ds18b20";
93+
resolution = <12>;
94+
family-code = <0x28>;
95+
};
96+
97+
ds18b20_4: ds18b20_4 {
98+
compatible = "maxim,ds18b20";
99+
resolution = <12>;
100+
family-code = <0x28>;
101+
};
102+
103+
ds18b20_5: ds18b20_5 {
104+
compatible = "maxim,ds18b20";
105+
resolution = <12>;
106+
family-code = <0x28>;
107+
};
108+
109+
ds18b20_6: ds18b20_6 {
110+
compatible = "maxim,ds18b20";
111+
resolution = <12>;
112+
family-code = <0x28>;
113+
};
114+
115+
ds18b20_7: ds18b20_7 {
116+
compatible = "maxim,ds18b20";
117+
resolution = <12>;
118+
family-code = <0x28>;
119+
};
120+
121+
ds18b20_8: ds18b20_8 {
122+
compatible = "maxim,ds18b20";
123+
resolution = <12>;
124+
family-code = <0x28>;
125+
};
126+
127+
ds18b20_9: ds18b20_9 {
128+
compatible = "maxim,ds18b20";
129+
resolution = <12>;
130+
family-code = <0x28>;
131+
};
132+
};
133+
/* SUBSYSTEM-LTE-V2 */
134+
/ {
135+
chosen {
136+
ctr,lte_link = &ctr_lte_link;
137+
};
138+
};
139+
140+
&uart0 {
141+
status = "okay";
142+
143+
ctr_lte_link: ctr_lte_link {
144+
compatible = "hardwario,ctr-lte-link";
145+
status = "okay";
146+
reset-gpios = <&gpio1 7 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
147+
wakeup-gpios = <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
148+
};
149+
};
150+
151+
&uart0 {
152+
status = "okay";
153+
};
154+
/* SUBSYSTEM-SOIL-SENSOR */
155+
&ds2484 {
156+
ctr_soil_sensor_0: ctr_soil_sensor_0 {
157+
compatible = "maxim,ds28e17";
158+
family-code = <0x19>;
159+
};
160+
ctr_soil_sensor_1: ctr_soil_sensor_1 {
161+
compatible = "maxim,ds28e17";
162+
family-code = <0x19>;
163+
};
164+
ctr_soil_sensor_2: ctr_soil_sensor_2 {
165+
compatible = "maxim,ds28e17";
166+
family-code = <0x19>;
167+
};
168+
ctr_soil_sensor_3: ctr_soil_sensor_3 {
169+
compatible = "maxim,ds28e17";
170+
family-code = <0x19>;
171+
};
172+
ctr_soil_sensor_4: ctr_soil_sensor_4 {
173+
compatible = "maxim,ds28e17";
174+
family-code = <0x19>;
175+
};
176+
ctr_soil_sensor_5: ctr_soil_sensor_5 {
177+
compatible = "maxim,ds28e17";
178+
family-code = <0x19>;
179+
};
180+
ctr_soil_sensor_6: ctr_soil_sensor_6 {
181+
compatible = "maxim,ds28e17";
182+
family-code = <0x19>;
183+
};
184+
ctr_soil_sensor_7: ctr_soil_sensor_7 {
185+
compatible = "maxim,ds28e17";
186+
family-code = <0x19>;
187+
};
188+
ctr_soil_sensor_8: ctr_soil_sensor_8 {
189+
compatible = "maxim,ds28e17";
190+
family-code = <0x19>;
191+
};
192+
ctr_soil_sensor_9: ctr_soil_sensor_9 {
193+
compatible = "maxim,ds28e17";
194+
family-code = <0x19>;
195+
};
196+
};
197+
198+
/* ### Preserved code "overlay" (begin) */
199+
/* ^^^ Preserved code "overlay" (end) */

applications/meteo/child_image/mcuboot.conf

+5
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
55
#
66

7+
CONFIG_BOOT_MAX_IMG_SECTORS=4096
8+
CONFIG_BOOT_SWAP_USING_SCRATCH=y
79
CONFIG_MULTITHREADING=y
10+
CONFIG_SPI=y
11+
12+
CONFIG_MCUBOOT_ACTION_HOOKS=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2023 HARDWARIO a.s.
3+
*
4+
* SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
nordic,pm-ext-flash = &spi_flash0;
10+
};
11+
};

0 commit comments

Comments
 (0)