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

📄 setuptimer01.c

📁 ccxx00系列RF模块用8051控制的源代码
💻 C
字号:
/*******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***     This file implements a function for setting up                             *
 *      ***   +             timer 0 or timer 1.                                                        *
 *      ***   + +   ***                                                                                *
 *      ***   +++   ***     SetupTimer01.c                                                             *
 *      ***        ***                                                                                 *
 *       ************                                                                                  *
 *        **********                                                                                   *
 *                                                                                                     *
 *******************************************************************************************************
 * Compiler:                Keil C51 V7.50                                                             *
 * Target platform:         Chipcon CCxxx0 (Silabs F320                                                *
 * Author:                  SNA                                                                        *
 *******************************************************************************************************
 * Revision history:        See end of file                                                            *
 ******************************************************************************************************/
#include <Chipcon\srf04\regssrf04.h>
#include <Chipcon\srf04\halsrf04.h>




//-------------------------------------------------------------------------------------------------------
#define TIMER0_SYSCLK()             (CKCON |= 0x04)
#define TIMER0_PRESCALER()          (CKCON &= (~0x04))
#define TIMER1_SYSCLK()             (CKCON |= 0x08)
#define TIMER1_PRESCALER()          (CKCON &= (~0x08))
//-------------------------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------------------------
// void halSetupTimer01(UINT8 timer01, UINT8 clkSource, UINT8 mode, BOOL timerInt)
//
//  DESCRIPTION:
//      Function used to set up timer 0 or timer 1. Be aware that Timer 0 and Timer 1 share the same
//      prescaler. The function enables the given timer. Allowing the timer to be controlled by the 
//      external input signal can be done manually by setting GATE0 or GATE1 to 

⌨️ 快捷键说明

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