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:

  1. Phase Current Calculation: Computes the phase currents based on the ADC readings.
  2. Reference Input Sensing: Senses the reference inputs necessary for control.
  3. Rotor Position Calculation: Calculates or estimates the rotor position to ensure accurate control.
  4. Control Loop Execution: Executes the control loops to maintain optimal performance.
  5. PWM Output Generation: Generates and sets the Pulse Width Modulation (PWM) output to drive the motor effectively.
This structured approach ensures that the FOC tasks are handled efficiently and accurately.

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

ParamDescription
statusInterrupt status.
contextAllows 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.