![]() |
Kinetis Bootloader
2.0.0
Common bootloader for Kinetis devices
|
Collaboration diagram for WDOG32 Peripheral driver:Data Structures | |
| struct | wdog32_work_mode_t |
| Defines WDOG32 work mode. More... | |
| struct | wdog32_config_t |
| Describes WDOG32 configuration structure. More... | |
Enumerations | |
| enum | wdog32_clock_source_t { kWDOG32_ClockSource0 = 0U, kWDOG32_ClockSource1 = 1U, kWDOG32_ClockSource2 = 2U, kWDOG32_ClockSource3 = 3U } |
| Describes WDOG32 clock source. More... | |
| enum | wdog32_clock_prescaler_t { kWDOG32_ClockPrescalerDivide1 = 0x0U, kWDOG32_ClockPrescalerDivide256 = 0x1U } |
| Describes the selection of the clock prescaler. More... | |
| enum | wdog32_test_mode_t { kWDOG32_TestModeDisabled = 0U, kWDOG32_UserModeEnabled = 1U, kWDOG32_LowByteTest = 2U, kWDOG32_HighByteTest = 3U } |
| Describes WDOG32 test mode. More... | |
| enum | _wdog32_interrupt_enable_t { kWDOG32_InterruptEnable = WDOG_CS_INT_MASK } |
| WDOG32 interrupt configuration structure. More... | |
| enum | _wdog32_status_flags_t { kWDOG32_RunningFlag = WDOG_CS_EN_MASK, kWDOG32_InterruptFlag = WDOG_CS_FLG_MASK } |
| WDOG32 status flags. More... | |
WDOG32 Initialization and De-initialization | |
| void | WDOG32_GetDefaultConfig (wdog32_config_t *config) |
| Initializes WDOG32 configure sturcture. More... | |
| void | WDOG32_Init (WDOG_Type *base, const wdog32_config_t *config) |
| Initializes WDOG32 module. More... | |
| void | WDOG32_Deinit (WDOG_Type *base) |
| De-initializes WDOG32 module. More... | |
WDOG32 functional Operation | |
| static void | WDOG32_Enable (WDOG_Type *base) |
| Enables WDOG32 module. More... | |
| static void | WDOG32_Disable (WDOG_Type *base) |
| Disables WDOG32 module. More... | |
| static void | WDOG32_EnableInterrupts (WDOG_Type *base, uint32_t mask) |
| Enable WDOG32 interrupt. More... | |
| static void | WDOG32_DisableInterrupts (WDOG_Type *base, uint32_t mask) |
| Disable WDOG32 interrupt. More... | |
| uint32_t | WDOG32_GetStatusFlags (WDOG_Type *base) |
| Gets WDOG32 all status flags. More... | |
| void | WDOG32_ClearStatusFlags (WDOG_Type *base, uint32_t mask) |
| Clear WDOG32 flag. More... | |
| static void | WDOG32_SetTimeoutValue (WDOG_Type *base, uint16_t timeoutCount) |
| Set the WDOG32 timeout value. More... | |
| static void | WDOG32_SetWindowValue (WDOG_Type *base, uint16_t windowValue) |
| Sets the WDOG32 window value. More... | |
| static void | WDOG32_Unlock (WDOG_Type *base) |
| Unlocks the WDOG32 register written. More... | |
| static void | WDOG32_Refresh (WDOG_Type *base) |
| Refreshes the WDOG32 timer. More... | |
| static uint16_t | WDOG32_GetCounterValue (WDOG_Type *base) |
| Gets WDOG32 counter value. More... | |
This section describes the programming interface of the WDOG32 Peripheral driver. The WDOG32 driver configures the WDOG32 module.
This function group initializes and de-initializes the WDOG32 module.
This function group implements the WDOG32 functional API.
| struct wdog32_work_mode_t |
| struct wdog32_config_t |
Describes WDOG32 configuration structure.
Collaboration diagram for wdog32_config_t:| Data Fields | ||
|---|---|---|
| wdog32_clock_source_t | clockSource |
Clock source select |
| bool | enableInterrupt |
Enables or disables WDOG32 interrupt |
| bool | enableUpdate |
Update write-once register enable |
| bool | enableWdog32 |
Enables or disables WDOG32 |
| bool | enableWindowMode |
Enables or disables WDOG32 window mode |
| wdog32_clock_prescaler_t | prescaler |
Clock prescaler value |
| wdog32_test_mode_t | testMode |
Configures WDOG32 test mode |
| uint16_t | timeoutValue |
Timeout value |
| uint16_t | windowValue |
Window value |
| wdog32_work_mode_t | workMode |
Configures WDOG32 work mode in debug stop and wait mode |
| enum wdog32_test_mode_t |
| void WDOG32_ClearStatusFlags | ( | WDOG_Type * | base, |
| uint32_t | mask | ||
| ) |
Clear WDOG32 flag.
This function clears WDOG32 status flag.
Example for clearing interrupt flag:
| base | WDOG32 peripheral base address |
| mask | The status flags to clear. The parameter could be any combination of the following values:
|
| void WDOG32_Deinit | ( | WDOG_Type * | base | ) |
De-initializes WDOG32 module.
This function shuts down the WDOG32. Make sure that the WDOG_CS.UPDATE is 1 which means that the register update is enabled.
| base | WDOG32 peripheral base address |
|
inlinestatic |
Disables WDOG32 module.
This function write value into WDOG_CS register to disable WDOG32. WDOG_CS register is a write-once register, make sure the WCT window is still open and this register has not been written in this WCT while this function is called.
| base | WDOG32 peripheral base address |
|
inlinestatic |
Disable WDOG32 interrupt.
This function write value into WDOG_CS register to disable the WDOG32 interrupt. WDOG_CS register is a write-once register, make sure the WCT window is still open and this register has not been written in this WCT while this function is called.
| base | WDOG32 peripheral base address |
| mask | The interrupts to disable The parameter can be combination of the following source if defined:
|
|
inlinestatic |
Enables WDOG32 module.
This function write value into WDOG_CS register to enable WDOG32. WDOG_CS register is a write-once register, make sure the WCT window is still open and this register has not been written in this WCT while this function is called.
| base | WDOG32 peripheral base address |
|
inlinestatic |
Enable WDOG32 interrupt.
This function write value into WDOG_CS register to enable the WDOG32 interrupt. WDOG_CS register is a write-once register, make sure the WCT window is still open and this register has not been written in this WCT while this function is called.
| base | WDOG32 peripheral base address |
| mask | The interrupts to enable The parameter can be combination of the following source if defined:
|
|
inlinestatic |
Gets WDOG32 counter value.
This function gets the WDOG32 counter value.
| base | WDOG32 peripheral base address |
| void WDOG32_GetDefaultConfig | ( | wdog32_config_t * | config | ) |
Initializes WDOG32 configure sturcture.
This function initializes the WDOG32 configure structure to default value. The default value are:
| config | Pointer to WDOG32 config structure. |
|
inline |
Gets WDOG32 all status flags.
This function gets all status flags.
Example for getting Running Flag:
| base | WDOG32 peripheral base address |
| void WDOG32_Init | ( | WDOG_Type * | base, |
| const wdog32_config_t * | config | ||
| ) |
Initializes WDOG32 module.
This function is used to initializes WDOG32. If user wants to reconfigure WDOG32 without forcing a reset first, enableUpdate must be set to true in configuration.
Example:
| base | WDOG32 peripheral base address |
| config | The configuration of WDOG32 |
|
inlinestatic |
Refreshes the WDOG32 timer.
This function feeds the WDOG32. This function should be called before watchdog timer is in timeout. Otherwise, a reset is asserted.
| base | WDOG32 peripheral base address |
|
inlinestatic |
Set the WDOG32 timeout value.
This function write timeout value into WDOG_TOVAL register. WDOG_TOVAL register is a write-once register, make sure the WCT window is still open and this register has not been written in this WCT while this function is called.
| base | WDOG32 peripheral base address |
| timeoutCount | WDOG32 timeout value, count of WDOG32 clock tick. |
|
inlinestatic |
Sets the WDOG32 window value.
This function write window value into WDOG_WIN register. WDOG_WIN register is a write-once register, make sure the WCT window is still open and this register has not been written in this WCT while this function is called.
| base | WDOG32 peripheral base address |
| windowValue | WDOG32 window value. |
|
inlinestatic |
Unlocks the WDOG32 register written.
This function unlocks the WDOG32 register written.
Before starting the unlock sequence and following congfiguration, disable the global interrupts. Otherwise, an interrupt could effectively invalidate the unlock sequence and the WCT may expire, After the configuration finishes, re-enable the global interrupts.
| base | WDOG32 peripheral base address |