brazos-trapezoidal
SRMCPwm_prm.h
Go to the documentation of this file.
1
8#ifndef SRMCPWM_PRM_H_
9 #define SRMCPWM_PRM_H_
10
11//=====================================================================================================================
12//-------------------------------------- PUBLIC (Extern Variables, Constants & Defines) -------------------------------
13//=====================================================================================================================
14
15// This value is used to fine tune conversion trigger event in order to avoid ringing cross talk
16#define SR_MCPWM_ADC_START_DELAY 140// This constant ADC start delay 3PCLK + 3ADCLK (in peripheral cycles)
17
18
19#define SR_PWM_HIGH_CHANNELS_ACTIVE_LEVEL 1 // 1 = active level high; 0 = active level low
20#define SR_PWM_LOW_CHANNELS_ACTIVE_LEVEL 1 // 1 = active level high; 0 = active level low
21
22#define SR_PWM_LOWERS_ON_DUTY_CYCLE SRMCPWM__GET_LOWERS_ON_PWM()
23#define SR_PWM_UPPERS_ON_DUTY_CYCLE 0
24
25#define SR_PWM_FREQUENCY_HZ 8000// Frequency in Hertz (16KHz)
26#define SR_PWM_DEADTIME_NS 1000 // Dead time in nanosseconds
27
28#define SR_PWM_SEL_INTRNL_SHUTDOWN 1 // 1 - use internal shut down circuit detection; 0 - use external shut down circuit
29
30#define PIN_OF_HIGHERS_PWM_IDLE_STATE 0 /* Upper side state when peripheral is disconnected from the pin */
31#define PIN_OF_LOWERS_PWM_IDLE_STATE 0 /* Low side state when peripheral is disconnected from the pin */
32#define SD_PIN_TYPE_DEF OUTPUT_PUSHPULL
33#define SD_PIN_INIT_STATE 1
34
35#define SR_TRANSMIT_AT_CREST (1) // 1 for transmit at crest
36 // 0 for transmit at trough
37#define SR_MTU_FREQUENCY (HSE_VALUE * 8) // MTU frequency for 12MHz external crystal
38
39
40#define SR_MCPWM_SD_PULSE_WIDTH_BASE250US 12 // At least 3ms at low level
41
42#define SR_MCPWM_SHUTDOWN_ACTIVE_POLARITY 0 // define the level which the shut down circuit is active LEVEL 0
43
44#define SR_MCPWM_DIAG_TOTAL_SAMPLES_NR 25 // this is equivalent to ~1.56ms @62.5us
45#define SR_MCPWM_DIAG_SAMPLES_4_DECISION 15 // 60% of the samples in this level defines a decision shift,
46 // 966.8us as worst low level case to read the shut down as zero
47
48//#define FORCE_SHUTDOWN_FAILURE_ALREADY_ACTIVE
49//#define FORCE_SHUTDOWN_FAILURE_STUCK_AT_1
50//#define FORCE_SHUTDOWN_FAILURE_STUCK_AT_0
51
52//=====================================================================================================================
53//-------------------------------------- PUBLIC (Function Prototypes) -------------------------------------------------
54//=====================================================================================================================
55
56#endif // SRMCPWM_PRM_H_
57
58