Digital Power Starter Kit 3 Firmware
dsPIC33C Boost Converter Voltage Mode Control Example
dev_boost_ptemp_pwm.c
1 /*
2  * File: dev_boost_ptemp_pwm.c
3  * Author: M91406
4  *
5  * Created on October 29, 2020, 10:31 AM
6  */
7 
8 #include "xc16_pral.h" // include peripehral register abstraction layer drivers
9 #include "dev_boost_ptemp_pwm.h" // include peripheral register configuration values header
10 
11 /****************************************************************************************************
12  * @ingroup lib-layer-boost-ptemplate-properties-variables
13  * @var boostPwmModuleConfig
14  * @brief PWM module default configuration
15  *****************************************************************************************************/
16 volatile struct P33C_PWM_MODULE_s boostPwmModuleConfig =
17 {
19  .vFSCL.value = 0x0000,
20  .vFSMINPER.value = 0x0000,
21  .vMPHASE.value = 0x0000,
22  .vMDC.value = 0x0000,
23  .vMPER.value = 0x0000,
24  .vLFSR.value = 0x0000,
25  .vCMBTRIGL.value = REG_CMBTRIGL,
26  .vCMBTRIGH.value = REG_CMBTRIGH,
27  .LOGCON_A.value = REG_LOGCONA,
28  .LOGCON_B.value = REG_LOGCONB,
29  .LOGCON_C.value = REG_LOGCONC,
30  .LOGCON_D.value = REG_LOGCOND,
31  .LOGCON_E.value = REG_LOGCONE,
32  .LOGCON_F.value = REG_LOGCONF,
33  .PWMEVT_A.value = REG_PWMEVTA,
34  .PWMEVT_B.value = REG_PWMEVTB,
35  .PWMEVT_C.value = REG_PWMEVTC,
36  .PWMEVT_D.value = REG_PWMEVTD,
37  .PWMEVT_E.value = REG_PWMEVTE,
38  .PWMEVT_F.value = REG_PWMEVTF
39  };
40 
41 
42 /****************************************************************************************************
43  * @ingroup lib-layer-boost-ptemplate-properties-variables
44  * @var boostPwmGeneratorConfig
45  * @brief PWM generator default configuration
46  *****************************************************************************************************/
47 volatile struct P33C_PWM_GENERATOR_s boostPwmGeneratorConfig =
48 {
50  .PGxCONH.value = REG_PGxCONH,
51  .PGxSTAT.value = 0x0000,
52  .PGxIOCONL.value = REG_PGxIOCONL,
53  .PGxIOCONH.value = REG_PGxIOCONH,
54  .PGxEVTL.value = REG_PGxEVTL,
55  .PGxEVTH.value = REG_PGxEVTH,
56  .PGxCLPCIL.value = REG_PGxCLPCIL,
57  .PGxCLPCIH.value = REG_PGxCLPCIH,
58  .PGxFPCIL.value = REG_PGxFPCIL,
59  .PGxFPCIH.value = REG_PGxFPCIH,
60  .PGxFFPCIL.value = REG_PGxFFPCIL,
61  .PGxFFPCIH.value = REG_PGxFFPCIH,
62  .PGxSPCIL.value = REG_PGxSPCIL,
63  .PGxSPCIH.value = REG_PGxSPCIH,
64  .PGxLEBL.value = REG_PGxLEBL,
65  .PGxLEBH.value = REG_PGxLEBH,
66  .PGxPHASE.value = 0x0000,
67  .PGxDC.value = 0x0000,
68  .PGxDCA.value = 0x0000,
69  .PGxPER.value = 0x0000,
70  .PGxTRIGA.value = 0x0000,
71  .PGxTRIGB.value = 0x0000,
72  .PGxTRIGC.value = 0x0000,
73  .PGxDTL.value = 0x0000,
74  .PGxDTH.value = 0x0000,
75  .PGxCAP.value = 0x0000
76 };
77 
78 // end of file
79 
#define REG_PGxIOCONL
PGxIOCONL: PWM GENERATOR x I/O CONTROL REGISTER LOW.
#define REG_PGxEVTL
PGxEVTL: PWM GENERATOR x EVENT REGISTER LOW.
#define REG_PGxCONH
PGxCONH: PWM GENERATOR x CONTROL REGISTER LOW.
#define REG_PWMEVTF
PWMEVTF: PWM EVENT OUTPUT CONTROL REGISTER F.
#define REG_PGxCONL
PGxCONL: PWM GENERATOR x CONTROL REGISTER LOW.
#define REG_LOGCONA
LOGCONA: COMBINATORIAL PWM LOGIC CONTROL REGISTER A.
union P33C_PWM_MODULE_s::@212 vPCLKCON
#define REG_PGxFFPCIL
PGxFFPCIL: PWM GENERATOR FEED FORWARD PCI REGISTER LOW.
#define REG_PWMEVTD
PWMEVTD: PWM EVENT OUTPUT CONTROL REGISTER D.
#define REG_LOGCONC
LOGCONC: COMBINATORIAL PWM LOGIC CONTROL REGISTER C.
union P33C_PWM_GENERATOR_s::@266 PGxCONL
#define REG_PGxCLPCIH
PGxCLPCIH: PWM GENERATOR CURRENT LIMIT PCI REGISTER HIGH.
#define REG_PGxLEBL
PGxLEBL: PWM GENERATOR x LEADING-EDGE BLANKING REGISTER LOW.
#define REG_CMBTRIGH
CMBTRIGH: COMBINATIONAL TRIGGER REGISTER HIGH.
#define REG_LOGCONF
LOGCONF: COMBINATORIAL PWM LOGIC CONTROL REGISTER F.
#define REG_PCLKCON
PCLKCON: PWM CLOCK CONTROL REGISTER.
#define REG_LOGCONE
LOGCONE: COMBINATORIAL PWM LOGIC CONTROL REGISTER E.
#define REG_LOGCONB
LOGCONB: COMBINATORIAL PWM LOGIC CONTROL REGISTER B.
#define REG_PGxLEBH
PGxLEBH: PWM GENERATOR x LEADING-EDGE BLANKING REGISTER HIGH.
#define REG_PWMEVTC
PWMEVTC: PWM EVENT OUTPUT CONTROL REGISTER C.
#define REG_LOGCOND
LOGCOND: COMBINATORIAL PWM LOGIC CONTROL REGISTER D.
#define REG_PGxCLPCIL
PGxCLPCIL: PWM GENERATOR CURRENT LIMIT PCI REGISTER LOW.
#define REG_PGxSPCIH
PGxSPCIH: PWM GENERATOR SOFTWARE PCI REGISTER LOW.
#define REG_PGxSPCIL
PGxSPCIL: PWM GENERATOR SOFTWARE PCI REGISTER LOW.
#define REG_PGxEVTH
PGxEVTH: PWM GENERATOR x EVENT REGISTER LOW.
#define REG_PGxFFPCIH
PGxFFPCIH: PWM GENERATOR FEED FORWARD PCI REGISTER LOW.
uint16_t value
Definition: p33c_pwm.h:88
#define REG_PGxFPCIH
PGxFPCIH: PWM GENERATOR FAULT PCI REGISTER HIGH.
#define REG_PGxFPCIL
PGxFPCIL: PWM GENERATOR FAULT PCI REGISTER LOW.
#define REG_CMBTRIGL
CMBTRIGL: COMBINATIONAL TRIGGER REGISTER LOW.
#define REG_PWMEVTA
PWMEVTA: PWM EVENT OUTPUT CONTROL REGISTER A.
#define REG_PWMEVTB
PWMEVTB: PWM EVENT OUTPUT CONTROL REGISTER B.
#define REG_PWMEVTE
PWMEVTE: PWM EVENT OUTPUT CONTROL REGISTER E.
#define REG_PGxIOCONH
PGxIOCONH: PWM GENERATOR x I/O CONTROL REGISTER LOW.