Редактирование проекта
Инструменты редактирования проекта дают вам возможность изменять общие параметры проекта и настройки проекта Visual TFT.
Общие настройки проекта
В этом окне вы можете изменить частоту генератора MCU, тип сборки, биты конфигурации и настройки прерывания для выбранного устройства.
Когда вы закончите настройку своего устройства, вы можете сохранить эту конфигурацию в качестве схемы, используя кнопку .
Если вам нужна эта схема в другом проекте, вы можете загрузить ее, используя кнопку .
Настройки проекта Visual TFT
Настройки визуального TFT-проекта. В настройках Visual TFT вы можете настроить следующее:
Общие
Вкладка «Общие параметры» разделена на три основные части: «Настройки устройства», «Настройки дисплея» и «Тип сенсорной панели»:
Настройки устройства В Настройках устройств пользователь может добавить пользовательский код инициализации, необходимый для активного проекта.
Настройки дисплея. В настройках дисплея пользователь может выбрать желаемый дисплейный контроллер и размер дисплея.
Visual TFT поддерживает следующие TFT-контроллеры:
Himax HX8347G, HX8347D, HX8352A,
Solomon Systech SSD1963,
Renesas SP R61526,
Sitronix SST7715R,
Ilitek ILI9340, ILI9341, ILI9342 и ILI9481,
FTDI FT800, FT801, FT810, FT811, FT812 и FT813
TIVA
Тип контроллера сенсорной панели Пользователь может выбирать между типом контроллера сенсорной панели по умолчанию, расположенным на досках mikroElektronika, типом сенсорной панели STMPE610, контроллером сенсорной панели FT8xx и контроллером сенсорной панели TSC2006.
TFT
Эта вкладка используется для настройки параметров TFT-соединения для выбранного TFT-контроллера:
Himax, Solomon Systech, Renesas SP, Sitronix, Ilitek
Configure the TFT Module Connections by inputting the following information :
>FT8xx
Configure the FT8xx Module Connections by inputting the following information :
> Connections :To configure the FT8xx connections, input the required data :
- RST : FT8xx Reset Pin.
- CS : FT8xx Chip Select Pin.
- RST_Direction : FT8xx Reset Pin Direction.
- CS_Direction : FT8xx Chip Select Pin Direction.
- SPI_No : Select SPI module.
- Shared : Check this box to share SPI lines with the external memory.
- Oscillator : Select internal or external oscillator.
To configure the FT8xx display parameters, input the required data :
- VSync0 : Vertical sync fall offset.
- Vsync1 : Vertical sync rise offset.
- VOffset : Vertical display start offset.
- VCycle : Vertical total cycle count.
- HSync0 : Horizontal sync fall offset.
- Hsync1 : Horizontal sync rise offset.
- HOffset : Horizontal display start offset.
- HCycle : Horizontal total cycle count.
- Render : Rendering mode, normal or single-line.
- Scanline : Scanline selection.
- Rotate : Rotate screen by 0 or 180 degrees.
To configure the FT8xx clock, input the required data :
- Frequency : Clock frequency.
- Prescaler : Clock prescaler.
- Polarity : Clock polarity.
- Clock Spread : Clock spreading.
To configure the FT8xx RGB Color, input the required data :
- Out Bits : Bit width of each of the color channels.
- RGB Order : Order of the color channels.
- Bit Order : Normal or reverse bit order of the color channels.
To configure the FT8xx backlight parameters, input the required data :
- Frequency : Backlight frequency.
- Intensity : Backlight intensity.
TIVA
Configure the TIVA module by inputting the following information :
> Display Parameters and Timings:To configure the TIVA display parameters and settings, input the required data :
- TFT Pixel Clock : The pixel clock used by the TFT display to clock the pixel data into the line shift register.
- RGB Data Type : Type of RGB Data (12-bit, 16-bit, 24-bit...).
- Data Loading : Select wheter the data, palette or data and palette data are loaded.
- Timing Sync : Select pixel clock synchronization source.
- OE Active On : Output enable signal active level.
- PixClk Active On : Pixel clock signal active level.
- HSync Active On : Horizontal clock active level.
- VSync Active On : Vertical clock active level.
- Horizontal Front Porch : Number of pixel clock periods to add to the end of a line transmission before line clock is asserted (programmed value plus 1).
- Horizontal Back Porch : Number of pixel clock periods to add to the beginning of a line transmission before the first set of pixels is output to the display (programmed value plus 1).
- Horizontal Sync Width : Number of pixel clock periods to pulse the line clock at the end of each line (programmed value plus 1).
- Vertical Front Porch : Number of line clock periods to add to the end of each frame.
- Vertical Back Porch : Number of line clock periods to add to the beginning of a frame before the first set of pixels is output to the display.
- Vertical Sync Width :
- Active mode - it is used to specify the number of line clock periods to set the lcd_fp pin active at the end of each frame after the Vertical Front Porch period elapses.
- Passive mode - it is used to specify the number of extra line clock periods to insert after the Vertical Front Porch period has elapsed.
To configure the DMA and EPI Settings, input the required data :
Set Active
This tab is used to set the custom TFT communication routines, Set_Index, Write_Command, Write_Data and an auxiliary routine which will be used during custom TFT initialization :
This tab will be available when the Custom TFT communication routines option from the General tab is checked.
Touch Panel
This tab is used to configure the touch panel connections and settings and can have various input fields depending on the selected touch panel controller :
- Default mikroElektronika,
- STMPE610,
- Resistive FT800, FT810 and FT812,
- Capacitive FT801, FT811 and FT813,
- TSC2006>
Default mikroElektronika Touch Panel Controller
For default mikroElektronika Touch Panel Controller, this tab is consisted of the following :
A/D Settings :To configure the ADC module, input the required data :
- READ-X : AD channel No : ADC input channel for X-axis.
- READ-Y : AD channel No : ADC input channel for Y-axis.
- Init Code : ADC initialization code.
- ADC Threshold Value : : Threshold value for ADC.
Upon the data input, the text box will be populated with the appropriate code.
Connections :To configure the Touch Panel Module Connections, input the required data :
Calibration :Calibration can be performed manually, i.e. each time the code is executed or automatically with the predefined constants :
Set the Touch Sensitive Area by entering the coorinate values XMin, XMax, YMin and YMax.
For calibrating touch panel each time after reset choose Manual calibration. If you want to avoid calibration at the start of the program choose Preset and set the values of these constants.
STMPE610 Touch Panel Controller
For STMPE610 Touch Panel Controller, this tab is consisted of the following :
A/D Settings :To configure the STMPE610 ADC, input the required data :
- ADC Voltage Reference : Select ADC Voltage reference
- ADC Resolution : Choose ADC Resolution.
- ADC Sample Time : Time used to read each ADC sample.
- ADC Average Sample : Number of samples used for the coordinate calculation.
- ADC Clock : Clock used for ADC reading.
- Touch Detection Delay : Touch Detect delay is used to compensate for the time it takes for the panel voltage to be pulled high during a non-touch condition.
- Touch Settle Time : Time used for setting the touch activity.
- Tracking Index : Determines the distance between the current touch position and the previous touch position.
To configure the STMPE610 module settings, input the required data :
- Module I2C Address : Select module I2C address
- FIFO Size : FIFO buffer used for storing touch data.
- Touch IDrive : Current limit value of the touchscreen drivers.
- Touch Threshold : Sets the touch panel threshold value.
Touchscreen is always set in XYZ mode, in any other mode it will not work properly.
Enable Interrupts :To configure the STMPE610 interrupts, input the required data :
- Enable Interrupts : Check/uncheck to enable/disable interrupts.
- Interrupt trigger : Select the desired interrupt trigger.
- Interrupt polarity : Select the desired interrupt polarity.
- Interrupt type : Select the desired interrupt type.
Calibration can be performed manually, i.e. each time the code is executed, or automatically with the predefined constants :
Set the Touch Sensitive Area by entering the coorinate values XMin, XMax, YMin and YMax.
For calibrating touch panel each time after reset choose Manual calibration. If you want to avoid calibration at the start of the program choose Preset and set the values of these constants.
If the user wishes to enter calibration contants, it is advisable that the calibration is performed in the landscape display orientation.
Resistive FT800, FT810 and FT812 Touch Panel Controller
For the resistive FT800, FT810 and FT812 Touch Panel Controller, this tab is consisted of the following :
A/D Settings :To configure the FT800, FT810 and FT812 ADC, input the required data :
- Touch Mode : Touchscreen sampling mode.
- Touch ADC Mode : Select single ended (low power) or differential (accurate) sampling.
- Touch Charge : Touchscreen charge time, units of 6 clocks.
- Touch Settle : Touchscreen settle time, units of 6 clock.
- Touch Oversample : Touchscreen oversample factor.
- Threshhold : Touchscreen resistance threshold.
Calibration can be performed manually, i.e. each time the code is executed, or automatically with the predefined constants :
Calibrate the Touch Sensitive Area by entering the transform coefficients - A, B, C, D, E and F.
For calibrating touch panel each time after reset choose Manual calibration. If you want to avoid calibration at the start of the program choose Preset and set the values of these constants.
Capacitive FT801, FT811 and FT813 Touch Panel Controller
For capacitive FT801, FT811 and FT813 Touch Panel Controller, this tab is consisted of the following :
Settings :- Touch Mode : Touchscreen sampling mode - one-shot, continuous or off.
- Operation modee : Touchscreen operation mode - compatibility (single-touch) or extended (multi-touch).
Calibration can be performed manually, i.e. each time the code is executed, or automatically with the predefined constants :
Calibrate the Touch Sensitive Area by entering the transform coefficients - A, B, C, D, E and F.
For calibrating touch panel each time after reset choose Manual calibration. If you want to avoid calibration at the start of the program choose Preset and set the values of these constants.
TSC2006 Touch Panel Controller
For TSC2006 Touch Panel Controller, this tab is consisted of the following :
Connections :To configure the TSC2006 connections, input the required data :
- TSC2006_CS : TSC2006 Chip Select Pin declaration.
- TSC2006_CS_Direction : TSC2006 Chip Select Pin Direction declaration.
- TSC2006_RST : TSC2006 Reset Pin declaration.
- TSC2006_RST_Direction : TSC2006 Reset Pin Direction declaration.
To configure the TSC2006 ADC, input the required data :
- ADC Resolution : Resolution of the TSC2006 internal ADC module.
- ADC Conversion Clock : Clock rate that the TSC2006 internal ADC module uses to perform conversion.
- Touch Threshold : Touchscreen threshold value.
- Precharge Time : Amount of time allowed for precharging any pin capacitance on the touch screen prior to sensing if a pen touch is happening.
- Sense Time : Amount of time the TSC2006 waits to sense whether the screen is touched after converting a coordinate.
- Stabilization Time : Time delay from the moment the touch screen controller is enabled to the time the voltage is sampled and a conversion is started.
- Longer Sampling : Set to add extra 500ns of sampling time to the normal sampling cycles of each conversion.
Calibration can be performed manually, i.e. each time the code is executed, or automatically with the predefined constants :
Calibrate the Touch Sensitive Area by entering the appropriate coefficients value.
For calibrating touch panel each time after reset choose Manual calibration in Settings Window (>F12>). If you want to avoid calibration at the start of the program choose Preset and set the values of these constants.
Resources
This tab enables user to choose the location of his resources (images and fonts). User can choose to store them Internally (in the MCU code memory) or to store them Externally in the resource file located on some external media (MMC/SD card, for example).
By storing the resources in the external memory, Flash memory consumption is significantly reduced. It is possible to use vast amount of constants, whose size is considerably larger than the size of the MCU Flash memory.
During the code generation process, the resources used are stored in the .RES
file located in the project folder.
In order to use them from the external memory, user must transfer this file to this memory.
Note |
---|
If SD/MMC card is used as an external resource, bear in mind that it has to be properly formatted to FAT16 and empty before transfering the resource file. |
The reading of the resource file from the external memory consists of the following code blocks :
External Memory Global Declarations Block - FAT16
mikroC Code
// MMC/SD Connections sbit Mmc_Chip_Select at GPIOD_ODR.B3; // end of MMC/SD Connections // TFT Get Data globals char Ext_Data_Buffer[512]; unsigned long currentSector = -1, res_file_size; // end of TFT Get Data globals
mikroPascal Code
// MMC/SD Connections var Mmc_Chip_Select : sbit at GPIOD_ODR.B3; // end of MMC/SD Connections // TFT Get Data globals var Ext_Data_Buffer : array[512] of byte; var currentSector : longint; var res_file_size : dword; // end of TFT Get Data globals
mikroBasic Code
' MMC/SD Connections dim Mmc_Chip_Select as sbit at GPIOD_ODR.B3 ' end of MMC/SD Connections ' TFT Get Data globals dim Ext_Data_Buffer as byte[512] dim currentSector as longint dim res_file_size as longword ' end of TFT Get Data globals
External Memory Global Declarations Block - FAT32
mikroC Code
// Extern memory interface // MMC/SD Connections sbit Mmc_Chip_Select at GPIOD_ODR.B3; // end of MMC/SD // VTFT Get Data globals short rfHandle; char* rfName; unsigned long rfStartSect; // end of VTFT Get Data // End of extern memory interface
mikroPascal Code
// Extern memory interface // MMC/SD Connections var Mmc_Chip_Select: sbit at GPIOD_ODR.B3; // end of MMC/SD // VTFT Get Data globals var rfHandle: short; var rfName: string[14]; var rfStartSect: dword; // end of VTFT Get Data // End of extern memory interface
mikroBasic Code
' Extern memory interface ' MMC/SD Connections dim Mmc_Chip_Select as sbit at GPIOD_ODR.B3 ' end of MMC/SD ' VTFT Get Data globals dim rfHandle as short dim rfName as string[14] dim rfStartSect as longword ' end of VTFT Get Data ' End of extern memory interface
External Memory Initalization Block - FAT16
mikroC Code
void Init_Ext_Mem() { // Initialize SPI SPI3_Init_Advanced(_SPI_FPCLK_DIV64, _SPI_MASTER | _SPI_8_BIT | _SPI_CLK_IDLE_LOW | _SPI_FIRST_CLK_EDGE_TRANSITION | _SPI_MSB_FIRST | _SPI_SS_DISABLE | _SPI_SSM_ENABLE | _SPI_SSI_1, &_GPIO_MODULE_SPI3_PC10_11_12); Delay_ms(10); // Initialize MMC if (!Mmc_Fat_Init()) { // Reinitialize SPI at higher speed SPI3_Init_Advanced(_SPI_FPCLK_DIV2, _SPI_MASTER | _SPI_8_BIT | _SPI_CLK_IDLE_LOW | _SPI_FIRST_CLK_EDGE_TRANSITION | _SPI_MSB_FIRST | _SPI_SS_DISABLE | _SPI_SSM_ENABLE | _SPI_SSI_1, &_GPIO_MODULE_SPI3_PC10_11_12); // Open resource file for read Mmc_Fat_Assign("%FILE_NAME", 0); Mmc_Fat_Reset(&res_file_size); } }
mikroPascal Code
procedure Init_Ext_Mem(); begin currentSector := -1; // Initialize SPI SPI3_Init_Advanced(_SPI_FPCLK_DIV64, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12); Delay_ms(10); // Initialize MMC if (Mmc_Fat_Init() = 0) then begin // Reinitialize SPI at higher speed SPI3_Init_Advanced(_SPI_FPCLK_DIV2, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12); // Open resource file for read Mmc_Fat_Assign('%FILE_NAME', 0); Mmc_Fat_Reset(res_file_size); end; end;
mikroBasic Code
sub procedure Init_Ext_Mem() currentSector = -1 ' Initialize SPI SPI3_Init_Advanced(_SPI_FPCLK_DIV64, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12) Delay_ms(10) ' Initialize MMC if (Mmc_Fat_Init() = 0) then ' Reinitialize SPI at higher speed SPI3_Init_Advanced(_SPI_FPCLK_DIV2, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12) ' Open resource file for read Mmc_Fat_Assign("%FILE_NAME", 0) Mmc_Fat_Reset(res_file_size) end if end sub
%FILE_NAME
is the resource file name.
External Memory Initalization Block - FAT32
mikroC Code
void Init_Ext_Mem() { rfHandle = -1; rfName = "Resource.RES"; rfStartSect = 0; // ensure ft8xx is not selected (because of shared SPI lines) // adjust this code to suite hw configuration FT800_CS_Direction = 0; FT800_CS = 1; // Init MMC SPI interface at low speed SPI3_Init_Advanced(_SPI_FPCLK_DIV64, _SPI_MASTER | _SPI_8_BIT | _SPI_CLK_IDLE_LOW | _SPI_FIRST_CLK_EDGE_TRANSITION | _SPI_MSB_FIRST | _SPI_SS_DISABLE | _SPI_SSM_ENABLE | _SPI_SSI_1, &_GPIO_MODULE_SPI3_PC10_11_12); // Init FAT32 stack if (!FAT32_Init()) { // Reinitialize SPI at higher speed SPI3_Init_Advanced(_SPI_FPCLK_DIV2, _SPI_MASTER | _SPI_8_BIT | _SPI_CLK_IDLE_LOW | _SPI_FIRST_CLK_EDGE_TRANSITION | _SPI_MSB_FIRST | _SPI_SS_DISABLE | _SPI_SSM_ENABLE | _SPI_SSI_1, &_GPIO_MODULE_SPI3_PC10_11_12); // Open resource file for read rfHandle = FAT32_Open(rfName, 0x01); rfStartSect = FAT32_ClustToSect(fat32_fdesc[rfHandle]._1stClust); } }
mikroPascal Code
procedure Init_Ext_Mem(); begin rfHandle := -1; rfName := 'Resource.RES'; rfStartSect := 0; // ensure ft8xx is not selected (because of shared SPI lines) // adjust this code to suite hw configuration FT800_CS_Direction := 0; FT800_CS := 1; // Init MMC SPI interface at low speed SPI3_Init_Advanced(_SPI_FPCLK_DIV64, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12); // Init FAT32 stack if (FAT32_Init() = 0) then begin // Reinitialize SPI at higher speed SPI3_Init_Advanced(_SPI_FPCLK_DIV2, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12); // Open resource file for read rfHandle := FAT32_Open(@rfName, 0x01); rfStartSect := FAT32_ClustToSect(fat32_fdesc[rfHandle]._1stClust); end; end;
mikroBasic Code
sub procedure Init_Ext_Mem() rfHandle = -1 rfName = "Resource.RES" rfStartSect = 0 ' ensure ft8xx is not selected (because of shared SPI lines) ' adjust this code to suite hw configuration FT800_CS_Direction = 0 FT800_CS = 1 ' Init MMC SPI interface at low speed SPI3_Init_Advanced(_SPI_FPCLK_DIV64, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12) ' Init FAT32 stack if (FAT32_Init() = 0) then ' Reinitialize SPI at higher speed SPI3_Init_Advanced(_SPI_FPCLK_DIV2, _SPI_MASTER or _SPI_8_BIT or _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1, @_GPIO_MODULE_SPI3_PC10_11_12) ' Open resource file for read rfHandle = FAT32_Open(@rfName, 0x01) rfStartSect = FAT32_ClustToSect(fat32_fdesc[rfHandle]._1stClust) end if end sub
Get Data from the External Memory Block - FAT16
mikroC Code
char* TFT_Get_Data(unsigned long offset, unsigned long count, unsigned long *num) { unsigned long start_sector; unsigned long pos; start_sector = Mmc_Get_File_Write_Sector() + offset/512; pos = (unsigned long)offset%512; if(start_sector == currentSector+1) { Mmc_Multi_Read_Sector(Ext_Data_Buffer); currentSector = start_sector; } else if (start_sector != currentSector) { if(currentSector != -1) Mmc_Multi_Read_Stop(); Mmc_Multi_Read_Start(start_sector); Mmc_Multi_Read_Sector(Ext_Data_Buffer); currentSector = start_sector; } if(count>512-pos) *num = 512-pos; else *num = count; return Ext_Data_Buffer+pos; }
mikroPascal Code
function TFT_Get_Data(offset, count : dword; var num : dword) : ^byte; var start_sector: dword; pos : dword; begin start_sector := Mmc_Get_File_Write_Sector() + offset div 512; pos := dword(offset) mod 512; if(start_sector = currentSector+1) then begin Mmc_Multi_Read_Sector(Ext_Data_Buffer); currentSector := start_sector; end else if(start_sector <> currentSector) then begin if(currentSector <> -1) then Mmc_Multi_Read_Stop(); Mmc_Multi_Read_Start(start_sector); Mmc_Multi_Read_Sector(Ext_Data_Buffer); currentSector := start_sector; end; if(count>512-pos) then num := 512-pos else num := count; result := @Ext_Data_Buffer+pos; end;
mikroBasic Code
sub function TFT_Get_Data(dim offset as longword, dim count as longword, dim byref num as longword) as ^byte dim start_sector as longword dim pos as longword start_sector = Mmc_Get_File_Write_Sector() + offset div 512 pos = longword(offset) mod 512 if(start_sector = currentSector+1) then Mmc_Multi_Read_Sector(Ext_Data_Buffer) currentSector = start_sector else if(start_sector <> currentSector) then if(currentSector <> -1) then Mmc_Multi_Read_Stop() end if Mmc_Multi_Read_Start(start_sector) Mmc_Multi_Read_Sector(Ext_Data_Buffer) currentSector = start_sector end if end if if(count>512-pos) then num = 512-pos else num = count end if result = @Ext_Data_Buffer+pos end sub
Get Data from the External Memory Block - FAT32
mikroC Code
char *VTFT_GetExtData(unsigned long fPos, unsigned long bytesToGet, unsigned long *pBytesGot) { unsigned int scOffset; *pBytesGot = 0; if (rfHandle < 0) { return 0; // return with nil if handle was bad. } // We will utilize some of the fat32 implied features // (such as built in sector buffer) to reduce ram memory consumpiton. // You can't use this approach if this buffer is going to be used // from another thread (i.e. using fat32 routines in interrupt...) // In that case or if you have plenty of ram memory use separate // as large as possible data buffer. f32_sector.fSectNum = rfStartSect + fPos / 512; Mmc_Read_Sector(f32_sector.fSectNum, f32_sector.fSect); // 512 bytes sector buffer implied. scOffset = fPos % 512; if(bytesToGet > 512-scOffset) *pBytesGot = 512-scOffset; else *pBytesGot = bytesToGet; return &f32_sector.fSect + scOffset; }
mikroPascal Code
function VTFT_GetExtData(fPos : dword; bytesToGet : dword; pBytesGot : ^dword): ^byte; var scOffset : word; begin pBytesGot^ := 0; if (rfHandle < 0) then begin result := 0; // return with nil if handle was bad. exit; end; // We will utilize some of the fat32 implied features // (such as built in sector buffer) to reduce ram memory consumpiton. // You can't use this approach if this buffer is going to be used // from another thread (i.e. using fat32 routines in interrupt...) // In that case or if you have plenty of ram memory use separate // as large as possible data buffer. f32_sector.fSectNum := rfStartSect + fPos div 512; Mmc_Read_Sector(f32_sector.fSectNum, f32_sector.fSect); // 512 bytes sector buffer implied. scOffset := fPos mod 512; if(bytesToGet > 512-scOffset) then pBytesGot^ := 512-scOffset else pBytesGot^ := bytesToGet; result := @f32_sector.fSect + scOffset; end;
mikroBasic Code
sub function VTFT_GetExtData(Dim fPos as longword, Dim bytesToGet as longword, Dim pBytesGot as ^longword) as ^byte Dim scOffset as word sc as longword pBytesGot^ = 0 if (rfHandle < 0) then result = 0 ' return with nil if handle was bad. exit end if ' We will utilize some of the fat32 implied features ' (such as built in sector buffer) to reduce ram memory consumpiton. ' You can't use this approach if this buffer is going to be used ' from another thread (i.e. using fat32 routines in interrupt...) ' In that case or if you have plenty of ram memory use separate ' as large as possible data buffer. sc = rfStartSect + fPos div 512 Mmc_Read_Sector(sc, f32_sector.fSect) ' 512 bytes sector buffer implied. scOffset = fPos mod 512 if(bytesToGet > 512-scOffset) then pBytesGot^ = 512-scOffset else pBytesGot^ = bytesToGet end if result = @f32_sector.fSect + scOffset end sub
The generated blocks of code are located in the Driver file.
Besides these, there are two more options available :
- JPEG as BMP : When this option is enabled, the used JPEG files will be automatically converted to BMP file format, as it provides faster displaying speed.
- Use mE file system : When this option is enabled, the generated resource file will contain header with information about images and fonts included in it. If not enabled, resource file will contain only used images and fonts.