SAM BOD Callback Quick Start.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
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 |
Initialize the USART for unit test.
Initializes the SERCOM USART (SERCOM4) used for sending the unit test status to the computer via the EDBG CDC gateway.
References usart_config::baudrate, cdc_uart_module, CONF_STDIO_BAUDRATE, CONF_STDIO_MUX_SETTING, CONF_STDIO_PINMUX_PAD0, CONF_STDIO_PINMUX_PAD1, CONF_STDIO_PINMUX_PAD2, CONF_STDIO_PINMUX_PAD3, usart_config::mux_setting, usart_config::pinmux_pad0, usart_config::pinmux_pad1, usart_config::pinmux_pad2, usart_config::pinmux_pad3, usart_enable(), and usart_get_config_defaults().
Referenced by main().
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 |
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 |
Test for bod detected in polled mode.
adjust the cpu power supply to lower than 3v, bod should be detected.
test | Current 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 |