Unit tests for EIC driver.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include <board.h>
#include <sysclk.h>
#include "eic.h"
#include "ioport.h"
#include "delay.h"
#include <string.h>
#include <unit_test/suite.h>
#include <stdio_serial.h>
#include <conf_test.h>
#include <conf_board.h>
Functions | |
int | main (void) |
Run EIC driver unit tests. More... | |
static void | run_eic_test (const struct test_case *test) |
Test EIC. More... | |
static void | set_int_flag (void) |
Interrupt handler for EIC interrupt. More... | |
Variables | |
volatile uint8_t | intflag = 0 |
int main | ( | void | ) |
Run EIC driver unit tests.
References uart_rs232_options::baudrate, board_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, NULL, run_eic_test(), stdio_serial_init(), sysclk_init(), test_suite_run(), and usart_serial_options.
|
static |
Test EIC.
test | Current test case. |
References delay_ms, eic_line_config::eic_async, EIC_ASYNCH_MODE, eic_line_config::eic_edge, EIC_EDGE_FALLING_EDGE, eic_enable(), eic_line_config::eic_filter, EIC_FILTER_DISABLED, eic_line_config::eic_level, EIC_LEVEL_LOW_LEVEL, eic_line_enable(), eic_line_set_callback(), eic_line_set_config(), eic_line_config::eic_mode, EIC_MODE_EDGE_TRIGGERED, intflag, IOPORT_DIR_OUTPUT, ioport_disable_pin(), IOPORT_PIN_LEVEL_HIGH, IOPORT_PIN_LEVEL_LOW, ioport_set_pin_dir(), ioport_set_pin_level(), ioport_set_pin_mode(), set_int_flag(), and test_assert_true.
Referenced by main().
|
static |
Interrupt handler for EIC interrupt.
References eic_line_disable_interrupt(), eic_line_interrupt_is_pending(), and intflag.
Referenced by run_eic_test().
volatile uint8_t intflag = 0 |