⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_rtcaux.h

📁 dsp在音频处理中的运用
💻 H
📖 第 1 页 / 共 3 页
字号:

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  RTC is Started.
 *
 *   @b Modifies
 *   @n  The RTC Control Register.
 *
 *   @b Example
 *   @verbatim
         CSL_rtcStart (hRtc);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcStart (
	CSL_RtcHandle hRtc
)
{
	CSL_FINST (hRtc->regs->RTC_CTRL_REG, \
			    RTC_RTC_CTRL_REG_STOP_RTC, START);
}

/** ============================================================================
 *   @n@b CSL_rtcFreeze
 *
 *   @b Description
 *   @n This function freezes the RTC.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  RTC is Freezed.
 *
 *   @b Modifies
 *   @n  The RTC Control Register.
 *
 *   @b Example
 *   @verbatim
         CSL_rtcFreeze (hRtc);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcFreeze (
	CSL_RtcHandle hRtc
)
{
	CSL_FINST (hRtc->regs->RTC_CTRL_REG, \
		       RTC_RTC_CTRL_REG_STOP_RTC, FREEZE);
}

/** ============================================================================
 *   @n@b CSL_rtcClearPowerUp
 *
 *   @b Description
 *   @n This function clears the Powerup bit in RTC Status Register.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The Powerup bit in RTC Status Register is cleared.
 *
 *   @b Modifies
 *   @n  The RTC Status Register.
 *
 *   @b Example
 *   @verbatim
         CSL_rtcClearPowerUp (hRtc);

     @endverbatim
 * =============================================================================
 */

static inline
void CSL_rtcClearPowerUp (
	CSL_RtcHandle hRtc
)
{
   hRtc->regs->RTC_STATUS_REG = CSL_FMK(RTC_RTC_STATUS_REG_POWER_UP, \
                                        CSL_RTC_SET);
	
}

/** ============================================================================
 *   @n@b CSL_rtcClearAlarm
 *
 *   @b Description
 *   @n This function clears the Alarm bit in RTC Status Register.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The Alarm bit in RTC Status Register is cleared.
 *
 *   @b Modifies
 *   @n  The RTC Status Register.
 *
 *   @b Example
 *   @verbatim
         CSL_rtcClearAlarm (hRtc);

     @endverbatim
 * =============================================================================
 */

static inline
void CSL_rtcClearAlarm (
	CSL_RtcHandle hRtc
)
{
	hRtc->regs->RTC_STATUS_REG = CSL_FMK(RTC_RTC_STATUS_REG_ALARM, CSL_RTC_SET);
}

/** ============================================================================
 *   @n@b CSL_rtcAlarmIntEnable
 *
 *   @b Description
 *   @n This function enables the alarm interrupt.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Alarm Interrupt is Enabled.
 *
 *   @b Modifies
 *   @n  The RTC Interrupt Register.
 *
 *   @b Example
 *   @verbatim
        CSL_rtcAlarmIntEnable (hRtc);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcAlarmIntEnable (
	CSL_RtcHandle hRtc
)
{
	CSL_FINST (hRtc->regs->RTC_INTERRUPTS_REG, \
				     RTC_RTC_INTERRUPTS_REG_IT_ALARM, ENABLE);
}

/** ============================================================================
 *   @n@b CSL_rtcAlarmIntDisable
 *
 *   @b Description
 *   @n This function disables the alarm interrupt.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Alarm Interrupt is Disabled.
 *
 *   @b Modifies
 *   @n  The RTC Interrupt Register.
 *
 *   @b Example
 *   @verbatim
        CSL_rtcAlarmIntDisable (hRtc);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcAlarmIntDisable (
	CSL_RtcHandle hRtc
)
{
	CSL_FINST (hRtc->regs->RTC_INTERRUPTS_REG, \
			    RTC_RTC_INTERRUPTS_REG_IT_ALARM, DISABLE);
}

/** ============================================================================
 *   @n@b CSL_rtcTimerIntEnable
 *
 *   @b Description
 *   @n This function enables the Timer interrupt for RTC.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Timer Interrupt is Enabled.
 *
 *   @b Modifies
 *   @n  The RTC Interrupt Register.
 *
 *   @b Example
 *   @verbatim
        CSL_rtcTimerIntEnable (hRtc);

     @endverbatim
 * ===========================================================================
 */


static inline
void CSL_rtcTimerIntEnable (
	CSL_RtcHandle hRtc
)
{
	CSL_FINST (hRtc->regs->RTC_INTERRUPTS_REG, \
			    RTC_RTC_INTERRUPTS_REG_IT_TIMER, ENABLE);
}

/** ============================================================================
 *   @n@b CSL_rtcTimerIntDisable
 *
 *   @b Description
 *   @n This function disables the Timer interrupt.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Timer Interrupt is Disabled.
 *
 *   @b Modifies
 *   @n  The RTC Interrupt Register.
 *
 *   @b Example
 *   @verbatim
        CSL_rtcTimermIntDisable (hRtc);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcTimerIntDisable (
	CSL_RtcHandle hRtc
)
{
	CSL_FINST (hRtc->regs->RTC_INTERRUPTS_REG, \
				     RTC_RTC_INTERRUPTS_REG_IT_TIMER, DISABLE);
}

/** ============================================================================
 *   @n@b CSL_rtcIntPeriodConfig
 *
 *   @b Description
 *   @n This function configures the Configure the Interrupt period of RTC
 *		for every sec/min/hour/day.
 *
 *   @b Arguments
 *   @verbatim

            hRtc            Handle to the RTC instance.

            period          Interrupt Period for the RTC.

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The RTC Interupt period is configured to second, minute, hour or day.
 *
 *   @b Modifies
 *   @n  The RTC Interrupt Register
 *
 *   @b Example
 *   @verbatim
        CSL_RtcHandle 	    hRtc;
        CSL_RtcIntPeriod    period = CSL_RTC_RTC_INTERRUPTS_REG_EVERY_MIN;

        CSL_rtcIntPeriodConfig (hRtc, period);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcIntPeriodConfig (
	CSL_RtcHandle    hRtc,
	CSL_RtcIntPeriod period
)
{
	CSL_FINS (hRtc->regs->RTC_INTERRUPTS_REG, \
			   RTC_RTC_INTERRUPTS_REG_EVERY, period);
}

/** ============================================================================
 *   @n@b CSL_rtcHourModeConfig
 *
 *   @b Description
 *   @n This function loads and configures the RTC Compensation Registers.
 *
 *   @b Arguments
 *   @verbatim

            hRtc        Handle to the RTC instance

            comp        Structure to load the RTC Compensation Registers.

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The RTC Compensation Registers are congiured.
 *
 *   @b Modifies
 *   @n  RTC Compensation Registers
 *
 *   @b Example
 *   @verbatim
        CSL_RtcHandle       hRtc;
        CSL_RtcHourMode     mode = CSL_RTC_HOURMODE_12;

        CSL_rtcHourModeConfig (hRtc, mode);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcLoadCompReg (
	CSL_RtcHandle hRtc,
	CSL_RtcComp   comp
)
{
	hRtc->regs->RTC_COMP_LSB_REG = comp.lsb;
	hRtc->regs->RTC_COMP_MSB_REG = comp.msb;
}

/** ============================================================================
 *   @n@b CSL_rtcSetOscPwrdn
 *
 *   @b Description
 *   @n This function configures the 32-kHz Oscillator in powerdown mode.
 *
 *   @b Arguments
 *   @verbatim

            hRtc     	    Handle to the RTC instance

     @endverbatim
 *
 *   <b> Return Value </b> None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The 32-kHz Oscillator is configured in powerdown mode.
 *
 *   @b Modifies
 *   @n  The RTC Oscillator Register
 *
 *   @b Example
 *   @verbatim
         CSL_rtcSetOscPwrdn (hRtc);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_rtcSetOscPwrdn (
	CSL_RtcHandle hRtc
)
{
	CSL_FINST (hRtc->regs->RTC_OSC_REG, RTC_RTC_OSC_REG_OSC32K_PWRDN_R, PWRDN);
}

#ifdef __cplusplus
}
#endif


#endif  /* _CSL_RTCAUX_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -