98d9b01322
Via coccinelle: @r_device_driver_api_and_data_1@ struct device *D; @@ ( D-> - driver_api + api | D-> - driver_data + data ) @r_device_driver_api_and_data_2@ expression E; @@ ( net_if_get_device(E)-> - driver_api + api | net_if_get_device(E)-> - driver_data + data ) And grep/sed rules for macros: git grep -rlz 'dev)->driver_data' | xargs -0 sed -i 's/dev)->driver_data/dev)->data/g' git grep -rlz 'dev->driver_data' | xargs -0 sed -i 's/dev->driver_data/dev->data/g' git grep -rlz 'device->driver_data' | xargs -0 sed -i 's/device->driver_data/device->data/g' Fixes #27397 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
49 lines
1.1 KiB
C
49 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2019 Centaur Analytics, Inc
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef ZEPHYR_DRIVERS_WATCHDOG_WWDG_STM32_H_
|
|
#define ZEPHYR_DRIVERS_WATCHDOG_WWDG_STM32_H_
|
|
|
|
#include <zephyr/types.h>
|
|
#include <drivers/clock_control/stm32_clock_control.h>
|
|
#include <drivers/clock_control.h>
|
|
|
|
/**
|
|
* @brief Driver for System Window Watchdog (WWDG) for STM32 MCUs
|
|
*
|
|
* The driver targets all STM32 SoCs. For details please refer to
|
|
* an appropriate reference manual and look for chapter called:
|
|
*
|
|
* System window watchdog (WWDG)
|
|
*
|
|
*/
|
|
|
|
/* driver configuration */
|
|
struct wwdg_stm32_config {
|
|
struct stm32_pclken pclken;
|
|
WWDG_TypeDef *Instance;
|
|
};
|
|
|
|
/* driver data */
|
|
struct wwdg_stm32_data {
|
|
/* WWDG reset counter */
|
|
uint8_t counter;
|
|
|
|
/* WWDG user defined callback on EWI */
|
|
wdt_callback_t callback;
|
|
};
|
|
|
|
#define WWDG_STM32_CFG(dev) \
|
|
((const struct wwdg_stm32_config *const)(dev)->config)
|
|
|
|
#define WWDG_STM32_DATA(dev) \
|
|
((struct wwdg_stm32_data *const)(dev)->data)
|
|
|
|
#define WWDG_STM32_STRUCT(dev) \
|
|
((WWDG_TypeDef *)(WWDG_STM32_CFG(dev))->Instance)
|
|
|
|
#endif /* ZEPHYR_DRIVERS_WATCHDOG_WWDG_STM32_H_ */
|