44 #ifndef SVGENCURRENT_H_
45 #define SVGENCURRENT_H_
102 extern SVGENCURRENT_Handle
SVGENCURRENT_init(
void *pMemory,
const size_t numBytes);
165 static inline void SVGENCURRENT_RunIgnoreShunt(SVGENCURRENT_Handle svgencurrentHandle, uint16_t cmp1, uint16_t cmp2, uint16_t cmp3, uint16_t cmpM1, uint16_t cmpM2, uint16_t cmpM3)
172 uint16_t nextPulse1 = (cmp1 + cmpM1)>>1;
173 uint16_t nextPulse2 = (cmp2 + cmpM2)>>1;
174 uint16_t nextPulse3 = (cmp3 + cmpM3)>>1;
176 if(nextPulse1 < minWidth)
178 if((nextPulse2 < minWidth) || ((cmp2 - cmp1) < minWidth))
182 else if((nextPulse3 < minWidth) || ((cmp3 - cmp1) < minWidth))
191 else if(nextPulse2 < minWidth)
193 if((nextPulse1 < minWidth) || ((cmp1 - cmp2) < minWidth))
197 else if((nextPulse3 < minWidth) || ((cmp3 - cmp2) < minWidth))
206 else if(nextPulse3 < minWidth)
208 if((nextPulse1 < minWidth) || ((cmp1 - cmp3) < minWidth))
212 else if((nextPulse2 < minWidth) || ((cmp2 - cmp3) < minWidth))
271 pAdcData->
value[0] = Ia;
272 pAdcData->
value[1] = Ib;
273 pAdcData->
value[2] = Ic;
struct _SVGENCURRENT_Obj_ SVGENCURRENT_Obj
Defines the Svgen Current object.
Contains the public interface to the types definitions.
SVGENCURRENT_Handle SVGENCURRENT_init(void *pMemory, const size_t numBytes)
Initializes the svgen current object.
static SVGENCURRENT_IgnoreShunt_e SVGENCURRENT_getIgnoreShunt(SVGENCURRENT_Handle svgencurrentHandle)
Gets the ignore shunt value.
Ignore the B phase shunt measurement.
Ignore the AC phase shunt measurement.
Ignore the A phase shunt measurement.
Ignore the BC phase shunt measurement.
Ignore the AB phase shunt measurement.
int16_t MinWidth
The maximum width where a valid measurement cannot be taken.
SVGENCURRENT_IgnoreShunt_e IgnoreShunt
Output of what shunt or shunts to ignore.
Defines a three element vector.
static int16_t SVGENCURRENT_getMinWidth(SVGENCURRENT_Handle svgencurrentHandle)
Gets the minimum Duty Cycle width that the lower switch can be on before.
static void SVGENCURRENT_setIgnoreShunt(SVGENCURRENT_Handle svgencurrentHandle, const SVGENCURRENT_IgnoreShunt_e ignoreShunt)
Sets the ignore shunt value.
Contains the public interface to the math (MATH) module routines.
SVGENCURRENT_IgnoreShunt_e
static void SVGENCURRENT_setMinWidth(SVGENCURRENT_Handle svgencurrentHandle, const int16_t minwidth)
Sets the minimum Duty Cycle width that the lower switch can be on before.
Use all shunt measurements.
struct _SVGENCURRENT_Obj_ * SVGENCURRENT_Handle
Defines the Svgen Current handle.
static void SVGENCURRENT_RunIgnoreShunt(SVGENCURRENT_Handle svgencurrentHandle, uint16_t cmp1, uint16_t cmp2, uint16_t cmp3, uint16_t cmpM1, uint16_t cmpM2, uint16_t cmpM3)
Gets the svgen current module ignore shunt.
static void SVGENCURRENT_RunRegenCurrent(SVGENCURRENT_Handle svgencurrentHandle, MATH_vec3 *pAdcData)
Reconstructs the missed measured currents due to a small sampling window.
Ignore the C phase shunt measurement.
Defines the Svgen Current object.