📄 lh7a404_timer.h
字号:
/***********************************************************************
* $Workfile: lh7a404_timer.h $
* $Revision: 1.0 $
* $Author: WellsK $
* $Date: Jun 30 2003 16:28:52 $
*
* Project: LH7A404 timer definitions
*
* Description:
* This file contains the structure definitions and manifest
* constants for LH7A404 component:
* Timers
*
* Revision History:
* $Log: //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a404/include/lh7a404_timer.h-arc $
*
* Rev 1.0 Jun 30 2003 16:28:52 WellsK
* Initial revision.
*
*
***********************************************************************
* SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
* OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
* AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
* SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
*
* SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
* FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
* SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
* FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
*
* COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
* CAMAS, WA
**********************************************************************/
#ifndef LH7A404_TIMER_H
#define LH7A404_TIMER_H
#include "abl_types.h"
#include "lh7a404_chip.h"
/***********************************************************************
* Timers Module Register Structure
**********************************************************************/
/* Timer Module Register Structure (for all timers) */
typedef struct
{
volatile UNS_32 load; /* Timer load value */
volatile UNS_32 value; /* Timer current count value */
volatile UNS_32 control; /* Timer control word */
volatile UNS_32 clear; /* Timer interrupt clear register */
} TIMER_REGS_T;
/***********************************************************************
* Timer Load register defines
**********************************************************************/
/* Timer maximum count value */
#define TIMER_MAXCOUNT 0xFFFF
/* Timer load value macro */
#define TIMER_LOAD(n) ((n) & TIMER_MAXCOUNT)
/**********************************************************************
* Timer Control register defines
*********************************************************************/
#define TIMER_CTRL_ENABLE 0x80 /* Timer enable macro */
#define TIMER_CTRL_DISABLE 0x00 /* Timer disable macro */
#define TIMER_CTRL_PERIODIC 0x40 /* Timer periodic mode macro */
#define TIMER_CTRL_FREERUN 0x00 /* Timer freerun mode macro */
#define TIMER_CTRL_508K 0x08 /* Timer 508KHz clock source macro */
#define TIMER_CTRL_2K 0x00 /* Timer 2KHz clock source macro */
/**********************************************************************
* Buzzer Control (timers) register defines
*********************************************************************/
#define BZCONT_BZMOD 0x2 /* Timer 1 buzzer signal enable */
#define BZCONT_BZTOG 0x1 /* Set state of buzzer (BZTOG) */
/* Macro pointing to timer registers at timer 1 base address */
#define TIMER1 ((TIMER_REGS_T *)(TIMER1_BASE))
/* Macro pointing to timer registers registers at timer 3 base address */
#define TIMER2 ((TIMER_REGS_T *)(TIMER2_BASE))
/* Macro pointing to timer registers at timer 3 base address */
#define TIMER3 ((TIMER_REGS_T *)(TIMER3_BASE))
/* Macro pointing to buzzer control register */
#define BZCONT * ((UNS_32 *)(BZCONT_BASE))
#endif /* LH7A404_TIMER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -