3.1.3 mcAppI_AdcFinishedIsr
C
/* Interrupt tasks execution */
void mcAppI_AdcFinishedIsr( uint32_t status, uintptr_t context );
Summary
Execution of FOC Tasks.
Description
This function is specifically designed to execute Field-Oriented Control (FOC) tasks and it is triggered by the Analog-to-Digital Converter (ADC) end-of-conversion interrupt. Upon activation, the function performs the following key operations:
- Phase Current Calculation: Computes the phase currents based on the ADC readings.
- Reference Input Sensing: Senses the reference inputs necessary for control.
- Rotor Position Calculation: Calculates or estimates the rotor position to ensure accurate control.
- Control Loop Execution: Executes the control loops to maintain optimal performance.
- PWM Output Generation: Generates and sets the Pulse Width Modulation (PWM) output to drive the motor effectively.
Precondition
The function mcAppI_ApplicationInit() must be called first for the associated instance, and mcHalI_AdcCallbackRegister() must be called to set the function to be executed.
Parameters
Param | Description |
---|---|
status | Interrupt status. |
context | Allows the caller to provide a context value (usually a pointer to the callers context for multi-instance clients) |
Returns
None
Example
void mcAppI_AdcFinishedIsr( uint32_t status, uintptr_t context )
{
}
mcHalI_AdcCallbackRegister( (ADC_CALLBACK)mcAppI_AdcFinishedIsr, (uintptr_t)dummyForMisra );
Remarks
None.