Unit tests for ACIFC driver.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <board.h>
#include <sysclk.h>
#include "acifc.h"
#include "delay.h"
#include <string.h>
#include <unit_test/suite.h>
#include <stdio_serial.h>
#include <conf_test.h>
#include <conf_board.h>
Macros | |
#define | EXAMPLE_AC_CHANNEL 0 |
Analog comparator channel number. More... | |
Functions | |
int | main (void) |
Run AC driver unit tests. More... | |
static void | run_ac_test (const struct test_case *test) |
Test AC. More... | |
static void | set_int_flag (void) |
Callback for AC interrupt. More... | |
Variables | |
struct ac_dev_inst | ac_device |
volatile bool | intflag = false |
#define EXAMPLE_AC_CHANNEL 0 |
Analog comparator channel number.
Referenced by run_ac_test().
int main | ( | void | ) |
Run AC driver unit tests.
References uart_rs232_options::baudrate, board_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, NULL, run_ac_test(), stdio_serial_init(), sysclk_init(), test_suite_run(), and usart_serial_options.
|
static |
Test AC.
test | Current test case. |
References ac_ch_get_config_defaults(), ac_ch_set_config(), ac_device, ac_enable(), ac_get_config_defaults(), ac_init(), AC_INTERRUPT_CONVERSION_COMPLETED_0, ac_set_callback(), ac_user_trigger_single_comparison(), ac_ch_config::always_on, delay_ms, ac_config::event_trigger, EXAMPLE_AC_CHANNEL, ac_ch_config::fast_mode, intflag, set_int_flag(), and test_assert_true.
Referenced by main().
|
static |
Callback for AC interrupt.
References ac_clear_interrupt_status(), ac_device, and intflag.
Referenced by run_ac_test().
struct ac_dev_inst ac_device |