Infineon MOTIX™ MCU TLE985x Device Family SDK
Enumerations | Functions
mathdiv.h File Reference

Go to the source code of this file.

Detailed Description

MATH DIV low level access library.

Version
V0.2.5
Date
28. Aug 2023
Note
This file violates [MISRA 2012 Rule 11.1, required], [MISRA 2012 Rule 11.4, advisory], [MISRA 2012 Rule 11.6, required]

Include Graph

Include dependency graph for mathdiv.h:

Enumerations

enum  TMath_Sus_Cfg { Ch_MATH_Sus_Off = 0u , Ch_MATH_Sus_Hard = 1u , Ch_MATH_Sus_Soft = 2u }
 This enum lists the MATH Suspend Mode. More...
 
enum  TMath_Chain_Cfg { Ch_MATH_Chain_Off = 0u , Ch_MATH_Chain_QUOT = 1u , Ch_MATH_Chain_RMD = 2u }
 This enum lists the MATH Chain Configuration. More...
 
enum  TMath_DIVMode_Cfg { Ch_MATH_DIVMode_32_32 = 0u , Ch_MATH_DIVMode_32_16 = 1u , Ch_MATH_DIVMode_16_16 = 2u }
 This enum lists the MATH Division Configuation. More...
 
enum  TMath_STMode_Cfg { Ch_MATH_STMode_Auto = 0u , Ch_MATH_STMode_Manual = 1u }
 This enum lists the MATH Start MOde Configuation. More...
 

Functions

void MATH_Init (void)
 Initializes the math divider module. More...
 
INLINE void MATH_DIV_START (void)
 Starts the division operation. More...
 
INLINE uint8 MATH_BSY_Sts (void)
 Reads the Busy Indication. More...
 
INLINE void MATH_DIVEOC_Int_Clr (void)
 Clears the Divider End of Calculation Event Flag. More...
 
INLINE void MATH_DIVERR_Int_Clr (void)
 Clears the Divider Error Event Flag. More...
 
INLINE void MATH_DIVEOC_Int_En (void)
 Enables the Divider End of Calculation Interrupt. More...
 
INLINE void MATH_DIVEOC_Int_Dis (void)
 Disables the Divider End of Calculation Interrupt. More...
 
INLINE void MATH_DIVERR_Int_En (void)
 Enables the Divider Error Interrupt. More...
 
INLINE void MATH_DIVERR_Int_Dis (void)
 Disables the Divider Error Interrupt. More...
 
INLINE void MATH_Suspend_Conf (TMath_Sus_Cfg MATH_SUS_Cfg)
 Sets the Suspend Configuration. More...
 
INLINE void MATH_DVS_Chain (TMath_Chain_Cfg MATH_CHAIN_Cfg)
 Sets the Divisor Chaining. More...
 
INLINE void MATH_DVD_Chain (TMath_Chain_Cfg MATH_CHAIN_Cfg)
 Sets the Dividend Chaining. More...
 
INLINE void MATH_DVS_Set (uint32 VALUE)
 Sets the Divisor Value. More...
 
INLINE void MATH_DVD_Set (uint32 VALUE)
 Sets the Dividend Value. More...
 
INLINE uint32 MATH_DVS_Read (void)
 Reads the Divisor Value. More...
 
INLINE uint32 MATH_DVD_Read (void)
 Reads the Dividend Value. More...
 
INLINE uint32 MATH_QUOT_Read (void)
 Reads the Quotient Value. More...
 
INLINE uint32 MATH_RMD_Read (void)
 Reads the Remainder Value. More...
 
INLINE void MATH_DIVMODE_Set (TMath_DIVMode_Cfg MATH_DIVMODE_Cfg)
 Sets the Division Mode. More...
 
INLINE void MATH_STMODE_Set (TMath_STMode_Cfg MATH_STMODE_Cfg)
 Sets the Start Mode. More...
 
INLINE uint8 MATH_DIVMODE_Read (void)
 Reads the Division Mode. More...
 
INLINE uint8 MATH_STMODE_Read (void)
 Reads the Start Mode. More...
 

Enumeration Type Documentation

◆ TMath_Chain_Cfg

This enum lists the MATH Chain Configuration.

Enumerator
Ch_MATH_Chain_Off 

No result chaining is selected

Ch_MATH_Chain_QUOT 

QUOT register is the selected source

Ch_MATH_Chain_RMD 

RMD register is the selected source

◆ TMath_DIVMode_Cfg

This enum lists the MATH Division Configuation.

Enumerator
Ch_MATH_DIVMode_32_32 

32-bit divide by 32-bit

Ch_MATH_DIVMode_32_16 

32-bit divide by 16-bit

Ch_MATH_DIVMode_16_16 

16-bit divide by 16-bit

◆ TMath_STMode_Cfg

This enum lists the MATH Start MOde Configuation.

Enumerator
Ch_MATH_STMode_Auto 

Start Automatically

Ch_MATH_STMode_Manual 

Start Manually

◆ TMath_Sus_Cfg

This enum lists the MATH Suspend Mode.

Enumerator
Ch_MATH_Sus_Off 

Suspend disabled

Ch_MATH_Sus_Hard 

Hard Suspend

Ch_MATH_Sus_Soft 

Soft Suspend

Function Documentation

◆ MATH_BSY_Sts()

INLINE uint8 MATH_BSY_Sts ( void  )

Reads the Busy Indication.

Returns
Busy Indication

Example

This example waits until finishing the division operation.

void Example_Function(void)
{
while (MATH_BSY_Sts() == 1u);
{
}
}
INLINE uint8 MATH_BSY_Sts(void)
Reads the Busy Indication.
Definition: mathdiv.h:569
INLINE void MATH_DIV_START(void)
Starts the division operation.
Definition: mathdiv.h:564

◆ MATH_DIV_START()

INLINE void MATH_DIV_START ( void  )

Starts the division operation.

Example

This example starts the calculation of the division operation when it is configured manually.

void Example_Function(void)
{
}
@ Ch_MATH_STMode_Manual
Start Manually
Definition: mathdiv.h:111
INLINE void MATH_STMODE_Set(TMath_STMode_Cfg MATH_STMODE_Cfg)
Sets the Start Mode.
Definition: mathdiv.h:654

◆ MATH_DIVEOC_Int_Clr()

INLINE void MATH_DIVEOC_Int_Clr ( void  )

Clears the Divider End of Calculation Event Flag.

Example

This example treats the Divider End of Calculation Interrupt.

void Example_Function(void)
{
if ((uint8)MATH->EVFR.bit.DIVEOC == (uint8)1)
{
MATH_DIVEOC_CALLBACK();
}
}
#define MATH
Definition: tle985x.h:6273
INLINE void MATH_DIVEOC_Int_En(void)
Enables the Divider End of Calculation Interrupt.
Definition: mathdiv.h:584
INLINE void MATH_DIVEOC_Int_Clr(void)
Clears the Divider End of Calculation Event Flag.
Definition: mathdiv.h:574
uint8_t uint8
8 bit unsigned value
Definition: types.h:153

◆ MATH_DIVEOC_Int_Dis()

INLINE void MATH_DIVEOC_Int_Dis ( void  )

Disables the Divider End of Calculation Interrupt.

Example

This example treats the Divider End of Calculation Interrupt.

void Example_Function(void)
{
if ((uint8)MATH->EVFR.bit.DIVEOC == (uint8)1)
{
MATH_DIVEOC_CALLBACK();
}
}
INLINE void MATH_DIVEOC_Int_Dis(void)
Disables the Divider End of Calculation Interrupt.
Definition: mathdiv.h:589

◆ MATH_DIVEOC_Int_En()

INLINE void MATH_DIVEOC_Int_En ( void  )

Enables the Divider End of Calculation Interrupt.

Example

This example treats the Divider End of Calculation Interrupt.

void Example_Function(void)
{
if ((uint8)MATH->EVFR.bit.DIVEOC == (uint8)1)
{
MATH_DIVEOC_CALLBACK();
}
}

◆ MATH_DIVERR_Int_Clr()

INLINE void MATH_DIVERR_Int_Clr ( void  )

Clears the Divider Error Event Flag.

Example

This example treats the Divider Error Interrupt.

void Example_Function(void)
{
if ((uint8)MATH->EVFR.bit.DIVERR == (uint8)1)
{
MATH_DIVERR_CALLBACK();
}
}
INLINE void MATH_DIVERR_Int_En(void)
Enables the Divider Error Interrupt.
Definition: mathdiv.h:594
INLINE void MATH_DIVERR_Int_Clr(void)
Clears the Divider Error Event Flag.
Definition: mathdiv.h:579

◆ MATH_DIVERR_Int_Dis()

INLINE void MATH_DIVERR_Int_Dis ( void  )

Disables the Divider Error Interrupt.

Example

This example treats the Divider Error Interrupt.

