px-fwlib
0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers
generated with
Doxygen
1.9.2
px_iwdg.h
1
#ifndef __PX_IWDG_H__
2
#define __PX_IWDG_H__
3
/* =============================================================================
4
____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM
5
| _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ /
6
| |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ /
7
| __/ | | | |___ | |_| | | |\ | | |_| | | | | | | | / \
8
|_| |___| \____| \___/ |_| \_| \___/ |_| |_| |___| /_/\_\
9
10
Copyright (c) 2021 Pieter Conradie <https://piconomix.com>
11
12
License: MIT
13
https://github.com/piconomix/px-fwlib/blob/master/LICENSE.md
14
15
Title: px_iwdg.h : Independent Watchdog module
16
Author(s): Pieter Conradie
17
Creation Date: 2021-05-08
18
19
============================================================================= */
20
21
/**
22
* @ingroup STM32
23
* @defgroup STM32_IWDG px_iwdg.h : Independent Watchdog module
24
*
25
* This module is used to initialise the IWDG peripheral.
26
*
27
* File(s):
28
* - arch/arm/stm32/inc/px_iwdg.h
29
* - arch/arm/stm32/src/px_iwdg.c
30
*
31
* @{
32
*/
33
34
/* _____STANDARD INCLUDES____________________________________________________ */
35
36
/* _____PROJECT INCLUDES_____________________________________________________ */
37
#include "px_defs.h"
38
39
#ifdef __cplusplus
40
extern
"C"
{
41
#endif
42
/* _____DEFINITIONS__________________________________________________________ */
43
44
/* _____TYPE DEFINITIONS_____________________________________________________ */
45
/// Independent Watchdog clock prescaler (40 kHz LSI clock source)
46
typedef
enum
47
{
48
PX_IWDG_PRESCALER_4
= 0,
///< Clock = 40 kHz / 4
49
PX_IWDG_PRESCALER_8
= 1,
///< Clock = 40 kHz / 8
50
PX_IWDG_PRESCALER_16
= 2,
///< Clock = 40 kHz / 16
51
PX_IWDG_PRESCALER_32
= 3,
///< Clock = 40 kHz / 32
52
PX_IWDG_PRESCALER_64
= 4,
///< Clock = 40 kHz / 64
53
PX_IWDG_PRESCALER_128
= 5,
///< Clock = 40 kHz / 128
54
PX_IWDG_PRESCALER_256
= 6,
///< Clock = 40 kHz / 256
55
}
px_iwdg_prescaler_t
;
56
57
/* _____GLOBAL VARIABLES_____________________________________________________ */
58
59
/* _____GLOBAL FUNCTION DECLARATIONS_________________________________________ */
60
/**
61
* Initialise Independent Watchdog
62
*
63
* @param prescaler Clock prescaler. See #px_iwdg_prescaler_t
64
* @param reload Counter reload value (1 to 0x0fff)
65
* @param window Reload window (0 if not used; max 0x0fff)
66
*/
67
void
px_iwdg_init
(
px_iwdg_prescaler_t
prescaler, uint16_t reload, uint16_t window);
68
69
/**
70
* Reload watchdog counter, a.k.a. "patting the dog"
71
*/
72
void
px_iwdg_reload_counter
(
void
);
73
74
/* _____MACROS_______________________________________________________________ */
75
76
#ifdef __cplusplus
77
}
78
#endif
79
80
/// @}
81
#endif
px_iwdg_init
void px_iwdg_init(px_iwdg_prescaler_t prescaler, uint16_t reload, uint16_t window)
Initialise Independent Watchdog.
Definition:
px_iwdg.c:40
px_iwdg_prescaler_t
px_iwdg_prescaler_t
Independent Watchdog clock prescaler (40 kHz LSI clock source)
Definition:
px_iwdg.h:47
px_iwdg_reload_counter
void px_iwdg_reload_counter(void)
Reload watchdog counter, a.k.a.
Definition:
px_iwdg.c:67
PX_IWDG_PRESCALER_16
@ PX_IWDG_PRESCALER_16
Clock = 40 kHz / 16.
Definition:
px_iwdg.h:50
PX_IWDG_PRESCALER_64
@ PX_IWDG_PRESCALER_64
Clock = 40 kHz / 64.
Definition:
px_iwdg.h:52
PX_IWDG_PRESCALER_32
@ PX_IWDG_PRESCALER_32
Clock = 40 kHz / 32.
Definition:
px_iwdg.h:51
PX_IWDG_PRESCALER_4
@ PX_IWDG_PRESCALER_4
Clock = 40 kHz / 4.
Definition:
px_iwdg.h:48
PX_IWDG_PRESCALER_256
@ PX_IWDG_PRESCALER_256
Clock = 40 kHz / 256.
Definition:
px_iwdg.h:54
PX_IWDG_PRESCALER_8
@ PX_IWDG_PRESCALER_8
Clock = 40 kHz / 8.
Definition:
px_iwdg.h:49
PX_IWDG_PRESCALER_128
@ PX_IWDG_PRESCALER_128
Clock = 40 kHz / 128.
Definition:
px_iwdg.h:53