upsd_flash.h

来自「uPSD Device Driver Files」· C头文件 代码 · 共 57 行

H
57
字号
/*  upsd_flash.h 
Header file for uPSD 3200 flash I/O routines

Note: Please edit the addresses shown to match your system memory map


Copyright (c) 2002 ST Microelectronics
This example demo code is provided as is and has no warranty,
implied or otherwise.  You are free to use/modify any of the provided
code at your own risk in your applications with the expressed limitation
of liability (see below) so long as your product using the code contains
at least one uPSD products (device).

LIMITATION OF LIABILITY:   NEITHER STMicroelectronics NOR ITS VENDORS OR 
AGENTS SHALL BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA,
INTERRUPTION OF BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER THIS AGREEMENT OR
OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
--------------------------------------------------------------------------*/



#define PSD_REG_BASE (unsigned int) 0x0200	// base address of PSD8XXFX control registers. This area is
                                               // 256 bytes.

// Addresses to use to invoke embedded algorithm in FLASH memory. Modify these addresses.
// It is advised to pick a Flash memory address that is common to all memory pages.
	
#define	FLASH_COMMON_XAAA (volatile unsigned char xdata *) 0x9AAA 
#define	FLASH_COMMON_X555 (volatile unsigned char xdata *) 0x9555 

// Addresses to use to invoke embedded algorithm in FLASH boot memory. Modify these addresses.
// It is advised to pick a Flash memory address that is common to all memory pages.

#define	FLASH_BOOT_XAAA (volatile unsigned char xdata *) 0x0AAA 
#define	FLASH_BOOT_X555 (volatile unsigned char xdata *) 0x0555 

unsigned char flash_write_with_poll(
    volatile unsigned char xdata *addr, unsigned char dat);
unsigned char flash_erase_bulk(
    volatile unsigned char xdata* flash_bulk_erase_address);
unsigned char flash_boot_write_with_poll(
    volatile unsigned char xdata *addr, unsigned char dat);
unsigned char flash_boot_erase_bulk(
    volatile unsigned char xdata* flash_boot_bulk_erase_address);
unsigned char flash_erase_sector(
     volatile unsigned char xdata* sector_erase_address);	
unsigned char flash_write_with_toggle(unsigned char *addr,unsigned char dat);
void flash_reset(void);	
unsigned char flash_read_id(unsigned char *flash_id_address);
unsigned char flash_boot_write_with_toggle(volatile unsigned char *addr, 
unsigned char dat);
void flash_boot_reset(void);
unsigned char flash_boot_read_id(volatile unsigned char *flash_boot_id_address);
unsigned char flash_boot_read_sector_protect(void);	

⌨️ 快捷键说明

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