Microchip® Advanced Software Framework

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

Unit test for PARC driver.

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

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

Macros

#define DELAY_TIME   100
 

Functions

int main (void)
 Run PARC driver unit tests. More...
 
static void parc_complete_callback (struct parc_module *const module)
 callback handler for PARC data ready interrupt. More...
 
static void parc_port_input_simulation (bool risingedge, uint32_t data)
 PARC input signal generating through GPIO port. More...
 
static void run_parc_callback_test (const struct test_case *test)
 Test PARC functions in callback way. More...
 
static void run_parc_ctrl_test (const struct test_case *test)
 Test PARC register write/read. More...
 
static void run_parc_polled_test (const struct test_case *test)
 Test PARC functions in polling way. More...
 

Variables

static bool callback_data_ready = false
 
uint32_t captured_data = 0
 
struct parc_config config
 PARC configure stuct. More...
 
struct parc_module module_inst
 

#define DELAY_TIME   100

static void parc_complete_callback ( struct parc_module *const  module)
static

callback handler for PARC data ready interrupt.

Parameters
moduleThe parc_module instance.

References callback_data_ready, captured_data, and parc_read().

Referenced by run_parc_callback_test().

static void parc_port_input_simulation ( bool  risingedge,
uint32_t  data 
)
static

PARC input signal generating through GPIO port.

Parameters
risingedgePARC sampling edge, rising edge(true),fall edge (false)
dataData to send

References IOPORT_PIN_LEVEL_HIGH, IOPORT_PIN_LEVEL_LOW, and ioport_set_pin_level().

Referenced by run_parc_callback_test(), and run_parc_polled_test().

static void run_parc_ctrl_test ( const struct test_case test)
static
static void run_parc_polled_test ( const struct test_case test)
static

bool callback_data_ready = false
static
uint32_t captured_data = 0