programmer.py 676 B

12345678910111213141516171819202122232425262728293031
  1. from abc import ABC, abstractmethod
  2. from enum import Enum
  3. class Programmer(ABC):
  4. def __init__(self):
  5. pass
  6. class RunMode(Enum):
  7. Run = "run"
  8. Stop = "stop"
  9. @abstractmethod
  10. def reset(self, mode: RunMode = RunMode.Run) -> bool:
  11. pass
  12. @abstractmethod
  13. def flash(self, address: int, file_path: str, verify: bool = True) -> bool:
  14. pass
  15. @abstractmethod
  16. def option_bytes_validate(self, file_path: str) -> bool:
  17. pass
  18. @abstractmethod
  19. def option_bytes_set(self, file_path: str) -> bool:
  20. pass
  21. @abstractmethod
  22. def otp_write(self, address: int, file_path: str) -> bool:
  23. pass