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

📄 reset_a.h

📁 摩托罗拉MMC2107在ucosII的移植代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/************************************************************************/
/*	File: reset_a.h                                                 */
/*                                                                      */
/*  Purpose: File containing the structures and prototypes for the      */
/*           RESET_A device driver                                      */
/*                                                                      */
/*	(C) Copyright Motorola Inc, 2000.  All rights reserved.         */
/*                                                                      */
/*	$RCSfile: reset_a.h,v $                                         */
/*	$Revision: 1.1 $                                                */
/*	$Date: 2000/06/23 20:22:21 $                                    */
/*	$Author: jeffk $                                              */
/*                                                                      */
/************************************************************************/

#ifndef _RESET_A_H
#define _RESET_A_H

#include "mcore.h"

/*----------------------------------------------------------------------*/
/* Enumerations                                                         */
/*----------------------------------------------------------------------*/


typedef enum {
              RESET_A_ERR_NONE,
              RESET_A_ERR_INVALID_HANDLE,
              RESET_A_ERR_BAD_RESULT_ADDR,
              RESET_A_ERR_INVALID_REGISTER,
              RESET_A_ERR_INVALID_EXTERNAL_RESET_PARAMETER,
              RESET_A_ERR_INVALID_SOFT_RESET_PARAMETER
} Reset_A_ReturnCode_t;


typedef enum {
    Reset_A_RCR,            /* Select RESET Control Register     */
    Reset_A_RSR             /* Select RESET Status Register      */
} Reset_A_RegSwitch_t;


typedef enum {
          Reset_A_ENABLE,       /* Select ENABLE */
          Reset_A_DISABLE       /* Select DISABLE  */
} Reset_A_Control_t;


typedef enum{
  Reset_A_FALSE, /* Logical value FALSE */
  Reset_A_TRUE   /* Logical value TRUE */
 } Reset_A_Boolean_t;      /* Reset_A boolean enum */


/*----------------------------------------------------------------------*/
/*  Structures                                                          */
/*----------------------------------------------------------------------*/

typedef struct 
         {
           Reset_A_Boolean_t  SoftwareResetFlag;           /* RSR-SOFT */
           Reset_A_Boolean_t  WatchdogTimerResetFlag;      /* RSR-WDR */
           Reset_A_Boolean_t  PowerOnResetFlag;            /* RSR-POR */
           Reset_A_Boolean_t  ExternalResetFlag;           /* RSR-EXT */
           Reset_A_Boolean_t  LossOfClockResetFlag;        /* RSR-LOC */
           Reset_A_Boolean_t  LossOfLockResetFlag;         /* RSR-LOL */
         } RESET_A_StatusRegister_t, *pRESET_A_StatusRegister_t;

typedef struct 
         {
           UINT8 RCR; /* Reset control register */
           UINT8 RSR;  /* Reset status register */
} RESET_A_t, *pRESET_A_t;


/*----------------------------------------------------------------------*/
/* Register Bits & Masks                                                */
/*----------------------------------------------------------------------*/

/* Reset Module Control Register       */
          
#define RCR_SOFTRST_BITNO 7
#define RCR_SOFTRST_MASK (1 << RCR_SOFTRST_BITNO)
#define RCR_FRCRSTOUT_BITNO 6
#define RCR_FRCRSTOUT_MASK (1 << RCR_FRCRSTOUT_BITNO)

/* Reset Module Status Register  */
#define RSR_SOFT_BITNO 5
#define RSR_SOFT_MASK (1 << RSR_SOFT_BITNO)
#define RSR_WDR_BITNO 4
#define RSR_WDR_MASK (1 << RSR_WDR_BITNO)
#define RSR_POR_BITNO 3
#define RSR_POR_MASK (1 << RSR_POR_BITNO)
#define RSR_EXT_BITNO 2
#define RSR_EXT_MASK (1 << RSR_EXT_BITNO)
#define RSR_LOC_BITNO 1
#define RSR_LOC_MASK (1 << RSR_LOC_BITNO)
#define RSR_LOL_BITNO 0
#define RSR_LOL_MASK (1 << RSR_LOL_BITNO)


/*----------------------------------------------------------------------*/
/* Prototypes                                                           */
/*----------------------------------------------------------------------*/

Reset_A_ReturnCode_t  Reset_A_SoftReset_f (
                                        pRESET_A_t
                                        );
				       
Reset_A_ReturnCode_t Reset_A_ControlExternalReset_f ( pRESET_A_t,
                                                      Reset_A_Control_t
                                                    );

Reset_A_ReturnCode_t Reset_A_GetResetStatus_f( 
                                               pRESET_A_t,
                                               pRESET_A_StatusRegister_t
                                             );

Reset_A_ReturnCode_t Reset_A_SetRegister_f(
                                           pRESET_A_t, 			
                                           UINT8
                                          );

Reset_A_ReturnCode_t Reset_A_GetRegister_f(
                                           pRESET_A_t, 
                                           Reset_A_RegSwitch_t,
                                           UINT8 * 
                                           );
					  
					     


/*----------------------------------------------------------------------*/
/* Macro:       Reset_A_ControlExternalReset                            */
/*                                                                      */
/* Purpose:     RESET_A_ControlExternalReset allows software control    */
/*              for requesting a reset or for independently asserting   */
/*              the external reset pin.                                 */
/*                                                                      */
/* Input:                                                               */
/*   RESETPtr           : Reset module base address associated with     */
/*                        this driver.                                  */
/*   ExternalResetControlVal : External reset control bit.              */
/*                                                                      */
/* Output:                                                              */
/*  RESET_A_ERR_NONE    : No error.                                     */ 
/*  RESET_A_ERR_INVALID_HANDLE : Reset module base address parameter is */
/*                               zero.                                  */
/*  RESET_A_ERR_INVALID_EXTERNAL_RESET_PARAMETER : The external reset   */
/*                                                 is out of range.     */
/*----------------------------------------------------------------------*/
#define Reset_A_ControlExternalReset(                               \
                                     RESETPtr, 	                    \
                                     ExternalResetControlVal        \
                                     )                              \
(                                                                   \
    (RESET_A_PARAM_CHECKING) ?                                      \
    (                                                               \

⌨️ 快捷键说明

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