|
|
|
Component
IntFLASH
Internal FLASH
Methods:
(Methods are user-callable functions/subroutines intended for
the component functions control. Please see the Embedded Components page for more information.)
-
DisableEvent
- This method disables all the events except OnSaveBuffer, OnRestoreBuffer and OnEraseError. The method is available only if any event is enabled.
ANSIC prototype: byte DisableEvent(void)
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_SPEED - This device does not work in the active speed mode
-
EnableEvent
- This method enables all the events except OnSaveBuffer, OnRestoreBuffer and OnEraseError. The method is available only if any event is enabled.
ANSIC prototype: byte EnableEvent(void)
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_SPEED - This device does not work in the active speed mode
-
SetWait
- Method changes the wait status of writing or erasing methods. This method is available only if property Wait in RAM is not selected.
ANSIC prototype: void SetWait(bool Wait)
- Wait:bool - true - methods wait till the FLASH write or erase operation is finished, data is verified at the end of writing method false - methods do not wait for the end of write or erase operation, data is not verified at the end of writing method.
-
Busy
- This method returns the status of the FLASH device. The method may be required and called from another component methods - in this case it cannot be disabled.
ANSIC prototype: bool Busy(byte Block)
- Block:byte - Number of Flash block. Not used for Freescale 56800, HCS08, HCS12X and ColdFireV1 derivates - any value may be passed.
- Return value:bool - true/false - FLASH is busy/ready
- Methods for Freescale ColdFireV1/HCS12/HCS12X/HCS08 and 56800/E derivatives.
-
EraseSector
- Erases the sector to which address Addr belongs.
ANSIC prototype: byte EraseSector(ComponentName_TAddress Addr)
- Addr:ComponentName_TAddress - Address in FLASH.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE - Address is out of range
- ERR_SPEED - This device does not work in the active speed mode
- ERR_BUSY - Device is busy
- ERR_PROTECT - Flash is write protect
- ERR_VALUE - Flash sector erase was not successful
-
SetByteFlash
- Writes a byte to an address in FLASH. The operation of this method depends on the "Write method" property and state of the flash. Please see more details on general info page of the help.
ANSIC prototype: byte SetByteFlash(ComponentName_TAddress Addr, byte Data)
- Addr:ComponentName_TAddress - Address to FLASH.
- Data:byte - Data to write.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE - Address is out of range
- ERR_VALUE - Read value is not equal to written value
- ERR_SPEED - This device does not work in the active speed mode
- ERR_BUSY - Device is busy
- ERR_PROTECT - Flash is write protect
-
GetByteFlash
- Gets byte from an address in FLASH.
ANSIC prototype: byte GetByteFlash(ComponentName_TAddress Addr, byte *Data)
- Addr:ComponentName_TAddress - Address to FLASH.
- Data: Pointer to byte - A pointer to the returned 8-bit data.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE - Address is out of range
- ERR_BUSY - Device is busy
-
SetWordFlash
- Writes a word to an address in FLASH. The operation of this method depends on the "Write method" property and state of the flash. Please see more details on general info page of the help.
ANSIC prototype: byte SetWordFlash(ComponentName_TAddress Addr, word Data)
- Addr:ComponentName_TAddress - Address to FLASH.
- Data:word - Data to write.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE - Address is out of range
- ERR_VALUE - Read value is not equal to written value
- ERR_SPEED - This device does not work in the active speed mode
- ERR_BUSY - Device is busy
- ERR_PROTECT - Flash is write protect
-
GetWordFlash
- Gets a word from an address in FLASH.
ANSIC prototype: byte GetWordFlash(ComponentName_TAddress Addr, word *Data)
- Addr:ComponentName_TAddress - Address to FLASH.
- Data: Pointer to word - A pointer to the returned 16-bit data.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE - Address is out of range
- ERR_BUSY - Device is busy
-
SetLongFlash
- Writes a long word to an address in FLASH. The operation of this method depends on the "Write method" property and state of the flash. Please see more details on general info page of the help.
ANSIC prototype: byte SetLongFlash(ComponentName_TAddress Addr, dword Data)
- Addr:ComponentName_TAddress - Address to FLASH.
- Data:dword - Data to write.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE – The address is out of range
- ERR_VALUE – The read value is not equal to the written value
- ERR_SPEED - This device does not work in the active speed mode
- ERR_BUSY - Device is busy
- ERR_PROTECT - Flash is write protect
-
GetLongFlash
- Gets a long word from an address in FLASH.
ANSIC prototype: byte GetLongFlash(ComponentName_TAddress Addr, dword *Data)
- Addr:ComponentName_TAddress - Address to FLASH.
- Data: Pointer to dword - A pointer to the returned 32-bit data.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE – The address is out of range
- ERR_BUSY - Device is busy
-
SetBlockFlash
- Writes data to FLASH. The operation of this method depends on the "Write method" property and state of the flash. Please see more details on general info page of the help.
ANSIC prototype: byte SetBlockFlash(ComponentName_TDataAddress Source, ComponentName_TAddress Dest, word Count)
- Source:ComponentName_TDataAddress - Source address of the data.
- Dest:ComponentName_TAddress - Destination address in FLASH.
- Count:word - Count of the data fields (in the smallest addressable units).
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE – The address is out of range
- ERR_BUSY - Device is busy
- ERR_SPEED - This device does not work in the active speed mode
- ERR_PROTECT - Flash is write protect
- ERR_VALUE - Read value is not equal to written value
-
GetBlockFlash
- Reads data from FLASH.
ANSIC prototype: byte GetBlockFlash(ComponentName_TAddress Source, ComponentName_TDataAddress Dest, word Count)
- Source:ComponentName_TAddress - Destination address in FLASH.
- Dest:ComponentName_TDataAddress - Source address of the data.
- Count:word - Count of the data fields (in the smallest addressable units).
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE – The address is out of range
- ERR_BUSY - Device is busy
-
SetBytePage
- Writes a byte to an address of the virtual page. This method is only available when Virtual page property is enabled.
Version specific information for Freescale HCS08, ColdFireV1, Fujitsu 16LX derivatives
When the type of virtual page is set by the property Allocated to "By the user" then a method SetVirtualPageAddress should be invoked before this method.
ANSIC prototype: byte SetBytePage(word Index, byte Data)
- Index:word - Index to virtual page.
- Data:byte - Data to write.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE - Index is out of range
- ERR_NOTAVAIL - Virtual page address not set by the user
-
SetWordPage
- Writes a word to an address in the virtual page. This method is only available when Virtual page property is enabled.
Version specific information for Freescale HCS08, ColdFireV1, Fujitsu 16LX derivatives
When the type of virtual page is set by the property Allocated to "By the user" then a method SetVirtualPageAddress should be invoked before this method.
ANSIC prototype: byte SetWordPage(word Index, word Data)
- Index:word - Index to virtual page.
- Data:word - Data to write.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE - Index is out of range
- ERR_NOTAVAIL - Virtual page address not set by the user
-
GetBytePage
- Gets a byte from an address in the virtual page. This method is only available when Virtual page property is enabled.
Version specific information for Freescale HCS08, ColdFireV1, Fujitsu 16LX derivatives
When the type of virtual page is set by the property Allocated to "By the user" then a method SetVirtualPageAddress should be invoked before this method.
ANSIC prototype: byte GetBytePage(word Index, byte *Data)
- Index:word - Index to a virtual page.
- Data: Pointer to byte - A pointer to the returned 8-bit data.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE - Index is out of range
- ERR_NOTAVAIL - Virtual page address not set by the user
-
GetWordPage
- Gets a word from an address in the virtual page. This method is only available when Virtual page property is enabled.
Version specific information for Freescale HCS08, ColdFireV1, Fujitsu 16LX derivatives
When the type of virtual page is set by the property Allocated to "By the user" then a method SetVirtualPageAddress should be invoked before this method.
ANSIC prototype: byte GetWordPage(word Index, word *Data)
- Index:word - Index to virtual page.
- Data: Pointer to word - A pointer to the returned 16-bit data.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE - Index is out of range
- ERR_NOTAVAIL - Virtual page address not set by the user
-
SetLongPage
- Writes a long word to an address in the virtual page. This method is only available when Virtual page property is enabled.
Version specific information for Freescale HCS08, ColdFireV1, Fujitsu 16LX derivatives
When the type of virtual page is set by the property Allocated to "By the user" then a method SetVirtualPageAddress should be invoked before this method.
ANSIC prototype: byte SetLongPage(word Index, dword Data)
- Index:word - Index to virtual page.
- Data:dword - Data to write.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE - Index is out of range
- ERR_NOTAVAIL - Virtual page address not set by the user
-
GetLongPage
- Gets a long word from an address in the virtual page. This method is only available when Virtual page property is enabled.
Version specific information for Freescale HCS08, ColdFireV1, Fujitsu 16LX derivatives
When the type of virtual page is set by the property Allocated to "By the user" then a method SetVirtualPageAddress should be invoked before this method.
ANSIC prototype: byte GetLongPage(word Index, dword *Data)
- Index:word - Index to virtual page.
- Data: Pointer to dword - A pointer to the returned 32-bit data.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE - Index is out of range
- ERR_NOTAVAIL - Virtual page address not set by the user
-
SetVirtualPageAddr
- Sets up an address of the virtual page in RAM.
This method is only available when Virtual page property is enabled and Allocated property is set to "By the user".
ANSIC prototype: void SetVirtualPageAddr(ComponentName_TDataAddress Addr)
- Addr:ComponentName_TDataAddress - Virtual page address in RAM.
- Methods for Freescale HCS08/ColdFireV1 derivatives and Fujitsu 16LX microcontrollers derivates.
-
RestoreToFlash
- This method should be used in the OnRestoreBuffer event to write the data back to FLASH. This method is only available when the Write method item is set to "Safe write ..." value. It can be called more then once to write all data required by OnRestoreBuffer, but every byte of the flash sector may be written only once.
ANSIC prototype: byte RestoreToFlash(ComponentName_TAddress Addr, byte *Data, word Size)
- Addr:ComponentName_TAddress - Address to FLASH.
- Data: Pointer to byte - A pointer to the data to write.
- Size:word - The size of the buffer to restore.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - The method is not available, because event OnRestoreBuffer is not active
- ERR_VALUE - Parameter of incorrect value - data was not restored into flash correctly
- ERR_RANGE – Parameter Addr is out of range
-
SetPage
- Writes a virtual page to an address in FLASH.
This method is enabled only if Virtual page property is enabled. The operation of this method depends on the "Write method" property and state of the flash. Please see more details on general info page of the help.
ANSIC prototype: byte SetPage(ComponentName_TAddress Addr)
- Addr:ComponentName_TAddress - Address in FLASH.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_NOTAVAIL - Desired program/erase operation is not available
- ERR_RANGE – The address is out of range
- ERR_VALUE – The read value is not equal to the written value
- ERR_SPEED - This device does not work in the active speed mode
- ERR_BUSY - Device is busy
- ERR_PROTECT - Flash is write protect
-
GetPage
- Gets the virtual page from FLASH.
This method is enabled only if Virtual page property is enabled.
ANSIC prototype: byte GetPage(ComponentName_TAddress Addr)
- Addr:ComponentName_TAddress - Address in FLASH.
- Return value:byte - Error code, possible codes:
- ERR_OK - OK
- ERR_RANGE – The address is out of range
- ERR_BUSY - Device is busy
-
DataPtr2Addr
- This method converts data pointer to format of a component's method address parameter. Generally a data pointer format is different from format of a method Addr parameter.
ANSIC prototype: ComponentName_TAddress DataPtr2Addr(void* Addr)
- Addr:void* - Data pointer.
- Return value:ComponentName_TAddress - Address in the format used in the component methods.
-
FuncPtr2Addr
- This method converts function pointer to format of a component's method address parameter. Generally a function pointer format is different from format of a method Addr parameter.
ANSIC prototype: ComponentName_TAddress FuncPtr2Addr(void(*Addr)())
- Addr:void* - Function pointer.
- Return value:ComponentName_TAddress - Address in the format used in the component methods.
Note: Some methods can be implemented as macros.
|