Software APIs
uart_functest.c
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #include <stdbool.h>
6 #include <stdint.h>
7 
11 #include "sw/device/silicon_creator/lib/drivers/uart.h"
12 #include "sw/device/silicon_creator/lib/error.h"
13 
15 
16 OTTF_DEFINE_TEST_CONFIG(.console.test_may_clobber = true);
17 
18 rom_error_t uart_test(void) {
19  // Configure UART0 as stdout.
20  uart_init(kUartNCOValue);
22  .data = NULL,
23  .sink = uart_sink,
24  });
25 
26  base_printf("uart functional test!\r\n");
27  return kErrorOk;
28 }
29 
30 bool test_main(void) {
31  status_t result = OK_STATUS();
32  EXECUTE_TEST(result, uart_test);
33  return status_ok(result);
34 }