1 /* 2 * Copyright (c) 2019 Centaur Analytics, Inc 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_DRIVERS_WATCHDOG_WWDG_STM32_H_ 8 #define ZEPHYR_DRIVERS_WATCHDOG_WWDG_STM32_H_ 9 10 #include <zephyr/types.h> 11 #include <zephyr/drivers/clock_control/stm32_clock_control.h> 12 #include <zephyr/drivers/clock_control.h> 13 14 /** 15 * @brief Driver for System Window Watchdog (WWDG) for STM32 MCUs 16 * 17 * The driver targets all STM32 SoCs. For details please refer to 18 * an appropriate reference manual and look for chapter called: 19 * 20 * System window watchdog (WWDG) 21 * 22 */ 23 24 /* driver configuration */ 25 struct wwdg_stm32_config { 26 struct stm32_pclken pclken; 27 WWDG_TypeDef *Instance; 28 }; 29 30 /* driver data */ 31 struct wwdg_stm32_data { 32 /* WWDG reset counter */ 33 uint8_t counter; 34 35 /* WWDG user defined callback on EWI */ 36 wdt_callback_t callback; 37 }; 38 39 #define WWDG_STM32_CFG(dev) \ 40 ((const struct wwdg_stm32_config *const)(dev)->config) 41 42 #define WWDG_STM32_DATA(dev) \ 43 ((struct wwdg_stm32_data *const)(dev)->data) 44 45 #define WWDG_STM32_STRUCT(dev) \ 46 ((WWDG_TypeDef *)(WWDG_STM32_CFG(dev))->Instance) 47 48 #endif /* ZEPHYR_DRIVERS_WATCHDOG_WWDG_STM32_H_ */ 49