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

📄 configrealtimeclock.c

📁 ti-Chipcon CC1010 1G以下Soc源码库。包括rf,powermodes,clockmodes,flashRW,interrupts,timer,pwm,uart...所有底层驱动源码
💻 C
字号:
/*****************************************************************************
 *                                                                           *
 *        **********                                                         *
 *       ************                                                        *
 *      ***        ***                                                       *
 *      ***   +++   ***                                                      *
 *      ***   + +   ***                                                      *
 *      ***   +                            CHIPCON CC1010                    *
 *      ***   + +   ***              HAL - ConfigRealtimeClock               *
 *      ***   +++   ***                                                      *
 *      ***       ***                                                        *
 *       ***********                                                         *
 *        *********                                                          *
 *                                                                           *
 *****************************************************************************
 *                                                                           *
 *****************************************************************************
 * Author:              ROH                                                  *
 *****************************************************************************
 * Revision history:                                                         *
 *                                                                           *
 * $Log: ConfigRealtimeClock.c,v $
 * Revision 1.1  2002/10/14 13:04:30  tos
 * Initial version in CVS.
 *
 *                                                                           *
 ****************************************************************************/

#include <chipcon/hal.h>

//----------------------------------------------------------------------------
// void halConfigRealtimeClock(...);
//
//  Description:
//      This function configures the realtime clock. It's period in seconds
//      is given in _period_. In order for the realtime clock to function
//      the 32 kHz oscillator must be connected to a 32 kHz crystal or a 32 kHz
//      clock signal must be available on pin XOSC32_Q1. The 32 kHz oscillator
//      must be started up and stable before the RTC is activated.
//      The realtime clock must be started by using the macro RTC_RUN(TRUE).
//
//  Arguments:
//      byte period
//          The desired period between interrupts in seconds.
//
//  Return value:
//      void
//----------------------------------------------------------------------------
void halConfigRealTimeClock(byte period) {
    RTCON = (RTCON&0x80) | (period&0x7F);
    RTCIF=0;
    RTCIE=1;
    EA=1;
}    

⌨️ 快捷键说明

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