5 #include "sw/device/examples/demos.h"
13 #include "sw/device/lib/testing/pinmux_testutils.h"
14 #include "sw/device/lib/testing/test_framework/check.h"
15 #include "sw/device/lib/testing/test_framework/ottf_test_config.h"
19 OTTF_DEFINE_TEST_CONFIG();
21 static dif_gpio_t gpio;
22 static dif_pinmux_t pinmux;
23 static dif_uart_t uart;
39 void configure_pinmux(
void) {
40 pinmux_testutils_init(&pinmux);
42 for (
size_t i = 0; i <
ARRAYSIZE(leds); ++i) {
47 for (
size_t i = 0; i <
ARRAYSIZE(switches); ++i) {
53 void _ottf_main(
void) {
54 CHECK_DIF_OK(dif_pinmux_init(
58 CHECK_DIF_OK(dif_uart_init(
61 CHECK(
kUartBaudrate <= UINT32_MAX,
"kUartBaudrate must fit in uint32_t");
63 "kClockFreqPeripheralHz must fit in uint32_t");
82 LOG_INFO(
"Built at: " __DATE__
", " __TIME__);
84 demo_gpio_startup(&gpio);
89 LOG_INFO(
"Try out USERDIP switches 0-thru-3 on the board");
90 LOG_INFO(
"or type anything into the console window.");
92 "The LEDs show the lower nibble of the ASCII code of the last "
95 uint32_t gpio_state = 0;
98 gpio_state = demo_gpio_to_log_echo(&gpio, gpio_state);
99 demo_uart_to_uart_and_gpio_echo(&uart, &gpio);