AM243x MCU+ SDK  09.02.01
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 
96 #ifndef EPWM_V0_H_
97 #define EPWM_V0_H_
98 
99 /* ========================================================================== */
100 /* Include Files */
101 /* ========================================================================== */
102 
103 #include <drivers/hw_include/cslr.h>
104 #include <drivers/hw_include/cslr_epwm.h>
105 
106 #ifdef __cplusplus
107 extern "C" {
108 #endif
109 
110 /* ========================================================================== */
111 /* Macros & Typedefs */
112 /* ========================================================================== */
113 
120 typedef uint32_t EPWM_OutputCh_t;
121 #define EPWM_OUTPUT_CH_MIN (0U)
122 
123 #define EPWM_OUTPUT_CH_A (EPWM_OUTPUT_CH_MIN)
124 
125 #define EPWM_OUTPUT_CH_B (1U)
126 
127 #define EPWM_OUTPUT_CH_MAX (EPWM_OUTPUT_CH_B)
128 
137 typedef uint32_t EPWM_TbCounterDir_t;
138 #define EPWM_TB_COUNTER_DIR_UP (PWMSS_EPWM_TBCTL_CTRMODE_UP_COUNT)
139 
140 #define EPWM_TB_COUNTER_DIR_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_DOWN_COUNT)
141 
142 #define EPWM_TB_COUNTER_DIR_UP_DOWN (PWMSS_EPWM_TBCTL_CTRMODE_UP_DOWN_COUNT)
143 
144 #define EPWM_TB_COUNTER_DIR_STOP (PWMSS_EPWM_TBCTL_CTRMODE_STOP_FREEZE)
145 
175 typedef uint32_t EPWM_ShadowRegCtrl_t;
176 #define EPWM_SHADOW_REG_CTRL_ENABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_FROM_SHADOW)
177 
178 #define EPWM_SHADOW_REG_CTRL_DISABLE (PWMSS_EPWM_TBCTL_PRDLD_LOAD_IMMEDIATELY)
179 
188 typedef uint32_t EPWM_TbCntDirAftSync_t;
189 #define EPWM_TB_CNT_DIR_AFT_SYNC_DOWN (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_DOWN)
190 
191 #define EPWM_TB_CNT_DIR_AFT_SYNC_UP (PWMSS_EPWM_TBCTL_PHSDIR_COUNT_UP)
192 
201 typedef uint32_t EPWM_TbSyncOutEvt_t;
202 #define EPWM_TB_SYNC_OUT_EVT_SYNCIN (PWMSS_EPWM_TBCTL_SYNCOSEL_EPWMXSYNC)
203 
204 #define EPWM_TB_SYNC_OUT_EVT_CNT_EQ_ZERO (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_0)
205 
206 #define EPWM_TB_SYNC_OUT_EVT_CNT_EQ_CMP_B (PWMSS_EPWM_TBCTL_SYNCOSEL_CTR_CPMB)
207 
208 #define EPWM_TB_SYNC_OUT_EVT_DISABLE (PWMSS_EPWM_TBCTL_SYNCOSEL_DISABLE_EPWMXSYNCO)
209 
218 typedef uint32_t EPWM_TbSts_t;
219 #define EPWM_TB_STS_CTR_MAX (PWMSS_EPWM_TBSTS_CTRMAX_MASK)
220 
221 #define EPWM_TB_STS_SYNCI (PWMSS_EPWM_TBSTS_SYNCI_MASK)
222 
223 #define EPWM_TB_STS_CTR_DIR (PWMSS_EPWM_TBSTS_CTRDIR_MASK)
224 
234 typedef uint32_t EPWM_TbEmuMode_t;
235 #define EPWM_TB_EMU_MODE_STP_AFT_NEXT_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_NEXT_CTR)
236 
237 #define EPWM_TB_EMU_MODE_STP_AFT_COMPLETE_CYCLE (PWMSS_EPWM_TBCTL_FREE_SOFT_STOP_AFTER_CYCLE)
238 
242 #define EPWM_TB_EMU_MODE_FREE_RUN (PWMSS_EPWM_TBCTL_FREE_SOFT_RUN2)
243 
252 typedef uint32_t EPWM_CcCmp_t;
253 #define EPWM_CC_CMP_MIN (0U)
254 
255 #define EPWM_CC_CMP_A (EPWM_CC_CMP_MIN)
256 
257 #define EPWM_CC_CMP_B (1U)
258 
259 #define EPWM_CC_CMP_MAX (CSL_EPWM_CC_CMP_B)
260 
296 typedef uint32_t EPWM_CcCmpLoadMode_t;
297 #define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0)
298 
299 #define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_PRD)
300 
301 #define EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO_OR_PRD (PWMSS_EPWM_CMPCTL_LOADAMODE_CTR_0_OR_PRD)
302 
303 #define EPWM_CC_CMP_LOAD_MODE_NO_LOAD (PWMSS_EPWM_CMPCTL_LOADAMODE_FREEZE)
304 
349 typedef uint32_t EPWM_AqAction_t;
350 #define EPWM_AQ_ACTION_DONOTHING (PWMSS_EPWM_AQCTLA_ZRO_DISABLED)
351 
352 #define EPWM_AQ_ACTION_LOW (PWMSS_EPWM_AQCTLA_ZRO_CLEAR)
353 
354 #define EPWM_AQ_ACTION_HIGH (PWMSS_EPWM_AQCTLA_ZRO_SET)
355 
356 #define EPQM_AQ_ACTION_TOLLGE (PWMSS_EPWM_AQCTLA_ZRO_TOGGLE)
357 #define EPWM_AQ_ACTION_TOLLGE (CSL_EPQM_AQ_ACTION_TOLLGE)
358 
387 typedef uint32_t EPWM_AqSwTrigOtAction_t;
388 #define EPWM_AQ_SW_TRIG_OT_ACTION_DONOTHING (PWMSS_EPWM_AQSFRC_ACTSFA_DISABLED)
389 
390 #define EPWM_AQ_SW_TRIG_OT_ACTION_LOW (PWMSS_EPWM_AQSFRC_ACTSFA_CLEAR)
391 
392 #define EPWM_AQ_SW_TRIG_OT_ACTION_HIGH (PWMSS_EPWM_AQSFRC_ACTSFA_SET)
393 
394 #define EPWM_AQ_SW_TRIG_OT_ACTION_TOGGLE (PWMSS_EPWM_AQSFRC_ACTSFA_TOGGLE)
395 
422 typedef uint32_t EPWM_AqSwTrigContAction_t;
423 #define EPWM_AQ_SW_TRIG_CONT_ACTION_NOEFFECT (PWMSS_EPWM_AQCSFRC_CSFA_DISABLED)
424 
425 #define EPWM_AQ_SW_TRIG_CONT_ACTION_LOW (PWMSS_EPWM_AQCSFRC_CSFA_LOW_OUTPUT)
426 
427 #define EPWM_AQ_SW_TRIG_CONT_ACTION_HIGH (PWMSS_EPWM_AQCSFRC_CSFA_HIGH_OUTPUT)
428 
429 #define EPWM_AQ_SW_TRIG_CONT_ACTION_SW_DISBALED (PWMSS_EPWM_AQCSFRC_CSFA_NO_EFFECT)
430 
440 typedef uint32_t EPWM_AqCsfrcRegReload_t;
441 #define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0)
442 
443 #define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_PERIOD)
444 
445 #define EPWM_AQ_CSFRC_REG_RELOAD_CNT_EQ_ZRO_OR_PRD (PWMSS_EPWM_AQSFRC_RLDCSF_CTR_0_OR_PERIOD)
446 
447 #define EPWM_AQ_CSFRC_REG_RELOAD_IMMEDIATE (PWMSS_EPWM_AQSFRC_RLDCSF_IMMEDIATE)
448 
458 typedef uint32_t EPWM_DbInMode_t;
459 #define EPWM_DB_IN_MODE_A_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_AFED)
460 
462 #define EPWM_DB_IN_MODE_B_RED_A_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_AFED)
463 
466 #define EPWM_DB_IN_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_ARED_BFED)
467 
470 #define EPWM_DB_IN_MODE_B_RED_B_FED (PWMSS_EPWM_DBCTL_IN_MODE_SRC_BRED_BFED)
471 
483 typedef uint32_t EPWM_DbPolSel_t;
484 #define EPWM_DB_POL_SEL_ACTV_HIGH (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH)
485 
486 #define EPWM_DB_POL_SEL_ACTV_LOW_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW_COMPLEMENTARY)
487 
488 #define EPWM_DB_POL_SEL_ACTV_HIGH_COMPLEMENTARY (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_HIGH_COMPLEMENTARY)
489 
490 #define EPWM_DB_POL_SEL_ACTV_LOW (PWMSS_EPWM_DBCTL_POLSEL_ACTIVE_LOW)
491 
502 typedef uint32_t EPWM_DbOutMode_t;
503 #define EPWM_DB_OUT_MODE_BYPASS (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLED)
504 
507 #define EPWM_DB_OUT_MODE_NO_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_RISING_EDGE)
508 
511 #define EPWM_DB_OUT_MODE_A_RED_NO_FED (PWMSS_EPWM_DBCTL_OUT_MODE_DISABLE_FALLING_EDGE)
512 
515 #define EPWM_DB_OUT_MODE_A_RED_B_FED (PWMSS_EPWM_DBCTL_OUT_MODE_ENABLED)
516 
526 typedef uint32_t EPWM_ChpDutyCycle_t;
527 #define EPWM_CHP_DUTY_CYCLE_PERC_12PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_12_5)
528 
529 #define EPWM_CHP_DUTY_CYCLE_PERC_25 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_25)
530 
531 #define EPWM_CHP_DUTY_CYCLE_PERC_37PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_37_5)
532 
533 #define EPWM_CHP_DUTY_CYCLE_PERC_50_PER (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_50)
534 
535 #define EPWM_CHP_DUTY_CYCLE_PERC_62PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_62_5)
536 
537 #define EPWM_CHP_DUTY_CYCLE_PERC_75 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_75)
538 
539 #define EPWM_CHP_DUTY_CYCLE_PERC_87PNT5 (PWMSS_EPWM_PCCTL_CHPDUTY_DUTY_87_5)
540 
549 typedef uint32_t EPWM_ChpClkFreq_t;
550 #define EPWM_CHP_CLK_FREQ_DIV_BY_1 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_1)
551 
552 #define EPWM_CHP_CLK_FREQ_DIV_BY_2 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_2)
553 
554 #define EPWM_CHP_CLK_FREQ_DIV_BY_3 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_3)
555 
556 #define EPWM_CHP_CLK_FREQ_DIV_BY_4 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_4)
557 
558 #define EPWM_CHP_CLK_FREQ_DIV_BY_5 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_5)
559 
560 #define EPWM_CHP_CLK_FREQ_DIV_BY_6 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_6)
561 
562 #define EPWM_CHP_CLK_FREQ_DIV_BY_7 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_7)
563 
564 #define EPWM_CHP_CLK_FREQ_DIV_BY_8 (PWMSS_EPWM_PCCTL_CHPFREQ_DIV_8)
565 
574 typedef uint32_t EPWM_ChpOshtWidth_t;
575 #define EPWM_CHP_OSHT_WIDTH_MIN (0U)
576 
577 #define EPWM_CHP_OSHT_WIDTH_1XSYSOUT_BY_8 (CSL_EPWM_CHP_OSHT_WIDTH_MIN)
578 
579 #define EPWM_CHP_OSHT_WIDTH_2XSYSOUT_BY_8 (1U)
580 
581 #define EPWM_CHP_OSHT_WIDTH_3XSYSOUT_BY_8 (2U)
582 
583 #define EPWM_CHP_OSHT_WIDTH_4XSYSOUT_BY_8 (3U)
584 
585 #define EPWM_CHP_OSHT_WIDTH_5XSYSOUT_BY_8 (4U)
586 
587 #define EPWM_CHP_OSHT_WIDTH_6XSYSOUT_BY_8 (5U)
588 
589 #define EPWM_CHP_OSHT_WIDTH_7XSYSOUT_BY_8 (6U)
590 
591 #define EPWM_CHP_OSHT_WIDTH_8XSYSOUT_BY_8 (7U)
592 
593 #define EPWM_CHP_OSHT_WIDTH_9XSYSOUT_BY_8 (8U)
594 
595 #define EPWM_CHP_OSHT_WIDTH_10XSYSOUT_BY_8 (9U)
596 
597 #define EPWM_CHP_OSHT_WIDTH_11XSYSOUT_BY_8 (10U)
598 
599 #define EPWM_CHP_OSHT_WIDTH_12XSYSOUT_BY_8 (11U)
600 
601 #define EPWM_CHP_OSHT_WIDTH_13XSYSOUT_BY_8 (12U)
602 
603 #define EPWM_CHP_OSHT_WIDTH_14XSYSOUT_BY_8 (13U)
604 
605 #define EPWM_CHP_OSHT_WIDTH_15XSYSOUT_BY_8 (14U)
606 
607 #define EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8 (15U)
608 
609 #define EPWM_CHP_OSHT_WIDTH_MAX (CSL_EPWM_CHP_OSHT_WIDTH_16XSYSOUT_BY_8)
610 
637 typedef uint32_t EPWM_TzTripAction_t;
638 #define EPWM_TZ_TRIP_ACTION_TRI_STATE (PWMSS_EPWM_TZCTL_TZA_HIGH_IMPEDANCE)
639 
640 #define EPWM_TZ_TRIP_ACTION_HIGH (PWMSS_EPWM_TZCTL_TZA_HIGH_STATE)
641 
642 #define EPWM_TZ_TRIP_ACTION_LOW (PWMSS_EPWM_TZCTL_TZA_LOW_STATE)
643 
644 #define EPWM_TZ_TRIP_ACTION_DO_NOTHING (PWMSS_EPWM_TZCTL_TZA_DO_NOTHING)
645 
654 typedef uint32_t EPWM_TzEvent_t;
655 #define EPWM_TZ_EVENT_MIN (0x0U)
656 
657 #define EPWM_TZ_EVENT_ONE_SHOT (EPWM_TZ_EVENT_MIN)
658 
659 #define EPWM_TZ_EVENT_CYCLE_BY_CYCLE (0x1U)
660 
661 #define EPWM_TZ_EVENT_MAX (CSL_EPWM_TZ_EVENT_CYCLE_BY_CYCLE)
662 
671 typedef uint32_t EPWM_TzStsFlg_t;
672 #define EPWM_TZ_STS_FLG_OST (PWMSS_EPWM_TZFLG_OST_MASK)
673 
674 #define EPWM_TZ_STS_FLG_CBC (PWMSS_EPWM_TZFLG_CBC_MASK)
675 
676 #define EPWM_TZ_STS_FLG_INT (PWMSS_EPWM_TZFLG_INT_MASK)
677 
686 typedef uint32_t EPWM_EtIntrEvt_t;
687 #define EPWM_ET_INTR_EVT_CNT_EQ_ZRO (PWMSS_EPWM_ETSEL_INTSEL_CTR_0)
688 
689 #define EPWM_ET_INTR_EVT_CNT_EQ_PRD (PWMSS_EPWM_ETSEL_INTSEL_CTR_PERIOD)
690 
691 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPA_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_INCR)
692 
694 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPA_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPA_DECR)
695 
697 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPB_INC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_INCR)
698 
700 #define EPWM_ET_INTR_EVT_CNT_EQ_CMPB_DEC (PWMSS_EPWM_ETSEL_INTSEL_CTR_CMPB_DECR)
701 
713 typedef uint32_t EPWM_EtIntrPeriod_t;
714 #define EPWM_ET_INTR_PERIOD_DIS_INTR (PWMSS_EPWM_ETPS_INTPRD_DISABLE)
715 
716 #define EPWM_ET_INTR_PERIOD_FIRST_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_FIRST_EVT)
717 
718 #define EPWM_ET_INTR_PERIOD_SECOND_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_SECOND_EVT)
719 
720 #define EPWM_ET_INTR_PERIOD_THIRD_EVT (PWMSS_EPWM_ETPS_INTPRD_GEN_THIRD_EVT)
721 
725 #define EPWM_ETFLG_INT_MASK (PWMSS_EPWM_ETFLG_INT_MASK)
726 
727 /* ========================================================================== */
728 /* Structures and Enums */
729 /* ========================================================================== */
730 
732 typedef struct EPWM_TimebaseCfg_s
733 {
734  uint32_t tbClk;
738  uint32_t tbCntrDirection;
744  uint32_t cntDirAfterSync;
749  uint32_t syncOutSrc;
753 
755 typedef struct EPWM_CounterCmpCfg_s
756 {
757  uint32_t cmpAValue;
759  uint32_t cmpBValue;
762 
765 typedef struct EPWM_AqActionCfg_s
766 {
767  uint32_t zeroAction;
770  uint32_t prdAction;
773  uint32_t cmpAUpAction;
777  uint32_t cmpADownAction;
781  uint32_t cmpBUpAction;
785  uint32_t cmpBDownAction;
790 
793 typedef struct EPWM_DeadbandCfg_s
794 {
795  uint32_t inputMode;
799  uint32_t outputMode;
803  uint32_t polaritySelect;
807  uint32_t risingEdgeDelay;
812 
815 typedef struct EPWM_ChopperCfg_s
816 {
817  uint32_t dutyCycle;
820  uint32_t clkFrequency;
827 
830 typedef struct EPWM_TripzoneCfg_s
831 {
832  uint32_t tripAction;
835  uint32_t tripEvtType;
838  uint32_t tripPin;
840  uint32_t enableTripIntr;
843 
846 typedef struct EPWM_EtCfg_s
847 {
848  uint32_t intrEvtSource;
851  uint32_t intrPrd;
855 } EPWM_EtCfg;
856 
857 /* ========================================================================== */
858 /* Global Variables Declarations */
859 /* ========================================================================== */
860 
861 /* None */
862 
863 /* ========================================================================== */
864 /* Function Declarations */
865 /* ========================================================================== */
866 
877 void EPWM_tbTimebaseClkCfg(uint32_t baseAddr,
878  uint32_t tbClk,
879  uint32_t moduleClk);
880 
901 void EPWM_tbPwmFreqCfg(uint32_t baseAddr,
902  uint32_t tbClk,
903  uint32_t pwmFreq,
904  uint32_t counterDir,
905  uint32_t enableShadowWrite);
906 
922 void EPWM_tbSyncEnable(uint32_t baseAddr,
923  uint32_t tbPhsValue,
924  uint32_t counterDir);
925 
932 void EPWM_tbSyncDisable(uint32_t baseAddr);
933 
944 void EPWM_tbSetSyncOutMode(uint32_t baseAddr, uint32_t syncOutMode);
945 
954 void EPWM_tbTriggerSwSync(uint32_t baseAddr);
955 
963 void EPWM_tbWriteTbCount(uint32_t baseAddr, uint32_t tbCount);
964 
973 uint16_t EPWM_tbReadTbCount(uint32_t baseAddr);
974 
1003 uint16_t EPWM_tbGetStatus(uint32_t baseAddr, uint32_t tbStatusMask);
1004 
1015 void EPWM_tbStatusClear(uint32_t baseAddr, uint32_t tbStatusClrMask);
1016 
1026 void EPWM_tbSetEmulationMode(uint32_t baseAddr, uint32_t mode);
1027 
1054 uint32_t EPWM_counterComparatorCfg(uint32_t baseAddr,
1055  uint32_t cmpType,
1056  uint32_t cmpVal,
1057  uint32_t enableShadowWrite,
1058  uint32_t shadowToActiveLoadTrigger,
1059  uint32_t overwriteShadow);
1060 
1078 void EPWM_aqActionOnOutputCfg(uint32_t baseAddr,
1079  uint32_t pwmOutputCh,
1080  const EPWM_AqActionCfg *pCfg);
1081 
1096 void EPWM_aqSwTriggerOneTimeAction(uint32_t baseAddr,
1097  uint32_t pwmOutputCh,
1098  uint32_t swTrigAction);
1099 
1115 void EPWM_aqSwTriggerContAction(uint32_t baseAddr,
1116  uint32_t pwmOutputCh,
1117  uint32_t swTrigAction,
1118  uint32_t activeRegReloadMode);
1119 
1134 void EPWM_deadbandCfg(uint32_t baseAddr, const EPWM_DeadbandCfg *pCfg);
1135 
1141 void EPWM_deadbandBypass(uint32_t baseAddr);
1142 
1152 void EPWM_chopperCfg(uint32_t baseAddr, const EPWM_ChopperCfg *pCfg);
1153 
1163 void EPWM_chopperEnable(uint32_t baseAddr, uint32_t enableChopper);
1164 
1177 void EPWM_tzTriggerTripAction(uint32_t baseAddr,
1178  uint32_t tripAction,
1179  uint32_t pwmOutputCh);
1180 
1193 void EPWM_tzTripEventEnable(uint32_t baseAddr,
1194  uint32_t tzEventType,
1195  uint32_t pinNum);
1196 
1207 void EPWM_tzTripEventDisable(uint32_t baseAddr,
1208  uint32_t tzEventType,
1209  uint32_t pinNum);
1210 
1220 void EPWM_tzIntrEnable(uint32_t baseAddr, uint32_t tzEventType);
1221 
1230 void EPWM_tzIntrDisable(uint32_t baseAddr, uint32_t tzEventType);
1231 
1256 uint16_t EPWM_tzEventStatus(uint32_t baseAddr, uint32_t eventMask);
1257 
1266 void EPWM_tzEventStatusClear(uint32_t baseAddr, uint32_t eventMask);
1267 
1276 void EPWM_tzTriggerSwEvent(uint32_t baseAddr, uint32_t tzEventType);
1277 
1291 void EPWM_etIntrCfg(uint32_t baseAddr, uint32_t intrEvtSrc, uint32_t intrPrd);
1292 
1298 void EPWM_etIntrEnable(uint32_t baseAddr);
1299 
1305 void EPWM_etIntrDisable(uint32_t baseAddr);
1306 
1315 uint16_t EPWM_etIntrStatus(uint32_t baseAddr);
1316 
1323 void EPWM_etIntrClear(uint32_t baseAddr);
1324 
1331 void EPWM_etIntrTrigger(uint32_t baseAddr);
1332 
1341 uint16_t EPWM_etGetEventCount(uint32_t baseAddr);
1342 
1343 #ifdef __cplusplus
1344 }
1345 #endif
1346 
1347 #endif /* #ifndef EPWM_V0_H_ */
1348 
EPWM_CcCmp_t
uint32_t EPWM_CcCmp_t
Definition: epwm/v0/epwm.h:252
EPWM_TimebaseCfg
Structure holding the TimeBase sub-module configuration parameters.
Definition: epwm/v0/epwm.h:733
EPWM_AqActionCfg
Structure holding the Action Qualifier actions to be taken on the PWM output at the specific events.
Definition: epwm/v0/epwm.h:766
EPWM_AqActionCfg::zeroAction
uint32_t zeroAction
Definition: epwm/v0/epwm.h:767
EPWM_DeadbandCfg::inputMode
uint32_t inputMode
Definition: epwm/v0/epwm.h:795
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:188
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:120
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:832
EPWM_AqActionCfg::cmpADownAction
uint32_t cmpADownAction
Definition: epwm/v0/epwm.h:777
EPWM_TimebaseCfg::cntDirAfterSync
uint32_t cntDirAfterSync
Definition: epwm/v0/epwm.h:744
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:756
EPWM_ChopperCfg
Structure holding the configuration parameters of Chopper sub-module.
Definition: epwm/v0/epwm.h:816
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:794
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:785
EPWM_TimebaseCfg::phsCountAfterSync
uint32_t phsCountAfterSync
Definition: epwm/v0/epwm.h:747
EPWM_AqSwTrigContAction_t
uint32_t EPWM_AqSwTrigContAction_t
Types of Continuous software forced actions on output.
Definition: epwm/v0/epwm.h:422
EPWM_AqActionCfg::prdAction
uint32_t prdAction
Definition: epwm/v0/epwm.h:770
EPWM_ChpOshtWidth_t
uint32_t EPWM_ChpOshtWidth_t
One-Shot Pulse Width values.
Definition: epwm/v0/epwm.h:574
EPWM_AqActionCfg::cmpBUpAction
uint32_t cmpBUpAction
Definition: epwm/v0/epwm.h:781
EPWM_TbSyncOutEvt_t
uint32_t EPWM_TbSyncOutEvt_t
Source of Synchronization output signal.
Definition: epwm/v0/epwm.h:201
EPWM_ChopperCfg::clkFrequency
uint32_t clkFrequency
Definition: epwm/v0/epwm.h:820
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:234
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:526
EPWM_EtCfg::intrEvtSource
uint32_t intrEvtSource
Definition: epwm/v0/epwm.h:848
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:736
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:387
EPWM_TimebaseCfg::enableSynchronization
uint32_t enableSynchronization
Definition: epwm/v0/epwm.h:741
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:549
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:823
EPWM_TbSts_t
uint32_t EPWM_TbSts_t
Flags to get the different types of time base status.
Definition: epwm/v0/epwm.h:218
EPWM_TzEvent_t
uint32_t EPWM_TzEvent_t
Type of trip zone events.
Definition: epwm/v0/epwm.h:654
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:749
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:440
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:458
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:803
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:840
EPWM_TimebaseCfg::tbClk
uint32_t tbClk
Definition: epwm/v0/epwm.h:734
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:831
EPWM_DeadbandCfg::fallingEdgeDelay
uint32_t fallingEdgeDelay
Definition: epwm/v0/epwm.h:809
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:835
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:851
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:686
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:738
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:807
EPWM_ChopperCfg::dutyCycle
uint32_t dutyCycle
Definition: epwm/v0/epwm.h:817
EPWM_ShadowRegCtrl_t
uint32_t EPWM_ShadowRegCtrl_t
Shadow register enable or disable control.
Definition: epwm/v0/epwm.h:175
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:671
EPWM_CounterCmpCfg::cmpBValue
uint32_t cmpBValue
Definition: epwm/v0/epwm.h:759
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:483
EPWM_CounterCmpCfg::cmpAValue
uint32_t cmpAValue
Definition: epwm/v0/epwm.h:757
EPWM_TripzoneCfg::tripPin
uint32_t tripPin
Definition: epwm/v0/epwm.h:838
EPWM_TbCounterDir_t
uint32_t EPWM_TbCounterDir_t
Types of Time base counter direction modes.
Definition: epwm/v0/epwm.h:137
EPWM_EtCfg
Structure holding the Event Trigger Sub-Module configuration parameters.
Definition: epwm/v0/epwm.h:847
EPWM_AqActionCfg::cmpAUpAction
uint32_t cmpAUpAction
Definition: epwm/v0/epwm.h:773
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:349
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:502
EPWM_DeadbandCfg::outputMode
uint32_t outputMode
Definition: epwm/v0/epwm.h:799
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:637
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:296
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:713