HAL IWDG Overview ¶
Introducing IWDG ¶
- group IWDG_Introduction
-
-
This introduction is under development.
-
Module and files ¶
The following diagram illustrates the IWDG module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the IWDG module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL IWDG module, specifying their locations, default values, and descriptions:
- group IWDG_Configuration_Table
-
¶
Configuration inside the IWDG driver: ¶
Config defines
Where
Default value
Note
USE_HAL_IWDG_MODULE
hal_conf.h
1
Enable the HAL IWDG module.
USE_HAL_IWDG_REGISTER_CALLBACKS
hal_conf.h
0
Enable the register callbacks assert
USE_HAL_CHECK_PARAM
hal_conf.h
0
Enable checking of vital parameters at
runtime
USE_HAL_IWDG_HARDWARE_START
hal_conf.h
0
IWDG driver starts in HW mode
USE_HAL_IWDG_USER_DATA
hal_conf.h
0
Add an user data inside HAL IWDG handle
USE_HAL_IWDG_TIME_UNIT (*)
hal_conf.h
HAL_IWDG_TIME_UNIT_MS
Time unit to be used for IWDG driver
USE_HAL_IWDG_LSI_FREQ (**)
hal_conf.h
LSI_VALUE
LSI value to be applied to the IWDG driver
USE_ASSERT_DBG_PARAM
PreProcessor env
NA
Enable the params assert
USE_ASSERT_DBG_STATE
PreProcessor env
NA
Enable the state assert
(*) User can choose the value of the time Unit with the USE_HAL_IWDG_TIME_UNIT define:
-
HAL_IWDG_TIME_UNIT_US: IWDG driver time unit in microseconds.
-
HAL_IWDG_TIME_UNIT_MS: IWDG driver time unit in milliseconds.
-
HAL_IWDG_TIME_UNIT_S: IWDG driver time unit in seconds.
The default time unit is milliseconds if not set by the user.
(**) User can choose the value of the LSI frequency with the USE_HAL_IWDG_LSI_FREQ define:
-
LSI_VALUE_DYNAMIC: Dynamic LSI to be computed and set by the user.
-
LSI_VALUE: LSI value of 32kHz.
-
(LSI_VALUE / 128U): LSI value of 250Hz.
The default LSI value is LSI_VALUE if not set by the user.
¶
Allowed Maximum time ranges: ¶
The selection of prescaler is done as follows: As long as the requested reset time value is lower than the max_time of a time range n, algorithm keeps the same prescaler n, once it exceeds the max_time of the range n, algorithm switch to the prescaler of the range n+1. The next table describes the possible Max time ranges for each prescaler and with both standard values of the LSI frequency:
Note:
-
For “Not supported” value in s, the user must switch to the ms or us unit. Same, for “Not supported” values in us, the user must switch to the ms or s unit.
-
In order to cover all the ranges, time unit static configuration has been introduced and can be expressed in us, ms or second.
LSI(Hz)
Prescaler
Step(us)
Max(us)
Max(ms)
Max(s)
32000
4
125
512000
512
Not supported
32000
8
250
1024000
1024
1.024
32000
16
500
2048000
2048
2.048
32000
32
1000
4096000
4096
4.096
32000
64
2000
8192000
8192
8.192
32000
128
4000
16384000
16384
16.384
32000
256
8000
32768000
32768
32.768
32000
512
16000
65536000
65536
65.536
32000
1024
32000
131072000
131072
131.072
250
4
16000
65536000
65536
65.536
250
8
32000
131072000
131072
131.072
250
16
64000
262144000
262144
262.144
250
32
128000
524288000
524288
524.288
250
64
256000
1048576000
1048576
1048.576
250
128
512000
2097152000
2097152
2097.152
250
256
1024000
4194304000
4194304
4194.304
250
512
2048000
Not supported
8388608
8388.608
250
1024
4096000
Not supported
16777216
16777.216
-