18. API - Watch Dog Timer
18.1. Regular Classes
The following classes are intended for general use with the devices they represent. All classes in this section are concrete (not abstract).
18.1.1. WDT
- class lannerpsp.WDT(check_platform: bool = False)[source]
Watch Dog Timer.
- Parameters:
check_platform (bool) – Set to
True
to check if the platform supports this feature. Defaults toFalse
for better compatibility.- Raises:
PSPNotSupport – This function is not supported (when
check_platform
is set toTrue
).NotImplementedError – It has not been verified to run on this platform (when
check_platform
is set toTrue
).
- get_info() WDTInfoModel [source]
Get Watch Dog Timer information.
Example:
>>> wdt = WDT() >>> wdt.get_info() WDTInfoModel(type='SuperIO', max_count=255, is_minute_support=True)
- Returns:
WDT information
- Return type:
- Raises:
PSPNotOpened – The library is not ready or opened yet.
PSPNotSupport – This platform does not support this function.
PSPError – General PSP functional error.
- config(count: int, time_base: int = 1) None [source]
Configure the Watch Dog Timer for specific time.
Example for 200 seconds:
>>> wdt = WDT() >>> wdt.config(200)
Example for 2 minutes:
>>> wdt = WDT() >>> wdt.config(2, 2)
- Parameters:
- Raises:
TypeError – The input parameters type error.
PSPInvalid – Invalid parameter value.
PSPNotOpened – The library is not ready or opened yet.
PSPNotSupport – This platform does not support this function.
PSPBusyInUses – This step is skipped because WDT is already starting now.
PSPError – General PSP functional error.
- enable(count: int = 0, time_base: int = 1) None [source]
Configure the Watch Dog Timer for specific time and start the WDT countdown.
You can
enable()
dircetly by a given time:>>> wdt = WDT() >>> wdt.enable(200)
Or
config()
first thenenable()
>>> wdt = WDT() >>> wdt.config(200) >>> wdt.enable()
- Parameters:
- Raises:
TypeError – The input parameters type error.
PSPInvalid – Invalid parameter value.
PSPNotOpened – The library is not ready or opened yet.
PSPNotSupport – This platform does not support this function.
PSPBusyInUses – This step is skipped because WDT is already starting now.
PSPError – General PSP functional error.
- disable() None [source]
Stop the WDT countdown.
Example:
>>> wdt = WDT() >>> wdt.enable(10) >>> >>> wdt.disable()
- Raises:
PSPNotOpened – The library is not ready or opened yet.
PSPNotSupport – This platform does not support this function.
PSPError – General PSP functional error.
- reset() None [source]
Reload the timer and then re-computes it.
Example:
>>> wdt = WDT() >>> wdt.enable(10) >>> >>> wdt.reset()
- Raises:
PSPNotOpened – The library is not ready or opened yet.
PSPNotSupport – This platform does not support this function.
PSPError – General PSP functional error.
18.2. Models
The following models are used to store data for data modeling.
18.2.1. WDTInfoModel
18.3. Supported Platforms
Note
Almost for all versions of Lanner PSP on all platforms.
The following platforms have been verified and confirmed to be supported: