-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the DSTRX-3 test. Signed-off-by: Takuya Sasaki <takuya.sasaki@spacecubics.com>
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 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
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,45 @@ | ||
/* | ||
* Copyright (c) 2024 Space Cubics, LLC. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/kernel.h> | ||
#include "sc_dstrx3.h" | ||
|
||
#include <zephyr/logging/log.h> | ||
LOG_MODULE_REGISTER(dstrx3_test); | ||
|
||
int dstrx3_test(uint32_t *err_cnt) | ||
{ | ||
int ret; | ||
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(dstrx)); | ||
struct sc_dstrx3_hk hk; | ||
|
||
ret = sc_dstrx3_get_hk_telemetry(dev, &hk); | ||
if (ret < 0) { | ||
LOG_ERR("DSTRX-3 HK: Failed"); | ||
(*err_cnt)++; | ||
goto end; | ||
} | ||
|
||
LOG_INF("DSTRX-3 HK FREE_COUNTER : %d", hk.free_count); | ||
LOG_INF("DSTRX-3 HK WDT_COUNTER : %d", hk.wdt_count); | ||
LOG_INF("DSTRX-3 HK RSSI : %d", -(hk.rssi + 16)); | ||
LOG_INF("DSTRX-3 HK RCV_FREQ : %.4f [Hz] (raw: %d)", | ||
(2105.350 + (hk.rcv_freq * 100)), hk.rcv_freq); | ||
LOG_INF("DSTRX-3 HK TEMPERATURE : %d [deg]", hk.temperature); | ||
LOG_INF("DSTRX-3 HK VOLTAGE : %.04f [v] (raw: %d)", | ||
(float)((hk.voltage / 256) * 2.5), hk.voltage); | ||
LOG_INF("DSTRX-3 HK TX_PWR : %.04f [dBm] (raw: %d)", | ||
((0.2473 * hk.tx_power) + 0.99), hk.tx_power); | ||
LOG_INF("DSTRX-3 HK CARRIER_LOCK : %d", hk.carrier_lock); | ||
LOG_INF("DSTRX-3 HK SUB_CARRIER_LOCK : %d", hk.sub_carrier_lock); | ||
LOG_INF("DSTRX-3 HK TX_PWR_SET : %d", hk.tx_power_set); | ||
LOG_INF("DSTRX-3 HK BIT_RATE_SET : %d", hk.bit_rate_set); | ||
LOG_INF("DSTRX-3 HK PROG_NO : %d", hk.program_no); | ||
LOG_INF("DSTRX-3 HK CHK_SUM : %d", hk.checksum); | ||
|
||
end: | ||
return ret; | ||
} |
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,11 @@ | ||
/* | ||
* Copyright (c) 2024 Space Cubics, LLC.↲ | ||
*↲ | ||
* SPDX-License-Identifier: Apache-2.0↲ | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
int dstrx3_test(uint32_t *err_cnt); |
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