void Example_Function(void)
{
if ((uint8)MATH->EVFR.bit.DIVERR == (uint8)1)
{
MATH_DIVERR_CALLBACK();
}
}
INLINE void MATH_DIVERR_Int_Dis(void)
Disables the Divider Error Interrupt.
Definition: mathdiv.h:599

◆ MATH_DIVERR_Int_En()

INLINE void MATH_DIVERR_Int_En ( void  )

Enables the Divider Error Interrupt.

Example

This example treats the Divider Error Interrupt.

void Example_Function(void)
{
if ((uint8)MATH->EVFR.bit.DIVERR == (uint8)1)
{
MATH_DIVERR_CALLBACK();
}
}

◆ MATH_DIVMODE_Read()

INLINE uint8 MATH_DIVMODE_Read ( void  )

Reads the Division Mode.

Returns
Division Mode

Example

This example reads the Division Mode.

void Example_Function(void)
{
uint8 sts;
}
INLINE uint8 MATH_DIVMODE_Read(void)
Reads the Division Mode.
Definition: mathdiv.h:659

◆ MATH_DIVMODE_Set()

INLINE void MATH_DIVMODE_Set ( TMath_DIVMode_Cfg  MATH_DIVMODE_Cfg)

Sets the Division Mode.

Parameters
MATH_DIVMODE_CfgMATH Division Mode Configuration, see TMath_DIVMode_Cfg

Example

This example selects the the 16-16 Division Mode.

void Example_Function(void)
{
}
@ Ch_MATH_DIVMode_16_16
16-bit divide by 16-bit
Definition: mathdiv.h:102
INLINE void MATH_DIVMODE_Set(TMath_DIVMode_Cfg MATH_DIVMODE_Cfg)
Sets the Division Mode.
Definition: mathdiv.h:649

◆ MATH_DVD_Chain()

INLINE void MATH_DVD_Chain ( TMath_Chain_Cfg  MATH_CHAIN_Cfg)

Sets the Dividend Chaining.

Parameters
MATH_CHAIN_CfgMATH Divisor Chaining Configuration, see TMath_Chain_Cfg

Example

This example selects the RMD register as Dividend Register Result Chaining.

void Example_Function(void)
{
}
INLINE void MATH_DVD_Chain(TMath_Chain_Cfg MATH_CHAIN_Cfg)
Sets the Dividend Chaining.
Definition: mathdiv.h:614
@ Ch_MATH_Chain_RMD
RMD register is the selected source
Definition: mathdiv.h:92

◆ MATH_DVD_Read()

INLINE uint32 MATH_DVD_Read ( void  )

Reads the Dividend Value.

Returns
Dividend Value

Example

This example configures DVD and DVS to calculate the division operation 25/5 and checks the QUOT and RMD values.

void Example_Function(void)
{
while (MATH_DVS_Read() != 25)
{
}
while (MATH_DVD_Read() != 5)
{
}
if ((MATH_QUOT_Read() == 5) && (MATH_RMD_Read() == 0));
{
//Correct QUOT and RMD values
}
}
INLINE uint32 MATH_DVS_Read(void)
Reads the Divisor Value.
Definition: mathdiv.h:629
INLINE uint32 MATH_QUOT_Read(void)
Reads the Quotient Value.
Definition: mathdiv.h:639
INLINE void MATH_DVD_Set(uint32 VALUE)
Sets the Dividend Value.
Definition: mathdiv.h:624
INLINE uint32 MATH_DVD_Read(void)
Reads the Dividend Value.
Definition: mathdiv.h:634
INLINE void MATH_DVS_Set(uint32 VALUE)
Sets the Divisor Value.
Definition: mathdiv.h:619
INLINE uint32 MATH_RMD_Read(void)
Reads the Remainder Value.
Definition: mathdiv.h:644

◆ MATH_DVD_Set()

INLINE void MATH_DVD_Set ( uint32  VALUE)

Sets the Dividend Value.

Parameters
VALUEDividend Value

Example

This example configures DVD and DVS to calculate the division operation 25/5 and checks the QUOT and RMD values.

void Example_Function(void)
{
while (MATH_DVS_Read() != 25)
{
}
while (MATH_DVD_Read() != 5)
{
}
if ((MATH_QUOT_Read() == 5) && (MATH_RMD_Read() == 0));
{
//Correct QUOT and RMD values
}
}

◆ MATH_DVS_Chain()

