Infineon MOTIX™ MCU TLE988x/9x Device Family SDK
cantrx.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  **********************************************************************************************************************/
39 /*******************************************************************************
40 ** Author(s) Identity **
41 ********************************************************************************
42 ** Initials Name **
43 ** ---------------------------------------------------------------------------**
44 ** DM Daniel Mysliwitz **
45 ** BG Blandine Guillot **
46 ** JO Julia Ott **
47 *******************************************************************************/
48 
49 /*******************************************************************************
50 ** Revision Control History **
51 ********************************************************************************
52 ** V0.1.0: 2019-10-28, DM: Initial version **
53 ** V0.2.0: 2020-04-28, BG: Updated revision history format **
54 ** V0.3.0: 2020-11-27, BG: EP-627: Added functions for CANTRX **
55 ** V0.3.1: 2020-12-18, BG: EP-652: Corrected name of error code variable **
56 ** V0.3.2: 2021-02-02, BG: EP-654: Separated CAN and CANTRX **
57 ** Renamed file **
58 ** V0.3.3: 2021-04-06, BG: EP-760: Replaced if instructions to check if the **
59 ** module is enabled with preprocessor directives to**
60 ** avoid compiler warnings **
61 ** V0.3.4: 2021-11-12, JO: EP-937: Updated copyright and branding **
62 *******************************************************************************/
63 
64 #ifndef _CANTRX_H
65 #define _CANTRX_H
66 
67 /*******************************************************************************
68 ** Includes **
69 *******************************************************************************/
70 
71 #include "types.h"
72 #include "tle989x.h"
73 #include "cantrx_defines.h"
74 
75 /*******************************************************************************
76 ** Global Constant Declarations **
77 *******************************************************************************/
78 
79 /*******************************************************************************
80 ** Global Type Declarations **
81 *******************************************************************************/
82 
83 /*******************************************************************************
84 ** Global Macro Declarations **
85 *******************************************************************************/
86 
87 /*******************************************************************************
88 ** Global Function Declarations **
89 *******************************************************************************/
90 
91 sint8 CANTRX_init(void);
115 
116 /*******************************************************************************
117 ** Deprecated Function Declarations **
118 *******************************************************************************/
119 
123 void CANTRX_setCANTRXIntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
124 
125 /*******************************************************************************
126 ** Global Inline Function Definitions **
127 *******************************************************************************/
128 
132 {
133  CANTRX->IRQEN.bit.BUS_TO_IEN = 1u;
134 }
135 
139 {
140  CANTRX->IRQEN.bit.BUS_TO_IEN = 0u;
141 }
142 
148 {
149  return CANTRX->IRQS.bit.BUS_TO_IS;
150 }
151 
157 {
158  return CANTRX->IRQS.bit.BUS_TO_STS;
159 }
160 
164 {
165  CANTRX->IRQCLR.bit.BUS_TO_ISC = 1u;
166 }
167 
171 {
172  CANTRX->IRQCLR.bit.BUS_TO_SC = 1u;
173 }
174 
178 {
179  CANTRX->IRQEN.bit.TXD_TO_IEN = 1u;
180 }
181 
185 {
186  CANTRX->IRQEN.bit.TXD_TO_IEN = 0u;
187 }
188 
194 {
195  return CANTRX->IRQS.bit.TXD_TO_IS;
196 }
197 
203 {
204  return CANTRX->IRQS.bit.TXD_TO_STS;
205 }
206 
210 {
211  CANTRX->IRQCLR.bit.TXD_TO_ISC = 1u;
212 }
213 
217 {
218  CANTRX->IRQCLR.bit.TXD_TO_SC = 1u;
219 }
220 
224 {
225  CANTRX->IRQEN.bit.OT_IEN = 1u;
226 }
227 
231 {
232  CANTRX->IRQEN.bit.OT_IEN = 0u;
233 }
234 
240 {
241  return CANTRX->IRQS.bit.OT_IS;
242 }
243 
249 {
250  return CANTRX->IRQS.bit.OT_STS;
251 }
252 
256 {
257  CANTRX->IRQCLR.bit.OT_ISC = 1u;
258 }
259 
263 {
264  CANTRX->IRQCLR.bit.OT_SC = 1u;
265 }
266 
270 {
271  CANTRX->IRQEN.bit.BUS_ACT_IEN = 1u;
272 }
273 
277 {
278  CANTRX->IRQEN.bit.BUS_ACT_IEN = 0u;
279 }
280 
286 {
287  return CANTRX->IRQS.bit.BUS_ACT_IS;
288 }
289 
295 {
296  return CANTRX->IRQS.bit.UV_STS;
297 }
298 
302 {
303  CANTRX->IRQCLR.bit.BUS_ACT_ISC = 1u;
304 }
305 
306 #endif /* _CAN_H */
INLINE void CANTRX_clrBusDominantTimeoutSts(void)
Clear Bus Dominant Timeout Status.
Definition: cantrx.h:170
INLINE void CANTRX_disTXDDominantTimeoutInt(void)
Disable TXD Dominant Timeout Interrupt.
Definition: cantrx.h:184
INLINE void CANTRX_disBusDominantTimeoutInt(void)
Disable Bus Dominant Timeout Interrupt.
Definition: cantrx.h:138
INLINE uint8 CANTRX_getBusDominantTimeoutIntSts(void)
Get Bus Dominant Timeout Interrupt Status.
Definition: cantrx.h:147
INLINE uint8 CANTRX_getTXDDominantTimeoutSts(void)
Get TXD Dominant Timeout Status.
Definition: cantrx.h:202
INLINE void CANTRX_enBusDominantTimeoutInt(void)
Enable Bus Dominant Timeout Interrupt.
Definition: cantrx.h:131
INLINE uint8 CANTRX_getCANOvertempIntSts(void)
Get CAN Overtemperature Interrupt Status.
Definition: cantrx.h:239
INLINE void CANTRX_clrTXDDominantTimeoutSts(void)
Clear TXD Dominant Timeout Status.
Definition: cantrx.h:216
INLINE void CANTRX_enTXDDominantTimeoutInt(void)
Enable TXD Dominant Timeout Interrupt.
Definition: cantrx.h:177
sint8 CANTRX_init(void)
Initialize all CW registers of the cantrx module.
Definition: cantrx.c:59
INLINE void CANTRX_clrBusDominantTimeoutIntSts(void)
Clear Bus Dominant Timeout Interrupt Status.
Definition: cantrx.h:163
INLINE void CANTRX_disCANOvertempInt(void)
Disable CAN Overtemperature Interrupt.
Definition: cantrx.h:230
INLINE uint8 CANTRX_getTXDDominantTimeoutIntSts(void)
Get TXD Dominant Timeout Interrupt Status.
Definition: cantrx.h:193
INLINE uint8 CANTRX_getBusDominantTimeoutSts(void)
Get Bus Dominant Timeout Status.
Definition: cantrx.h:156
INLINE uint8 CANTRX_getActBusWhenCANSleepIntSts(void)
Get Bus Active During CAN Sleep Interrupt Status.
Definition: cantrx.h:285
INLINE void CANTRX_clrCANOvertempIntSts(void)
Clear CAN Overtemperature Interrupt Status.
Definition: cantrx.h:255
INLINE void CANTRX_enCANOvertempInt(void)
Enable CAN Overtemperature Interrupt.
Definition: cantrx.h:223
INLINE void CANTRX_enActBusWhenCANSleepInt(void)
Enable Bus Active During CAN Sleep Interrupt.
Definition: cantrx.h:269
INLINE void CANTRX_clrTXDDominantTimeoutIntSts(void)
Clear TXD Dominant Timeout Interrupt Status.
Definition: cantrx.h:209
void CANTRX_setCANTRXIntNodePtr(void) __attribute__((deprecated("Do not change this at runtime
Set CANTRX Interrupt Node Pointer.
INLINE uint8 CANTRX_getCANSupplyUndervoltageSts(void)
Get CAN Supply Undervoltage Status.
Definition: cantrx.h:294
INLINE void CANTRX_disActBusWhenCANSleepInt(void)
Disable Bus Active During CAN Sleep Interrupt.
Definition: cantrx.h:276
INLINE void CANTRX_clrActBusWhenCANSleepIntSts(void)
Clear Bus Active During CAN Sleep Interrupt Status.
Definition: cantrx.h:301
INLINE uint8 CANTRX_getCANOvertempSts(void)
Get CAN Overtemperature Status.
Definition: cantrx.h:248
INLINE void CANTRX_clrCANOvertempSts(void)
Clear CAN Overtemperature Status.
Definition: cantrx.h:262
#define CANTRX
Definition: tle989x.h:24065
__attribute__((noreturn))
Definition: startup_tle989x.c:208
General type declarations.
#define INLINE
Definition: types.h:167
uint8_t uint8
8 bit unsigned value
Definition: types.h:220
int8_t sint8
8 bit signed value
Definition: types.h:225