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

📄 spl78k0_kx2_user.h

📁 NEC upd78f0300的自编程序样例
💻 H
字号:
/************************************************************************************/
/*                                                                                  */
/* File:        spl78k0_kx2_user.h                                                  */
/* Project:     Selfprogramming application note, MF2 single voltage flash          */
/* Device:      78k0/Kx2                                                            */
/* Version:     1v06                                                                */
/* Date:        12.09.2006 09:31                                                    */
/*                                                                                  */
/* Copyright:   (c)2004-2006 by NEC Electronics (Europe) GmbH. All rights reserved. */
/*                                                                                  */
/* Description: user configurable constant/macros of the selfprogramming library    */
/*                                                                                  */
/* Environment: IAR environment for 78K0 and 78K0S (version V3.xx and V4.xx)        */
/*                                                                                  */
/************************************************************************************/


#ifndef __SPL78K0_KX2_USER_H_INCLUDED
#define __SPL78K0_KX2_USER_H_INCLUDED


// include files list
// -------------------
#include "spl78k0_kx2_config.h"          // NEC EE


// constant definitions
// --------------------

// size of the common data buffer expressed in [bytes]
// the data buffer is used for data-exchange between the firmware and the selflib.
#define   DATA_BUFFER_SIZE    200


// customizable interrupt controller configuration during selfprogramming period
// Bit     --7-------6-------5-------4-------3-------2-------1-------0----------------------
// MK0L:     SREMK6  PMK5    PMK4    PMK3    PMK2    PMK1    PMK0    LVIMK
// MK0H:     TMMK010 TMMK000 TMMK50  TMMKH0  TMMKH1  DUALMK0 STMK6   SRMK6
// MK1L:     PMK7    PMK6    WTMK    KRMK    TMMK51  WTIMK   SRMK0   ADMK
// MK1H:     1       1       1       1       TMMK011 TMMK001 CSIMK11 DMUMK/IICMK0
//------------------------------------------------------------------------------------------
//#define   MK0L_SELFPROG_MASK   0xF7   /* allow INTP2 interrupt during selfprogramming   */
//#define   MK0H_SELFPROG_MASK   0xDF   /* allow TM50 interrupt during selfprogramming    */
//#define   MK1L_SELFPROG_MASK   0xF7   /* allow TM51 interrupt during selfprogramming    */
//#define   MK1H_SELFPROG_MASK   0xFF   /* all interrupts disabled during selfprogramming */
//------------------------------------------------------------------------------------------
#define   MK0L_SELFPROG_MASK   0xFF   /* all interrupts disabled during selfprogramming */
#define   MK0H_SELFPROG_MASK   0xFF   /* all interrupts disabled during selfprogramming */
#define   MK1L_SELFPROG_MASK   0xFF   /* all interrupts disabled during selfprogramming */
#define   MK1H_SELFPROG_MASK   0xFF   /* all interrupts disabled during selfprogramming */


// FLMD0_port control macros (FLDM0<->P4.0 connection pulled-down by 10kOhm resistor)
#if(__VER__ >= 400)
  #define  FLMD0_CTRL_PORT_HIGH   {P1_bit.no2 = 1; PM1_bit.no2 = 0; }
  #define  FLMD0_CTRL_PORT_LOW    {P1_bit.no2 = 0; PM1_bit.no2 = 1; }
#else
  #define  FLMD0_CTRL_PORT_HIGH   {P1.2 = 1; PM1.2 = 0; }
  #define  FLMD0_CTRL_PORT_LOW    {P1.2 = 0; PM1.2 = 1; }
#endif


// switch variables for conditional compiling
// (comment out if backup not required, but please be careful
// and take necessary countermeasures in your application)
// ------------------------------------------------------------------
//#define  __INT_BACKUP
//#define  __RB3_BACKUP

#endif

⌨️ 快捷键说明

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