This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
github-actions[bot]
committed
May 16, 2023
1 parent
6f8edf6
commit 8c8bdb7
Showing
9 changed files
with
216 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
# This file is merged with prj.conf in the application folder, and options | ||
# set here will take precedence if they are present in both files. | ||
|
||
# CAF - Common Application Framework | ||
CONFIG_GPIO=y | ||
CONFIG_LED_GPIO=y | ||
|
||
# Enable external flash | ||
CONFIG_SPI=y | ||
CONFIG_SPI_NOR=y | ||
CONFIG_SPI_NOR_SFDP_DEVICETREE=y | ||
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/ { | ||
/delete-node/ leds; | ||
|
||
leds0 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
label = "LED0"; | ||
led0: led_0 { | ||
status = "okay"; | ||
gpios = <&gpio0 0 0>; | ||
label = "Green LED 1"; | ||
}; | ||
}; | ||
|
||
leds1 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
label = "LED1"; | ||
led1: led_1 { | ||
gpios = <&gpio0 1 0>; | ||
label = "Green LED 2"; | ||
}; | ||
}; | ||
|
||
leds2 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
label = "LED2"; | ||
led2: led_2 { | ||
gpios = <&gpio0 4 0>; | ||
label = "Green LED 3"; | ||
}; | ||
}; | ||
|
||
leds3 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
label = "LED3"; | ||
led3: led_3 { | ||
gpios = <&gpio0 5 0>; | ||
label = "Green LED 4"; | ||
}; | ||
}; | ||
|
||
/* Configure partition manager to use gd25lb256 as the external flash */ | ||
chosen { | ||
nordic,pm-ext-flash = &gd25lb256; | ||
}; | ||
}; | ||
|
||
/* Enable high drive mode for the SPI3 pins to get a square signal at 8 MHz */ | ||
&spi3_default { | ||
group1 { | ||
nordic,drive-mode = <NRF_DRIVE_H0H1>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
# MCUboot config to enable secondary slot on the external flash | ||
|
||
CONFIG_FLASH=y | ||
CONFIG_SPI=y | ||
CONFIG_SPI_NOR=y | ||
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 | ||
CONFIG_SPI_NOR_SFDP_DEVICETREE=y | ||
|
||
CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x13E00 | ||
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y | ||
|
||
CONFIG_MULTITHREADING=y | ||
CONFIG_MAIN_STACK_SIZE=2048 | ||
CONFIG_BOOT_MAX_IMG_SECTORS=256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/* Enable high drive mode for the SPI3 pins to get a square signal at 8 MHz */ | ||
&spi3_default { | ||
group1 { | ||
nordic,drive-mode = <NRF_DRIVE_H0H1>; | ||
}; | ||
}; | ||
|
||
&gd25lb256 { | ||
status = "okay"; | ||
}; | ||
|
||
/ { | ||
/* Configure partition manager to use gd25lb256 as the external flash */ | ||
chosen { | ||
nordic,pm-ext-flash = &gd25lb256; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <caf/led_effect.h> | ||
#include "events/led_state_event.h" | ||
|
||
/* This configuration file is included only once from led_state module and holds | ||
* information about LED effects associated with Asset Tracker v2 states. | ||
*/ | ||
|
||
/* This structure enforces the header file to be included only once in the build. | ||
* Violating this requirement triggers a multiple definition error at link time. | ||
*/ | ||
const struct {} led_state_def_include_once; | ||
|
||
enum led_id { | ||
LED_ID_1, | ||
LED_ID_2, | ||
LED_ID_3, | ||
LED_ID_4, | ||
|
||
LED_ID_COUNT, | ||
|
||
LED_ID_CONNECTING = LED_ID_1, | ||
LED_ID_CLOUD_CONNECTING = LED_ID_3, | ||
LED_ID_SEARCHING = LED_ID_2, | ||
LED_ID_PUBLISHING = LED_ID_3, | ||
LED_ID_ASSOCIATING = LED_ID_3, | ||
LED_ID_ASSOCIATED = LED_ID_3, | ||
LED_ID_FOTA_1 = LED_ID_1, | ||
LED_ID_FOTA_2 = LED_ID_2, | ||
LED_ID_PASSIVE_MODE_1 = LED_ID_3, | ||
LED_ID_PASSIVE_MODE_2 = LED_ID_4, | ||
LED_ID_ACTIVE_MODE = LED_ID_4, | ||
}; | ||
|
||
#define LED_PERIOD_NORMAL 350 | ||
#define LED_PERIOD_RAPID 100 | ||
#define LED_TICKS_DOUBLE 2 | ||
#define LED_TICKS_TRIPLE 3 | ||
|
||
static const struct led_effect asset_tracker_led_effect[] = { | ||
[LED_STATE_LTE_CONNECTING] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_LOCATION_SEARCHING] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_CLOUD_PUBLISHING] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_CLOUD_CONNECTING] = LED_EFFECT_LED_CLOCK(LED_TICKS_TRIPLE, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_CLOUD_ASSOCIATING] = LED_EFFECT_LED_CLOCK(LED_TICKS_DOUBLE, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_CLOUD_ASSOCIATED] = LED_EFFECT_LED_ON_GO_OFF(LED_COLOR(100, 100, 100), | ||
LED_PERIOD_NORMAL, | ||
LED_PERIOD_RAPID), | ||
[LED_STATE_ACTIVE_MODE] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_PASSIVE_MODE] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_ERROR_SYSTEM_FAULT] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_FOTA_UPDATING] = LED_EFFECT_LED_BLINK(LED_PERIOD_RAPID, | ||
LED_COLOR(100, 100, 100)), | ||
[LED_STATE_FOTA_UPDATE_REBOOT] = LED_EFFECT_LED_ON(LED_COLOR(100, 100, 100)), | ||
[LED_STATE_TURN_OFF] = LED_EFFECT_LED_OFF(), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters