beautypg.com

Flash_init(), Memcpy_rx (), E 63) – Maxim Integrated 73S12xxF Software User Manual

Page 63

background image


UG_12xxF_016

73S12xxF Software User Guide

Rev. 1.50

63

4.2.16 Flash/Memory API – Available with all 73S12xxF Devices

Flash management assumes that the CPU is running at the default clock rate of 3.69 MHz. A Flash write
is processed on a page basis. If a write to a Flash address overlays two pages, a two-page write
operation will be performed.

The Flash write process involves 4 steps: Read, Erase, Verify, Write. Should any of these steps fail, the
write operation will fail. The user must use caution when using these APIs as there will be no check in
the LAPI for accidental writes. The API includes:

Flash_Init()

(page 63)

memcpy_rx ()

(page 63)

memcpy_xx ()

(page 64)

memcpy_xi ()

(page 64)

memcpy_ix ()

(page 64)

memcmp_rx ()

(page 65)

memcmp_xx ()

(page 65)

memset_x ()

(page 65)

strlen_x ()

(page 66)

strlen_r ()

(page 66)

Log2 ()

(page 66)


Flash_Init()

Purpose

Initialize the Flash management registers to values appropriate for the CPU running
at the default speed.

Synopsis

void Flash_Init ( void );

Parameters

None.

Return Codes None.

memcpy_rx ()

Purpose

Flash management – use to write to a Flash page that the destination ROM address
belongs to using the contents from the RAM source location. If the length of the
source and the starting ROM location cause the write operation to span more than
one 512-byte Flash page, the Read/Erase/Verify/Write will take place on all the
pages involved. An erase operation will result in the Flash contents being set to
0xFF.

Synopsis

Bbool memcpy_rx (

Unsigned char code *dst,

Unsigned char xdata *src,

Unsigned integer len );

Parameters

dst: Input parameter
Specifies starting ROM address of Flash to be written (destination).

src: Input parameter
Use contents at this RAM address location as the source data.

len: Input parameter
Length (in bytes) of data to write to Flash.

Return Codes TRUE if the Write was successful.

FALSE if the Write was not completed.