1 /*
2  * Copyright 2023 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 #ifndef FSL_GDET_H_
8 #define FSL_GDET_H_
9 
10 #include "fsl_common.h"
11 
12 /*!
13  * @addtogroup GDET
14  * @{
15  */
16 
17 /*! @file */
18 
19 /*******************************************************************************
20  * Definitions
21  *******************************************************************************/
22 
23 /*! @name Driver version */
24 /*! @{ */
25 /*! @brief Defines GDET driver version 2.0.0.
26  *
27  * Change log:
28  * - Version 2.0.0
29  *   - initial version
30  */
31 #define FSL_GDET_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
32 /*! @} */
33 
34 /*!
35  * @brief GDET Core Voltage.
36  *
37  * These constants are used to define core voltage argument to be used with
38  * GDET_ReconfigureVoltageMode().
39  */
40 
41 typedef uint32_t gdet_core_voltage_t;
42 #define kGDET_MidVoltage       ((gdet_core_voltage_t)0x0u) /*!< Mid Voltage (1.0V) */
43 #define kGDET_NormalVoltage    ((gdet_core_voltage_t)0x1u) /*!< Normal Voltage (1.1V) */
44 #define kGDET_OverDriveVoltage ((gdet_core_voltage_t)0x2u) /*!< Over Drive Voltage (1.2V) */
45 
46 /*******************************************************************************
47  * API
48  *******************************************************************************/
49 
50 extern void GDET_DriverIRQHandler(void);
51 
52 #if defined(__cplusplus)
53 extern "C" {
54 #endif /* __cplusplus */
55 
56 /*!
57  * @name GDET Functional Operation
58  * @{
59  */
60 
61 /*!
62  * @brief Initialize GDET
63  *
64  * This function initializes GDET block and setting.
65  *
66  * @param base GDET peripheral base address
67  * @return Status of the init operation
68  */
69 status_t GDET_Init(GDET_Type *base);
70 
71 /*!
72  * @brief Deinitialize GDET
73  *
74  * This function deinitializes GDET secure counter.
75  *
76  * @param base GDET peripheral base address
77  */
78 void GDET_Deinit(GDET_Type *base);
79 /*!
80  * @brief Turn on GDET isolation
81  *
82  * This function turns on isolation of GDET peripheral
83  *
84  * @param base GDET peripheral base address
85  */
86 status_t GDET_IsolateOn(GDET_Type *base);
87 
88 /*!
89  * @brief Turn off GDET isolation
90  *
91  * This function turns off isolation of GDET peripheral
92  *
93  * @param base GDET peripheral base address
94  */
95 status_t GDET_IsolateOff(GDET_Type *base);
96 
97 /*!
98  * @brief Change expected core voltage
99  *
100  * This function changes core voltage which Glitch detector expect.
101  *
102  * @param base GDET peripheral base address
103  * @param voltage Expected core voltage
104  * @return Status of the GDET reconfiguration operation
105  */
106 status_t GDET_ReconfigureVoltageMode(GDET_Type *base, gdet_core_voltage_t voltage);
107 
108 /*! @}*/
109 
110 #if defined(__cplusplus)
111 }
112 #endif   /* __cplusplus */
113 
114 /*! @}*/ /* end of group gdet */
115 
116 #endif   /* FSL_GDET_H_ */
117