📄 tim_a.h
字号:
/**********************************************************************/
/* File: tim_a.h File containing the structures and prototypes */
/* for the TIM_A */
/* */
/* Design Reference: Doc. Name Version */
/* --------------------------- ------- */
/* TIM_A Level 1 Service 1.0 */
/* Functional Design Specification */
/* */
/* (C) Copyright Motorola Inc, 2000. All rights reserved. */
/* */
/* $RCSfile: tim_a.h,v $ */
/* $Revision: 1.1 $ */
/* $Date: 2001/12/19 00:00:00 $ */
/* $Author: Dmitry Shvarts $ */
/**********************************************************************/
#ifndef _TIM_A_H
#define _TIM_A_H
#include "mcore.h"
/*--------------------------------------------------------------------*/
/* TIM_A Register Definitions */
/*--------------------------------------------------------------------*/
typedef struct
{
volatile UINT8 TIMIOS; /* 0 */
volatile UINT8 TIMCFORC; /* 1 */
volatile UINT8 TIMOC3M; /* 2 */
volatile UINT8 TIMOC3D; /* 3 */
volatile UINT16 TIMCNTL; /* 4-5 */
volatile UINT8 TIMSCR1; /* 6 */
volatile UINT8 e1; /* 7 */
volatile UINT8 TIMTOV; /* 8 */
volatile UINT8 TIMCTL1; /* 9 */
volatile UINT8 e2; /* A */
volatile UINT8 TIMCTL2; /* B */
volatile UINT8 TIMIE; /* C */
volatile UINT8 TIMSCR2; /* D */
volatile UINT8 TIMFLG1; /* E */
volatile UINT8 TIMFLG2; /* F */
volatile UINT16 TIMC[4]; /*10-11, 12-13, 14-15, 16-17 */
volatile UINT8 TIMPACTL; /*18 */
volatile UINT8 TIMPAFLG; /*19 */
volatile UINT16 TIMPACNTL; /*1A-1B */
volatile UINT8 empty3; /*1C */
volatile UINT8 TIMPORT; /*1D */
volatile UINT8 TIMDDR; /*1E */
volatile UINT8 TIMTST; /*1F */
} TIM_A_t, *pTIM_A_t;
/*--------------------------------------------------------------------*/
/* Enumerations
/*--------------------------------------------------------------------*/
typedef enum
{
TIM_A_TIMIOS,
TIM_A_TIMCFORC,
TIM_A_TIMOC3M,
TIM_A_TIMOC3D,
TIM_A_TIMCNTL,
TIM_A_TIMSCR1,
TIM_A_TIMTOV,
TIM_A_TIMCTL1,
TIM_A_TIMCTL2,
TIM_A_TIMIE,
TIM_A_TIMSCR2,
TIM_A_TIMFLG1,
TIM_A_TIMFLG2,
TIM_A_TIMC_0,
TIM_A_TIMC_1,
TIM_A_TIMC_2,
TIM_A_TIMC_3,
TIM_A_TIMPACTL,
TIM_A_TIMPAFLG,
TIM_A_TIMPACNTL,
TIM_A_TIMPORT,
TIM_A_TIMDDR,
TIM_A_TIMTST
} TIM_A_Register_t;
/*--- Timer configuration structures ---------------------------------*/
typedef enum
{
TIM_A_FUNCTION_DISABLED,
TIM_A_FUNCTION_ENABLED
} TIM_A_TIMEnable_t;
typedef enum
{
TIM_A_INTERRUPT_DISABLED, /* Interrupt disabled */
TIM_A_INTERRUPT_ENABLED /* Interrupt enabled */
} TIM_A_InterruptEnable_t;
typedef enum
{
TIM_A_FAST_CLEAR_DISABLED, /* Interrupt flag should be creared */
/* explicitly by software */
TIM_A_FAST_CLEAR_ENABLED /* Interrupt flag is automatically cleared */
/* during output read or write of flag register */
} TIM_A_FastClearEnable_t;
typedef enum
{
TIM_A_PULLUP_INPUT_DISABLED, /* Pullup Resistors disabled */
TIM_A_PULLUP_INPUT_ENABLED /* Pullup Resistors enabled */
} TIM_A_PullupInputEnable_t;
typedef enum
{
TIM_A_DRV_REDUCED_OUTPUT_DISABLED, /* Output Drive Reduction disabled */
TIM_A_DRV_REDUCED_OUTPUT_ENABLED /* Output Drive Reduction enabled */
} TIM_A_DrvReducedOutputEnable_t;
typedef enum
{
TIM_A_RESET_COMPARE_3_DISABLED, /* Counter resets on channel 3 compare */
TIM_A_RESET_COMPARE_3_ENABLED /* Counter keeps running until 0xFFFF */
} TIM_A_CounterResetOn3Enable_t;
/*--- Channel configuration structures -------------------------------*/
typedef enum
{
TIM_A_CHANNEL_0,
TIM_A_CHANNEL_1,
TIM_A_CHANNEL_2,
TIM_A_CHANNEL_3,
TIM_A_CHANNELS
} TIM_A_Channel_t;
typedef enum
{
TIM_A_INPUT,
TIM_A_OUTPUT
} TIM_A_IOSelect_t;
typedef enum
{
TIM_A_TOGGLE_ON_OVERFLOW_DISABLED,
TIM_A_TOGGLE_ON_OVERFLOW_ENABLED
} TIM_A_ToggleOnOverflow_t;
typedef enum
{
TIM_A_OUTPUT_ACTION_DISABLED , /* 00 */
TIM_A_OUTPUT_ACTION_TOGGLE , /* 01 */
TIM_A_OUTPUT_ACTION_CLEAR , /* 10 */
TIM_A_OUTPUT_ACTION_SET , /* 11 */
} TIM_A_OutputAction_t;
typedef enum
{
TIM_A_INPUT_CAPTURE_DISABLED , /* 00 */
TIM_A_INPUT_CAPTURE_ON_RISING_EDGES , /* 01 */
TIM_A_INPUT_CAPTURE_ON_FALLING_EDGES, /* 10 */
TIM_A_INPUT_CAPTURE_ON_ANY_EDGE , /* 11 */
} TIM_A_InputCaptureEdge_t;
typedef enum
{
TIM_A_OUTPUT_COMPARE_3_MASK_DISABLED,
TIM_A_OUTPUT_COMPARE_3_MASK_ENABLED
} TIM_A_OutputCompare3Mask_t;
/*--- Channel indication structures ----------------------------------*/
typedef enum
{
TIM_A_NO_INTERRUPT_PRESENT, /* No TIM interrupt is present */
TIM_A_INTERRUPT_PRESENT /* TIM interrupt is present */
} TIM_A_TIMInterruptFlag_t;
typedef enum
{
TIM_A_SCALAR_00 = 0x0, /* Pre-Scaler select value is equal to the*/
/* system clock */
TIM_A_SCALAR_01 = 0x1, /* Pre-Scaler select value is equal to the*/
/* (system clock) / 2 */
TIM_A_SCALAR_02 = 0x2, /* Pre-Scaler select value is equal to the*/
/* (system clock) / 4 */
TIM_A_SCALAR_03 = 0x3, /* Pre-Scaler select value is equal to the*/
/* (system clock) / 8 */
TIM_A_SCALAR_04 = 0x4, /* Pre-Scaler select value is equal to the*/
/* (system clock) / 16 */
TIM_A_SCALAR_05 = 0x5, /* Pre-Scaler select value is equal to the*/
/* (system clock) / 32 */
TIM_A_SCALAR_06 = 0x6, /* Pre-Scaler select value is equal to the*/
/* (system clock) / 64 */
TIM_A_SCALAR_07 = 0x7, /* Pre-Scaler select value is equal to the*/
/* (system clock) / 128 */
} TIM_A_PreScalarSelect_t;
#define TIM_A_MAX_COMPARE_VALUE 0xFFFF
typedef enum{
TIM_A_ERR_NONE,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -