Skip to content

Commit

Permalink
tests: pm: Adding tests based on new approach to PM testing.
Browse files Browse the repository at this point in the history
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
gbarkadiusz committed Dec 13, 2024
1 parent e1b4320 commit 1f00e48
Show file tree
Hide file tree
Showing 27 changed files with 1,347 additions and 0 deletions.
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

0 comments on commit 1f00e48

Please sign in to comment.