Microchip® Advanced Software Framework

drivers/bod/unit_test/unit_test.c File Reference

SAM BOD Callback Quick Start.

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

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

Functions

static void cdc_uart_init (void)
 Initialize the USART for unit test. More...
 
int main (void)
 Run BOD unit tests. More...
 
static void run_bod_init_test (const struct test_case *test)
 Initialize the bod for unit test. More...
 
static void run_bod_test (const struct test_case *test)
 Test for bod detected in polled mode. More...
 

Variables

struct usart_module cdc_uart_module
 

static void cdc_uart_init ( void  )
static
int main ( void  )

Run BOD unit tests.

Initializes the system and serial output, then sets up the BOD unit test suite and runs it.

References cdc_uart_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, NULL, run_bod_init_test(), run_bod_test(), system_init(), and test_suite_run().

static void run_bod_init_test ( const struct test_case test)
static

Initialize the bod for unit test.

Initializes the BOD module used for detected test.

References bod_config::action, BOD_ACTION_INTERRUPT, BOD_BOD33, bod_enable(), bod_get_config_defaults(), bod_set_config(), bod_config::level, status, STATUS_OK, and test_assert_true.

Referenced by main().

static void run_bod_test ( const struct test_case test)
static

Test for bod detected in polled mode.

adjust the cpu power supply to lower than 3v, bod should be detected.

Parameters
testCurrent test case.

References BOD_BOD33, bod_clear_detected(), bod_disable(), bod_is_detected(), status, STATUS_OK, and test_assert_true.

Referenced by main().

struct usart_module cdc_uart_module