1.29.7.5 DIVAS_DivmodUnsigned Function

C

uint64_t DIVAS_DivmodUnsigned( uint32_t numerator, uint32_t denominator)

Summary

This function uses the DIVAS peripheral to performs a unsigned 32-bit division, and returns both the quotient and remainder as 64-bit number.

Description

This function uses the DIVAS peripheral to perform a unsigned 32-bit division. The function takes a unsigned divisor and dividend as input, and returns quotient and remainder as 64-bit number

Precondition

The peripheral should have been initialized by calling the DIVAS_Initialize() function once.

Parameters

Param Description
numerator This should contain the unsigned dividend.
denominator This should contain the unsigned divisor

Returns

Returns quotient and remainder as 64-bit number (32-bit LSB is quotient and 32-bit MSB is remainder)

Example

uint32_t dividend;
uint32_t divisor;
uint64_t divmod;

dividend = 10000;
divisor = 2000;

divmod = DIVAS_DivmodUnsigned(dividend, divisor)

Remarks

None.