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

📄 fmwu_common.h

📁 OKI DEMO FLASH WRITE PROGRAM
💻 H
字号:
/****************************************************************************/
/*                                                                          */
/*    Copyright (C) 2006 Oki Electric Industry Co., LTD.                    */
/*                                                                          */
/*    System Name    :  ML675050                                            */
/*    Module Name    :  Flash Memory Write Utility flash module             */
/*    File   Name    :  fmwu_common.h                                       */
/*    Revision       :  01.00                                               */
/*    Date           :  2006/03/20                                          */
/*                                                                          */
/****************************************************************************/
#ifndef FMWU_COMMON_H
#define FMWU_COMMON_H

/* type definitions */
typedef unsigned char	UBYTE;	/* unsigned byte */
typedef unsigned short  UHWORD;	/* unsigned half word */
typedef unsigned long   UWORD;	/* unsigned word */

#define	OK		(0)
#define ERROR	(-1)

#define YES            (1)
#define NO             (0)
#define PROTECT_CANCEL (1)
#define PROTECT_SET    (2)
#define SECURITY       (0)
#define NOSECURITY     (-1)

/** Read Data **/
#define in_b(n)		(*((volatile UBYTE *)(n)))
#define in_hw(n)	(*((volatile UHWORD *)(n)))
#define in_w(n)		(*((volatile UWORD *)(n)))

/** Write Data **/
#define out_b(n,c)	(*((volatile UBYTE *)(n)) = (c))
#define out_hw(n,c)	(*((volatile UHWORD *)(n)) = (c))
#define out_w(n,c)	(*((volatile UWORD *)(n)) = (c))

#ifndef SemiSWI
#ifdef __thumb
/* Define Angel Semihosting SWI to be Thumb one */
#define SemiSWI (0xAB)
#else
/* Define Angel Semihosting SWI to be ARM one */
#define SemiSWI (0x123456)
#endif
#endif

/* global functions */
int strlen(const char *s);
const char *ltoa_hex(unsigned long i, int len);

/* Write a string */
__swi(SemiSWI) void _Write0(unsigned long op, const char *string);
#define Write0(string) _Write0(0x4, string)

/* Read a character  */
__swi(SemiSWI) int _ReadC(unsigned op);
#define ReadC() _ReadC (0x7)

/* Exit */
__swi(SemiSWI) void _Exit(unsigned long op, unsigned long except);
#define Exit() _Exit(0x18,0x20026)

/* Register */
#define FLACON	0xB7000100

/* FLACON BIT */
#define	FLWE_BIT    0x00000001
#define	FWEND_BIT   0x00000002
#define SEQMD_BIT   0x00000010
#define SEQM_BIT    0x00000020

/* ADDRESS */
#define ADDR_15554	0x00015554
#define ADDR_0AAA8	0x0000AAA8
#define ADDR_00000	0x00000000
#define ADDR_00001	0x00000001
#define ADDR_00002	0x00000002
#define ADDR_00003	0x00000003
#define ADDR_AAA	0x00000AAA
#define ADDR_555	0x00000555
#define ADDR_2AA	0x000002AA

#endif

⌨️ 快捷键说明

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