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

📄 ma_scb.c

📁 The EM6125 is a bit map controller and driver for full dot matrix
💻 C
字号:

/*
*****************************************************************************
**
**      Project     : My project
**
**      Component   : LPC2106 (LPC2106)
**
**      Modulename  : SCB
**
**      Filename    : ma_scb.c
**
**      Abstract    : This file implements a device driver for the SCB 
**                    module.
**
**      Compiler    : IAR C compiler
**
**      Date        : 2004-07-05 10:18:53
**
**      License no. : 9503-663-863-6224     Ivan
**
**      Warning     : This file has been automatically generated.
**                    Do not edit this file if you intend to regenerate it.
**
**      This device driver was created by IAR MakeApp version 
**      4.02A (Philips LPC210x: 4.00C) for the Philips LPC210x series of
**      microcontrollers.
**
**      (c)Copyright 2004 IAR Systems.
**      Your rights to this file are explained in the IAR MakeApp 
**      License Agreement. All other rights reserved.
**
*****************************************************************************
*/

/*
**===========================================================================
**  1       GENERAL
**  1.1     Revisions
**
**  Please read the IAR MakeApp for Philips LPC210x readme file 
**  
**
**===========================================================================
*/

/*
**===========================================================================
**  1.2     References
** 
**  No   Identification          Name or Description
**  ==   ===================     ================================
**
**  1    02/Oct/2003             Philips LPC210x Hardware Manual
** 
**===========================================================================
*/

/*
**===========================================================================
**  2.      INCLUDE FILES
**  2.1     Standard include files
**===========================================================================
*/

/*
**===========================================================================
**  2.2     Application include files
**===========================================================================
*/

#include "usercode.h"   /* Usercode macros (see <template.h>) */
#include "ma_tgt.h"     /* Target specific header file */
#include "ma_sfr.h"     /* Special function register bitfield macros */
#include "iolpc210x.h"  /* Defines Special function registers */

#include "ma_scb.h"     /* SCB Module driver header file */

/*
**===========================================================================
**  3.      DECLARATIONS
**  3.1     Internal constants
**===========================================================================
*/

#define MA_MAMCR_SCB           0x00000000  /* MAM Control Register */
#define MA_MAMCR_SCB_MASK      0x00000003  /* Used bits */
#define MA_MAMTIM_SCB          0x00000007  /* MAM Timing Control Register */
#define MA_MAMTIM_SCB_MASK     0x00000007  /* Used bits */
#define MA_MEMMAP_SCB          0x00000001  /* Memory Mapping Control Register */
#define MA_MEMMAP_SCB_MASK     0x00000003  /* Used bits */
#define MA_PLLCON_SCB          0x00000000  /* PLL Control Register */
#define MA_PLLCON_SCB_MASK     0x00000003  /* Used bits */
#define MA_PLLCFG_SCB          0x00000000  /* PLL Configuration Register */
#define MA_PLLCFG_SCB_MASK     0x0000007F  /* Used bits */
#define MA_PLLFEED_SCB         0x00000000  /* PLL Feed Register */
#define MA_PLLFEED_SCB_MASK    0x000000FF  /* Used bits */
#define MA_PCON_SCB            0x00000000  /* Power Control Register */
#define MA_PCON_SCB_MASK       0x00000003  /* Used bits */
#define MA_PCONP_SCB           0x000003BE  /* Power Control for Peripherals Register */
#define MA_PCONP_SCB_MASK      0x000003BE  /* Used bits */
#define MA_VPBDIV_SCB          0x00000000  /* VPB Divider Register */
#define MA_VPBDIV_SCB_MASK     0x00000003  /* Used bits */
#define MA_EXTINT_SCB          0x00000000  /* External Interrupt Flag Register */
#define MA_EXTINT_SCB_MASK     0x00000007  /* Used bits */
#define MA_EXTWAKE_SCB         0x00000000  /* External Interrupt Wakeup Register */
#define MA_EXTWAKE_SCB_MASK    0x00000007  /* Used bits */

/*
**===========================================================================
**  3.2     Internal macros
**===========================================================================
*/

/*
**===========================================================================
**  3.3     Internal type definitions
**===========================================================================
*/

