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
Parameters:
   text message text

IntToHex ( value , digits ): string;

 Analog IntToHex

ProgressBar ( inc , max , pos );

 Sets the status of the ProgressBar
Parameters:
   inc how much the position is increased
Optional parameters:
   max maximum position ProgressBar
   pos sets the specific position 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  
  Parameters:
    speed
    _SPI_SPEED_MAX  = AvrIsp 8 (4) MHz / USbAsp 3 MHz
 If the frequency is not set, returns false
 Ignored for devices with a fixed frequency

SPIExitProgMode ();

Disables SPI pins

SPIRead ( cs , size , buffer , ... ): integer;

Reads data to buffer  
   Parameters:  
     cs if cs = 1 release Chip Select after reading data
     size data   size in bytes  
     buffer variables for storing data or an array created by CreateByteArray  
   Returns the number of bytes read

SPIWrite ( cs , size , buffer , ... ): integer;

Writes data from the buffer  
   Parameters:  
     cs if cs = 1 release Chip Select after writing data
     size data   size in bytes  
     buffer data variables or array created CreateByteArray  
   Returns the number of written bytes

SPIReadToEditor ( cs , size ): integer;

Reads data to the editor  
   Parameters:  
     cs if cs = 1 release Chip Select after reading data
     size data   size in bytes  
   Returns the number of bytes read

SPIWriteFromEditor ( cs , size , position ): integer;

From Writes data size editor size from the standpoint position  
   parameters:  
     Cs if Cs = 1 release, after Chip Select data record  
     size data size in bytes of the  
     position the position in the editor  
   returns the number of bytes written

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  
   Parameters:  
     DevAddr device address  
     size data size in bytes  
     buffer variable data or array created CreateByteArray  
   Returns the number of recorded bytes read +
   * If rsize = 0 can omit the parameter rbuffer

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