view target-utils/include/rtc.h @ 137:5fe5559003b7

RV bring-up: RVT "system time" heartbeat messages now get printed every 20 s! The problem was a slight Nucleus API incompatibility between what the RVF code from TCS211 expected and what our FreeNucleus implements: in the TCS211 version of Nucleus it was OK to pass 0 for the initial_time parameter to NU_Create_Timer(), but our version flags such usage as an error. RVF used 0 as the dummy initial_time value when initializing the legacy RV timers with NU_DISABLE_TIMER. Implemented fix: using a dummy value of 1 instead.
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 11 Nov 2013 09:56:23 +0000
parents 92c1ed6b4b67
children
line wrap: on
line source

/* Calypso RTC registers */

#ifndef __CALYPSO_RTC_H
#define	__CALYPSO_RTC_H

#include "types.h"

#define	RTC_REGS_BASE	0xFFFE1800

struct rtctime {
	u8	seconds;
	u8	minutes;
	u8	hours;
	u8	day_of_month;
	u8	month;
	u8	year;
	u8	day_of_week;
	u8	pad;
};

struct rtcregs {
	struct rtctime	rtc_cur;
	struct rtctime	rtc_alarm;
	u8		rtc_ctrl_reg;
	u8		rtc_status_reg;
	u8		rtc_int_reg;
	u8		rtc_comp_lsb_reg;
	u8		rtc_comp_msb_reg;
	u8		rtc_res_prog_reg;
};

#define	RTC_REGS	(*(volatile struct rtcregs *) RTC_REGS_BASE)

#endif	/* include guard */