brazos-trapezoidal
SRMCAtod_prm.h
Go to the documentation of this file.
1
9#ifndef SRMCATOD_PRM_H_
10 #define SRMCATOD_PRM_H_
11
12//#include "SRMotorSafetyMgr.h"
13//#include "SRClockMonitor.h"
14
15//=====================================================================================================================
16//-------------------------------------- PUBLIC (Extern Variables, Constants & Defines) -------------------------------
17//=====================================================================================================================
18
19#define SR_MCATOD_IRQ_LEVEL_S12AD 6 //5
20
21// These values are used to fine tune conversion trigger event in order to avoid ringing cross talk
22#define SR_MCATOD_SAMPLING_TIME 0x14//0x99//0x14 // This constant sets sampling time (in peripheral cycles, minimum value is 0x14)
23
29#define SRMCATOD_I1_DATA_REG() 1
30#define SRMCATOD_I2_DATA_REG() 1
31#define SRMCATOD_I3_DATA_REG() 1
32#define SRMCATOD_HVDC_BUS_DATA_REG() 1
33
34#define SRMCATOD_V1_DATA_REG() 1
35#define SRMCATOD_V2_DATA_REG() 1
36#define SRMCATOD_V3_DATA_REG() 1
37
38
39//#define SRMCATOD_EOC_ISR_HANDLER() SRClockMonitor__Monitor250us();SRMotorSafetyMgr__MCPwmHandler();
40#define SRMCATOD_EOC_ISR_HANDLER() //ControlLoop__AtodIsr();
41
42
43//#define TC_03_2 // This is specific test case to force failure stuck at 0
44//#define TC_03_3 // This is specific test case to force failure stuck at 1
45//#define TC_03_4 // This is specific test case to force converter error failure
46//#define TC_05_1 // This is specific test case to check if interrupts are disabled during initialization
47//PERIOD_LONGER_THAN_250US 0x00FFFFFF
48
49/* Enable/Disable programmable gain
50 * ================================
51 * Options:
52 * 1: enable
53 * 0: disable
54 * */
55 #define S12AD0_PG000EN_PRM 1
56 #define S12AD0_PG001EN_PRM 1
57 #define S12AD0_PG002EN_PRM 0
58 #define S12AD1_PG000EN_PRM 0
59 #define S12AD1_PG001EN_PRM 0
60 #define S12AD1_PG002EN_PRM 0
61
62/* Selection of programmable gain
63 * ================================
64 * Options:
65 * 1: programmable gain amplifier used
66 * 0: programmable gain amplifier bypassed
67 * */
68 #define S12AD0_PG000SEL_PRM 1
69 #define S12AD0_PG001SEL_PRM 1
70 #define S12AD0_PG002SEL_PRM 0
71 #define S12AD1_PG000SEL_PRM 0
72 #define S12AD1_PG001SEL_PRM 0
73 #define S12AD1_PG002SEL_PRM 0
74
75
76/* Gain selection options
77 * ======================
78 * x2.0 : 0x00
79 * x2.5 : 0x01
80 * x3.077 : 0x04
81 * x3.636 : 0x06
82 * x4.0 : 0x07
83 * x4.444 : 0x08
84 * x5.0 : 0x09
85 * x5.714 : 0x0A
86 * x6.667 : 0x0B
87 * x10.0 : 0x0D
88 * x13.333: 0x0E
89 * */
90 #define S12AD0_PG000GAIN_PRM 0x04
91 #define S12AD0_PG001GAIN_PRM 0x04
92 #define S12AD0_PG002GAIN_PRM 0x00
93 #define S12AD1_PG000GAIN_PRM 0x00
94 #define S12AD1_PG001GAIN_PRM 0x00
95 #define S12AD1_PG002GAIN_PRM 0x00
96
97//=====================================================================================================================
98//-------------------------------------- PUBLIC (Function Prototypes) -------------------------------------------------
99//=====================================================================================================================
100#endif // SRMCATOD_PRM_H_