S32 SDK
wdog_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Freescale Semiconductor, Inc.
3  * Copyright 2016 NXP
4  * All rights reserved.
5  *
6  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
7  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
11  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
12  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
14  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
16  * THE POSSIBILITY OF SUCH DAMAGE.
17  */
18 
23 #ifndef WDOG_DRIVER_H
24 #define WDOG_DRIVER_H
25 
26 #include <stddef.h>
27 #include <stdbool.h>
28 #include "device_registers.h"
29 #include "wdog_hal.h"
30 #include "interrupt_manager.h"
31 #include "clock_manager.h"
32 #include "status.h"
33 
42 /*******************************************************************************
43  * Variables
44  ******************************************************************************/
45 
46 /* Table of base addresses for WDOG instances. */
48 
49 /* Table to save WDOG IRQ enumeration numbers defined in the CMSIS header file. */
51 
52 /*******************************************************************************
53  * Enumerations.
54  ******************************************************************************/
55 
56  /*******************************************************************************
57  * Definitions
58  ******************************************************************************/
59 
60 
61 /*******************************************************************************
62  * API
63  ******************************************************************************/
69 #if defined(__cplusplus)
70 extern "C" {
71 #endif
72 
73 
85 status_t WDOG_DRV_Init(uint32_t instance,
86  const wdog_user_config_t *userConfigPtr);
92 void WDOG_DRV_Deinit(uint32_t instance);
93 
100 void WDOG_DRV_GetConfig(uint32_t instance, wdog_user_config_t *config);
101 
114 status_t WDOG_DRV_SetInt(uint32_t instance, bool enable, void (*handler)(void));
115 
121 void WDOG_DRV_Trigger(uint32_t instance);
122 
123 
124 
126 #if defined(__cplusplus)
127 }
128 #endif
129 
132 #endif /* WDOG_DRIVER_H */
133 /*******************************************************************************
134  * EOF
135  ******************************************************************************/
status_t WDOG_DRV_Init(uint32_t instance, const wdog_user_config_t *userConfigPtr)
Initializes the WDOG driver.
Definition: wdog_driver.c:106
void WDOG_DRV_GetConfig(uint32_t instance, wdog_user_config_t *config)
Gets the current configuration of the WDOG.
Definition: wdog_driver.c:208
IRQn_Type
Defines the Interrupt Numbers definitions.
Definition: S32K144.h:269
WDOG configuration structure Implements : wdog_user_config_t_Class.
Definition: wdog_hal.h:90
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:31
WDOG_Type *const g_wdogBase[WDOG_INSTANCE_COUNT]
Table of base addresses for WDOG instances.
Definition: wdog_driver.c:55
status_t WDOG_DRV_SetInt(uint32_t instance, bool enable, void(*handler)(void))
Enables/Disables the WDOG timeout interrupt and sets a function to be called when a timeout interrupt...
Definition: wdog_driver.c:227
void WDOG_DRV_Deinit(uint32_t instance)
De-initializes the WDOG driver.
Definition: wdog_driver.c:146
#define WDOG_INSTANCE_COUNT
Definition: S32K144.h:11270
void WDOG_DRV_Trigger(uint32_t instance)
Refreshes the WDOG counter.
Definition: wdog_driver.c:269
const IRQn_Type g_wdogIrqId[WDOG_INSTANCE_COUNT]
Table to save WDOG IRQ enum numbers defined in CMSIS header file.
Definition: wdog_driver.c:58