Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ifx_tcpwm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Infineon Technologies AG,
3 * or an affiliate of Infineon Technologies AG.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/*
9 * The TCPWM function and macros in the PDL use a complex set of arrays and marcos to
10 * reference a specific TCPWM instance. With the information in the .dtsi file, we
11 * have the absolute address for each TCPWM instance. We will make use of that
12 * when we provide the ADDRESS to the macros below. This means that the cntNum parameter
13 * is always 0.
14 */
15
16#if !defined(ZEPHYR_INCLUDE_DRIVERS_TIMER_IFX_TCPWM_TIMER_H)
17#define ZEPHYR_INCLUDE_DRIVERS_TIMER_IFX_TCPWM_TIMER_H
18
19#include <stdint.h>
20#include "cy_tcpwm.h"
21
23#define IFX_TCPWM_Block_EnableCompare0Swap(ADDRESS, ENABLE) \
24 Cy_TCPWM_Block_EnableCompare0Swap((TCPWM_Type *)ADDRESS, 0, ENABLE)
25#define IFX_TCPWM_Block_EnableCompare1Swap(ADDRESS, ENABLE) \
26 Cy_TCPWM_Block_EnableCompare1Swap((TCPWM_Type *)ADDRESS, 0, ENABLE)
27#define IFX_TCPWM_Block_GetCC0BufVal(ADDRESS) Cy_TCPWM_Block_GetCC0BufVal((TCPWM_Type *)ADDRESS, 0)
28#define IFX_TCPWM_Block_GetCC0Val(ADDRESS) Cy_TCPWM_Block_GetCC0Val((TCPWM_Type *)ADDRESS, 0)
29#define IFX_TCPWM_Block_GetCC1BufVal(ADDRESS) Cy_TCPWM_Block_GetCC1BufVal((TCPWM_Type *)ADDRESS, 0)
30#define IFX_TCPWM_Block_GetCC1Val(ADDRESS) Cy_TCPWM_Block_GetCC1Val((TCPWM_Type *)ADDRESS, 0)
31#define IFX_TCPWM_Block_GetCounter(ADDRESS) Cy_TCPWM_Block_GetCounter((TCPWM_Type *)ADDRESS, 0)
32#define IFX_TCPWM_Block_GetPeriod(ADDRESS) Cy_TCPWM_Block_GetPeriod((TCPWM_Type *)ADDRESS, 0)
33#define IFX_TCPWM_Block_SetCC0BufVal(ADDRESS, COMPARE1) \
34 Cy_TCPWM_Block_SetCC0BufVal((TCPWM_Type *)ADDRESS, 0, COMPARE1)
35#define IFX_TCPWM_Block_SetCC0Val(ADDRESS, COMPARE0) \
36 Cy_TCPWM_Block_SetCC0Val((TCPWM_Type *)ADDRESS, 0, COMPARE0)
37#define IFX_TCPWM_Block_SetCC1BufVal(ADDRESS, COMPAREBUF1) \
38 Cy_TCPWM_Block_SetCC1BufVal((TCPWM_Type *)ADDRESS, 0, COMPAREBUF1)
39#define IFX_TCPWM_Block_SetCC1Val(ADDRESS, COMPARE1) \
40 Cy_TCPWM_Block_SetCC1Val((TCPWM_Type *)ADDRESS, 0, COMPARE1)
41#define IFX_TCPWM_Block_SetCounter(ADDRESS, COUNT) \
42 Cy_TCPWM_Block_SetCounter((TCPWM_Type *)ADDRESS, 0, COUNT)
43#define IFX_TCPWM_Block_SetPeriod(ADDRESS, PERIOD) \
44 Cy_TCPWM_Block_SetPeriod((TCPWM_Type *)ADDRESS, 0, PERIOD)
45#define IFX_TCPWM_ClearInterrupt(ADDRESS, SOURCE) \
46 Cy_TCPWM_ClearInterrupt((TCPWM_Type *)ADDRESS, 0, SOURCE)
47#define IFX_TCPWM_Disable_Single(ADDRESS) Cy_TCPWM_Disable_Single((TCPWM_Type *)ADDRESS, 0)
48#define IFX_TCPWM_Enable_Single(ADDRESS) Cy_TCPWM_Enable_Single((TCPWM_Type *)ADDRESS, 0)
49#define IFX_TCPWM_GetInterruptMask(ADDRESS) Cy_TCPWM_GetInterruptMask((TCPWM_Type *)ADDRESS, 0)
50#define IFX_TCPWM_GetInterruptStatus(ADDRESS) Cy_TCPWM_GetInterruptStatus((TCPWM_Type *)ADDRESS, 0)
51#define IFX_TCPWM_GetInterruptStatusMasked(ADDRESS) \
52 Cy_TCPWM_GetInterruptStatusMasked((TCPWM_Type *)ADDRESS, 0)
53#define IFX_TCPWM_GetTrigPinLevel(ADDRESS, TRIGGERSELECT) \
54 Cy_TCPWM_GetTrigPinLevel((TCPWM_Type *)ADDRESS, 0, TRIGGERSELECT)
55#define IFX_TCPWM_SetDebugFreeze(ADDRESS, ENABLE) \
56 Cy_TCPWM_SetDebugFreeze((TCPWM_Type *)ADDRESS, 0, ENABLE)
57#define IFX_TCPWM_SetInterrupt(ADDRESS, SOURCE) \
58 Cy_TCPWM_SetInterrupt((TCPWM_Type *)ADDRESS, 0, SOURCE)
59#define IFX_TCPWM_SetInterruptMask(ADDRESS, MASK) \
60 Cy_TCPWM_SetInterruptMask((TCPWM_Type *)ADDRESS, 0, MASK)
61#define IFX_TCPWM_TriggerCapture0(ADDRESS) Cy_TCPWM_TriggerCapture0((TCPWM_Type *)ADDRESS, 0)
62#define IFX_TCPWM_TriggerCapture1(ADDRESS) Cy_TCPWM_TriggerCapture1((TCPWM_Type *)ADDRESS, 0)
63#define IFX_TCPWM_TriggerStart_Single(ADDRESS) \
64 Cy_TCPWM_TriggerStart_Single((TCPWM_Type *)ADDRESS, 0)
65#define IFX_TCPWM_TriggerStopOrKill_Single(ADDRESS) \
66 Cy_TCPWM_TriggerStopOrKill_Single((TCPWM_Type *)ADDRESS, 0)
67
68#define IFX_TCPWM_Counter_DeInit(ADDRESS, CONFIG) \
69 Cy_TCPWM_Counter_DeInit((TCPWM_Type *)ADDRESS, 0, CONFIG)
70#define IFX_TCPWM_Counter_Disable(ADDRESS) Cy_TCPWM_Counter_Disable((TCPWM_Type *)ADDRESS, 0)
71#define IFX_TCPWM_Counter_Enable(ADDRESS) Cy_TCPWM_Counter_Enable((TCPWM_Type *)ADDRESS, 0)
72#define IFX_TCPWM_Counter_EnableCompare0Swap(ADDRESS, ENABLE) \
73 Cy_TCPWM_Counter_EnableCompare0Swap((TCPWM_Type *)ADDRESS, 0, ENABLE)
74#define IFX_TCPWM_Counter_EnableCompare1Swap(ADDRESS, ENABLE) \
75 Cy_TCPWM_Counter_EnableCompare1Swap((TCPWM_Type *)ADDRESS, 0, ENABLE)
76#define IFX_TCPWM_Counter_EnableSwap(ADDRESS, ENABLE) \
77 Cy_TCPWM_Counter_EnableSwap((TCPWM_Type *)ADDRESS, 0, ENABLE)
78#define IFX_TCPWM_Counter_GetCapture0BufVal(ADDRESS) \
79 Cy_TCPWM_Counter_GetCapture0BufVal((TCPWM_Type *)ADDRESS, 0)
80#define IFX_TCPWM_Counter_GetCapture0Val(ADDRESS) \
81 Cy_TCPWM_Counter_GetCapture0Val((TCPWM_Type *)ADDRESS, 0)
82#define IFX_TCPWM_Counter_GetCapture1BufVal(ADDRESS) \
83 Cy_TCPWM_Counter_GetCapture1BufVal((TCPWM_Type *)ADDRESS, 0)
84#define IFX_TCPWM_Counter_GetCapture1Val(ADDRESS) \
85 Cy_TCPWM_Counter_GetCapture1Val((TCPWM_Type *)ADDRESS, 0)
86#define IFX_TCPWM_Counter_GetCompare0BufVal(ADDRESS) \
87 Cy_TCPWM_Counter_GetCompare0BufVal((TCPWM_Type *)ADDRESS, 0)
88#define IFX_TCPWM_Counter_GetCompare0Val(ADDRESS) \
89 Cy_TCPWM_Counter_GetCompare0Val((TCPWM_Type *)ADDRESS, 0)
90#define IFX_TCPWM_Counter_GetCompare1BufVal(ADDRESS) \
91 Cy_TCPWM_Counter_GetCompare1BufVal((TCPWM_Type *)ADDRESS, 0)
92#define IFX_TCPWM_Counter_GetCompare1Val(ADDRESS) \
93 Cy_TCPWM_Counter_GetCompare1Val((TCPWM_Type *)ADDRESS, 0)
94#define IFX_TCPWM_Counter_GetCounter(ADDRESS) Cy_TCPWM_Counter_GetCounter((TCPWM_Type *)ADDRESS, 0)
95#define IFX_TCPWM_Counter_GetPeriod(ADDRESS) Cy_TCPWM_Counter_GetPeriod((TCPWM_Type *)ADDRESS, 0)
96#define IFX_TCPWM_Counter_GetStatus(ADDRESS) Cy_TCPWM_Counter_GetStatus((TCPWM_Type *)ADDRESS, 0)
97#define IFX_TCPWM_Counter_Init(ADDRESS, CONFIG) \
98 Cy_TCPWM_Counter_Init((TCPWM_Type *)ADDRESS, 0, CONFIG)
99#define IFX_TCPWM_Counter_SetCompare0BufVal(ADDRESS, COMPARE1) \
100 Cy_TCPWM_Counter_SetCompare0BufVal((TCPWM_Type *)ADDRESS, 0, COMPARE1)
101#define IFX_TCPWM_Counter_SetCompare0Val(ADDRESS, COMPARE0) \
102 Cy_TCPWM_Counter_SetCompare0Val((TCPWM_Type *)ADDRESS, 0, COMPARE0)
103#define IFX_TCPWM_Counter_SetCompare1BufVal(ADDRESS, COMPAREBUF1) \
104 Cy_TCPWM_Counter_SetCompare1BufVal((TCPWM_Type *)ADDRESS, 0, COMPAREBUF1)
105#define IFX_TCPWM_Counter_SetCompare1Val(ADDRESS, COMPARE1) \
106 Cy_TCPWM_Counter_SetCompare1Val((TCPWM_Type *)ADDRESS, 0, COMPARE1)
107#define IFX_TCPWM_Counter_SetCounter(ADDRESS, COUNT) \
108 Cy_TCPWM_Counter_SetCounter((TCPWM_Type *)ADDRESS, 0, COUNT)
109#define IFX_TCPWM_Counter_SetDirection_Change_Mode(ADDRESS, DIRECTION_MODE) \
110 Cy_TCPWM_Counter_SetDirection_Change_Mode((TCPWM_Type *)ADDRESS, 0, DIRECTION_MODE)
111#define IFX_TCPWM_Counter_SetPeriod(ADDRESS, PERIOD) \
112 Cy_TCPWM_Counter_SetPeriod((TCPWM_Type *)ADDRESS, 0, PERIOD)
113
114#define IFX_TCPWM_PWM_Disable(ADDRESS) Cy_TCPWM_PWM_Disable((TCPWM_Type *)ADDRESS, 0)
115#define IFX_TCPWM_PWM_Enable(ADDRESS) Cy_TCPWM_PWM_Enable((TCPWM_Type *)ADDRESS, 0)
116#define IFX_TCPWM_PWM_EnableCompare0Swap(ADDRESS, ENABLE) \
117 Cy_TCPWM_PWM_EnableCompare0Swap((TCPWM_Type *)ADDRESS, 0, ENABLE)
118#define IFX_TCPWM_PWM_EnableLineSelectSwap(ADDRESS, ENABLE) \
119 Cy_TCPWM_PWM_EnableLineSelectSwap((TCPWM_Type *)ADDRESS, 0, ENABLE)
120#define IFX_TCPWM_PWM_EnablePeriodSwap(ADDRESS, ENABLE) \
121 Cy_TCPWM_PWM_EnablePeriodSwap((TCPWM_Type *)ADDRESS, 0, ENABLE)
122#define IFX_TCPWM_PWM_EnableSwap(ADDRESS, ENABLE) \
123 Cy_TCPWM_PWM_EnableSwap((TCPWM_Type *)ADDRESS, 0, ENABLE)
124#define IFX_TCPWM_PWM_GetCompare0BufVal(ADDRESS) \
125 Cy_TCPWM_PWM_GetCompare0BufVal((TCPWM_Type *)ADDRESS, 0)
126#define IFX_TCPWM_PWM_GetCompare0Val(ADDRESS) Cy_TCPWM_PWM_GetCompare0Val((TCPWM_Type *)ADDRESS, 0)
127#define IFX_TCPWM_PWM_GetCounter(ADDRESS) Cy_TCPWM_PWM_GetCounter((TCPWM_Type *)ADDRESS, 0)
128#define IFX_TCPWM_PWM_GetDtCounter(ADDRESS) Cy_TCPWM_PWM_GetDtCounter((TCPWM_Type *)ADDRESS, 0)
129#define IFX_TCPWM_PWM_GetPeriod0(ADDRESS) Cy_TCPWM_PWM_GetPeriod0((TCPWM_Type *)ADDRESS, 0)
130#define IFX_TCPWM_PWM_GetPeriod1(ADDRESS) Cy_TCPWM_PWM_GetPeriod1((TCPWM_Type *)ADDRESS, 0)
131#define IFX_TCPWM_PWM_GetStatus(ADDRESS) Cy_TCPWM_PWM_GetStatus((TCPWM_Type *)ADDRESS, 0)
132#define IFX_TCPWM_PWM_Init(ADDRESS, CONFIG) Cy_TCPWM_PWM_Init((TCPWM_Type *)ADDRESS, 0, CONFIG)
133#define IFX_TCPWM_PWM_PWMDeadTime(ADDRESS, DEADTIME) \
134 Cy_TCPWM_PWM_PWMDeadTime((TCPWM_Type *)ADDRESS, 0, DEADTIME)
135#define IFX_TCPWM_PWM_PWMDeadTimeBuff(ADDRESS, DEADTIME) \
136 Cy_TCPWM_PWM_PWMDeadTimeBuff((TCPWM_Type *)ADDRESS, 0, DEADTIME)
137#define IFX_TCPWM_PWM_PWMDeadTimeBuffN(ADDRESS, DEADTIME) \
138 Cy_TCPWM_PWM_PWMDeadTimeBuffN((TCPWM_Type *)ADDRESS, 0, DEADTIME)
139#define IFX_TCPWM_PWM_PWMDeadTimeN(ADDRESS, DEADTIME) \
140 Cy_TCPWM_PWM_PWMDeadTimeN((TCPWM_Type *)ADDRESS, 0, DEADTIME)
141#define IFX_TCPWM_PWM_SetCompare0BufVal(ADDRESS, COMPAREBUF0) \
142 Cy_TCPWM_PWM_SetCompare0BufVal((TCPWM_Type *)ADDRESS, 0, COMPAREBUF0)
143#define IFX_TCPWM_PWM_SetCompare0Val(ADDRESS, COMPARE0) \
144 Cy_TCPWM_PWM_SetCompare0Val((TCPWM_Type *)ADDRESS, 0, COMPARE0)
145#define IFX_TCPWM_PWM_SetCounter(ADDRESS, COUNT) \
146 Cy_TCPWM_PWM_SetCounter((TCPWM_Type *)ADDRESS, 0, COUNT)
147#define IFX_TCPWM_PWM_SetDT(ADDRESS, DEADTIME) \
148 Cy_TCPWM_PWM_SetDT((TCPWM_Type *)ADDRESS, 0, DEADTIME)
149#define IFX_TCPWM_PWM_SetDTBuff(ADDRESS, DEADTIME) \
150 Cy_TCPWM_PWM_SetDTBuff((TCPWM_Type *)ADDRESS, 0, DEADTIME)
151#define IFX_TCPWM_PWM_SetPeriod0(ADDRESS, PERIOD0) \
152 Cy_TCPWM_PWM_SetPeriod0((TCPWM_Type *)ADDRESS, 0, PERIOD0)
153#define IFX_TCPWM_PWM_SetPeriod1(ADDRESS, PERIOD1) \
154 Cy_TCPWM_PWM_SetPeriod1((TCPWM_Type *)ADDRESS, 0, PERIOD1)
155#define IFX_TCPWM_TriggerCaptureOrSwap_Single(ADDRESS) \
156 Cy_TCPWM_TriggerCaptureOrSwap_Single((TCPWM_Type *)ADDRESS, 0)
157#define IFX_en_tcpwm_status_t(ADDRESS, MODE, PERIOD, DUTY, LIMITER) \
158 cy_en_tcpwm_status_t Cy_TCPWM_PWM_Configure_Dithering((TCPWM_Type *)ADDRESS, 0, MODE, \
159 PERIOD, DUTY, LIMITER)
161#endif /* ZEPHYR_INCLUDE_DRIVERS_TIMER_IFX_TCPWM_TIMER_H */