2024-10-21 03:18 AM
Hi, what is the correct way to switch between CAD state machines? For example, between DRP to SNK and vice versa.
Motivation: When the battery is bellow the defined SOC, switch from the DRP state machine to the SNK only and stop toggling between SRC and SNK.
Switch can be done by executing for example:
// To SNK
CAD_HW_Handles[PortNum].CAD_PtrStateMachine = &CAD_StateMachine_SNK;
// To DRP
CAD_HW_Handles[PortNum].CAD_PtrStateMachine = &CAD_StateMachine_DRP;
But what is the best place for the code to change the state machine and in what CAD state?
Hard reset? Error recovery? or simply in disconnected state?
Thanks for any advice