STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches

Independent watchdog. More...

Collaboration diagram for IWDG:

Data Structures

struct  IwdgRegisters_t
 IWDG register block. More...

Macros

#define IWDG_BASE   (0x40003000UL)
 IWDG base address (APB1).
#define IWDG   ((IwdgRegisters_t *)IWDG_BASE)
 The IWDG instance.

Typedefs

typedef struct IwdgRegisters_t IwdgRegisters_t
 IWDG register block.

KR - key values (0x00)

#define IWDG_KEY_RELOAD   (0xAAAAU)
 Reload the counter from RLR (refresh).
#define IWDG_KEY_ENABLE_ACCESS   (0x5555U)
 Unlock PR and RLR for writing.
#define IWDG_KEY_START   (0xCCCCU)
 Start the watchdog; it cannot be stopped.

PR - prescaler (0x04)

#define IWDG_PR_PR_Pos   (0U)
 Bits 2:0.
#define IWDG_PR_PR_Msk   ((uint32_t)0x7U << IWDG_PR_PR_Pos)
  rw LSI divider: /4 << value, up to /256.

PR values

7 also divides by 256; IWDG_PR_DIV256 is the one value used for it.

#define IWDG_PR_DIV4   (0x0U)
 LSI / 4.
#define IWDG_PR_DIV8   (0x1U)
 LSI / 8.
#define IWDG_PR_DIV16   (0x2U)
 LSI / 16.
#define IWDG_PR_DIV32   (0x3U)
 LSI / 32.
#define IWDG_PR_DIV64   (0x4U)
 LSI / 64.
#define IWDG_PR_DIV128   (0x5U)
 LSI / 128.
#define IWDG_PR_DIV256   (0x6U)
 LSI / 256.

RLR - reload (0x08)

#define IWDG_RLR_RL_Pos   (0U)
 Bits 11:0.
#define IWDG_RLR_RL_Msk   ((uint32_t)0xFFFU << IWDG_RLR_RL_Pos)
  rw Counter reload value.

SR - status (0x0C)

#define IWDG_SR_PVU_Pos   (0U)
 Bit 0.
#define IWDG_SR_PVU   ((uint32_t)1U << IWDG_SR_PVU_Pos)
  ro A PR update is in progress.
#define IWDG_SR_RVU_Pos   (1U)
 Bit 1.
#define IWDG_SR_RVU   ((uint32_t)1U << IWDG_SR_RVU_Pos)
  ro An RLR update is in progress.

Detailed Description

Independent watchdog.

Macro Definition Documentation

◆ IWDG_BASE

#define IWDG_BASE   (0x40003000UL)

IWDG base address (APB1).

Definition at line 22 of file iwdg_reg.h.

◆ IWDG

#define IWDG   ((IwdgRegisters_t *)IWDG_BASE)

The IWDG instance.

Definition at line 33 of file iwdg_reg.h.

◆ IWDG_KEY_RELOAD

#define IWDG_KEY_RELOAD   (0xAAAAU)

Reload the counter from RLR (refresh).

Definition at line 37 of file iwdg_reg.h.

Referenced by iwdgRefresh().

◆ IWDG_KEY_ENABLE_ACCESS

#define IWDG_KEY_ENABLE_ACCESS   (0x5555U)

Unlock PR and RLR for writing.

Definition at line 38 of file iwdg_reg.h.

Referenced by iwdgStart().

◆ IWDG_KEY_START

#define IWDG_KEY_START   (0xCCCCU)

Start the watchdog; it cannot be stopped.

Definition at line 39 of file iwdg_reg.h.

Referenced by iwdgStart().

◆ IWDG_PR_PR_Pos

#define IWDG_PR_PR_Pos   (0U)

Bits 2:0.

Definition at line 44 of file iwdg_reg.h.

Referenced by iwdgStart().

◆ IWDG_PR_PR_Msk

#define IWDG_PR_PR_Msk   ((uint32_t)0x7U << IWDG_PR_PR_Pos)

rw LSI divider: /4 << value, up to /256.

Definition at line 46 of file iwdg_reg.h.

◆ IWDG_PR_DIV4

#define IWDG_PR_DIV4   (0x0U)

LSI / 4.

Definition at line 52 of file iwdg_reg.h.

◆ IWDG_PR_DIV8

#define IWDG_PR_DIV8   (0x1U)

LSI / 8.

Definition at line 53 of file iwdg_reg.h.

◆ IWDG_PR_DIV16

#define IWDG_PR_DIV16   (0x2U)

LSI / 16.

Definition at line 54 of file iwdg_reg.h.

◆ IWDG_PR_DIV32

#define IWDG_PR_DIV32   (0x3U)

LSI / 32.

Definition at line 55 of file iwdg_reg.h.

◆ IWDG_PR_DIV64

#define IWDG_PR_DIV64   (0x4U)

LSI / 64.

Definition at line 56 of file iwdg_reg.h.

◆ IWDG_PR_DIV128

#define IWDG_PR_DIV128   (0x5U)

LSI / 128.

Definition at line 57 of file iwdg_reg.h.

◆ IWDG_PR_DIV256

#define IWDG_PR_DIV256   (0x6U)

LSI / 256.

Definition at line 58 of file iwdg_reg.h.

Referenced by iwdgStart().

◆ IWDG_RLR_RL_Pos

#define IWDG_RLR_RL_Pos   (0U)

Bits 11:0.

Definition at line 63 of file iwdg_reg.h.

Referenced by iwdgStart().

◆ IWDG_RLR_RL_Msk

#define IWDG_RLR_RL_Msk   ((uint32_t)0xFFFU << IWDG_RLR_RL_Pos)

rw Counter reload value.

Definition at line 65 of file iwdg_reg.h.

Referenced by iwdgStart().

◆ IWDG_SR_PVU_Pos

#define IWDG_SR_PVU_Pos   (0U)

Bit 0.

Definition at line 70 of file iwdg_reg.h.

◆ IWDG_SR_PVU

#define IWDG_SR_PVU   ((uint32_t)1U << IWDG_SR_PVU_Pos)

ro A PR update is in progress.

Definition at line 72 of file iwdg_reg.h.

Referenced by iwdgWaitUpdates().

◆ IWDG_SR_RVU_Pos

#define IWDG_SR_RVU_Pos   (1U)

Bit 1.

Definition at line 73 of file iwdg_reg.h.

◆ IWDG_SR_RVU

#define IWDG_SR_RVU   ((uint32_t)1U << IWDG_SR_RVU_Pos)

ro An RLR update is in progress.

Definition at line 75 of file iwdg_reg.h.

Referenced by iwdgWaitUpdates().