TLE986x Device Family SDK
mon.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) 2015, 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 ** JO Julia Ott **
44 ** BG Blandine Guillot **
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, moved revision history from **
66 ** mon.c to mon.h **
67 ** V0.1.5: 2020-02-28, BG: Updated revision history format **
68 *******************************************************************************/
69 
70 #ifndef MON_H
71 #define MON_H
72 
73 /*******************************************************************************
74 ** Includes **
75 *******************************************************************************/
76 #include "tle986x.h"
77 #include "types.h"
78 #include "sfr_access.h"
79 
80 /*******************************************************************************
81 ** Global Macro Definitions **
82 *******************************************************************************/
84 #define MON_STATUS_LOW (0U)
85 
86 #define MON_STATUS_HIGH (1U)
87 
88 /*******************************************************************************
89 ** Global Inline Function Definitions **
90 *******************************************************************************/
112 {
114 }
115 
137 {
139 }
140 
162 {
163  Field_Mod8(&SCU->EXICON0.reg, (uint8)6u, (uint8)0x40u, 1u);
164 }
165 
188 {
189  Field_Mod8(&SCU->EXICON0.reg, (uint8)6u, (uint8)0x40u, 0u);
190 }
191 
213 {
214  Field_Mod8(&SCU->EXICON0.reg, (uint8)7u, (uint8)0x80u, 1u);
215 }
216 
239 {
240  Field_Mod8(&SCU->EXICON0.reg, (uint8)7u, (uint8)0x80u, 0u);
241 }
242 
259 INLINE uint8 MON_Sts(void)
260 {
262 }
263 
277 INLINE void MON_PullUp_En(void)
278 {
280 }
281 
295 INLINE void MON_PullUp_Dis(void)
296 {
298 }
299 
313 INLINE void MON_PullDown_En(void)
314 {
316 }
317 
331 INLINE void MON_PullDown_Dis(void)
332 {
334 }
335 
349 INLINE void MON_CycSense_En(void)
350 {
352 }
353 
367 INLINE void MON_CycSense_Dis(void)
368 {
370 }
371 
385 INLINE void MON_WakeOnRise_En(void)
386 {
388 }
389 
403 INLINE void MON_WakeOnRise_Dis(void)
404 {
406 }
407 
421 INLINE void MON_WakeOnFall_En(void)
422 {
424 }
425 
439 INLINE void MON_WakeOnFall_Dis(void)
440 {
442 }
443 
457 INLINE void MON_En(void)
458 {
460 }
461 
474 INLINE void MON_Dis(void)
475 {
477 }
478 
479 /*******************************************************************************
480 ** Global Function Declarations **
481 *******************************************************************************/
483 
488 void MON_Init(void);
489 
507 uint8 MON_Debounce(uint8 MonActiveState);
508 
509 /*******************************************************************************
510 ** Global Inline Function Definitions **
511 *******************************************************************************/
530 {
532 }
533 
534 #endif
MON_WakeOnFall_En
INLINE void MON_WakeOnFall_En(void)
enables Wake-up on Falling Edge for MON.
Definition: mon.h:416
MON_PullDown_Dis
INLINE void MON_PullDown_Dis(void)
disables PullDown for MON.
Definition: mon.h:326
MON_CycSense_En
INLINE void MON_CycSense_En(void)
enables Cycle Sense for MON.
Definition: mon.h:344
types.h
General type declarations.
MON
#define MON
Definition: tle986x.h:6001
MON_PullUp_En
INLINE void MON_PullUp_En(void)
enables PullUp for MON.
Definition: mon.h:272
PMU_MON_CNF_CYC_Msk
#define PMU_MON_CNF_CYC_Msk
Definition: tle986x.h:8163
MON_Falling_Edge_Int_Clr
INLINE void MON_Falling_Edge_Int_Clr(void)
clears MON on falling edge interrupt flag.
Definition: mon.h:131
SCU_MODIEN3_MONSTS_Pos
#define SCU_MODIEN3_MONSTS_Pos
Definition: tle986x.h:9002
SCU_IRCON0CLR_MONRC_Msk
#define SCU_IRCON0CLR_MONRC_Msk
Definition: tle986x.h:8876
PMU_MON_CNF_PU_Msk
#define PMU_MON_CNF_PU_Msk
Definition: tle986x.h:8159
sfr_access.h
SFR low level access library.
PMU_MON_CNF_FALL_Pos
#define PMU_MON_CNF_FALL_Pos
Definition: tle986x.h:8166
INLINE
#define INLINE
Definition: types.h:134
Field_Mod8
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:346
u1_Field_Rd8
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:391
MON_Sts
INLINE uint8 MON_Sts(void)
reads MON Status.
Definition: mon.h:254
SCU_IRCON0CLR_MONRC_Pos
#define SCU_IRCON0CLR_MONRC_Pos
Definition: tle986x.h:8875
MON_Rising_Edge_Int_En
INLINE void MON_Rising_Edge_Int_En(void)
enables MON on rising edge interrupt.
Definition: mon.h:156
MON_Rising_Edge_Int_Clr
INLINE void MON_Rising_Edge_Int_Clr(void)
clears MON on rising edge interrupt flag.
Definition: mon.h:106
MON_Rising_Edge_Int_Dis
INLINE void MON_Rising_Edge_Int_Dis(void)
disables MON on rising edge interrupt.
Definition: mon.h:182
MON_Falling_Edge_Int_Dis
INLINE void MON_Falling_Edge_Int_Dis(void)
disables MON on falling edge interrupt.
Definition: mon.h:233
MON_WakeOnFall_Dis
INLINE void MON_WakeOnFall_Dis(void)
disables Wake-up on Falling Edge for MON.
Definition: mon.h:434
uint8
unsigned char uint8
8 bit unsigned value
Definition: types.h:139
PMU_MON_CNF_PD_Msk
#define PMU_MON_CNF_PD_Msk
Definition: tle986x.h:8161
MON_Get_Status
INLINE uint8 MON_Get_Status(void)
Reads out the MON Status.
Definition: mon.h:522
PMU_MON_CNF_FALL_Msk
#define PMU_MON_CNF_FALL_Msk
Definition: tle986x.h:8167
MON_PullUp_Dis
INLINE void MON_PullUp_Dis(void)
disables PullUp for MON.
Definition: mon.h:290
SCU_IRCON0CLR_MONFC_Pos
#define SCU_IRCON0CLR_MONFC_Pos
Definition: tle986x.h:8873
MON_En
INLINE void MON_En(void)
enables MON.
Definition: mon.h:452
PMU_MON_CNF_RISE_Msk
#define PMU_MON_CNF_RISE_Msk
Definition: tle986x.h:8165
SCU_MODIEN3_MONSTS_Msk
#define SCU_MODIEN3_MONSTS_Msk
Definition: tle986x.h:9003
PMU_MON_CNF_EN_Msk
#define PMU_MON_CNF_EN_Msk
Definition: tle986x.h:8169
MON_CycSense_Dis
INLINE void MON_CycSense_Dis(void)
disables Cycle Sense for MON.
Definition: mon.h:362
MON_PullDown_En
INLINE void MON_PullDown_En(void)
enables PullDown for MON.
Definition: mon.h:308
PMU_MON_CNF_PD_Pos
#define PMU_MON_CNF_PD_Pos
Definition: tle986x.h:8160
MON_WakeOnRise_En
INLINE void MON_WakeOnRise_En(void)
enables Wake-up on Rising Edge for MON.
Definition: mon.h:380
tle986x.h
CMSIS register HeaderFile.
SCU
#define SCU
Definition: tle986x.h:6004
PMU_MON_CNF_PU_Pos
#define PMU_MON_CNF_PU_Pos
Definition: tle986x.h:8158
MON_Debounce
uint8 MON_Debounce(uint8 MonActiveState)
Debounces the MON input and reads the logical input value.
PMU_MON_CNF_CYC_Pos
#define PMU_MON_CNF_CYC_Pos
Definition: tle986x.h:8162
SCU_IRCON0CLR_MONFC_Msk
#define SCU_IRCON0CLR_MONFC_Msk
Definition: tle986x.h:8874
PMU_MON_CNF_EN_Pos
#define PMU_MON_CNF_EN_Pos
Definition: tle986x.h:8168
PMU_MON_CNF_RISE_Pos
#define PMU_MON_CNF_RISE_Pos
Definition: tle986x.h:8164
MON_Falling_Edge_Int_En
INLINE void MON_Falling_Edge_Int_En(void)
enables MON on falling edge interrupt.
Definition: mon.h:207
Field_Wrt8
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:331
MON_Dis
INLINE void MON_Dis(void)
disables MON.
Definition: mon.h:469
MON_Init
void MON_Init(void)
Initializes the MON module.
MON_WakeOnRise_Dis
INLINE void MON_WakeOnRise_Dis(void)
disables Wake-up on Rising Edge for MON.
Definition: mon.h:398