/*
**===========================================================================
**  3.4     Global variables (declared as 'extern' in some header file)
**===========================================================================
*/

/*
**===========================================================================
**  3.5     Internal function prototypes (defined in Section 5)
**===========================================================================
*/

/*
**===========================================================================
**  3.6     Internal variables
**===========================================================================
*/

/*
**===========================================================================
**  4.      GLOBAL FUNCTIONS (declared as 'extern' in some header file)
**===========================================================================
*/



void MA_Init_SCB( void ) 
/*
**---------------------------------------------------------------------------
**
**  Abstract:
**      Initialises the SCB module. Only sets those registers with  
**      values not equal to the power-on reset values. 
**
**      If the PLL shall be used this function only sets the PLL registers.
**      Changes to the PLLCFG registers will not take effect until a 
**      correct PLL feed sequence has been given into the PLLFEED register.
**      This must be done after the PLOCK bit is asserted. If PLL interrupt 
**      is enabled the feed sequence is done by MA_IntHandlerPLL_SCB().
**
**  Parameters:
**      None
**
**  Returns:
**      None
**
**---------------------------------------------------------------------------
*/
{
    /*--- Handle user code on function entry ---*/
    ENTER_MA_INIT_SCB;
            
    /*--- Init SCB registers ---*/     
    MEMMAP   = ( MEMMAP & ~MA_MEMMAP_SCB_MASK ) | MA_MEMMAP_SCB;

    /*--- Handle user code on function exit ---*/
    EXIT_MA_INIT_SCB;
    
} /* MA_Init_SCB */





void MA_Reset_SCB( void ) 
/*
**---------------------------------------------------------------------------
**
**  Abstract:
**      Resets the SCB module. Sets all registers. 
**
**      If the PLL shall be used this function only sets the PLL registers.
**      Changes to the PLLCFG registers will not take effect until a 
**      correct PLL feed sequence has been given into the PLLFEED register.
**      This must be done after the PLOCK bit is asserted. If PLL interrupt 
**      is enabled the feed sequence is done by MA_IntHandlerPLL_SCB().
**
**  Parameters:
**      None
**
**  Returns:
**      None
**
**---------------------------------------------------------------------------
*/
{
    /*--- Handle user code on function entry ---*/
    ENTER_MA_RESET_SCB;
            
    /*--- Reset SCB registers ---*/     
    MAMCR    = ( MAMCR & ~MA_MAMCR_SCB_MASK ) | MA_MAMCR_SCB;
    MAMTIM   = ( MAMTIM & ~MA_MAMTIM_SCB_MASK ) | MA_MAMTIM_SCB;
    MEMMAP   = ( MEMMAP & ~MA_MEMMAP_SCB_MASK ) | MA_MEMMAP_SCB;
    PLLCON   = ( PLLCON & ~MA_PLLCON_SCB_MASK ) | MA_PLLCON_SCB;
    PLLCFG   = ( PLLCFG & ~MA_PLLCFG_SCB_MASK ) | MA_PLLCFG_SCB;
    PLLFEED  = ( PLLFEED & ~MA_PLLFEED_SCB_MASK ) | MA_PLLFEED_SCB;
    PCON     = ( PCON & ~MA_PCON_SCB_MASK ) | MA_PCON_SCB;
    PCONP    = ( PCONP & ~MA_PCONP_SCB_MASK ) | MA_PCONP_SCB;
    VPBDIV   = ( VPBDIV & ~MA_VPBDIV_SCB_MASK ) | MA_VPBDIV_SCB;
    EXTINT   = ( EXTINT & ~MA_EXTINT_SCB_MASK ) | MA_EXTINT_SCB;
    EXTWAKE  = ( EXTWAKE & ~MA_EXTWAKE_SCB_MASK ) | MA_EXTWAKE_SCB;

    /*--- Handle user code on function exit ---*/
    EXIT_MA_RESET_SCB;
    
} /* MA_Reset_SCB */



/*
**===========================================================================
**  5.      INTERNAL FUNCTIONS (declared in Section 3.5)
**===========================================================================
*/

/*
**===========================================================================
** END OF FILE
**===========================================================================
*/ 



⌨️ 快捷键说明

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