MSPM0G3519SensorlessFOCMotorControlLibrary  1.0
Macros | Functions
iqTrig.h File Reference

Detailed Description

IQ Trignometry Module.


Overview

IQ Trignometry APIs


#include "stdint.h"
#include <ti/iqmath/include/IQmathLib.h>
#include "IQmath_mathacl.h"
#include <ti/devices/msp/msp.h>
#include <ti/driverlib/driverlib.h>
#include <ti/driverlib/m0p/dl_core.h>
Include dependency graph for iqTrig.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LOOKUP_POINTS   16
 Number of lookup points.
 
#define DELX_LOOKUP   _IQ(0.25)/(LOOKUP_POINTS - 1)
 Delta lookup.
 
#define INV_DELX_LOOKUP   (int32_t)(((LOOKUP_POINTS - 1) / 0.25))
 Inverted Delta lookup.
 

Functions

int32_t sine_LowPriority (int32_t orig_angle)
 LUT based sine computation.
 
int32_t cosine_LowPriority (int32_t orig_angle)
 LUT based cosine computation. More...
 
void sinCosMATHACLCompute (int_fast32_t orig_angle)
 Configures the MATHACL for sinCos computation and set the angle.
 
__STATIC_INLINE int_fast32_t readMATHACLSin (void)
 Reads and scales the MATHACL register with sine result. More...
 
__STATIC_INLINE int_fast32_t readMATHACLCos (void)
 Reads and scales the MATHACL register with cosine result. More...
 
int32_t sine_LowPrioirty (int32_t orig_angle)
 sine of angle More...
 
int_fast32_t sine (int32_t orig_angle)
 sine of angle More...
 
int_fast32_t cosine (int32_t orig_angle)
 cosine of angle More...
 
int_fast32_t arcTan2 (int_fast32_t iqNInputX, int_fast32_t iqNInputY)
 Finds tan inverse angle. More...
 

Function Documentation

§ cosine_LowPriority()

int32_t cosine_LowPriority ( int32_t  orig_angle)

LUT based cosine computation.

cosine of angle

Parameters
[in]orig_angleAngle input in pu
Returns
Cosine of the angle

References DELX_LOOKUP, INV_DELX_LOOKUP, and LOOKUP_POINTS.

Referenced by readMATHACLCos(), and sine_LowPriority().

§ readMATHACLSin()

__STATIC_INLINE int_fast32_t readMATHACLSin ( void  )

Reads and scales the MATHACL register with sine result.

Returns
Sine of the angle

References GLOBAL_IQ.

Referenced by MC_SinCos(), and sinCosMATHACLCompute().

§ readMATHACLCos()

__STATIC_INLINE int_fast32_t readMATHACLCos ( void  )

Reads and scales the MATHACL register with cosine result.

Returns
Cosine of the angle

References arcTan2(), cosine(), cosine_LowPriority(), GLOBAL_IQ, sine(), and sine_LowPrioirty().

Referenced by MC_SinCos(), and sinCosMATHACLCompute().

§ sine_LowPrioirty()

int32_t sine_LowPrioirty ( int32_t  orig_angle)

sine of angle

Parameters
[in]orig_angleAngle input in pu
Returns
Sine of the angle

Referenced by readMATHACLCos().

§ sine()

int_fast32_t sine ( int32_t  orig_angle)

sine of angle

Parameters
[in]orig_angleAngle input in pu
Returns
Sine of the angle

Referenced by readMATHACLCos(), and sinCosMATHACLCompute().

§ cosine()

int_fast32_t cosine ( int32_t  orig_angle)

cosine of angle

Parameters
[in]orig_angleAngle input in pu
Returns
Cosine of the angle

Referenced by readMATHACLCos(), and sinCosMATHACLCompute().

§ arcTan2()

int_fast32_t arcTan2 ( int_fast32_t  iqNInputX,
int_fast32_t  iqNInputY 
)

Finds tan inverse angle.

Parameters
[in]iqNInputXCosine value of angle
[in]iqNInputYSine value of angle
Returns
Tan inverse angle

References _IQdiv_mathacl, and GLOBAL_IQ.

Referenced by readMATHACLCos().

© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale