1/* 2 * Copyright 2019, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#include <camkes.h> 14#include <platsupport/plat/rtc.h> 15#include <camkes/io.h> 16#include <utils/util.h> 17 18rtc_time_date_t rtc_time_date(void) 19{ 20 rtc_time_date_t time_date; 21 int error UNUSED; 22 ps_io_port_ops_t ops = {0}; 23 error = camkes_io_port_ops(&ops); 24 assert(!error); 25 error = rtc_get_time_date_reg(&ops, 0, &time_date); 26 assert(!error); 27 return time_date; 28} 29 30void pre_init(void) 31{ 32 set_putchar(putchar_putchar); 33} 34