AM64x MCU+ SDK  08.02.00
epwm/v0/epwm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
94 #ifndef EPWM_V0_H_
95 #define EPWM_V0_H_
96 
97 /* ========================================================================== */
98 /* Include Files */
99 /* ========================================================================== */
100 
101 #include <drivers/hw_include/cslr.h>
102 #include <drivers/hw_include/cslr_epwm.h>
103 
104 #ifdef __cplusplus
105 extern "C" {
106 #endif
107 
108 /* ========================================================================== */
109 /* Macros & Typedefs */
110 /* ========================================================================== */
111 
118 typedef uint32_t EPWM_OutputCh_t;
119 #define EPWM_OUTPUT_CH_MIN (0U)
120 
121 #define EPWM_OUTPUT_CH_A (EPWM_OUTPUT_CH_MIN)
122 
123 #define EPWM_OUTPUT_CH_B (1U)
124 
125 #define EPWM_OUTPUT_CH_MAX (EPWM_OUTPUT_CH_B)
126 
135 typedef uint32_t EPWM_TbCounterDir_t;
136 #define EPWM_TB_COUNTER_DIR_UP (PWMSS_EPWM_TBCTL_CTRMODE_UP_COUNT)
137 
138 #define EPWM_TB_COUNTER_DIR_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_DOWN_COUNT)
139 
140 #define EPWM_TB_COUNTER_DIR_UP_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_UP_DOWN_COUNT)
141 
142 #define EPWM_TB_COUNTER_DIR_STOP (PWMSS_EPWM_TBCTL_CTRMODE_STOP_FREEZE)
143 
173 typedef uint32_t EPWM_ShadowRegCtrl_t;
174 #define EPWM_SHADOW_REG_CTRL_ENABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_FROM_SHADOW)
175 
176 #define EPWM_SHADOW_REG_CTRL_DISABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_IMMEDIATELY)
177 
186 typedef uint32_t EPWM_TbCntDirAftSync_t;
187 #define EPWM_TB_CNT_DIR_AFT_SYNC_DOWN (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_DOWN)
188 
189 #define EPWM_TB_CNT_DIR_AFT_SYNC_UP (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_UP)
190 
199 typedef uint32_t EPWM_TbSyncOutEvt_t;
200 #define EPWM_TB_SYNC_OUT_EVT_SYNCIN (PWMSS_EPWM_TBCTL_SYNCOSEL_EPWMXSYNC)
201 
202 #define EPWM_TB_SYNC_OUT_EVT_CNT_EQ_ZERO (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_0)
203 
204 #define EPWM_TB_SYNC_OUT_EVT_CNT_EQ_CMP_B (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_CPMB)
205 
206 #define EPWM_TB_SYNC_OUT_EVT_DISABLE (PWMSS_EPWM_TBCTL_SYNCOSEL_DISABLE_EPWMXSYNCO)
207 
216 typedef uint32_t EPWM_TbSts_t;
217 #define EPWM_TB_STS_CTR_MAX (PWMSS_EPWM_TBSTS_CTRMAX_MASK)
218 
219 #define EPWM_TB_STS_SYNCI (PWMSS_EPWM_TBSTS_SYNCI_MASK)
220 
221 #define EPWM_TB_STS_CTR_DIR (PWMSS_EPWM_TBSTS_CTRDIR_MASK)
222 
232 typedef uint32_t EPWM_TbEmuMode_t;
233 #define EPWM_TB_EMU_MODE_STP_AFT_NEXT_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_NEXT_CTR)
234 
235 #define EPWM_TB_EMU_MODE_STP_AFT_COMPLETE_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_CYCLE)
236 
240 #define EPWM_TB_EMU_MODE_FREE_RUN (PWMSS_EPWM_TBCTL_FREE_SOFT_RUN2)
241 
250 typedef uint32_t EPWM_CcCmp_t;
251 #define EPWM_CC_CMP_MIN (0U)
252 
253 #define EPWM_CC_CMP_A (EPWM_CC_CMP_MIN)
254 
255 #define EPWM_CC_CMP_B (1U)
256 
257 #define EPWM_CC_CMP_MAX (CSL_EPWM_CC_CMP_B)
258 
294 typedef uint32_t EPWM_CcCmpLoadMode_t;
295 #define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0)
296 
297 #define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_PRD)
298 
299 #define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO_OR_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0_OR_PRD)
300 
301 #define EPWM_CC_CMP_LOAD_MODE_NO_LOAD (PWMSS_EPWM_CMPCTL_LOADAMODE_FREEZE)
302 
347 typedef uint32_t EPWM_AqAction_t;
348 #define EPWM_AQ_ACTION_DONOTHING (PWMSS_EPWM_AQCTLA_ZRO_DISABLED)
349 
350 #define EPWM_AQ_ACTION_LOW (PWMSS_EPWM_AQCTLA_ZRO_CLEAR)
351 
352 #define EPWM_AQ_ACTION_HIGH (PWMSS_EPWM_AQCTLA_ZRO_SET)
353 
354 #define EPQM_AQ_ACTION_TOLLGE (PWMSS_EPWM_AQCTLA_ZRO_TOGGLE)
355 #define EPWM_AQ_ACTION_TOLLGE (CSL_EPQM_AQ_ACTION_TOLLGE)
356 
385 typedef uint32_t EPWM_AqSwTrigOtAction_t;
386 #define EPWM_AQ_SW_TRIG_OT_ACTION_DONOTHING (PWMSS_EPWM_AQSFRC_ACTSFA_DISABLED)
387 
388 #define EPWM_AQ_SW_TRIG_OT_ACTION_LOW (PWMSS_EPWM_AQSFRC_ACTSFA_CLEAR)
389 
390 #define EPWM_AQ_SW_TRIG_OT_ACTION_HIGH (PWMSS_EPWM_AQSFRC_ACTSFA_SET)
391 
392 #define EPWM_AQ_SW_TRIG_OT_ACTION_TOGGLE (PWMSS_EPWM_AQSFRC_ACTSFA_TOGGLE)
393 
420 typedef uint32_t EPWM_AqSwTrigContAction_t;
421 #define EPWM_AQ_SW_TRIG_CONT_ACTION_NOEFFECT (PWMSS_EPWM_AQCSFRC_CSFA_DISABLED)
422 
423 #define EPWM_AQ_SW_TRIG_CONT_ACTION_LOW (PWMSS_EPWM_AQCSFRC_CSFA_LOW_OUTPUT)
424 
425 #define EPWM_AQ_SW_TRIG_CONT_ACTION_HIGH (PWMSS_EPWM_AQCSFRC_CSFA_HIGH_OUTPUT)
426 
427 #define EPWM_AQ_SW_TRIG_CONT_ACTION_SW_DISBALED (PWMSS_EPWM_AQCSFRC_CSFA_NO_EFFECT)
428 
438 typedef uint32_t EPWM_AqCsfrcRegReload_t;
439 #define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0)
440 
441 #define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_PERIOD)
442 
443 #define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO_OR_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0_OR_PERIOD)
444 
445 #define EPWM_AQ_CSFRC_REG_RELOAD_IMMEDIATE (PWMSS_EPWM_AQSFRC_RLDCSF_IMMEDIATE)
446 
456 typedef uint32_t EPWM_DbInMode_t;
457 #define EPWM_DB_IN_MODE_A_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_AFED)
458 
460 #define EPWM_DB_IN_MODE_B_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_AFED)
461 
464 #define EPWM_DB_IN_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_BFED)
465 
468 #define EPWM_DB_IN_MODE_B_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_BFED)
469 
481 typedef uint32_t EPWM_DbPolSel_t;
482 #define EPWM_DB_POL_SEL_ACTV_HIGH (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH)
483 
484 #define EPWM_DB_POL_SEL_ACTV_LOW_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW_COMPLEMENTARY)
485 
486 #define EPWM_DB_POL_SEL_ACTV_HIGH_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH_COMPLEMENTARY)
487 
488 #define EPWM_DB_POL_SEL_ACTV_LOW (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW)
489 
500 typedef uint32_t EPWM_DbOutMode_t;
501 #define EPWM_DB_OUT_MODE_BYPASS (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLED)
502 
505 #define EPWM_DB_OUT_MODE_NO_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_RISING_EDGE)
506 
509 #define EPWM_DB_OUT_MODE_A_RED_NO_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_FALLING_EDGE)
510 
513 #define EPWM_DB_OUT_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_ENABLED)
514 
524 typedef uint32_t EPWM_ChpDutyCycle_t;
525 #define EPWM_CHP_DUTY_CYCLE_PERC_12PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_12_5)
526 
527 #define EPWM_CHP_DUTY_CYCLE_PERC_25 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_25)
528 
529 #define EPWM_CHP_DUTY_CYCLE_PERC_37PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_37_5)
530 
531 #define EPWM_CHP_DUTY_CYCLE_PERC_50_PER (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_50)
532 
533 #define EPWM_CHP_DUTY_CYCLE_PERC_62PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_62_5)
534 
535 #define EPWM_CHP_DUTY_CYCLE_PERC_75 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_75)
536 
537 #define EPWM_CHP_DUTY_CYCLE_PERC_87PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_87_5)
538 
547 typedef uint32_t EPWM_ChpClkFreq_t;
548 #define EPWM_CHP_CLK_FREQ_DIV_BY_1 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_1)
549 
550 #define EPWM_CHP_CLK_FREQ_DIV_BY_2 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_2)
551 
552 #define EPWM_CHP_CLK_FREQ_DIV_BY_3 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_3)
553 
554 #define EPWM_CHP_CLK_FREQ_DIV_BY_4 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_4)
555 
556 #define EPWM_CHP_CLK_FREQ_DIV_BY_5 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_5)
557 
558 #define EPWM_CHP_CLK_FREQ_DIV_BY_6 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_6)
559 
560 #define EPWM_CHP_CLK_FREQ_DIV_BY_7 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_7)
561 
562 #define EPWM_CHP_CLK_FREQ_DIV_BY_8 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_8)
563 
572 typedef uint32_t EPWM_ChpOshtWidth_t;
573 #define EPWM_CHP_OSHT_WIDTH_MIN (0U)
574 
575 #define EPWM_CHP_OSHT_WIDTH_1XSYSOUT_BY_8 (CSL_EPWM_CHP_OSHT_WIDTH_MIN)
576 
577 #define EPWM_CHP_OSHT_WIDTH_2XSYSOUT_BY_8 (1U)
578 
579 #define EPWM_CHP_OSHT_WIDTH_3XSYSOUT_BY_8 (2U)
580 
581 #define EPWM_CHP_OSHT_WIDTH_4XSYSOUT_BY_8 (3U)
582 
583 #define EPWM_CHP_OSHT_WIDTH_5XSYSOUT_BY_8 (4U)
584 
585 #define EPWM_CHP_OSHT_WIDTH_6XSYSOUT_BY_8 (5U)
586 
587 #define EPWM_CHP_OSHT_WIDTH_7XSYSOUT_BY_8 (6U)
588 
589 #define EPWM_CHP_OSHT_WIDTH_8XSYSOUT_BY_8 (7U)
590 
591 #define EPWM_CHP_OSHT_WIDTH_9XSYSOUT_BY_8 (8U)
592 
593 #define EPWM_CHP_OSHT_WIDTH_10XSYSOUT_BY_8 (9U)
594 
595 #define EPWM_CHP_OSHT_WIDTH_11XSYSOUT_BY_8 (10U)
596 
597 #define EPWM_CHP_OSHT_WIDTH_12XSYSOUT_BY_8 (11U)
598 
599 #define EPWM_CHP_OSHT_WIDTH_13XSYSOUT_BY_8 (12U)
600 
601 #define EPWM_CHP_OSHT_WIDTH_14XSYSOUT_BY_8 (13U)
602 
603 #define EPWM_CHP_OSHT_WIDTH_15XSYSOUT_BY_8 (14U)
604 
605 #define EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8 (15U)
606 
607 #define EPWM_CHP_OSHT_WIDTH_MAX (CSL_EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8)
608 
635 typedef uint32_t EPWM_TzTripAction_t;
636 #define EPWM_TZ_TRIP_ACTION_TRI_STATE (PWMSS_EPWM_TZCTL_TZA_HIGH_IMPEDANCE)
637 
638 #define EPWM_TZ_TRIP_ACTION_HIGH (PWMSS_EPWM_TZCTL_TZA_HIGH_STATE)
639 
640 #define EPWM_TZ_TRIP_ACTION_LOW (PWMSS_EPWM_TZCTL_TZA_LOW_STATE)
641 
642 #define EPWM_TZ_TRIP_ACTION_DO_NOTHING (PWMSS_EPWM_TZCTL_TZA_DO_NOTHING)
643 
652 typedef uint32_t EPWM_TzEvent_t;
653 #define EPWM_TZ_EVENT_MIN (0x0U)
654 
655 #define EPWM_TZ_EVENT_ONE_SHOT (EPWM_TZ_EVENT_MIN)
656 
657 #define EPWM_TZ_EVENT_CYCLE_BY_CYCLE (0x1U)
658 
659 #define EPWM_TZ_EVENT_MAX (CSL_EPWM_TZ_EVENT_CYCLE_BY_CYCLE)
660 
669 typedef uint32_t EPWM_TzStsFlg_t;
670 #define EPWM_TZ_STS_FLG_OST (PWMSS_EPWM_TZFLG_OST_MASK)
671 
672 #define EPWM_TZ_STS_FLG_CBC (PWMSS_EPWM_TZFLG_CBC_MASK)
673 
674 #define EPWM_TZ_STS_FLG_INT (PWMSS_EPWM_TZFLG_INT_MASK)
675 
684 typedef uint32_t EPWM_EtIntrEvt_t;
685 #define EPWM_ET_INTR_EVT_CNT_EQ_ZRO (PWMSS_EPWM_ETSEL_INTSEL_CTR_0)
686 
687 #define EPWM_ET_INTR_EVT_CNT_EQ_PRD (PWMSS_EPWM_ETSEL_INTSEL_CTR_PERIOD)
688 
689 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPA_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_INCR)
690 
692 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPA_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_DECR)
693 
695 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPB_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_INCR)
696 
698 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPB_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_DECR)
699 
711 typedef uint32_t EPWM_EtIntrPeriod_t;
712 #define EPWM_ET_INTR_PERIOD_DIS_INTR (PWMSS_EPWM_ETPS_INTPRD_DISABLE)
713 
714 #define EPWM_ET_INTR_PERIOD_FIRST_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_FIRST_EVT)
715 
716 #define EPWM_ET_INTR_PERIOD_SECOND_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_SECOND_EVT)
717 
718 #define EPWM_ET_INTR_PERIOD_THIRD_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_THIRD_EVT)
719 
723 #define EPWM_ETFLG_INT_MASK (PWMSS_EPWM_ETFLG_INT_MASK)
724 
725 /* ========================================================================== */
726 /* Structures and Enums */
727 /* ========================================================================== */
728 
730 typedef struct EPWM_TimebaseCfg_s
731 {
732  uint32_t tbClk;
736  uint32_t tbCntrDirection;
742  uint32_t cntDirAfterSync;
747  uint32_t syncOutSrc;
751 
753 typedef struct EPWM_CounterCmpCfg_s
754 {
755  uint32_t cmpAValue;
757  uint32_t cmpBValue;
760 
763 typedef struct EPWM_AqActionCfg_s
764 {
765  uint32_t zeroAction;
768  uint32_t prdAction;
771  uint32_t cmpAUpAction;
775  uint32_t cmpADownAction;
779  uint32_t cmpBUpAction;
783  uint32_t cmpBDownAction;
788 
791 typedef struct EPWM_DeadbandCfg_s
792 {
793  uint32_t inputMode;
797  uint32_t outputMode;
801  uint32_t polaritySelect;
805  uint32_t risingEdgeDelay;
810 
813 typedef struct EPWM_ChopperCfg_s
814 {
815  uint32_t dutyCycle;
818  uint32_t clkFrequency;
825 
828 typedef struct EPWM_TripzoneCfg_s
829 {
830  uint32_t tripAction;
833  uint32_t tripEvtType;
836  uint32_t tripPin;
838  uint32_t enableTripIntr;
841 
844 typedef struct EPWM_EtCfg_s
845 {
846  uint32_t intrEvtSource;
849  uint32_t intrPrd;
853 } EPWM_EtCfg;
854 
855 /* ========================================================================== */
856 /* Global Variables Declarations */
857 /* ========================================================================== */
858 
859 /* None */
860 
861 /* ========================================================================== */
862 /* Function Declarations */
863 /* ========================================================================== */
864 
875 void EPWM_tbTimebaseClkCfg(uint32_t baseAddr,
876  uint32_t tbClk,
877  uint32_t moduleClk);
878 
899 void EPWM_tbPwmFreqCfg(uint32_t baseAddr,
900  uint32_t tbClk,
901  uint32_t pwmFreq,
902  uint32_t counterDir,
903  uint32_t enableShadowWrite);
904 
920 void EPWM_tbSyncEnable(uint32_t baseAddr,
921  uint32_t tbPhsValue,
922  uint32_t counterDir);
923 
930 void EPWM_tbSyncDisable(uint32_t baseAddr);
931 
942 void EPWM_tbSetSyncOutMode(uint32_t baseAddr, uint32_t syncOutMode);
943 
952 void EPWM_tbTriggerSwSync(uint32_t baseAddr);
953 
961 void EPWM_tbWriteTbCount(uint32_t baseAddr, uint32_t tbCount);
962 
971 uint16_t EPWM_tbReadTbCount(uint32_t baseAddr);
972 
1001 uint16_t EPWM_tbGetStatus(uint32_t baseAddr, uint32_t tbStatusMask);
1002 
1013 void EPWM_tbStatusClear(uint32_t baseAddr, uint32_t tbStatusClrMask);
1014 
1024 void EPWM_tbSetEmulationMode(uint32_t baseAddr, uint32_t mode);
1025 
1052 uint32_t EPWM_counterComparatorCfg(uint32_t baseAddr,
1053  uint32_t cmpType,
1054  uint32_t cmpVal,
1055  uint32_t enableShadowWrite,
1056  uint32_t shadowToActiveLoadTrigger,
1057  uint32_t overwriteShadow);
1058 
1076 void EPWM_aqActionOnOutputCfg(uint32_t baseAddr,
1077  uint32_t pwmOutputCh,
1078  const EPWM_AqActionCfg *pCfg);
1079 
1094 void EPWM_aqSwTriggerOneTimeAction(uint32_t baseAddr,
1095  uint32_t pwmOutputCh,
1096  uint32_t swTrigAction);
1097 
1113 void EPWM_aqSwTriggerContAction(uint32_t baseAddr,
1114  uint32_t pwmOutputCh,
1115  uint32_t swTrigAction,
1116  uint32_t activeRegReloadMode);
1117 
1132 void EPWM_deadbandCfg(uint32_t baseAddr, const EPWM_DeadbandCfg *pCfg);
1133 
1139 void EPWM_deadbandBypass(uint32_t baseAddr);
1140 
1150 void EPWM_chopperCfg(uint32_t baseAddr, const EPWM_ChopperCfg *pCfg);
1151 
1161 void EPWM_chopperEnable(uint32_t baseAddr, uint32_t enableChopper);
1162 
1175 void EPWM_tzTriggerTripAction(uint32_t baseAddr,
1176  uint32_t tripAction,
1177  uint32_t pwmOutputCh);
1178 
1191 void EPWM_tzTripEventEnable(uint32_t baseAddr,
1192  uint32_t tzEventType,
1193  uint32_t pinNum);
1194 
1205 void EPWM_tzTripEventDisable(uint32_t baseAddr,
1206  uint32_t tzEventType,
1207  uint32_t pinNum);
1208 
1218 void EPWM_tzIntrEnable(uint32_t baseAddr, uint32_t tzEventType);
1219 
1228 void EPWM_tzIntrDisable(uint32_t baseAddr, uint32_t tzEventType);
1229 
1254 uint16_t EPWM_tzEventStatus(uint32_t baseAddr, uint32_t eventMask);
1255 
1264 void EPWM_tzEventStatusClear(uint32_t baseAddr, uint32_t eventMask);
1265 
1274 void EPWM_tzTriggerSwEvent(uint32_t baseAddr, uint32_t tzEventType);
1275 
1289 void EPWM_etIntrCfg(uint32_t baseAddr, uint32_t intrEvtSrc, uint32_t intrPrd);
1290 
1296 void EPWM_etIntrEnable(uint32_t baseAddr);
1297 
1303 void EPWM_etIntrDisable(uint32_t baseAddr);
1304 
1313 uint16_t EPWM_etIntrStatus(uint32_t baseAddr);
1314 
1321 void EPWM_etIntrClear(uint32_t baseAddr);
1322 
1329 void EPWM_etIntrTrigger(uint32_t baseAddr);
1330 
1339 uint16_t EPWM_etGetEventCount(uint32_t baseAddr);
1340 
1341 #ifdef __cplusplus
1342 }
1343 #endif
1344 
1345 #endif /* #ifndef EPWM_V0_H_ */
1346 
EPWM_CcCmp_t
uint32_t EPWM_CcCmp_t
Definition: epwm/v0/epwm.h:250
EPWM_TimebaseCfg
Structure holding the TimeBase sub-module configuration parameters.
Definition: epwm/v0/epwm.h:731
EPWM_AqActionCfg
Structure holding the Action Qualifier actions to be taken on the PWM output at the specific events.
Definition: epwm/v0/epwm.h:764
EPWM_AqActionCfg::zeroAction
uint32_t zeroAction
Definition: epwm/v0/epwm.h:765
EPWM_DeadbandCfg::inputMode
uint32_t inputMode
Definition: epwm/v0/epwm.h:793
EPWM_deadbandCfg
void EPWM_deadbandCfg(uint32_t baseAddr, const EPWM_DeadbandCfg *pCfg)
This API performs the configuration of the dead band sub-module. This API configures the input source...
EPWM_TbCntDirAftSync_t
uint32_t EPWM_TbCntDirAftSync_t
Counter directions after sync event.
Definition: epwm/v0/epwm.h:186
EPWM_tbReadTbCount
uint16_t EPWM_tbReadTbCount(uint32_t baseAddr)
This API gets the Time base counter current value. The count operation is not affected by the read.
EPWM_OutputCh_t
uint32_t EPWM_OutputCh_t
Number of supported EPWM outputs in a single epwm channel.
Definition: epwm/v0/epwm.h:118
EPWM_tbWriteTbCount
void EPWM_tbWriteTbCount(uint32_t baseAddr, uint32_t tbCount)
This API loads the Time base counter. The new value is taken immediately.
EPWM_chopperCfg
void EPWM_chopperCfg(uint32_t baseAddr, const EPWM_ChopperCfg *pCfg)
This API performs the configuration of the chopper sub-module. This API configures chopping clock dut...
EPWM_TripzoneCfg::tripAction
uint32_t tripAction
Definition: epwm/v0/epwm.h:830
EPWM_AqActionCfg::cmpADownAction
uint32_t cmpADownAction
Definition: epwm/v0/epwm.h:775
EPWM_TimebaseCfg::cntDirAfterSync
uint32_t cntDirAfterSync
Definition: epwm/v0/epwm.h:742
EPWM_tbSyncDisable
void EPWM_tbSyncDisable(uint32_t baseAddr)
This API disables the synchronization. Even if sync-in event occurs the count value will not be reloa...
EPWM_CounterCmpCfg
Structure holding the Counter Comparator values.
Definition: epwm/v0/epwm.h:754
EPWM_ChopperCfg
Structure holding the configuration parameters of Chopper sub-module.
Definition: epwm/v0/epwm.h:814
EPWM_tbPwmFreqCfg
void EPWM_tbPwmFreqCfg(uint32_t baseAddr, uint32_t tbClk, uint32_t pwmFreq, uint32_t counterDir, uint32_t enableShadowWrite)
This API configures the PWM Time base counter Frequency/Period.
EPWM_tbSyncEnable
void EPWM_tbSyncEnable(uint32_t baseAddr, uint32_t tbPhsValue, uint32_t counterDir)
This API enables the synchronization of time base sub-module and also configures the phase count valu...
EPWM_DeadbandCfg
Structure holding the dead band generation sub-module configuration parameters.
Definition: epwm/v0/epwm.h:792
EPWM_tbTriggerSwSync
void EPWM_tbTriggerSwSync(uint32_t baseAddr)
This API generates software triggered sync pulse.
EPWM_tbTimebaseClkCfg
void EPWM_tbTimebaseClkCfg(uint32_t baseAddr, uint32_t tbClk, uint32_t moduleClk)
This API configures the clock divider of the Time base module.
EPWM_AqActionCfg::cmpBDownAction
uint32_t cmpBDownAction
Definition: epwm/v0/epwm.h:783
EPWM_TimebaseCfg::phsCountAfterSync
uint32_t phsCountAfterSync
Definition: epwm/v0/epwm.h:745
EPWM_AqSwTrigContAction_t
uint32_t EPWM_AqSwTrigContAction_t
Types of Continuous software forced actions on output.
Definition: epwm/v0/epwm.h:420
EPWM_AqActionCfg::prdAction
uint32_t prdAction
Definition: epwm/v0/epwm.h:768
EPWM_ChpOshtWidth_t
uint32_t EPWM_ChpOshtWidth_t
One-Shot Pulse Width values.
Definition: epwm/v0/epwm.h:572
EPWM_AqActionCfg::cmpBUpAction
uint32_t cmpBUpAction
Definition: epwm/v0/epwm.h:779
EPWM_TbSyncOutEvt_t
uint32_t EPWM_TbSyncOutEvt_t
Source of Synchronization output signal.
Definition: epwm/v0/epwm.h:199
EPWM_ChopperCfg::clkFrequency
uint32_t clkFrequency
Definition: epwm/v0/epwm.h:818
EPWM_TbEmuMode_t
uint32_t EPWM_TbEmuMode_t
Emulation Mode. This selects the behaviour of the ePWM time-base counter during emulation events.
Definition: epwm/v0/epwm.h:232
EPWM_aqSwTriggerContAction
void EPWM_aqSwTriggerContAction(uint32_t baseAddr, uint32_t pwmOutputCh, uint32_t swTrigAction, uint32_t activeRegReloadMode)
This API forces output value continuously on PWM output channel. The output can be forced to low or h...
EPWM_ChpDutyCycle_t
uint32_t EPWM_ChpDutyCycle_t
Chopping Clock Duty Cycle values.
Definition: epwm/v0/epwm.h:524
EPWM_EtCfg::intrEvtSource
uint32_t intrEvtSource
Definition: epwm/v0/epwm.h:846
EPWM_chopperEnable
void EPWM_chopperEnable(uint32_t baseAddr, uint32_t enableChopper)
This API controls the enabling or disabling of chopper sub-module.
EPWM_tbSetEmulationMode
void EPWM_tbSetEmulationMode(uint32_t baseAddr, uint32_t mode)
This API configures emulation mode. This setting determines the behaviour of Timebase counter during ...
EPWM_TimebaseCfg::pwmtbCounterFreqPrd
uint32_t pwmtbCounterFreqPrd
Definition: epwm/v0/epwm.h:734
EPWM_AqSwTrigOtAction_t
uint32_t EPWM_AqSwTrigOtAction_t
Actions to be taken on the output, when Software triggered one time events will occur.
Definition: epwm/v0/epwm.h:385
EPWM_TimebaseCfg::enableSynchronization
uint32_t enableSynchronization
Definition: epwm/v0/epwm.h:739
EPWM_etIntrEnable
void EPWM_etIntrEnable(uint32_t baseAddr)
This API enables the ePWM Event interrupt.
EPWM_ChpClkFreq_t
uint32_t EPWM_ChpClkFreq_t
Chopping Clock Frequency values .
Definition: epwm/v0/epwm.h:547
EPWM_etIntrCfg
void EPWM_etIntrCfg(uint32_t baseAddr, uint32_t intrEvtSrc, uint32_t intrPrd)
This API configures the Event Trigger sub-module. This API configures the interrupt source and interr...
EPWM_ChopperCfg::oneShotPulseWidth
uint32_t oneShotPulseWidth
Definition: epwm/v0/epwm.h:821
EPWM_TbSts_t
uint32_t EPWM_TbSts_t
Flags to get the different types of time base status.
Definition: epwm/v0/epwm.h:216
EPWM_TzEvent_t
uint32_t EPWM_TzEvent_t
Type of trip zone events.
Definition: epwm/v0/epwm.h:652
EPWM_etIntrStatus
uint16_t EPWM_etIntrStatus(uint32_t baseAddr)
This API returns the ePWM event interrupt status.
EPWM_tbSetSyncOutMode
void EPWM_tbSetSyncOutMode(uint32_t baseAddr, uint32_t syncOutMode)
This API selects the source of the synchronization output signal. It determines on which of the suppo...
EPWM_TimebaseCfg::syncOutSrc
uint32_t syncOutSrc
Definition: epwm/v0/epwm.h:747
EPWM_etIntrClear
void EPWM_etIntrClear(uint32_t baseAddr)
This API clears the interrupt. This will clear the interrupt flag bit and enable further interrupts p...
EPWM_AqCsfrcRegReload_t
uint32_t EPWM_AqCsfrcRegReload_t
Action Qualifier Software Force Active Register Reload From Shadow Options.
Definition: epwm/v0/epwm.h:438
EPWM_aqSwTriggerOneTimeAction
void EPWM_aqSwTriggerOneTimeAction(uint32_t baseAddr, uint32_t pwmOutputCh, uint32_t swTrigAction)
This API triggers the SW forced single event on the PWM output.
EPWM_DbInMode_t
uint32_t EPWM_DbInMode_t
Dead Band Input Mode Control. This allows you to select the input source to the falling-edge and risi...
Definition: epwm/v0/epwm.h:456
EPWM_tzIntrEnable
void EPWM_tzIntrEnable(uint32_t baseAddr, uint32_t tzEventType)
This API enables the trip interrupt. When trip event occurs the sub-module can be configured to inter...
EPWM_DeadbandCfg::polaritySelect
uint32_t polaritySelect
Definition: epwm/v0/epwm.h:801
EPWM_aqActionOnOutputCfg
void EPWM_aqActionOnOutputCfg(uint32_t baseAddr, uint32_t pwmOutputCh, const EPWM_AqActionCfg *pCfg)
This API configures the action to be taken on output by the Action qualifier module upon receiving th...
EPWM_tzTripEventEnable
void EPWM_tzTripEventEnable(uint32_t baseAddr, uint32_t tzEventType, uint32_t pinNum)
This API enables the trip event.
EPWM_tzTriggerSwEvent
void EPWM_tzTriggerSwEvent(uint32_t baseAddr, uint32_t tzEventType)
This API enables to generate Software forced trip condition.
EPWM_TripzoneCfg::enableTripIntr
uint32_t enableTripIntr
Definition: epwm/v0/epwm.h:838
EPWM_TimebaseCfg::tbClk
uint32_t tbClk
Definition: epwm/v0/epwm.h:732
EPWM_tzTriggerTripAction
void EPWM_tzTriggerTripAction(uint32_t baseAddr, uint32_t tripAction, uint32_t pwmOutputCh)
This API configures the o/p on PWM channel when a trip event is recognized. The output can be set to ...
EPWM_etIntrTrigger
void EPWM_etIntrTrigger(uint32_t baseAddr)
This API forces interrupt to be generated. This API is used for testing purpose.
EPWM_TripzoneCfg
Structure holding the trip-zone sub-module configuration parameters.
Definition: epwm/v0/epwm.h:829
EPWM_DeadbandCfg::fallingEdgeDelay
uint32_t fallingEdgeDelay
Definition: epwm/v0/epwm.h:807
EPWM_deadbandBypass
void EPWM_deadbandBypass(uint32_t baseAddr)
This API bypasses the Dead-band sub-module.
EPWM_TripzoneCfg::tripEvtType
uint32_t tripEvtType
Definition: epwm/v0/epwm.h:833
EPWM_tzEventStatusClear
void EPWM_tzEventStatusClear(uint32_t baseAddr, uint32_t eventMask)
This API clears the selected trip zone event status.
EPWM_EtCfg::intrPrd
uint32_t intrPrd
Definition: epwm/v0/epwm.h:849
EPWM_tzEventStatus
uint16_t EPWM_tzEventStatus(uint32_t baseAddr, uint32_t eventMask)
This API returns the selected trip zone event status.
EPWM_EtIntrEvt_t
uint32_t EPWM_EtIntrEvt_t
ePWM Interrupt (EPWMx_INT) Selection Options.
Definition: epwm/v0/epwm.h:684
EPWM_etGetEventCount
uint16_t EPWM_etGetEventCount(uint32_t baseAddr)
This API returns the number of events occurred.
mode
char mode[32]
Definition: tisci_pm_core.h:1
EPWM_TimebaseCfg::tbCntrDirection
uint32_t tbCntrDirection
Definition: epwm/v0/epwm.h:736
EPWM_counterComparatorCfg
uint32_t EPWM_counterComparatorCfg(uint32_t baseAddr, uint32_t cmpType, uint32_t cmpVal, uint32_t enableShadowWrite, uint32_t shadowToActiveLoadTrigger, uint32_t overwriteShadow)
This API configures the counter comparator and loads the comparator value. When Counter comparator va...
EPWM_DeadbandCfg::risingEdgeDelay
uint32_t risingEdgeDelay
Definition: epwm/v0/epwm.h:805
EPWM_ChopperCfg::dutyCycle
uint32_t dutyCycle
Definition: epwm/v0/epwm.h:815
EPWM_ShadowRegCtrl_t
uint32_t EPWM_ShadowRegCtrl_t
Shadow register enable or disable control.
Definition: epwm/v0/epwm.h:173
EPWM_tbGetStatus
uint16_t EPWM_tbGetStatus(uint32_t baseAddr, uint32_t tbStatusMask)
This API gets the Time Base status as indicated by the tbStatusMask parameter.
EPWM_TzStsFlg_t
uint32_t EPWM_TzStsFlg_t
Trip zone status flags.
Definition: epwm/v0/epwm.h:669
EPWM_CounterCmpCfg::cmpBValue
uint32_t cmpBValue
Definition: epwm/v0/epwm.h:757
EPWM_tbStatusClear
void EPWM_tbStatusClear(uint32_t baseAddr, uint32_t tbStatusClrMask)
This API clears the Time base status bits indicated by the tbStatusClrMask parameter.
EPWM_DbPolSel_t
uint32_t EPWM_DbPolSel_t
Polarity Select Control. This allows you to selectively invert one of the delayed signals before it i...
Definition: epwm/v0/epwm.h:481
EPWM_CounterCmpCfg::cmpAValue
uint32_t cmpAValue
Definition: epwm/v0/epwm.h:755
EPWM_TripzoneCfg::tripPin
uint32_t tripPin
Definition: epwm/v0/epwm.h:836
EPWM_TbCounterDir_t
uint32_t EPWM_TbCounterDir_t
Types of Time base counter direction modes.
Definition: epwm/v0/epwm.h:135
EPWM_EtCfg
Structure holding the Event Trigger Sub-Module configuration parameters.
Definition: epwm/v0/epwm.h:845
EPWM_AqActionCfg::cmpAUpAction
uint32_t cmpAUpAction
Definition: epwm/v0/epwm.h:771
EPWM_AqAction_t
uint32_t EPWM_AqAction_t
Types of Actions that Action Qualifier can take on the Output when the supported counter compare even...
Definition: epwm/v0/epwm.h:347
EPWM_tzTripEventDisable
void EPWM_tzTripEventDisable(uint32_t baseAddr, uint32_t tzEventType, uint32_t pinNum)
This API disable the trip event. The disabled trip events will be ignored.
EPWM_DbOutMode_t
uint32_t EPWM_DbOutMode_t
Dead-band Output Mode Control. This allows you to selectively enable or bypass the dead-band generati...
Definition: epwm/v0/epwm.h:500
EPWM_DeadbandCfg::outputMode
uint32_t outputMode
Definition: epwm/v0/epwm.h:797
EPWM_etIntrDisable
void EPWM_etIntrDisable(uint32_t baseAddr)
This API disables the ePWM Event interrupt.
EPWM_TzTripAction_t
uint32_t EPWM_TzTripAction_t
Action to be taken on PWM output When a trip event occurs.
Definition: epwm/v0/epwm.h:635
EPWM_CcCmpLoadMode_t
uint32_t EPWM_CcCmpLoadMode_t
Counter-Comparator registers(A and B) load mode flags from shadow register.
Definition: epwm/v0/epwm.h:294
EPWM_tzIntrDisable
void EPWM_tzIntrDisable(uint32_t baseAddr, uint32_t tzEventType)
This API disables the trip interrupt.
EPWM_EtIntrPeriod_t
uint32_t EPWM_EtIntrPeriod_t
ePWM Interrupt (EPWMx_INT) Period Select. These values determine how many selected events need to occ...
Definition: epwm/v0/epwm.h:711