Microchip® Advanced Software Framework

divas.h File Reference

SAM Divide and Square Root Accelerator (DIVAS) Driver.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include <system.h>

Data Structures

struct  idiv_return
 DIVAS signed division operator result output structure. More...
 
struct  uidiv_return
 DIVAS unsigned division operator result output structure. More...
 

Functions

static void divas_disable_dlz (void)
 Disables DIVAS leading zero optimization. More...
 
static void divas_enable_dlz (void)
 Enables DIVAS leading zero optimization. More...
 
Call the DIVAS API Operation

In this mode, the way that directly call the DIVAS API implement division or mod operation.

int32_t divas_idiv (int32_t numerator, int32_t denominator)
 Signed division operation. More...
 
uint32_t divas_uidiv (uint32_t numerator, uint32_t denominator)
 Unsigned division operation. More...
 
int32_t divas_idivmod (int32_t numerator, int32_t denominator)
 Signed division remainder operation. More...
 
uint32_t divas_uidivmod (uint32_t numerator, uint32_t denominator)
 Unsigned division remainder operation. More...
 
uint32_t divas_sqrt (uint32_t radicand)
 Square root operation. More...
 
DIVAS Overload '/' and '' Operation

In this mode, the user can transparently access the DIVAS module when writing normal C code.

E.g. "a = b / c;" or "a = b % c;" will be translated to a subroutine call, which uses the DIVAS.

int32_t __aeabi_idiv (int32_t numerator, int32_t denominator)
 Signed division operation overload. More...
 
uint32_t __aeabi_uidiv (uint32_t numerator, uint32_t denominator)
 Unsigned division operation overload. More...
 
uint64_t __aeabi_idivmod (int32_t numerator, int32_t denominator)
 Signed division remainder operation overload. More...
 
uint64_t __aeabi_uidivmod (uint32_t numerator, uint32_t denominator)
 Unsigned division remainder operation overload. More...