Sections | |
{$ read} | Section code is executed when the read memory button is pressed. |
{$ write} | The section code is executed when the memory record button is pressed. |
{$ erase} | The section code is executed when the memory erase button is pressed. |
{$ verify} | Section code is executed when the memory comparison button is pressed. |
{$ unlock} | Section code is executed when the unprotect button is pressed. |
Predefined variables | |
_IC_Name | The name of the currently selected chip |
_IC_Size | Size, in bytes, of the currently selected chip |
_IC_Spare | Spare area size, in bytes, of the currently selected SPI NAND chip |
_IC_Page | Page size, in bytes, of the currently selected chip |
_SPI_SPEED_MAX | The highest possible frequency for SPISetSpeed |
Main functions | |
ShowMessage ( text+'\n'+text ); |
Analogue ShowMessage (use '\n' string for multi line) |
LogPrint ( text ); |
Print a message to the log |
IntToHex ( value , digits ): string; |
Analog IntToHex |
ProgressBar ( inc , max , pos ); |
Sets the status of the ProgressBar |
CreateByteArray ( size ): variant; |
Creates an array with varbyte element type |
CreateStringArray ( size ): variant; |
Creates an array of string |
GetArrayItem ( array , index ): variant; |
Returns the value of an array element |
SetArrayItem ( array , index , value ); |
Sets the value of an array element |
ReadToEditor ( size , position , buffer, ... ); |
Writes data from the buffer to the size editor at position |
WriteFromEditor ( size , position , buffer, ... ); |
Writes data from size editor from position |
GetEditorDataSize: longword; |
Returns data size in editor |
Work with SPI | |
SPIEnterProgMode ( speed ): boolean; |
Initializes the pin state for SPI and sets the SPI frequency |
SPIExitProgMode (); |
Disables SPI pins |
SPIRead ( cs , size , buffer , ... ): integer; |
Reads data to buffer |
SPIWrite ( cs , size , buffer , ... ): integer; |
Writes data from the buffer |
SPIReadToEditor ( cs , size ): integer; |
Reads data to the editor |
SPIWriteFromEditor ( cs , size , position ): integer; |
From Writes data size editor size from the standpoint position |
Work with I2C | |
I2CEnterProgMode (); |
Initializes the state of the pins |
I2cExitProgMode (); |
Disables pins |
I2CReadWrite ( DevAddr , wsize , rsize , wbuffer , rbuffer ): integer; |
Writes / reads data from buffers |
I2CStart (); |
Used with I2CReadByte and I2CWriteByte |
I2CStop (); |
Used with I2CReadByte and I2CWriteByte |
I2CReadByte ( ack : boolean): byte; |
Reads a data byte and sends ack / nack |
I2CWriteByte ( data ): boolean; |
Writes a data byte and returns ack / nack |