Skip to content

Commit 7e464db

Browse files
alstrzebonskirlubos
authored andcommitted
samples: bluetooth: fast_pair: locator_tag: Add motion detector Thingy53 UI
Improves motion detector integration in the Locator Tag sample for Thingy 53. Built-in accelerometer is used to detect motion. The motion detector active state is signalized on LED with cyan colour. Additionaly performs minor alignment in sample's platform-dependent cmake files. Jira: NCSDK-28956 Signed-off-by: Aleksander Strzebonski <[email protected]>
1 parent 4f2b00a commit 7e464db

File tree

11 files changed

+281
-90
lines changed

11 files changed

+281
-90
lines changed

samples/bluetooth/fast_pair/locator_tag/configuration/boards/thingy53_nrf5340_cpuapp.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ CONFIG_ASSERT_NO_COND_INFO=y
1414
CONFIG_ASSERT_NO_MSG_INFO=y
1515
CONFIG_HW_STACK_PROTECTION=y
1616

17-
# Enable the Zephyr drivers required by the speaker and battery module.
17+
# Enable the Zephyr drivers required by the speaker, battery module and motion detector module.
1818
CONFIG_PWM=y
1919
CONFIG_ADC=y
20+
CONFIG_SENSOR=y
21+
CONFIG_SPI=y
22+
CONFIG_BMI270=y
2023

2124
# Adjust the FMDN ringing configuration to align it with the platform`s capabilities.
2225
CONFIG_BT_FAST_PAIR_FMDN_RING_COMP_ONE=y

samples/bluetooth/fast_pair/locator_tag/configuration/boards/thingy53_nrf5340_cpuapp_common.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
/ {
88
aliases {
99
pwm-spk = &pwm_spk0;
10+
gyro-pwr = &sensor_pwr_ctrl;
11+
gyro = &bmi270;
1012
};
1113

1214
pwmspk {
@@ -16,3 +18,9 @@
1618
};
1719
};
1820
};
21+
22+
&spi3 {
23+
bmi270: spi-dev-bmi270@1 {
24+
status = "okay";
25+
};
26+
};

samples/bluetooth/fast_pair/locator_tag/configuration/boards/thingy53_nrf5340_cpuapp_ns.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ CONFIG_ASSERT_NO_COND_INFO=y
1414
CONFIG_ASSERT_NO_MSG_INFO=y
1515
CONFIG_HW_STACK_PROTECTION=y
1616

17-
# Enable the Zephyr drivers required by the speaker and battery module.
17+
# Enable the Zephyr drivers required by the speaker, battery module and motion detector module.
1818
CONFIG_PWM=y
1919
CONFIG_ADC=y
20+
CONFIG_SENSOR=y
21+
CONFIG_SPI=y
22+
CONFIG_BMI270=y
2023

2124
# Adjust the FMDN ringing configuration to align it with the platform`s capabilities.
2225
CONFIG_BT_FAST_PAIR_FMDN_RING_COMP_ONE=y

samples/bluetooth/fast_pair/locator_tag/configuration/boards/thingy53_nrf5340_cpuapp_ns_release.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
99
# Disable logging in the release configuration
1010
CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n
1111

12-
# Enable the Zephyr drivers required by the speaker and battery module.
12+
# Enable the Zephyr drivers required by the speaker, battery module and motion detector module.
1313
CONFIG_PWM=y
1414
CONFIG_ADC=y
15+
CONFIG_SENSOR=y
16+
CONFIG_SPI=y
17+
CONFIG_BMI270=y
1518

1619
# Adjust the FMDN ringing configuration to align it with the platform`s capabilities.
1720
CONFIG_BT_FAST_PAIR_FMDN_RING_COMP_ONE=y

samples/bluetooth/fast_pair/locator_tag/configuration/boards/thingy53_nrf5340_cpuapp_release.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
99
# Disable logging in the release configuration
1010
CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n
1111

12-
# Enable the Zephyr drivers required by the speaker and battery module.
12+
# Enable the Zephyr drivers required by the speaker, battery module and motion detector module.
1313
CONFIG_PWM=y
1414
CONFIG_ADC=y
15+
CONFIG_SENSOR=y
16+
CONFIG_SPI=y
17+
CONFIG_BMI270=y
1518

1619
# Adjust the FMDN ringing configuration to align it with the platform`s capabilities.
1720
CONFIG_BT_FAST_PAIR_FMDN_RING_COMP_ONE=y

samples/bluetooth/fast_pair/locator_tag/src/battery/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ target_include_directories(app_battery PRIVATE include_priv)
1212
# Platform indepedent source files.
1313
target_sources(app_battery PRIVATE common.c)
1414

15-
# DK specific
1615
if(CONFIG_APP_PLATFORM_DK)
1716
target_sources(app_battery PRIVATE platform_dk.c)
1817
target_link_libraries(app_battery PRIVATE app_ui)
19-
endif()
20-
21-
# Thingy specific
22-
if(CONFIG_APP_PLATFORM_THINGY)
18+
elseif(CONFIG_APP_PLATFORM_THINGY)
2319
target_sources(app_battery PRIVATE platform_thingy.c)
20+
else()
21+
message(FATAL_ERROR "Unsupported platform")
2422
endif()

samples/bluetooth/fast_pair/locator_tag/src/motion_detector/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ zephyr_library_named(app_motion_detector)
88

99
target_include_directories(app_motion_detector PUBLIC include)
1010

11+
target_link_libraries(app_motion_detector PRIVATE app_ui)
12+
1113
if(CONFIG_APP_PLATFORM_DK)
1214
target_sources(app_motion_detector PRIVATE platform_dk.c)
13-
target_link_libraries(app_motion_detector PRIVATE app_ui)
15+
elseif(CONFIG_APP_PLATFORM_THINGY)
16+
target_sources(app_motion_detector PRIVATE platform_thingy.c)
1417
else()
15-
target_sources(app_motion_detector PRIVATE platform_default.c)
18+
message(FATAL_ERROR "Unsupported platform")
1619
endif()

samples/bluetooth/fast_pair/locator_tag/src/motion_detector/platform_default.c

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)