 2702c00ba4
			
		
	
	
		2702c00ba4
		
			
		
	
	
	
	
		
			
			* Scripts: OB recovery * Scripts: slightly different ob * Scripts: remove excessive return * Scripts: simplifying work with registers * Make PVS happy Co-authored-by: SG <who.just.the.doctor@gmail.com>
		
			
				
	
	
		
			36 lines
		
	
	
		
			754 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			754 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from abc import ABC, abstractmethod
 | |
| from enum import Enum
 | |
| 
 | |
| 
 | |
| class Programmer(ABC):
 | |
|     def __init__(self):
 | |
|         pass
 | |
| 
 | |
|     class RunMode(Enum):
 | |
|         Run = "run"
 | |
|         Stop = "stop"
 | |
| 
 | |
|     @abstractmethod
 | |
|     def reset(self, mode: RunMode = RunMode.Run) -> bool:
 | |
|         pass
 | |
| 
 | |
|     @abstractmethod
 | |
|     def flash(self, address: int, file_path: str, verify: bool = True) -> bool:
 | |
|         pass
 | |
| 
 | |
|     @abstractmethod
 | |
|     def option_bytes_validate(self, file_path: str) -> bool:
 | |
|         pass
 | |
| 
 | |
|     @abstractmethod
 | |
|     def option_bytes_set(self, file_path: str) -> bool:
 | |
|         pass
 | |
| 
 | |
|     @abstractmethod
 | |
|     def option_bytes_recover(self) -> bool:
 | |
|         pass
 | |
| 
 | |
|     @abstractmethod
 | |
|     def otp_write(self, address: int, file_path: str) -> bool:
 | |
|         pass
 |