INLINE void MATH_DVS_Chain ( TMath_Chain_Cfg  MATH_CHAIN_Cfg)

Sets the Divisor Chaining.

Parameters
MATH_CHAIN_CfgMATH Divisor Chaining Configuration, see TMath_Chain_Cfg

Example

This example selects the QUOT register as Divisor Register Result Chaining.

void Example_Function(void)
{
}
@ Ch_MATH_Chain_QUOT
QUOT register is the selected source
Definition: mathdiv.h:91
INLINE void MATH_DVS_Chain(TMath_Chain_Cfg MATH_CHAIN_Cfg)
Sets the Divisor Chaining.
Definition: mathdiv.h:609

◆ MATH_DVS_Read()

INLINE uint32 MATH_DVS_Read ( void  )

Reads the Divisor Value.

Returns
Divisor Value

Example

This example configures DVD and DVS to calculate the division operation 25/5 and checks the QUOT and RMD values.

void Example_Function(void)
{
while (MATH_DVS_Read() != 25)
{
}
while (MATH_DVD_Read() != 5)
{
}
if ((MATH_QUOT_Read() == 5) && (MATH_RMD_Read() == 0));
{
//Correct QUOT and RMD values
}
}

◆ MATH_DVS_Set()

INLINE void MATH_DVS_Set ( uint32  VALUE)

Sets the Divisor Value.

Parameters
VALUEDivisor Value

Example

This example configures DVD and DVS to calculate the division operation 25/5 and checks the QUOT and RMD values.

void Example_Function(void)
{
while (MATH_DVS_Read() != 25)
{
}
while (MATH_DVD_Read() != 5)
{
}
if ((MATH_QUOT_Read() == 5) && (MATH_RMD_Read() == 0));
{
//Correct QUOT and RMD values
}
}

◆ MATH_Init()

void MATH_Init ( void  )

Initializes the math divider module.

◆ MATH_QUOT_Read()

INLINE uint32 MATH_QUOT_Read ( void  )

Reads the Quotient Value.

Returns
Quotient Value

Example

This example configures DVD and DVS to calculate the division operation 25/5 and checks the QUOT and RMD values.

void Example_Function(void)
{
while (MATH_DVS_Read() != 25)
{
}
while (MATH_DVD_Read() != 5)
{
}
if ((MATH_QUOT_Read() == 5) && (MATH_RMD_Read() == 0));
{
//Correct QUOT and RMD values
}
}

◆ MATH_RMD_Read()

INLINE uint32 MATH_RMD_Read ( void  )

Reads the Remainder Value.

Returns
Remainder Value

Example

This example configures DVD and DVS to calculate the division operation 25/5 and checks the QUOT and RMD values.

void Example_Function(void)
{
while (MATH_DVS_Read() != 25)
{
}
while (MATH_DVD_Read() != 5)
{
}
if ((MATH_QUOT_Read() == 5) && (MATH_RMD_Read() == 0));
{
//Correct QUOT and RMD values
}
}

◆ MATH_STMODE_Read()

INLINE uint8 MATH_STMODE_Read ( void  )

Reads the Start Mode.

Returns
Start Mode

Example

This example starts the calculation of the division operation when it is configured manually.

void Example_Function(void)
{
while (MATH_STMODE_Read() != 1)
{
}
}
INLINE uint8 MATH_STMODE_Read(void)
Reads the Start Mode.
Definition: mathdiv.h:664

◆ MATH_STMODE_Set()

INLINE void MATH_STMODE_Set ( TMath_STMode_Cfg  MATH_STMODE_Cfg)

Sets the Start Mode.

Parameters
MATH_STMODE_CfgMATH Start Mode Configuration, see TMath_STMode_Cfg

Example

This example starts the calculation of the division operation when it is configured manually.

void Example_Function(void)
{
while (MATH_STMODE_Read() != 1)
{
}
}

◆ MATH_Suspend_Conf()

INLINE void MATH_Suspend_Conf ( TMath_Sus_Cfg  MATH_SUS_Cfg)

Sets the Suspend Configuration.

Parameters
MATH_SUS_CfgMATH Suspend Configuration, see TMath_Sus_Cfg

Example

This example configures the Suspend Mode to hard suspend.

void Example_Function(void)
{
}
INLINE void MATH_Suspend_Conf(TMath_Sus_Cfg MATH_SUS_Cfg)
Sets the Suspend Configuration.
Definition: mathdiv.h:604
@ Ch_MATH_Sus_Hard
Hard Suspend
Definition: mathdiv.h:81