MTB CAT1 Peripheral driver library

General Description

Functions

__STATIC_INLINE void Cy_CORDIC_Enable (MXCORDIC_Type *base)
 Enables CORDIC IP. More...
 
__STATIC_INLINE void Cy_CORDIC_Disable (MXCORDIC_Type *base)
 Disables CORDIC IP. More...
 
__STATIC_INLINE bool Cy_CORDIC_IsBusy (MXCORDIC_Type *base)
 Checks if there is any computation is currently in progress. More...
 
__STATIC_INLINE void Cy_CORDIC_CosNB (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Cosine for the given angle in radians. More...
 
__STATIC_INLINE void Cy_CORDIC_SinNB (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Sine for the given angle in radians. More...
 
__STATIC_INLINE void Cy_CORDIC_TanNB (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Tangent for the given angle in radians. More...
 
__STATIC_INLINE void Cy_CORDIC_ArcTanNB (MXCORDIC_Type *base, CY_CORDIC_8Q23_t x, CY_CORDIC_8Q23_t y)
 Computes the Arc Tangent for the given value (y/x). More...
 
__STATIC_INLINE void Cy_CORDIC_CoshNB (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Hyperbolic Cosine for the given angle in radians. More...
 
__STATIC_INLINE void Cy_CORDIC_SinhNB (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Hyperbolic Sine for the given angle in radians. More...
 
__STATIC_INLINE void Cy_CORDIC_TanhNB (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Hyperbolic Tangent for the given angle in radians. More...
 
__STATIC_INLINE void Cy_CORDIC_ArcTanhNB (MXCORDIC_Type *base, CY_CORDIC_8Q23_t x, CY_CORDIC_8Q23_t y)
 Computes the Hyperbolic Arc Tangent for the given value (y/x). More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetCosResult (MXCORDIC_Type *base)
 Returns the result of Cosine operation. More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetSinResult (MXCORDIC_Type *base)
 Returns the result of Sine operation. More...
 
__STATIC_INLINE CY_CORDIC_20Q11_t Cy_CORDIC_GetTanResult (MXCORDIC_Type *base)
 Returns the result of Tangent operation. More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetArcTanResult (MXCORDIC_Type *base)
 Returns the result of Arc Tangent operation. More...
 
__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_GetCoshResult (MXCORDIC_Type *base)
 Returns the result of Hyperbolic Cosine operation. More...
 
__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_GetSinhResult (MXCORDIC_Type *base)
 Returns the result of Hyperbolic Sine operation. More...
 
__STATIC_INLINE CY_CORDIC_20Q11_t Cy_CORDIC_GetTanhResult (MXCORDIC_Type *base)
 Returns the result of Hyperbolic Tangent operation. More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetArcTanhResult (MXCORDIC_Type *base)
 Returns the result of Hyperbolic Arc Tangent operation. More...
 
__STATIC_INLINE void Cy_CORDIC_ParkTransformNB (MXCORDIC_Type *base, CY_CORDIC_Q31_t Vref_AngleQ31, CY_CORDIC_Q31_t I_Alpha_1Q31, CY_CORDIC_Q31_t I_Beta_1Q31)
 Computes the Park Transform. More...
 
__STATIC_INLINE void Cy_CORDIC_GetParkResult (MXCORDIC_Type *base, cy_stc_cordic_parkTransform_result_t *ptr)
 Returns Park Transform results. More...
 
__STATIC_INLINE void Cy_CORDIC_ClearZ (MXCORDIC_Type *base)
 Clears the CORDIC Z Data register. More...
 
__STATIC_INLINE void Cy_CORDIC_SetMode (MXCORDIC_Type *base, cy_en_cordic_operating_mode_t opmode, cy_en_cordic_rotvec_mode_t rotvec)
 Configures the operating modes. More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_Cos (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Cosine for the given angle in radians. More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_Sin (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Sine for the given angle in radians. More...
 
CY_CORDIC_20Q11_t Cy_CORDIC_Tan (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Tangent for the given angle in radians. More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_ArcTan (MXCORDIC_Type *base, CY_CORDIC_8Q23_t x, CY_CORDIC_8Q23_t y)
 Computes the Arc Tangent for the given value (y/x). More...
 
__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_Cosh (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Hyperbolic Cosine for the given angle in radians. More...
 
__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_Sinh (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Hyperbolic Hyperbolic Sine for the given angle in radians. More...
 
CY_CORDIC_20Q11_t Cy_CORDIC_Tanh (MXCORDIC_Type *base, CY_CORDIC_Q31_t angle_in_radians)
 Computes the Hyperbolic Tangent for the given angle in radians. More...
 
__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_ArcTanh (MXCORDIC_Type *base, CY_CORDIC_8Q23_t x, CY_CORDIC_8Q23_t y)
 Computes the Hyperbolic Arc Tangent for the given value (y/x). More...
 
uint32_t Cy_CORDIC_Sqrt (MXCORDIC_Type *base, uint32_t x)
 Computes the Square root of the given value. More...
 
__STATIC_INLINE uint32_t Cy_CORDIC_GetInterruptStatus (MXCORDIC_Type *base)
 Returns the interrupt cause register. More...
 
__STATIC_INLINE void Cy_CORDIC_ClearInterrupt (MXCORDIC_Type *base, uint32_t interruptMask)
 Clears the interrupt sources in the interrupt cause register. More...
 
__STATIC_INLINE void Cy_CORDIC_SetInterrupt (MXCORDIC_Type *base, uint32_t interruptMask)
 Sets the interrupt sources in the interrupt set register. More...
 
__STATIC_INLINE uint32_t Cy_CORDIC_GetInterruptMask (MXCORDIC_Type *base)
 Returns the interrupt mask register. More...
 
__STATIC_INLINE void Cy_CORDIC_SetInterruptMask (MXCORDIC_Type *base, uint32_t interruptMask)
 Writes interrupt mask register. More...
 
__STATIC_INLINE uint32_t Cy_CORDIC_GetInterruptStatusMasked (MXCORDIC_Type *base)
 Returns the interrupt masked register. More...
 
void Cy_CORDIC_Interrupt (MXCORDIC_Type *base, cy_stc_cordic_context_t *context)
 CORDIC Interrupt Service Routine. More...
 
__STATIC_INLINE void Cy_CORDIC_RegisterCallback (MXCORDIC_Type *base, cy_cb_cordic_handle_events_t callback, cy_stc_cordic_context_t *context)
 Registers a callback function that notifies that CORDIC Callback Events occurred in the Cy_CORDIC_Interrupt. More...
 

Function Documentation

◆ Cy_CORDIC_Enable()

__STATIC_INLINE void Cy_CORDIC_Enable ( MXCORDIC_Type *  base)

Enables CORDIC IP.

Parameters
baseThe pointer to the CORDIC instance.

◆ Cy_CORDIC_Disable()

__STATIC_INLINE void Cy_CORDIC_Disable ( MXCORDIC_Type *  base)

Disables CORDIC IP.

Parameters
baseThe pointer to the CORDIC instance.

◆ Cy_CORDIC_IsBusy()

__STATIC_INLINE bool Cy_CORDIC_IsBusy ( MXCORDIC_Type *  base)

Checks if there is any computation is currently in progress.

Parameters
baseThe pointer to the CORDIC instance.
Returns
true: calculation in progress false: no calculation in progress

◆ Cy_CORDIC_CosNB()

__STATIC_INLINE void Cy_CORDIC_CosNB ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Cosine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Note
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In circular function, |angle_in_radians| is less than or equal to integer value representing 1.74 radians
This is a non-blocking function. Cy_CORDIC_GetCosResult should be called to obtain the result.

◆ Cy_CORDIC_SinNB()

__STATIC_INLINE void Cy_CORDIC_SinNB ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Sine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Note
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In circular function, |angle_in_radians| is less than or equal to integer value representing 1.74 radians
This is a non-blocking function. Cy_CORDIC_GetSinResult should be called to obtain the result.

◆ Cy_CORDIC_TanNB()

__STATIC_INLINE void Cy_CORDIC_TanNB ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Tangent for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Note
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In circular function, |angle_in_radians| is less than or equal to integer value representing 1.74 radians
This is a non-blocking function. Cy_CORDIC_GetTanResult should be called to obtain the result.

◆ Cy_CORDIC_ArcTanNB()

__STATIC_INLINE void Cy_CORDIC_ArcTanNB ( MXCORDIC_Type *  base,
CY_CORDIC_8Q23_t  x,
CY_CORDIC_8Q23_t  y 
)

Computes the Arc Tangent for the given value (y/x).

Parameters
baseThe pointer to the CORDIC instance.
yThe numerator value.
xThe denominator value.
Note
  • The input parameters x and y should be left shifted by 8 bits: x = x << 8; y = y << 8;
  • This is a non-blocking function.
  • Cy_CORDIC_GetArcTanResult should be called to obtain the result.

◆ Cy_CORDIC_CoshNB()

__STATIC_INLINE void Cy_CORDIC_CoshNB ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Hyperbolic Cosine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Note
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In hyperbolic function, |angle_in_radians| is less than or equal to integer value representing 1.11 radians
This is a non-blocking function. Cy_CORDIC_GetCoshResult should be called to obtain the result.

◆ Cy_CORDIC_SinhNB()

__STATIC_INLINE void Cy_CORDIC_SinhNB ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Hyperbolic Sine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Note
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In hyperbolic function, |angle_in_radians| is less than or equal to integer value representing 1.11 radians
This is a non-blocking function. Cy_CORDIC_GetSinhResult should be called to obtain the result.

◆ Cy_CORDIC_TanhNB()

__STATIC_INLINE void Cy_CORDIC_TanhNB ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Hyperbolic Tangent for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Note
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In hyperbolic function, |angle_in_radians| is less than or equal to integer value representing 1.11 radians
This is a non-blocking function. Cy_CORDIC_GetTanhResult should be called to obtain the result.

◆ Cy_CORDIC_ArcTanhNB()

__STATIC_INLINE void Cy_CORDIC_ArcTanhNB ( MXCORDIC_Type *  base,
CY_CORDIC_8Q23_t  x,
CY_CORDIC_8Q23_t  y 
)

Computes the Hyperbolic Arc Tangent for the given value (y/x).

Parameters
baseThe pointer to the CORDIC instance.
yThe numerator value.
xThe denominator value.
Note
The input parameters x and y should be left shifted by 8 bits: x = x << 8; y = y << 8; This is a non-blocking function. Cy_CORDIC_GetArcTanhResult should be called to obtain the result.

◆ Cy_CORDIC_GetCosResult()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetCosResult ( MXCORDIC_Type *  base)

Returns the result of Cosine operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_Q31_t
Note
The result should be scaled: (((result) >> 8) / (2^23))

◆ Cy_CORDIC_GetSinResult()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetSinResult ( MXCORDIC_Type *  base)

Returns the result of Sine operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_Q31_t
Note
The result should be scaled: (((result) >> 8) / (2^23))

◆ Cy_CORDIC_GetTanResult()

__STATIC_INLINE CY_CORDIC_20Q11_t Cy_CORDIC_GetTanResult ( MXCORDIC_Type *  base)

Returns the result of Tangent operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_20Q11_t
Note
The result should be scaled: ((result) / (2^11))

◆ Cy_CORDIC_GetArcTanResult()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetArcTanResult ( MXCORDIC_Type *  base)

Returns the result of Arc Tangent operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_Q31_t
Note
The result should be scaled: ((result >> 8) * (pi / (2^23)))

◆ Cy_CORDIC_GetCoshResult()

__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_GetCoshResult ( MXCORDIC_Type *  base)

Returns the result of Hyperbolic Cosine operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_1Q30_t
Note
The result should be scaled: (((result) >> 8) / (2^22))

◆ Cy_CORDIC_GetSinhResult()

__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_GetSinhResult ( MXCORDIC_Type *  base)

Returns the result of Hyperbolic Sine operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_1Q30_t
Note
The result should be scaled: (((result) >> 8) / (2^22))

◆ Cy_CORDIC_GetTanhResult()

__STATIC_INLINE CY_CORDIC_20Q11_t Cy_CORDIC_GetTanhResult ( MXCORDIC_Type *  base)

Returns the result of Hyperbolic Tangent operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_20Q11_t
Note
The result should be scaled: ((result) / (2^11))

◆ Cy_CORDIC_GetArcTanhResult()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_GetArcTanhResult ( MXCORDIC_Type *  base)

Returns the result of Hyperbolic Arc Tangent operation.

Parameters
baseThe pointer to the CORDIC instance.
Returns
CY_CORDIC_1Q30_t
Note
The result should be scaled: ((result >> 8) * (pi / (2^23)))

◆ Cy_CORDIC_ParkTransformNB()

__STATIC_INLINE void Cy_CORDIC_ParkTransformNB ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  Vref_AngleQ31,
CY_CORDIC_Q31_t  I_Alpha_1Q31,
CY_CORDIC_Q31_t  I_Beta_1Q31 
)

Computes the Park Transform.

Parameters
baseThe pointer to the CORDIC instance.
Vref_AngleQ31The rotor angle value in radians.
I_Alpha_1Q31The current I_Alpha value.
I_Beta_1Q31The current I_Beta value.
Note
  • This is a non-blocking function.
  • The input parameters should be scaled as: ((I_Alpha_1Q31 * 0x800000) << 8); ((I_Beta_1Q31 * 0x800000) << 8); ((angle_in_radians * ((2^23) / pi)) << 8)
  • Cy_CORDIC_GetParkResult should be called to obtain the result.

◆ Cy_CORDIC_GetParkResult()

__STATIC_INLINE void Cy_CORDIC_GetParkResult ( MXCORDIC_Type *  base,
cy_stc_cordic_parkTransform_result_t ptr 
)

Returns Park Transform results.

Parameters
baseThe pointer to the CORDIC instance.
ptrThe pointer to the computed values of Park Transform.
Note
The result should be scaled as: ((float32_t)ptr.x /(float32_t)(2^23 - 1))

◆ Cy_CORDIC_ClearZ()

__STATIC_INLINE void Cy_CORDIC_ClearZ ( MXCORDIC_Type *  base)

Clears the CORDIC Z Data register.

Parameters
baseThe pointer to the CORDIC instance.

◆ Cy_CORDIC_SetMode()

__STATIC_INLINE void Cy_CORDIC_SetMode ( MXCORDIC_Type *  base,
cy_en_cordic_operating_mode_t  opmode,
cy_en_cordic_rotvec_mode_t  rotvec 
)

Configures the operating modes.

Parameters
baseThe pointer to the CORDIC instance.
opmodeSpecifies the Circular/Hyperbolic/Linear mode.
rotvecSpecifies the Rotation/Vectoring mode.

◆ Cy_CORDIC_Cos()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_Cos ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Cosine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Returns
The computed Cosine value. CY_CORDIC_Q31_t
Note
  • This is a blocking function.
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In circular function, |angle_in_radians| is less than or equal to integer value representing 1.74 radians
  • The result should be scaled- as: (((result) >> 8) / (2^23)

◆ Cy_CORDIC_Sin()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_Sin ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Sine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Returns
The computed Sine value. CY_CORDIC_Q31_t
Note
  • This is a blocking function.
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In circular function, |angle_in_radians| is less than or equal to integer value representing 1.74 radians
  • The result should be scaled as: (((result) >> 8) / (2^23)

◆ Cy_CORDIC_Tan()

CY_CORDIC_20Q11_t Cy_CORDIC_Tan ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Tangent for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Returns
The computed Tangent value. CY_CORDIC_20Q11_t
Note
  • This is a blocking function.
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In circular function, |angle_in_radians| is less than or equal to integer value representing 1.74 radians
  • The result should be scaled as: ((result) / (2^11))

◆ Cy_CORDIC_ArcTan()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_ArcTan ( MXCORDIC_Type *  base,
CY_CORDIC_8Q23_t  x,
CY_CORDIC_8Q23_t  y 
)

Computes the Arc Tangent for the given value (y/x).

Parameters
baseThe pointer to the CORDIC instance.
yThe numerator value.
xThe denominator value.
Returns
The computed Arc Tangent value. CY_CORDIC_Q31_t
Note
  • This is a blocking function.
  • The input parameters x and y should be left shifted by 8 bits: x = x << 8; y = y << 8;
  • The result should be scaled as: ((result >> 8) * (pi / (2^23)))

◆ Cy_CORDIC_Cosh()

__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_Cosh ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Hyperbolic Cosine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Returns
The computed Hyperbolic Cosine value. CY_CORDIC_1Q30_t
Note
  • This is a blocking function.
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In hyperbolic function, |angle_in_radians| is less than or equal to integer value representing 1.11 radians
  • The result should be scaled as: (((result) >> 8) / (2^22)

◆ Cy_CORDIC_Sinh()

__STATIC_INLINE CY_CORDIC_1Q30_t Cy_CORDIC_Sinh ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Hyperbolic Hyperbolic Sine for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Returns
The computed Hyperbolic Sine value. CY_CORDIC_1Q30_t
Note
  • This is a blocking function.
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In hyperbolic function, |angle_in_radians| is less than or equal to integer value representing 1.11 radians
  • The result should be scaled as: (((result) >> 8) / (2^22)

◆ Cy_CORDIC_Tanh()

CY_CORDIC_20Q11_t Cy_CORDIC_Tanh ( MXCORDIC_Type *  base,
CY_CORDIC_Q31_t  angle_in_radians 
)

Computes the Hyperbolic Tangent for the given angle in radians.

Parameters
baseThe pointer to the CORDIC instance.
angle_in_radiansThe angle in radians.
Returns
The computed Hyperbolic Tangent value. CY_CORDIC_20Q11_t
Note
  • This is a blocking function.
  • The input angle should be mapped to the integer value using: angle_in_radians = ((angle * ((2^23)/pi)) << 8)
  • In hyperbolic function, |angle_in_radians| is less than or equal to integer value representing 1.11 radians
  • The result should be scaled as: ((result) / (2^11))

◆ Cy_CORDIC_ArcTanh()

__STATIC_INLINE CY_CORDIC_Q31_t Cy_CORDIC_ArcTanh ( MXCORDIC_Type *  base,
CY_CORDIC_8Q23_t  x,
CY_CORDIC_8Q23_t  y 
)

Computes the Hyperbolic Arc Tangent for the given value (y/x).

Parameters
baseThe pointer to the CORDIC instance.
yThe numerator value.
xThe denominator value.
Returns
The computed Hyperbolic Arc Tangent value. CY_CORDIC_Q31_t
Note
  • The input parameters x and y should be left shifted by 8 bits: x = x << 8; y = y << 8;
  • This is a blocking function.
  • The result should be scaled as: ((result >> 8) * (pi / (2^23)))

◆ Cy_CORDIC_Sqrt()

uint32_t Cy_CORDIC_Sqrt ( MXCORDIC_Type *  base,
uint32_t  x 
)

Computes the Square root of the given value.

Parameters
baseThe pointer to the CORDIC instance.
xThe input value.
Returns
Square root of the given value.
Note
  • This is a blocking function.
  • The input parameter x of type float should be converted to Q31: (x * 0x80000000) + 0.5F
  • The result should be scaled from Q31 to float : (*result / 0x80000000)

Computes the Square root of the given value.

◆ Cy_CORDIC_GetInterruptStatus()

__STATIC_INLINE uint32_t Cy_CORDIC_GetInterruptStatus ( MXCORDIC_Type *  base)

Returns the interrupt cause register.

Parameters
baseThe pointer to the CORDIC instance.
Returns
The current status of the interrupt sources. Each constant is a bit field value. The value returned may have multiple bits set to indicate the current status.

◆ Cy_CORDIC_ClearInterrupt()

__STATIC_INLINE void Cy_CORDIC_ClearInterrupt ( MXCORDIC_Type *  base,
uint32_t  interruptMask 
)

Clears the interrupt sources in the interrupt cause register.

Parameters
baseThe pointer to the CORDIC instance.
interruptMaskThe interrupt sources to be cleared.

◆ Cy_CORDIC_SetInterrupt()

__STATIC_INLINE void Cy_CORDIC_SetInterrupt ( MXCORDIC_Type *  base,
uint32_t  interruptMask 
)

Sets the interrupt sources in the interrupt set register.

Parameters
baseThe pointer to the CORDIC instance.
interruptMaskThe interrupt sources to set in the interrupt set register.

◆ Cy_CORDIC_GetInterruptMask()

__STATIC_INLINE uint32_t Cy_CORDIC_GetInterruptMask ( MXCORDIC_Type *  base)

Returns the interrupt mask register.

This register specifies which bits from the interrupt cause register can trigger an interrupt event.

Parameters
baseThe pointer to the CORDIC instance.
Returns
Enabled interrupt sources.

◆ Cy_CORDIC_SetInterruptMask()

__STATIC_INLINE void Cy_CORDIC_SetInterruptMask ( MXCORDIC_Type *  base,
uint32_t  interruptMask 
)

Writes interrupt mask register.

This register specifies which bits from the interrupt cause register can trigger an interrupt event.

Parameters
baseThe pointer to the CORDIC instance.
interruptMaskThe interrupt sources to set in the interrupt set register.

◆ Cy_CORDIC_GetInterruptStatusMasked()

__STATIC_INLINE uint32_t Cy_CORDIC_GetInterruptStatusMasked ( MXCORDIC_Type *  base)

Returns the interrupt masked register.

This register contains a logical AND of corresponding bits from the interrupt cause and mask registers. This function is intended to be used in the interrupt service routine to identify which of enabled interrupt sources caused the interrupt event.

Parameters
baseThe pointer to the CORDIC instance.
Returns
The current status of enabled interrupt sources.

◆ Cy_CORDIC_Interrupt()

void Cy_CORDIC_Interrupt ( MXCORDIC_Type *  base,
cy_stc_cordic_context_t context 
)

CORDIC Interrupt Service Routine.

Parameters
*baseThe pointer to a CAN FD instance.
contextThe pointer to the context structure cy_stc_cordic_context_t allocated by the user. The structure is used during the CORDIC operation for internal configuration. The user must not modify anything in this structure.

◆ Cy_CORDIC_RegisterCallback()

__STATIC_INLINE void Cy_CORDIC_RegisterCallback ( MXCORDIC_Type *  base,
cy_cb_cordic_handle_events_t  callback,
cy_stc_cordic_context_t context 
)

Registers a callback function that notifies that CORDIC Callback Events occurred in the Cy_CORDIC_Interrupt.

Parameters
baseThe pointer to the CORDIC instance.
callbackThe pointer to a callback function. See cy_cb_cordic_handle_events_t for the function prototype.
contextThe pointer to context structure cy_stc_cordic_context_t allocated by the user. The structure is used during the CORDIC operation for internal configuration. The user should not modify anything in this structure.
Note
To remove the callback, pass NULL as the pointer to a callback function.