-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: pm: Adding tests based on new approach to PM testing.
Introduces scripts for powerShiled on stm32l562e_dk board. Adds three new power management pytests based on a new approach. Signed-off-by: Arkadiusz Cholewinski <[email protected]>
- Loading branch information
1 parent
e1b4320
commit 1f00e48
Showing
27 changed files
with
1,347 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
scripts/pm/power_monitor_stm32l562e_dk/AbstractPowerMonitor.py
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,40 @@ | ||
# Copyright: (c) 2024, Intel Corporation | ||
# Author: Arkadiusz Cholewinski <[email protected]> | ||
|
||
import string | ||
from abc import ABC, abstractmethod | ||
|
||
|
||
class PowerMonitor(ABC): | ||
@abstractmethod | ||
def init(self, device_id: string): | ||
""" | ||
Abstract method to initialize the power monitor. | ||
Agr: | ||
string: Address of the power monitor | ||
Return: | ||
bool: True of False. | ||
""" | ||
|
||
@abstractmethod | ||
def measure(self, duration: int): | ||
""" | ||
Abstract method to measure current with specified measurement time. | ||
Args: | ||
duration (int): The duration of the measurement in seconds. | ||
""" | ||
|
||
@abstractmethod | ||
def get_data(self, duration: int) -> list[float]: | ||
""" | ||
Measure current with specified measurement time. | ||
Args: | ||
duration (int): The duration of the measurement in seconds. | ||
Returns: | ||
List[float]: An array of measured current values in amperes. | ||
""" |
Oops, something went wrong.