Microchip® Advanced Software Framework

qs_divas_basic.c File Reference

SAM DIVAS Driver Quick Start.

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

#include <asf.h>

Macros

#define BUF_LEN   8
 [buffer] More...
 

Functions

int main (void)
 [calculate] More...
 
static void signed_division (void)
 [buffer] More...
 
static void signed_division_mod (void)
 
static void squart_root (void)
 
static void unsigned_division (void)
 
static void unsigned_division_mod (void)
 

Variables

const uint32_t excepted_r [BUF_LEN]
 
const int32_t excepted_s [BUF_LEN]
 
const int32_t excepted_s_m [BUF_LEN]
 
const uint32_t excepted_u [BUF_LEN]
 
const uint32_t excepted_u_m [BUF_LEN]
 
const int32_t numerator_s [BUF_LEN]
 
const uint32_t numerator_u [BUF_LEN]
 
static uint8_t result = 0
 
static uint32_t result_r [BUF_LEN]
 
static int32_t result_s [BUF_LEN]
 
static int32_t result_s_m [BUF_LEN]
 
static uint32_t result_u [BUF_LEN]
 
static uint32_t result_u_m [BUF_LEN]
 

int main ( void  )

[calculate]

[setup_init]

[setup_init]

[main] [main_1]

[main_1] [main_2]

[main_2] [main_3]

[main_3] [main_4]

[main_4] [main_5]

[main_5]

[main_6]

[main_6] [main]

References port_pin_set_output_level(), port_pin_toggle_output_level(), result, signed_division(), signed_division_mod(), squart_root(), system_init(), unsigned_division(), and unsigned_division_mod().

static void signed_division ( void  )
static

[buffer]

[calculate]

References BUF_LEN, divas_idiv(), excepted_s, i, numerator_s, result, and result_s.

Referenced by main().

static void signed_division_mod ( void  )
static

References BUF_LEN, divas_idivmod(), excepted_s_m, i, numerator_s, result, and result_s_m.

Referenced by main().

static void squart_root ( void  )
static

References BUF_LEN, divas_sqrt(), excepted_r, i, numerator_u, result, and result_r.

Referenced by main().

static void unsigned_division ( void  )
static

References BUF_LEN, divas_uidiv(), excepted_u, i, numerator_u, result, and result_u.

Referenced by main().

static void unsigned_division_mod ( void  )
static

References BUF_LEN, divas_uidivmod(), excepted_u_m, i, numerator_u, result, and result_u_m.

Referenced by main().

const uint32_t excepted_r[BUF_LEN]
Initial value:
= {
0x00000001,
0x00000009,
0x0000002C,
0x000000A5,
0x00000215,
0x00000C25,
0x00005B2B,
0x0000B504,
}
const int32_t excepted_s[BUF_LEN]
Initial value:
= {
2046, 207, 8, 0, 0, -42, -542, -8191}
const int32_t excepted_s_m[BUF_LEN]
Initial value:
= {
0, 1, 2, 1, -1, -3, -4, -7}
const uint32_t excepted_u[BUF_LEN]
Initial value:
= {
0x00000001,
0x0000002d,
0x0000028E,
0x00001AAF,
0x0000DE19,
0x00189612,
0x04A37153,
0x0FFFFFFF,
}
const uint32_t excepted_u_m[BUF_LEN]
Initial value:
= {
0, 0, 1, 0, 0, 2, 0, 7}
const int32_t numerator_s[BUF_LEN]
Initial value:
= {
2046, 415, 26, 1, -1, -255, -3798, -65535}
const uint32_t numerator_u[BUF_LEN]
Initial value:
= {
0x00000001,
0x0000005A,
0x000007AB,
0x00006ABC,
0x0004567D,
0x0093846E,
0x20781945,
0x7FFFFFFF,
}
uint8_t result = 0
static
uint32_t result_r[BUF_LEN]
static

Referenced by squart_root().

int32_t result_s[BUF_LEN]
static

Referenced by signed_division().

int32_t result_s_m[BUF_LEN]
static

Referenced by signed_division_mod().

uint32_t result_u[BUF_LEN]
static

Referenced by unsigned_division().

uint32_t result_u_m[BUF_LEN]
static

Referenced by unsigned_division_mod().