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

tests: pm: Adding tests based on new approach to PM testing. #80692

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
40 changes: 40 additions & 0 deletions scripts/pm/power_monitor_stm32l562e_dk/AbstractPowerMonitor.py
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.
"""
Loading
Loading