Path: blob/main/sys/contrib/ncsw/Peripherals/FM/Rtc/fm_rtc.h
48420 views
/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/******************************************************************************34@File fm_rtc.h3536@Description Memory map and internal definitions for FM RTC IEEE1588 Timer driver.3738@Cautions None39*//***************************************************************************/4041#ifndef __FM_RTC_H__42#define __FM_RTC_H__4344#include "std_ext.h"45#include "fm_rtc_ext.h"464748#define __ERR_MODULE__ MODULE_FM_RTC4950/* General definitions */5152#define ACCUMULATOR_OVERFLOW ((uint64_t)(1LL << 32))53#define DEFAULT_OUTPUT_CLOCK_DIVISOR 0x0000000254#define DEFAULT_BYPASS FALSE55#define DEFAULT_CLOCK_PERIOD 100056575859typedef struct t_FmRtcAlarm60{61t_FmRtcExceptionsCallback *f_AlarmCallback;62bool clearOnExpiration;63} t_FmRtcAlarm;6465typedef struct t_FmRtcPeriodicPulse66{67t_FmRtcExceptionsCallback *f_PeriodicPulseCallback;68} t_FmRtcPeriodicPulse;6970typedef struct t_FmRtcExternalTrigger71{72t_FmRtcExceptionsCallback *f_ExternalTriggerCallback;73} t_FmRtcExternalTrigger;747576/**************************************************************************//**77@Description RTC FM driver control structure.78*//***************************************************************************/79typedef struct t_FmRtc80{81t_Part *p_Part; /**< Pointer to the integration device */82t_Handle h_Fm;83t_Handle h_App; /**< Application handle */84struct rtc_regs *p_MemMap;85uint32_t clockPeriodNanoSec; /**< RTC clock period in nano-seconds (for FS mode) */86uint32_t srcClkFreqMhz;87uint16_t outputClockDivisor; /**< Output clock divisor (for FS mode) */88t_FmRtcAlarm alarmParams[FM_RTC_NUM_OF_ALARMS];89t_FmRtcPeriodicPulse periodicPulseParams[FM_RTC_NUM_OF_PERIODIC_PULSES];90t_FmRtcExternalTrigger externalTriggerParams[FM_RTC_NUM_OF_EXT_TRIGGERS];91struct rtc_cfg *p_RtcDriverParam; /**< RTC Driver parameters (for Init phase) */92} t_FmRtc;939495#endif /* __FM_RTC_H__ */969798