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

📄 main.c

📁 Data logger Power transision function switch among different power modes based on new Renesus microc
💻 C
📖 第 1 页 / 共 2 页
字号:
/***********************************************************************************
FILE NAME  		main.c
DESCRIPTION		Main Program.

Copyright   : 2006 Renesas Technology Europe Ltd.
Copyright   : 2006 Renesas Technology Corporation.
All Rights Reserved
***********************************************************************************/

/***********************************************************************************
Revision History
DD.MM.YYYY OSO-UID Description
24.05.2006 RTE-VNA First Release
***********************************************************************************/

/***********************************************************************************
User Includes
***********************************************************************************/

#include    <machine.h>

/*	Following header file provides a structure to access on-chip I/O registers. */
#include "iodefine.h"
/*	Following header file provides common defines for widely used items.	*/
#include "rsk38347def.h"
/*  Following header file provides prototype for main function */
#include "main.h"

/***********************************************************************************
User Program Code
***********************************************************************************/

/***********************************************************************************
Function Name : main
Description	  :	Main function.
Parameters	  : none
Return value  : none
***********************************************************************************/

/*************************************************************************************************************/
/*                                                                                                           */
/*  H8/300L Super Low Power Series                                                                           */
/*      -H8/38024 Series-                                                                                    */
/*  Application Note                                                                                         */
/*                                                                                                           */
/*  'Transition to Subactive Mode'                                                                           */
/*                                                                                                           */
/*  Function                                                                                                 */
/*  : Power-Down Mode                                                                                        */
/*     Subactive Mode                                                                                        */
/*                                                                                                           */
/*  External Clock : 10MHz                                                                                   */
/*  Internal Clock : 5MHz                                                                                    */
/*  Sub Clock      : 32.768kHz                                                                               */
/*                                                                                                           */
/*************************************************************************************************************/

/*************************************************************************************************************/
/*  Symbol Definition                                                                                        */
/*************************************************************************************************************/

struct BIT {
    unsigned char   b7:1;       /* bit7 */
    unsigned char   b6:1;       /* bit6 */
    unsigned char   b5:1;       /* bit5 */
    unsigned char   b4:1;       /* bit4 */
    unsigned char   b3:1;       /* bit3 */
    unsigned char   b2:1;       /* bit2 */
    unsigned char   b1:1;       /* bit1 */
    unsigned char   b0:1;       /* bit0 */
};



#define     TMA         *(volatile unsigned char *)0xFFB0        /* Timer Mode Register A                    */
#define     TCA         *(volatile unsigned char *)0xFFB1        /* Timer Counter A                          */


                                                           

#pragma interrupt   (dtint)
#pragma interrupt   (irq0int)
#pragma interrupt   (irq1int)
#pragma interrupt   (taint)
/*************************************************************************************************************/
/*  Function define                                                                                          */
/*************************************************************************************************************/
extern void INIT ( void );                                       /* SP Set                                   */
void        main ( void );
void        dtint ( void );
void        irq0int ( void );
void        irq1int ( void );
void        taint ( void );

/*************************************************************************************************************/
/*  RAM define                                                                                               */
/*************************************************************************************************************/

unsigned char   USRF;                                            /* User Flag Area                           */

#define     USRF_BIT    (*(struct BIT *)&USRF)
#define     SWONF       USRF_BIT.b1                              /* Switch On  Flag                          */
#define     LDONF       USRF_BIT.b0                              /* LED On Flag                              */

/*************************************************************************************************************/
/*  Vector Address 
                                                                                          */
/*************************************************************************************************************/
#pragma section ResetPointerSection
extern void PowerON_Reset(void);
void * const pointer=((void * const)(&(PowerON_Reset)));


#pragma section     V1                                           / * Vector Section Set                       * /
void (*const VEC_TBL1[])(void) = {
    INIT                                                         / * 0x0000 - 0x000F                          * /
};
#pragma section     V2                                           / * Vector Section Set                       * /
void (*const VEC_TBL2[])(void) = {
    irq0int                                                      / * 0x0008 IRQ0 Interrupt Vector             * /
};
#pragma section     V3                                           / * Vector Section Set                       * /
void (*const VEC_TBL3[])(void) = {
    irq1int                                                      / * 0x000A IRQ1  Interrupt Vector            * /
};
#pragma section     V4                                           / * Vector Section Set                       * /
void (*const VEC_TBL4[])(void) = {
    taint                                                        / * 0x0016 timer A  Interrupt Vector         * /
};
#pragma section     V5                                           / * Vector Section Set                       * /
void (*const VEC_TBL5[])(void) = {

⌨️ 快捷键说明

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