|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
drv_custom_config_pwm.h
Go to the documentation of this file.
1
8#ifndef DRV_CONFIG_CUSTOM_PWM_H
9#define DRV_CONFIG_CUSTOM_PWM_H
10
11#include "pwrctrl/pwrctrl_typedef.h"
12#include "drv_mcc_extension_pwm.h"
13#include "config/macros.h"
14#include "pwm_hs/pwm.h"
15
16
25 static __inline__ void DRV_Config_Custom_PWM(void)
26{
27 //PWMs needs to be re-triggerable for cascaded PWM scheme
28 PWM_Trigger_Mode(PWM_PRI_1, PWM_TRIG_MODE_RETRIGGERABLE);
29 PWM_Trigger_Mode(PWM_SEC_1, PWM_TRIG_MODE_RETRIGGERABLE);
30 PWM_Trigger_Mode(PWM_PRI_2, PWM_TRIG_MODE_RETRIGGERABLE);
31 PWM_Trigger_Mode(PWM_SEC_2, PWM_TRIG_MODE_RETRIGGERABLE);
32
33 // PWM Swap output based on the hardware
34 PWM_Swap_PWMxL_and_PWMxH(PWM_PRI_2, true);
35 PWM_Swap_PWMxL_and_PWMxH(PWM_SEC_2, true);
36
37 // Fault mode is Latched mode
38 PWM_PCI_Fault_AcceptanceCriteria(PWM_PRI_1, PWM_PCI_ACCEPT_LATCHED);
39 PWM_PCI_Fault_AcceptanceCriteria(PWM_SEC_1, PWM_PCI_ACCEPT_LATCHED);
40 PWM_PCI_Fault_AcceptanceCriteria(PWM_PRI_2, PWM_PCI_ACCEPT_LATCHED);
41 PWM_PCI_Fault_AcceptanceCriteria(PWM_SEC_2, PWM_PCI_ACCEPT_LATCHED);
42
43 // Stop PWMs straight away upon detection of a fault
44 PWM_PCI_Fault_TimetoTerminateAfterEvent(PWM_PRI_1, PWM_PCI_TERMTIME_AFTER_EVENT_IMMEDIATE);
45 PWM_PCI_Fault_TimetoTerminateAfterEvent(PWM_SEC_1, PWM_PCI_TERMTIME_AFTER_EVENT_IMMEDIATE);
46 PWM_PCI_Fault_TimetoTerminateAfterEvent(PWM_PRI_2, PWM_PCI_TERMTIME_AFTER_EVENT_IMMEDIATE);
47 PWM_PCI_Fault_TimetoTerminateAfterEvent(PWM_SEC_2, PWM_PCI_TERMTIME_AFTER_EVENT_IMMEDIATE);
48
49 PWM_Fault_DataMode(PWM_PRI_1, PWM_FAULT_EVENT_PWML);
50 PWM_Fault_DataMode(PWM_SEC_1, PWM_FAULT_EVENT_PWML);
51 PWM_Fault_DataMode(PWM_PRI_2, PWM_FAULT_EVENT_PWML);
52 PWM_Fault_DataMode(PWM_SEC_2, PWM_FAULT_EVENT_PWML);
53
54}
55
56#endif /* DRV_MCC_CONFIG_PWM_H */
57
pwm.h
This is the generated driver header file for the PWM driver.
PWM_SEC_1
@ PWM_SEC_1
Definition pwm_hs_types.h:56
PWM_PRI_1
@ PWM_PRI_1
Definition pwm_hs_types.h:55
PWM_SEC_2
@ PWM_SEC_2
Definition pwm_hs_types.h:58
PWM_PRI_2
@ PWM_PRI_2
Definition pwm_hs_types.h:57
drv_mcc_extension_pwm.h
Contains public functions and defines for the MCC code extension for PWM.
PWM_PCI_Fault_AcceptanceCriteria
static void PWM_PCI_Fault_AcceptanceCriteria(uint16_t pwmIndex, PWM_PCI_ACCEPTANCE_CRITERIA_t acpSetting)
Set PCI fault acceptance criteria.
Definition drv_mcc_extension_pwm.h:51
PWM_PCI_Fault_TimetoTerminateAfterEvent
static void PWM_PCI_Fault_TimetoTerminateAfterEvent(uint16_t pwmIndex, PWM_PCI_TERMTIME_AFTER_EVENT_t faultTerm)
Set TSYNCDIS bit to determine when PWM should stop after a fault occurs.
Definition drv_mcc_extension_pwm.h:199
PWM_Trigger_Mode
static void PWM_Trigger_Mode(uint16_t pwmIndex, PWM_TRIG_MODE_t trigMode)
Set source of fault PCI acceptance qualifier.
Definition drv_mcc_extension_pwm.h:947
PWM_Swap_PWMxL_and_PWMxH
static void PWM_Swap_PWMxL_and_PWMxH(uint16_t pwmIndex, bool swapPWMH_PWML)
Enable/Disable the PWM instance output swap bit.
Definition drv_mcc_extension_pwm.h:1053
PWM_Fault_DataMode
static void PWM_Fault_DataMode(uint16_t pwmIndex, PWM_FAULT_DATA_t faultDataMode)
Set the data mode of fault PCI.
Definition drv_mcc_extension_pwm.h:1271
DRV_Config_Custom_PWM
static __inline__ void DRV_Config_Custom_PWM(void)
Contains PWM initialization that was not supported by MCC generated code.
Definition drv_custom_config_pwm.h:25
PWM_PCI_TERMTIME_AFTER_EVENT_IMMEDIATE
@ PWM_PCI_TERMTIME_AFTER_EVENT_IMMEDIATE
Definition drv_mcc_extension_pwm.h:185
PWM_FAULT_EVENT_PWML
@ PWM_FAULT_EVENT_PWML
Definition drv_mcc_extension_pwm.h:1258
PWM_PCI_ACCEPT_LATCHED
@ PWM_PCI_ACCEPT_LATCHED
Definition drv_mcc_extension_pwm.h:34
PWM_TRIG_MODE_RETRIGGERABLE
@ PWM_TRIG_MODE_RETRIGGERABLE
Definition drv_mcc_extension_pwm.h:934