Infineon MOTIX™ MCU TLE987x Device Family SDK
mon.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) Infineon Technologies AG
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the
8  * following conditions are met:
9  *
10  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
11  * disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14  * following disclaimer in the documentation and/or other materials provided with the distribution.
15  *
16  * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
17  * products derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  **********************************************************************************************************************/
37 /*******************************************************************************
38 ** Author(s) Identity **
39 ********************************************************************************
40 ** Initials Name **
41 ** ---------------------------------------------------------------------------**
42 ** DM Daniel Mysliwitz **
43 ** BG Blandine Guillot **
44 ** JO Julia Ott **
45 *******************************************************************************/
46 
47 /*******************************************************************************
48 ** Revision Control History **
49 ********************************************************************************
50 ** V0.1.0: 2014-05-12, DM: Initial version **
51 ** V0.1.1: 2015-02-10, DM: Individual header file added **
52 ** V0.1.2: 2017-04-20, DM: Macros for configuration and status added **
53 ** V0.1.3: 2017-10-10, DM: MISRA 2012 compliance, the following PC-Lint **
54 ** rules are globally deactivated: **
55 ** - Info 793: ANSI/ISO limit of 6 'significant **
56 ** characters in an external identifier **
57 ** - Info 835: A zero has been given as right **
58 ** argument to operator **
59 ** - Info 845: The left argument to operator '&' **
60 ** is certain to be 0 **
61 ** Replaced macros by INLINE functions **
62 ** Replaced register accesses within functions by **
63 ** function calls **
64 ** Replaced __STATIC_INLINE by INLINE **
65 ** V0.1.4: 2018-11-27, JO: Doxygen update **
66 ** Moved revision history from mon.c to mon.h **
67 ** V0.1.5: 2020-04-15, BG: Updated revision history format **
68 ** V0.1.6: 2020-07-21, BG: EP-439: Formatted .h/.c files **
69 ** V0.1.7: 2022-02-28, JO: EP-936: Updated copyright and branding **
70 *******************************************************************************/
71 
72 #ifndef MON_H
73 #define MON_H
74 
75 /*******************************************************************************
76 ** Includes **
77 *******************************************************************************/
78 #include "tle987x.h"
79 #include "types.h"
80 #include "sfr_access.h"
81 
82 /*******************************************************************************
83 ** Global Macro Definitions **
84 *******************************************************************************/
86 #define MON_STATUS_LOW (0U)
88 #define MON_STATUS_HIGH (1U)
89 
90 /*******************************************************************************
91 ** Global Inline Function Definitions **
92 *******************************************************************************/
114 {
116 }
117 
139 {
141 }
142 
164 {
165  Field_Mod8(&SCU->EXICON0.reg, (uint8)6u, (uint8)0x40u, 1u);
166 }
167 
190 {
191  Field_Mod8(&SCU->EXICON0.reg, (uint8)6u, (uint8)0x40u, 0u);
192 }
193 
215 {
216  Field_Mod8(&SCU->EXICON0.reg, (uint8)7u, (uint8)0x80u, 1u);
217 }
218 
241 {
242  Field_Mod8(&SCU->EXICON0.reg, (uint8)7u, (uint8)0x80u, 0u);
243 }
244 
262 {
264 }
265 
280 {
282 }
283 
298 {
300 }
301 
316 {
318 }
319 
334 {
336 }
337 
352 {
354 }
355 
370 {
372 }
373 
388 {
390 }
391 
406 {
408 }
409 
424 {
426 }
427 
442 {
444 }
445 
459 INLINE void MON_En(void)
460 {
462 }
463 
476 INLINE void MON_Dis(void)
477 {
479 }
480 
481 /*******************************************************************************
482 ** Global Function Declarations **
483 *******************************************************************************/
485 
490 void MON_Init(void);
491 
509 uint8 MON_Debounce(uint8 MonActiveState);
510 
511 /*******************************************************************************
512 ** Global Inline Function Definitions **
513 *******************************************************************************/
532 {
534 }
535 
536 #endif
#define MON
Definition: tle987x.h:6094
#define SCU
Definition: tle987x.h:6097
#define PMU_MON_CNF_CYC_Pos
Definition: tle987x.h:8325
#define PMU_MON_CNF_EN_Pos
Definition: tle987x.h:8331
#define PMU_MON_CNF_EN_Msk
Definition: tle987x.h:8332
#define PMU_MON_CNF_PU_Pos
Definition: tle987x.h:8321
#define SCU_MODIEN3_MONSTS_Msk
Definition: tle987x.h:9158
#define SCU_IRCON0CLR_MONRC_Pos
Definition: tle987x.h:9030
#define PMU_MON_CNF_PD_Msk
Definition: tle987x.h:8324
#define PMU_MON_CNF_RISE_Pos
Definition: tle987x.h:8327
#define PMU_MON_CNF_RISE_Msk
Definition: tle987x.h:8328
#define PMU_MON_CNF_FALL_Msk
Definition: tle987x.h:8330
#define PMU_MON_CNF_CYC_Msk
Definition: tle987x.h:8326
#define PMU_MON_CNF_PD_Pos
Definition: tle987x.h:8323
#define PMU_MON_CNF_PU_Msk
Definition: tle987x.h:8322
#define SCU_IRCON0CLR_MONRC_Msk
Definition: tle987x.h:9031
#define PMU_MON_CNF_FALL_Pos
Definition: tle987x.h:8329
#define SCU_MODIEN3_MONSTS_Pos
Definition: tle987x.h:9157
#define SCU_IRCON0CLR_MONFC_Msk
Definition: tle987x.h:9029
#define SCU_IRCON0CLR_MONFC_Pos
Definition: tle987x.h:9028
INLINE void MON_CycSense_En(void)
enables Cycle Sense for MON.
Definition: mon.h:351
INLINE void MON_Falling_Edge_Int_En(void)
enables MON on falling edge interrupt.
Definition: mon.h:214
void MON_Init(void)
Initializes the MON module based on the Config Wizard for MOTIX MCU configuration.
INLINE void MON_Rising_Edge_Int_Clr(void)
clears MON on rising edge interrupt flag.
Definition: mon.h:113
INLINE void MON_Falling_Edge_Int_Dis(void)
disables MON on falling edge interrupt.
Definition: mon.h:240
INLINE void MON_Falling_Edge_Int_Clr(void)
clears MON on falling edge interrupt flag.
Definition: mon.h:138
INLINE void MON_En(void)
enables MON.
Definition: mon.h:459
INLINE uint8 MON_Get_Status(void)
Reads out the MON Status.
Definition: mon.h:531
INLINE void MON_PullUp_En(void)
enables PullUp for MON.
Definition: mon.h:279
INLINE void MON_WakeOnFall_En(void)
enables Wake-up on Falling Edge for MON.
Definition: mon.h:423
INLINE void MON_WakeOnRise_En(void)
enables Wake-up on Rising Edge for MON.
Definition: mon.h:387
INLINE void MON_PullUp_Dis(void)
disables PullUp for MON.
Definition: mon.h:297
INLINE uint8 MON_Sts(void)
reads MON Status.
Definition: mon.h:261
INLINE void MON_Rising_Edge_Int_Dis(void)
disables MON on rising edge interrupt.
Definition: mon.h:189
uint8 MON_Debounce(uint8 MonActiveState)
Debounces the MON input and reads the logical input value.
INLINE void MON_CycSense_Dis(void)
disables Cycle Sense for MON.
Definition: mon.h:369
INLINE void MON_WakeOnRise_Dis(void)
disables Wake-up on Rising Edge for MON.
Definition: mon.h:405
INLINE void MON_Dis(void)
disables MON.
Definition: mon.h:476
INLINE void MON_Rising_Edge_Int_En(void)
enables MON on rising edge interrupt.
Definition: mon.h:163
INLINE void MON_PullDown_En(void)
enables PullDown for MON.
Definition: mon.h:315
INLINE void MON_PullDown_Dis(void)
disables PullDown for MON.
Definition: mon.h:333
INLINE void MON_WakeOnFall_Dis(void)
disables Wake-up on Falling Edge for MON.
Definition: mon.h:441
SFR low level access library.
INLINE void Field_Wrt8(volatile uint8 *reg, uint8 pos, uint8 msk, uint8 val)
This function writes a bit field in a 8-bit register.
Definition: sfr_access.h:337
INLINE uint8 u1_Field_Rd8(const volatile uint8 *reg, uint8 pos, uint8 msk)
This function reads a 1-bit field of a 8-bit register.
Definition: sfr_access.h:397
INLINE void Field_Mod8(volatile uint8 *reg, uint8 pos, uint8 msk, uint8 val)
This function writes a bit field in a 8-bit register.
Definition: sfr_access.h:352
CMSIS register HeaderFile.
General type declarations.
#define INLINE
Definition: types.h:148
uint8_t uint8
8 bit unsigned value
Definition: types.h:153