Changeset 10 for ecs_cellMon/firmware/Drivers
- Timestamp:
- Jun 12, 2023, 12:09:16 PM (19 months ago)
- Location:
- ecs_cellMon/firmware/Drivers/STM32G0xx_HAL_Driver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ecs_cellMon/firmware/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_iwdg.h
r9 r10 7 7 * @attention 8 8 * 9 * Copyright (c) 2018 STMicroelectronics.10 * All rights reserved. 9 * <h2><center>© Copyright (c) 2018 STMicroelectronics. 10 * All rights reserved.</center></h2> 11 11 * 12 * This software is licensed under terms that can be found in the LICENSE file 13 * in the root directory of this software component. 14 * If no LICENSE file comes with this software, it is provided AS-IS. 12 * This software component is licensed by ST under BSD 3-Clause license, 13 * the "License"; You may not use this file except in compliance with the 14 * License. You may obtain a copy of the License at: 15 * opensource.org/licenses/BSD-3-Clause 15 16 * 16 17 ****************************************************************************** … … 87 88 #define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */ 88 89 #define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */ 90 89 91 /** 90 92 * @} … … 98 100 * @} 99 101 */ 102 100 103 101 104 /** … … 136 139 */ 137 140 /* Initialization/Start functions ********************************************/ 138 HAL_StatusTypeDef 141 HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg); 139 142 /** 140 143 * @} … … 145 148 */ 146 149 /* I/O operation functions ****************************************************/ 147 HAL_StatusTypeDef 150 HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg); 148 151 /** 149 152 * @} … … 236 239 237 240 #endif /* STM32G0xx_HAL_IWDG_H */ 241 242 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ -
ecs_cellMon/firmware/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c
r9 r10 9 9 * + IO operation functions 10 10 * 11 ******************************************************************************12 * @attention13 *14 * Copyright (c) 2018 STMicroelectronics.15 * All rights reserved.16 *17 * This software is licensed under terms that can be found in the LICENSE file18 * in the root directory of this software component.19 * If no LICENSE file comes with this software, it is provided AS-IS.20 *21 ******************************************************************************22 11 @verbatim 23 12 ============================================================================== … … 77 66 value will be loaded in the IWDG counter each time the watchdog is 78 67 reloaded, then the IWDG will start counting down from this value. 68 (++) Wait for status flags to be reset. 79 69 (++) Depending on window parameter: 80 70 (+++) If Window Init parameter is same as Window register value, … … 83 73 (+++) Else modify Window register. This will automatically reload 84 74 watchdog counter. 85 (++) Wait for status flags to be reset.86 75 87 76 (#) Then the application program must refresh the IWDG counter at regular … … 98 87 99 88 @endverbatim 89 ****************************************************************************** 90 * @attention 91 * 92 * <h2><center>© Copyright (c) 2018 STMicroelectronics. 93 * All rights reserved.</center></h2> 94 * 95 * This software component is licensed by ST under BSD 3-Clause license, 96 * the "License"; You may not use this file except in compliance with the 97 * License. You may obtain a copy of the License at: 98 * opensource.org/licenses/BSD-3-Clause 99 * 100 ****************************************************************************** 100 101 */ 101 102 … … 121 122 prescaler to be updated. The number of LSI clock periods is upper-rounded to 122 123 6 for the timeout value calculation. 123 The timeout value is calculated using the highest prescaler (256) and124 The timeout value is also calculated using the highest prescaler (256) and 124 125 the LSI_VALUE constant. The value of this constant can be changed by the user 125 126 to take into account possible LSI clock period variations. 126 The timeout value is multiplied by 1000 to be converted in milliseconds. 127 LSI startup time is also considered here by adding LSI_STARTUP_TIME 128 converted in milliseconds. */ 129 #define HAL_IWDG_DEFAULT_TIMEOUT (((6UL * 256UL * 1000UL) / LSI_VALUE) + ((LSI_STARTUP_TIME / 1000UL) + 1UL)) 130 #define IWDG_KERNEL_UPDATE_FLAGS (IWDG_SR_WVU | IWDG_SR_RVU | IWDG_SR_PVU) 127 The timeout value is multiplied by 1000 to be converted in milliseconds. */ 128 #define HAL_IWDG_DEFAULT_TIMEOUT ((6UL * 256UL * 1000UL) / LSI_VALUE) 131 129 /** 132 130 * @} … … 199 197 200 198 /* Wait for register to be updated */ 201 while ( (hiwdg->Instance->SR & IWDG_KERNEL_UPDATE_FLAGS)!= 0x00u)199 while (hiwdg->Instance->SR != 0x00u) 202 200 { 203 201 if ((HAL_GetTick() - tickstart) > HAL_IWDG_DEFAULT_TIMEOUT) 204 202 { 205 if ((hiwdg->Instance->SR & IWDG_KERNEL_UPDATE_FLAGS) != 0x00u) 206 { 207 return HAL_TIMEOUT; 208 } 203 return HAL_TIMEOUT; 209 204 } 210 205 } … … 229 224 } 230 225 231 232 226 /** 233 227 * @} … … 248 242 * @{ 249 243 */ 244 250 245 251 246 /** … … 264 259 } 265 260 266 267 261 /** 268 262 * @} … … 281 275 * @} 282 276 */ 277 278 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Note: See TracChangeset
for help on using the changeset viewer.