 727f043747
			
		
	
	
		727f043747
		
			
		
	
	
	
	
		
			
			* Scripts: option bytes check * Scripts: option bytes set * Scripts: openocd config * Scripts: increased readability, process IPCCBR option byte * Scripts: split dap_ob.py * Updater: process IPCCBR option byte * Scripts: move chip-related functions to chip definition * Scripts: freeze CPU registers * Scripts: flash programming routine * ob.py * otp.py * otp: handle errors correctly * downgrade to python 3.9 * correct type hinting * Scripts: fix path to ob.data Co-authored-by: あく <alleteam@gmail.com>
		
			
				
	
	
		
			32 lines
		
	
	
		
			676 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			676 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 otp_write(self, address: int, file_path: str) -> bool:
 | |
|         pass
 |