Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: Move power control API from hwtest #71

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2024 Space Cubics, LLC.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(core)
add_subdirectory_ifdef(CONFIG_SC_LIB_FLASH flash)
1 change: 1 addition & 0 deletions lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

menu "Space Cubics Libraries"

rsource "core/Kconfig"
rsource "flash/Kconfig"

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

if (CONFIG_BOARD_SCSAT1_MAIN OR CONFIG_BOARD_SCSAT1_ADCS)
zephyr_library()
zephyr_library_sources_ifdef(CONFIG_SC_LIB_CORE_MAIN pwrctrl_main.c)
zephyr_library_sources_ifdef(CONFIG_SC_LIB_CORE_ADCS pwrctrl_adcs.c)
zephyr_include_directories(.)
endif()
10 changes: 10 additions & 0 deletions lib/core/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024 Space Cubics, LLC.
# SPDX-License-Identifier: Apache-2.0

if BOARD_SCSAT1_MAIN
rsource "Kconfig.main"
endif

if BOARD_SCSAT1_ADCS
rsource "Kconfig.adcs"
endif
16 changes: 16 additions & 0 deletions lib/core/Kconfig.adcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2024 Space Cubics, LLC.
# SPDX-License-Identifier: Apache-2.0

menuconfig SC_LIB_CORE_ADCS
bool "Space Cubics Core libraries for ADCS Board"
default y
help
Enable Space Cubics Core libraries for ADCS Board.

if SC_LIB_CORE_ADCS

module = SC_LIB_CORE_ADCS
module-str = Space Cubics Core libraries for ADCS Board
source "subsys/logging/Kconfig.template.log_config"

endif
16 changes: 16 additions & 0 deletions lib/core/Kconfig.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2024 Space Cubics, LLC.
# SPDX-License-Identifier: Apache-2.0

menuconfig SC_LIB_CORE_MAIN
bool "Space Cubics Core libraries for MAIN Board"
default y
help
Enable Space Cubics Core libraries for MAIN Board.

if SC_LIB_CORE_MAIN

module = SC_LIB_CORE_MAIN
module-str = Space Cubics Core libraries for MAIN Board
source "subsys/logging/Kconfig.template.log_config"

endif
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <zephyr/kernel.h>
#include "sc_dstrx3.h"
#include "pwrctrl.h"
#include "pwrctrl_main.h"

/* Registers */
#define SC_MAIN_SYSREG_BASE_ADDR (0x4F000000)
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 @@ -10,7 +10,6 @@ project(scsat1-adcs)

target_sources(app PRIVATE src/main.c)
target_sources(app PRIVATE src/wdog.c)
target_sources(app PRIVATE src/pwrctrl.c)
target_sources(app PRIVATE src/sysmon.c)
target_sources(app PRIVATE src/temp.c)
target_sources(app PRIVATE src/temp_test.c)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/adcs_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <zephyr/kernel.h>
#include "pwrctrl.h"
#include "pwrctrl_adcs.h"
#include "sysmon.h"
#include "gnss.h"
#include "imu.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <zephyr/drivers/spi.h>
#include <zephyr/sys/byteorder.h>
#include "pwrctrl.h"
#include "pwrctrl_adcs.h"
#include "imu.h"

#include <zephyr/logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/loop_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <zephyr/kernel.h>
#include "common.h"
#include "loop_test.h"
#include "pwrctrl.h"
#include "pwrctrl_adcs.h"
#include "temp_test.h"
#include "cv_test.h"
#include "imu_test.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/rw.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

#include <stdint.h>
#include "pwrctrl.h"
#include "pwrctrl_adcs.h"

#define RW_MAX_POTENTION (0x7F)
#define RW_HALF_POTENTION (0x40)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/syshk_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stdlib.h>
#include <zephyr/kernel.h>
#include "common.h"
#include "pwrctrl.h"
#include "pwrctrl_adcs.h"
#include "temp_test.h"
#include "cv_test.h"
#include "imu_test.h"
Expand Down
1 change: 0 additions & 1 deletion tests/hwtest/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ project(scsat1-main)

target_sources(app PRIVATE src/main.c)
target_sources(app PRIVATE src/wdog.c)
target_sources(app PRIVATE src/pwrctrl.c)
target_sources(app PRIVATE src/mgnm.c )
target_sources(app PRIVATE src/mgnm_test.c )
target_sources(app PRIVATE src/temp.c)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/loop_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include "common.h"
#include "loop_test.h"
#include "pwrctrl.h"
#include "pwrctrl_main.h"
#include "temp_test.h"
#include "cv_test.h"
#include "csp_test.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/main_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <zephyr/kernel.h>
#include "common.h"
#include "pwrctrl.h"
#include "pwrctrl_main.h"
#include "sysmon.h"

#include <zephyr/logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/syshk_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include <csp/csp.h>
#include "common.h"
#include "pwrctrl.h"
#include "pwrctrl_main.h"
#include "temp_test.h"
#include "cv_test.h"
#include "csp_test.h"
Expand Down