mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-01 17:30:42 +00:00
Replace the existing Apache 2.0 boilerplate header with an SPDX tag throughout the zephyr code tree. This patch was generated via a script run over the master branch. Also updated doc/porting/application.rst that had a dependency on line numbers in a literal include. Manually updated subsys/logging/sys_log.c that had a malformed header in the original file. Also cleanup several cases that already had a SPDX tag and we either got a duplicate or missed updating. Jira: ZEP-1457 Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c Signed-off-by: David B. Kinder <david.b.kinder@intel.com> Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
77 lines
1.3 KiB
C
77 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2016 Open-RnD Sp. z o.o.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef _STM32_IWDG_H_
|
|
#define _STM32_IWDG_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
/**
|
|
* @brief Driver for Independent Watchdog (IWDG) for STM32 MCUs
|
|
*
|
|
* Based on reference manual:
|
|
* STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and STM32F107xx
|
|
* advanced ARM ® -based 32-bit MCUs
|
|
*
|
|
* Chapter 19: Independent watchdog (IWDG)
|
|
*
|
|
*/
|
|
|
|
|
|
/* counter reload trigger */
|
|
#define STM32_IWDG_KR_RELOAD 0xaaaa
|
|
/* magic value for unlocking write access to PR and RLR */
|
|
#define STM32_IWDG_KR_UNLOCK 0x5555
|
|
/* watchdog start */
|
|
#define STM32_IWDG_KR_START 0xcccc
|
|
|
|
/* 19.4.1 IWDG_KR */
|
|
union __iwdg_kr {
|
|
uint32_t val;
|
|
struct {
|
|
uint16_t key;
|
|
uint16_t rsvd;
|
|
} bit;
|
|
};
|
|
|
|
/* 19.4.2 IWDG_PR */
|
|
union __iwdg_pr {
|
|
uint32_t val;
|
|
struct {
|
|
uint32_t pr :3 __packed;
|
|
uint32_t rsvd__3_31 :29 __packed;
|
|
} bit;
|
|
};
|
|
|
|
/* 19.4.3 IWDG_RLR */
|
|
union __iwdg_rlr {
|
|
uint32_t val;
|
|
struct {
|
|
uint32_t rl :12 __packed;
|
|
uint32_t rsvd__12_31 :20 __packed;
|
|
} bit;
|
|
};
|
|
|
|
/* 19.4.4 IWDG_SR */
|
|
union __iwdg_sr {
|
|
uint32_t val;
|
|
struct {
|
|
uint32_t pvu :1 __packed;
|
|
uint32_t rvu :1 __packed;
|
|
uint32_t rsvd__2_31 :30 __packed;
|
|
} bit;
|
|
};
|
|
|
|
/* 19.4.5 IWDG register map */
|
|
struct iwdg_stm32 {
|
|
union __iwdg_kr kr;
|
|
union __iwdg_pr pr;
|
|
union __iwdg_rlr rlr;
|
|
union __iwdg_sr sr;
|
|
};
|
|
|
|
#endif /* _STM32_IWDG_H_ */
|