![]() |
![]() |
|
MSPM0GX51X Driver Library
2.03.00.07
|
|
Modules | |
| DL_MATHACL_STATUS | |
Data Structures | |
| struct | DL_MathACL_operationConfig |
| Configuration struct for DL_MathACL_configOperation. More... | |
Enumerations | |
| enum | DL_MATHACL_OP_TYPE { DL_MATHACL_OP_TYPE_SINCOS = MATHACL_CTL_FUNC_SINCOS, DL_MATHACL_OP_TYPE_ARCTAN2 = MATHACL_CTL_FUNC_ATAN2, DL_MATHACL_OP_TYPE_DIV = MATHACL_CTL_FUNC_DIV, DL_MATHACL_OP_TYPE_SQRT = MATHACL_CTL_FUNC_SQRT, DL_MATHACL_OP_TYPE_MPY_32 = MATHACL_CTL_FUNC_MPY32, DL_MATHACL_OP_TYPE_SQUARE_32 = MATHACL_CTL_FUNC_SQUARE32, DL_MATHACL_OP_TYPE_MPY_64 = MATHACL_CTL_FUNC_MPY64, DL_MATHACL_OP_TYPE_SQUARE_64 = MATHACL_CTL_FUNC_SQUARE64, DL_MATHACL_OP_TYPE_MAC = MATHACL_CTL_FUNC_MAC, DL_MATHACL_OP_TYPE_SAC = MATHACL_CTL_FUNC_SAC } |
| enum | DL_MATHACL_Q_TYPE { DL_MATHACL_Q_TYPE_Q0 = MATHACL_CTL_QVAL_Q0, DL_MATHACL_Q_TYPE_Q1 = MATHACL_CTL_QVAL_Q1, DL_MATHACL_Q_TYPE_Q2 = MATHACL_CTL_QVAL_Q2, DL_MATHACL_Q_TYPE_Q3 = MATHACL_CTL_QVAL_Q3, DL_MATHACL_Q_TYPE_Q4 = MATHACL_CTL_QVAL_Q4, DL_MATHACL_Q_TYPE_Q5 = MATHACL_CTL_QVAL_Q5, DL_MATHACL_Q_TYPE_Q6 = MATHACL_CTL_QVAL_Q6, DL_MATHACL_Q_TYPE_Q7 = MATHACL_CTL_QVAL_Q7, DL_MATHACL_Q_TYPE_Q8 = MATHACL_CTL_QVAL_Q8, DL_MATHACL_Q_TYPE_Q9 = MATHACL_CTL_QVAL_Q9, DL_MATHACL_Q_TYPE_Q10 = MATHACL_CTL_QVAL_Q10, DL_MATHACL_Q_TYPE_Q11 = MATHACL_CTL_QVAL_Q11, DL_MATHACL_Q_TYPE_Q12 = MATHACL_CTL_QVAL_Q12, DL_MATHACL_Q_TYPE_Q13 = MATHACL_CTL_QVAL_Q13, DL_MATHACL_Q_TYPE_Q14 = MATHACL_CTL_QVAL_Q14, DL_MATHACL_Q_TYPE_Q15 = MATHACL_CTL_QVAL_Q15, DL_MATHACL_Q_TYPE_Q16 = MATHACL_CTL_QVAL_Q16, DL_MATHACL_Q_TYPE_Q17 = MATHACL_CTL_QVAL_Q17, DL_MATHACL_Q_TYPE_Q18 = MATHACL_CTL_QVAL_Q18, DL_MATHACL_Q_TYPE_Q19 = MATHACL_CTL_QVAL_Q19, DL_MATHACL_Q_TYPE_Q20 = MATHACL_CTL_QVAL_Q20, DL_MATHACL_Q_TYPE_Q21 = MATHACL_CTL_QVAL_Q21, DL_MATHACL_Q_TYPE_Q22 = MATHACL_CTL_QVAL_Q22, DL_MATHACL_Q_TYPE_Q23 = MATHACL_CTL_QVAL_Q23, DL_MATHACL_Q_TYPE_Q24 = MATHACL_CTL_QVAL_Q24, DL_MATHACL_Q_TYPE_Q25 = MATHACL_CTL_QVAL_Q25, DL_MATHACL_Q_TYPE_Q26 = MATHACL_CTL_QVAL_Q26, DL_MATHACL_Q_TYPE_Q27 = MATHACL_CTL_QVAL_Q27, DL_MATHACL_Q_TYPE_Q28 = MATHACL_CTL_QVAL_Q28, DL_MATHACL_Q_TYPE_Q29 = MATHACL_CTL_QVAL_Q29, DL_MATHACL_Q_TYPE_Q30 = MATHACL_CTL_QVAL_Q30, DL_MATHACL_Q_TYPE_Q31 = MATHACL_CTL_QVAL_Q31 } |
| enum | DL_MATHACL_OPSIGN { DL_MATHACL_OPSIGN_UNSIGNED = MATHACL_CTL_OPTYPE_UNSIGNED, DL_MATHACL_OPSIGN_SIGNED = MATHACL_CTL_OPTYPE_SIGNED } |
Functions | |
| __STATIC_INLINE void | DL_MathACL_enablePower (MATHACL_Regs *mathacl) |
| Enables power on MATHACL module. More... | |
| __STATIC_INLINE void | DL_MathACL_disablePower (MATHACL_Regs *mathacl) |
| Disable power on MATHACL module. More... | |
| __STATIC_INLINE void | DL_MathACL_reset (MATHACL_Regs *mathacl) |
| Resets the MATHACL module. More... | |
| __STATIC_INLINE bool | DL_MathACL_isReset (MATHACL_Regs *mathacl) |
| Returns if MATHACL peripheral was reset. More... | |
| __STATIC_INLINE void | DL_MathACL_enableSaturation (MATHACL_Regs *mathacl) |
| Enable saturation. More... | |
| __STATIC_INLINE void | DL_MathACL_disableSaturation (MATHACL_Regs *mathacl) |
| Disable saturation. More... | |
| __STATIC_INLINE bool | DL_MathACL_isSaturationEnabled (MATHACL_Regs *mathacl) |
| Returns if saturation is enabled. More... | |
| __STATIC_INLINE void | DL_MathACL_setOperandOne (MATHACL_Regs *mathacl, uint32_t op) |
| Load Operand one into the math accelerator. More... | |
| __STATIC_INLINE void | DL_MathACL_setOperandTwo (MATHACL_Regs *mathacl, uint32_t op) |
| Load Operand two into the math accelerator. More... | |
| __STATIC_INLINE uint32_t | DL_MathACL_getResultOne (MATHACL_Regs *mathacl) |
| Returns MATHACL result one register. More... | |
| __STATIC_INLINE uint32_t | DL_MathACL_getResultTwo (MATHACL_Regs *mathacl) |
| Returns MATHACL result two register. More... | |
| __STATIC_INLINE uint32_t | DL_MathACL_getStatus (MATHACL_Regs *mathacl) |
| Returns MATHACL operation status. More... | |
| __STATIC_INLINE void | DL_MathACL_clearOverflowStatus (MATHACL_Regs *mathacl) |
| Clear the overflow status bit. More... | |
| __STATIC_INLINE void | DL_MathACL_clearUnderflowStatus (MATHACL_Regs *mathacl) |
| Clear the underflow status bit. More... | |
| __STATIC_INLINE void | DL_MathACL_clearErrorStatus (MATHACL_Regs *mathacl) |
| Clear the error status bit. More... | |
| __STATIC_INLINE void | DL_MathACL_waitForOperation (MATHACL_Regs *mathacl) |
| Block until MATHACL_STATUS_BUSY_DONE is active in MATHACL. More... | |
| void | DL_MathACL_configOperation (MATHACL_Regs *mathacl, const DL_MathACL_operationConfig *opConfig, uint32_t op1, uint32_t op2) |
| Configure and execute a Math accelerator operation. More... | |
| __STATIC_INLINE void | DL_MathACL_clearResultOne (MATHACL_Regs *mathacl) |
| Clears the RES1 register. More... | |
| __STATIC_INLINE void | DL_MathACL_clearResultTwo (MATHACL_Regs *mathacl) |
| Clears the RES2 register. More... | |
| __STATIC_INLINE void | DL_MathACL_clearResults (MATHACL_Regs *mathacl) |
| Clears the RES1 and RES2 registers. More... | |
The Math Accelerator Driver Library provides software to control the onboard Math Accelerator hardware.
| enum DL_MATHACL_OP_TYPE |
| Enumerator | |
|---|---|
| DL_MATHACL_OP_TYPE_SINCOS | Sin or cosine operation |
| DL_MATHACL_OP_TYPE_ARCTAN2 | Arc tangent 2 operation – takes in X, Y values |
| DL_MATHACL_OP_TYPE_DIV | Divide operation – takes in numerator, denominator, division type |
| DL_MATHACL_OP_TYPE_SQRT | Square root operation – requires that a scaling factor be provided as well |
| DL_MATHACL_OP_TYPE_MPY_32 | Multiply operation returns 32-bit result – takes in two operands |
| DL_MATHACL_OP_TYPE_SQUARE_32 | Square operation returns 32-bit result – takes in one operand. Supports Q and int data formats. Enable saturation with DL_MathACL_enableSaturation and check DL_MATHACL_STATUS_OVERFLOW for overflow. |
| DL_MATHACL_OP_TYPE_MPY_64 | Multiply operation returns 64-bit result – takes in two operands |
| DL_MATHACL_OP_TYPE_SQUARE_64 | Square operation returns 64-bit result – takes in one operand |
| DL_MATHACL_OP_TYPE_MAC | Multiply and Accumulate operation – takes in two operands. Supports Q and int data formats. Enable saturation with DL_MathACL_enableSaturation and check DL_MATHACL_STATUS_OVERFLOW for overflow. |
| DL_MATHACL_OP_TYPE_SAC | Square and Accumulate operation – takes in one operand. Supports Q and int data formats. Enable saturation with DL_MathACL_enableSaturation and check DL_MATHACL_STATUS_OVERFLOW for overflow. |
| enum DL_MATHACL_Q_TYPE |
| enum DL_MATHACL_OPSIGN |
| __STATIC_INLINE void DL_MathACL_enablePower | ( | MATHACL_Regs * | mathacl | ) |
Enables power on MATHACL module.
| mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_disablePower | ( | MATHACL_Regs * | mathacl | ) |
Disable power on MATHACL module.
| mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_reset | ( | MATHACL_Regs * | mathacl | ) |
Resets the MATHACL module.
| mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_MathACL_isReset | ( | MATHACL_Regs * | mathacl | ) |
Returns if MATHACL peripheral was reset.
| mathacl | Pointer to the register overlay for the MATHACL peripheral |
| __STATIC_INLINE void DL_MathACL_enableSaturation | ( | MATHACL_Regs * | mathacl | ) |
Enable saturation.
This bit is shared among DL_MATHACL_OP_TYPE_DIV, DL_MATHACL_OP_TYPE_SQUARE_32, DL_MATHACL_OP_TYPE_MPY_32, DL_MATHACL_OP_TYPE_MAC, and DL_MATHACL_OP_TYPE_SAC operations. When saturation is enabled, if there is an overflow event during an operation, then the result will saturate to the maximum value.
| mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_disableSaturation | ( | MATHACL_Regs * | mathacl | ) |
Disable saturation.
When saturation is disabled, if there is an overflow event during an operation, then the result will overflow to an unknown value.
| mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_MathACL_isSaturationEnabled | ( | MATHACL_Regs * | mathacl | ) |
Returns if saturation is enabled.
| mathacl | Pointer to the register overlay for the MATHACL peripheral |
| __STATIC_INLINE void DL_MathACL_setOperandOne | ( | MATHACL_Regs * | mathacl, |
| uint32_t | op | ||
| ) |
Load Operand one into the math accelerator.
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| [in] | op | Operand one to load into the Math Accelerator |
| __STATIC_INLINE void DL_MathACL_setOperandTwo | ( | MATHACL_Regs * | mathacl, |
| uint32_t | op | ||
| ) |
Load Operand two into the math accelerator.
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| [in] | op | Operand two to load into the Math Accelerator |
| __STATIC_INLINE uint32_t DL_MathACL_getResultOne | ( | MATHACL_Regs * | mathacl | ) |
Returns MATHACL result one register.
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE uint32_t DL_MathACL_getResultTwo | ( | MATHACL_Regs * | mathacl | ) |
Returns MATHACL result two register.
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE uint32_t DL_MathACL_getStatus | ( | MATHACL_Regs * | mathacl | ) |
Returns MATHACL operation status.
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_clearOverflowStatus | ( | MATHACL_Regs * | mathacl | ) |
Clear the overflow status bit.
Calling this API clears DL_MATHACL_STATUS_OVERFLOW
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_clearUnderflowStatus | ( | MATHACL_Regs * | mathacl | ) |
Clear the underflow status bit.
Calling this API clears DL_MATHACL_STATUS_UNDERFLOW
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_clearErrorStatus | ( | MATHACL_Regs * | mathacl | ) |
Clear the error status bit.
Calling this API clears DL_MATHACL_STATUS_ERR_MASK
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_waitForOperation | ( | MATHACL_Regs * | mathacl | ) |
Block until MATHACL_STATUS_BUSY_DONE is active in MATHACL.
| [in] | mathacl | Pointer to the register overlay for the peripheral |
References DL_MathACL_configOperation().
| void DL_MathACL_configOperation | ( | MATHACL_Regs * | mathacl, |
| const DL_MathACL_operationConfig * | opConfig, | ||
| uint32_t | op1, | ||
| uint32_t | op2 | ||
| ) |
Configure and execute a Math accelerator operation.
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| [in] | opConfig | Pointer to the configuration structure for the operation |
| [in] | op1 | Operand one for the operation |
| [in] | op2 | Operand two for the operation. May be left as 0 if unused |
Referenced by DL_MathACL_waitForOperation().
| __STATIC_INLINE void DL_MathACL_clearResultOne | ( | MATHACL_Regs * | mathacl | ) |
Clears the RES1 register.
Clears the Result 1 (RES1) register
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_clearResultTwo | ( | MATHACL_Regs * | mathacl | ) |
Clears the RES2 register.
Clears the Result 2 (RES2) register
| [in] | mathacl | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_MathACL_clearResults | ( | MATHACL_Regs * | mathacl | ) |
Clears the RES1 and RES2 registers.
Clears the Result 1 (RES1) and Result 2 (RES2) registers
| [in] | mathacl | Pointer to the register overlay for the peripheral |