Bar Logo 4kW dsPIC33C PSFB DC-DC DA (Part-No. )
 
Content
     
Loading...
Searching...
No Matches
pwrctrl_comm_interface.c
Go to the documentation of this file.
1/*
2 (c) 2024 Microchip Technology Inc. and its subsidiaries. You may use this
3 software and any derivatives exclusively with Microchip products.
4
5 THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
6 EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
7 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
8 PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
9 WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
10
11 IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
12 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
13 WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
14 BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
15 FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
16 ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
17 THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
18
19 MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
20 TERMS.
21 */
22
29#include "pwrctrl.h"
30
31
32
33
43
44
49void Dev_PwrCtrl_SetState(uint16_t reference)
50{
51 psfb_ptr->State = reference;
52}
53
54
59void PwrCtrl_SetIReference(uint16_t reference)
60{
61 psfb_ptr->Properties.IReference = reference;
62}
63
64
69void PwrCtrl_SetVSecReference(uint16_t reference)
70{
72}
73
74
79void PwrCtrl_SetPwrReference(uint16_t reference)
80{
81 psfb_ptr->Properties.PwrReference = reference;
82}
83
84
89void PwrCtrl_SetPeriodTarget(uint16_t reference)
90{
91 psfb_ptr->Pwm.PBVPeriodTarget = reference;
92}
93
94
99void PwrCtrl_SetPhaseTarget(uint16_t reference)
100{
102}
103
108void PwrCtrl_SetP2SPhaseTarget(uint16_t reference)
109{
111}
112
113
118void PwrCtrl_SetEnable(bool enable)
119{
120 psfb_ptr->Properties.Enable = enable;
121}
122
123
124
130{
131 return(psfb_ptr->Data.ISensePrimary);
132}
133
134
140{
142}
143
144
150{
152}
153
154
160{
161 return(psfb_ptr->Data.Temperature);
162}
163
164
170{
171 return(psfb_ptr->Data.VRail_5V);
172}
173
174
180{
181 return(psfb_ptr->Pwm.ControlPeriod);
182}
183
184
190{
192}
193
194
200{
201 return(psfb_ptr->State);
202}
203
204
210{
211 return(psfb_ptr->Status.value);
212}
213
214
221{
222 return(psfb_ptr->Properties.Enable);
223}
224
225
231{
233}
234
235
241{
242 return(psfb_ptr->Data.SecPower);
243}
244
250{
251 //return(vPrimAveraging.AverageValue);
252 return;
253}
254
260{
261 //return(vOutAveraging.AverageValue);
262 return;
263}
264
265
271{
272 //return(iSecAveraging.AverageValue);
273 return;
274}
275
276
277
283{
284 return(psfb_ptr->Data.VCapVoltage);
285}
286
287
293{
294 return(psfb_ptr->Data.VInVoltage);
295}
296
297
303{
304 return(psfb_ptr->Data.VOutVoltage);
305}
306
307
313{
314 return(psfb_ptr->Pwm.ControlPhase);
315}
316
317
323{
325}
326
327
333{
335}
POWER_CONTROL_t * psfb_ptr
Definition pwrctrl.c:28
void PwrCtrl_SetEnable(bool enable)
API function to set the power control enable bit.
uint16_t Dev_PwrCtrl_Get_State(void)
API function to get the current state of the state machine.
uint16_t Dev_PwrCtrl_GetIPri_Offset(void)
API function to get the value of the primary sensor offset value.
uint16_t Dev_PwrCtrl_GetAveraging_Isec(void)
API function to get the average value of the sampled ADC for secondary current.
uint16_t Dev_PwrCtrl_GetAveraging_Vsec(void)
API function to get the average value of the sampled ADC for secondary voltage.
void PwrCtrl_SetPwrReference(uint16_t reference)
API function to set the power controller reference.
uint16_t PwrCtrl_GetPhase_P2SDegree(void)
API function to set the power control State.
uint16_t PwrCtrl_GetAdc_Isec_avg(void)
API function to get the raw ADC value for secondary average current.
uint16_t PwrCtrl_GetAdc_Ipri_ct(void)
API function to get the raw ADC value for primary current transformer current.
uint16_t Dev_PwrCtrl_Get_Period(void)
API function to get the PWM period.
uint16_t Dev_PwrCtrl_GetAveraging_Vprim(void)
API function to get the average value of the sampled ADC for primary voltage.
void PwrCtrl_SetIReference(uint16_t reference)
API function to set the current controller reference.
uint16_t PwrCtrl_GetAdc_Isec_shunt(void)
API function to get the raw ADC value for secondary current transformer current.
uint16_t Dev_PwrCtrl_GetIsec_Offset(void)
API function to get the value of the secondary sensor offset value.
void PwrCtrl_SetPeriodTarget(uint16_t reference)
API function to set the target period.
uint16_t Dev_PwrCtrl_Get_EnableFlag(void)
API function to get the state of the power control enable bit.
void PwrCtrl_SetP2SPhaseTarget(uint16_t reference)
API function to set the target prim to sec phase which will steer other modulation.
uint16_t Dev_PwrCtrl_GetAdc_Vpri(void)
API function to get the value of the sampled ADC for input Voltage.
void PwrCtrl_SetVSecReference(uint16_t reference)
API function to set the secondary voltage controller reference.
uint16_t Dev_PwrCtrl_GetAdc_Vsec(void)
API function to get the value of the sampled ADC for output Voltage.
uint16_t Dev_PwrCtrl_Get_Status(void)
API function to get the power control status.
uint16_t PwrCtrl_GetAdc_Temperature(void)
API function to get the raw ADC value for temperature.
uint16_t Dev_PwrCtrl_Get_DutyCycle(void)
API function to get the PWM duty cycle.
uint16_t Dev_PwrCtrl_GetVoltage_Vcap(void)
API function to get the value of the sampled ADC for Capacitor Voltage.
uint16_t Dev_PwrCtrl_Get_PwmprdTarget(void)
API function to get the PWM period target.
void Dev_PwrCtrl_SetState(uint16_t reference)
API function to set the power control State.
void PwrCtrl_SetPhaseTarget(uint16_t reference)
API function to set the target PWM phase.
uint16_t PwrCtrl_GetAdc_Vrail_5V(void)
API function to get the raw ADC value for 5V rail.
uint16_t Dev_PwrCtrl_GetControl_Phase(void)
API function to get the value of the phase value.
uint16_t Dev_PwrCtrl_Get_SecPower(void)
API function to get the secondary power.
uint16_t ControlPhase_P2S_Target
Control phase value from control loop in degrees.
uint16_t ControlPeriod
Control period value from control loop.
uint16_t ControlPhase_P2S_Degreex10
Control phase value from control loop in 10 x degree, integer.
uint16_t ControlDutyCycle
Control Duty Cycle calculation based on Control Period.
uint16_t PBVPeriodTarget
Power Board Visualizer Set Control target.
uint16_t ControlPhase
Control phase value from control loop.
uint16_t PBVControlPhaseTarget
Power Board Visualizer Set Control phase.
uint16_t VCapVoltage
Data value for capacitor.
uint16_t ISecAverageRectified
Data value for average secondary current rectified.
uint16_t ISensePrimary
Data value for primary current as measured with CT.
int16_t SecPower
Data value for Secondary power (Watt)
uint16_t IPriSensorOffset
Offset of the primary current sensor.
uint16_t VInVoltage
Data value for input voltage.
uint16_t ISecSensorOffset
Offset of the secondary current sensor.
uint16_t ISenseSecondary
Data value for secondary current as measured with shunt.
uint16_t VRail_5V
Data value for 5V auxiliary rail.
uint16_t Temperature
Data value for temperature.
uint16_t VOutVoltage
Data value for output voltage.
uint16_t PwrReference
User power reference setting used to control the converter controller.
bool Enable
Control Flag: When set, enables the converter triggering a startup sequence; When cleared,...
int16_t IReference
User current reference setting used to control the converter controller.
uint16_t VSecReference
User secondary-voltage port reference setting used to control the power converter output voltage in b...
SWITCH_NODE_t Pwm
Switch node settings.
PWR_CTRL_PROPERTIES_t Properties
Power Control properties
PWR_CTRL_STATE_t State
Power Control State ID.
FEEDBACK_SETTINGS_t Data
Feedback channel settings.
STATUS_FLAGS_t Status
Power Supply status flags.