Skip to content

Commit

Permalink
lib/rw: Move Reaction Wheel API from hwtest
Browse files Browse the repository at this point in the history
This commit moves APIs related to Reaction Wheel from test/hwtest to
lib. This library is only enabled for the ADCS Board.

Signed-off-by: Takuya Sasaki <takuya.sasaki@spacecubics.com>
  • Loading branch information
sasataku committed Oct 30, 2024
1 parent bb62b43 commit 1b081e2
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ add_subdirectory_ifdef(CONFIG_SC_LIB_MGNM mgnm)
add_subdirectory_ifdef(CONFIG_SC_LIB_MTQ mtq)
add_subdirectory_ifdef(CONFIG_SC_LIB_GNSS gnss)
add_subdirectory_ifdef(CONFIG_SC_LIB_IMU imu)
add_subdirectory_ifdef(CONFIG_SC_LIB_RW rw)
1 change: 1 addition & 0 deletions lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ rsource "mgnm/Kconfig"
rsource "mtq/Kconfig"
rsource "gnss/Kconfig"
rsource "imu/Kconfig"
rsource "rw/Kconfig"

endmenu
6 changes: 6 additions & 0 deletions lib/rw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 Space Cubics, LLC.
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_library_sources_ifdef(CONFIG_SC_LIB_RW rw.c)
zephyr_include_directories(.)
17 changes: 17 additions & 0 deletions lib/rw/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2024 Space Cubics, LLC.
# SPDX-License-Identifier: Apache-2.0

menuconfig SC_LIB_RW
bool "Space Cubics Reaction Wheel libraries"
default y
depends on BOARD_SCSAT1_ADCS
help
Enable Space Cubics Reaction Wheel libraries.

if SC_LIB_RW

module = SC_LIB_RW
module-str = Space Cubics Reaction Wheel libraries
source "subsys/logging/Kconfig.template.log_config"

endif
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/rw.c → lib/rw/rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "cv_adcs.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(rw, CONFIG_SCSAT1_ADCS_LOG_LEVEL);
LOG_MODULE_REGISTER(rw, CONFIG_SC_LIB_RW_LOG_LEVEL);

#define SC_RWM_BASE_ADDR (0x50030000)
#define SC_RWM_MENR_OFFSET (0x0000)
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion tests/hwtest/adcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ target_sources(app PRIVATE src/cv_test.c)
target_sources(app PRIVATE src/imu_test.c)
target_sources(app PRIVATE src/gnss_test.c)
target_sources(app PRIVATE src/csp.c)
target_sources(app PRIVATE src/rw.c)
target_sources(app PRIVATE src/rw_test.c)
target_sources(app PRIVATE src/adcs_init.c)
target_sources(app PRIVATE src/loop_test.c)
Expand Down

0 comments on commit 1b081e2

Please sign in to comment.