1 /* 2 * Copyright (c) 2016 Open-RnD Sp. z o.o. 3 * Copyright (c) 2017 RnDity Sp. z o.o. 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #ifndef ZEPHYR_DRIVERS_WATCHDOG_IWDG_STM32_H_ 9 #define ZEPHYR_DRIVERS_WATCHDOG_IWDG_STM32_H_ 10 11 #include <zephyr/types.h> 12 13 /** 14 * @brief Driver for Independent Watchdog (IWDG) for STM32 MCUs 15 * 16 * The driver targets all STM32 SoCs. For details please refer to 17 * an appropriate reference manual and look for chapter called: 18 * 19 * Independent watchdog (IWDG) 20 * 21 */ 22 23 /* driver data */ 24 struct iwdg_stm32_data { 25 /* IWDG peripheral instance. */ 26 IWDG_TypeDef *Instance; 27 uint32_t prescaler; 28 uint32_t reload; 29 }; 30 31 #define IWDG_STM32_DATA(dev) \ 32 ((struct iwdg_stm32_data * const)(dev)->data) 33 34 #define IWDG_STM32_STRUCT(dev) \ 35 ((IWDG_TypeDef *)(IWDG_STM32_DATA(dev))->Instance) 36 37 #endif /* ZEPHYR_DRIVERS_WATCHDOG_IWDG_STM32_H_ */ 38