Microchip® Advanced Software Framework

sam/drivers/icm/unit_tests/unit_tests.c File Reference

Unit tests for ICM driver.

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

#include <asf.h>
#include <conf_test.h>
#include <string.h>

Functions

int main (void)
 Run ICM driver unit tests. More...
 
static void reg_hash_complete_handler (uint8_t reg_num)
 
static void run_icm_test (const struct test_case *test)
 Test ICM. More...
 

Variables

static volatile uint32_t gs_icm_triggered1 = 0U
 
static volatile uint32_t gs_icm_triggered2 = 0U
 
static volatile uint32_t gs_icm_triggered3 = 0U
 
uint32_t message_sha [16]
 
uint32_t output_sha [0x20]
 
struct
icm_region_descriptor_main_list 
reg_descriptor
 

static void reg_hash_complete_handler ( uint8_t  reg_num)
static
static void run_icm_test ( const struct test_case test)
static

Test ICM.

This test sets the ICM to trigger an region hash complete interrupt.

Parameters
testCurrent test case.

References icm_region_descriptor_main_list::rcfg::algo, icm_config::bbc, icm_region_descriptor_main_list::rcfg::bus_err_int_en, icm_region_descriptor_main_list::cfg, delay_ms, icm_config::des_area_val, icm_region_descriptor_main_list::rcfg::dig_mis_int_en, icm_region_descriptor_main_list::rcfg::ebit_con_int_en, gs_icm_triggered1, gs_icm_triggered2, gs_icm_triggered3, icm_config::hash_area_val, icm_enable(), icm_init(), ICM_INTERRUPT_RHC, ICM_REGION_NUM_0, icm_set_callback(), icm_set_hash_area_addr(), icm_set_reg_des_addr(), ICM_SHA_1, ICM_SHA_224, ICM_SHA_256, icm_config::is_auto_mode, icm_region_descriptor_main_list::rcfg::is_compare_mode, icm_config::is_dis_end_mon, icm_config::is_dual_buf, icm_region_descriptor_main_list::rcfg::is_end_mon, icm_region_descriptor_main_list::rcfg::is_pro_dly, icm_config::is_sec_list_branch, icm_config::is_user_hash, icm_region_descriptor_main_list::rcfg::is_wrap, icm_config::is_write_back, icm_region_descriptor_main_list::rcfg::mem_reg_val, message_sha, icm_region_descriptor_main_list::next_addr, output_sha, reg_descriptor, reg_hash_complete_handler(), icm_region_descriptor_main_list::rcfg::reg_hash_int_en, icm_region_descriptor_main_list::start_addr, icm_region_descriptor_main_list::rcfg::status_upt_con_int_en, test_assert_true, icm_region_descriptor_main_list::tran_size, icm_config::ualgo, and icm_region_descriptor_main_list::rcfg::wrap_con_int_en.

Referenced by main().

volatile uint32_t gs_icm_triggered1 = 0U
static
volatile uint32_t gs_icm_triggered2 = 0U
static
volatile uint32_t gs_icm_triggered3 = 0U
static
uint32_t message_sha[16]
Initial value:
= {
0x80636261,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x18000000
}

Referenced by run_icm_test().

uint32_t output_sha[0x20]
struct icm_region_descriptor_main_list reg_descriptor

Referenced by main(), and run_icm_test().