image/svg+xml
Brteve's API for EveApps
Version 0.0.1
The reference document for common folder of EveApps project.
 
Loading...
Searching...
No Matches
Gpu_Hal.cpp File Reference

GPU APIs. More...

#include "Platform.h"
#include "Gpu.h"
#include "Hal_Config.h"

Go to the source code of this file.

Functions

bool_t Gpu_Hal_Init (Gpu_HalInit_t *halinit)
 
bool_t Gpu_Hal_Open (EVE_HalContext *host)
 
void Gpu_Hal_Close (EVE_HalContext *host)
 
void Gpu_Hal_DeInit ()
 
void Gpu_Hal_StartTransfer (EVE_HalContext *host, GPU_TRANSFERDIR_T rw, uint32_t addr)
 
void Gpu_Hal_StartCmdTransfer (EVE_HalContext *host, GPU_TRANSFERDIR_T rw, uint16_t count)
 
void Gpu_Hal_TransferString (EVE_HalContext *host, const char8_t *string)
 
uint8_t Gpu_Hal_Transfer8 (EVE_HalContext *host, uint8_t value)
 
uint16_t Gpu_Hal_Transfer16 (EVE_HalContext *host, uint16_t value)
 
uint32_t Gpu_Hal_Transfer32 (EVE_HalContext *host, uint32_t value)
 
void Gpu_Hal_EndTransfer (EVE_HalContext *host)
 
void Gpu_Hal_WrCmdBufFromFlash (EVE_HalContext *host, PROGMEM prog_uchar8_t *buffer, uint32_t count)
 
uint8_t Gpu_Hal_Rd8 (EVE_HalContext *host, uint32_t addr)
 
uint16_t Gpu_Hal_Rd16 (EVE_HalContext *host, uint32_t addr)
 
uint32_t Gpu_Hal_Rd32 (EVE_HalContext *host, uint32_t addr)
 
void Gpu_Hal_Wr8 (EVE_HalContext *host, uint32_t addr, uint8_t v)
 
void Gpu_Hal_Wr16 (EVE_HalContext *host, uint32_t addr, uint16_t v)
 
void Gpu_Hal_Wr32 (EVE_HalContext *host, uint32_t addr, uint32_t v)
 
void Gpu_HostCommand (EVE_HalContext *host, uint8_t cmd)
 
void Gpu_HostCommand_Ext3 (EVE_HalContext *host, uint32_t cmd)
 
void Gpu_Hal_Powercycle (EVE_HalContext *host, bool_t up)
 
void Gpu_Hal_WrMemFromFlash (EVE_HalContext *host, uint32_t addr, const prog_uchar8_t *buffer, uint32_t length)
 
void Gpu_Hal_WrMem (EVE_HalContext *host, uint32_t addr, const uint8_t *buffer, uint32_t length)
 
void Gpu_Hal_RdMem (EVE_HalContext *host, uint32_t addr, uint8_t *buffer, uint32_t length)
 
void Gpu_Hal_DLSwap (EVE_HalContext *host, uint8_t DL_Swap_Type)
 
void Gpu_Hal_Sleep (uint32_t ms)
 
uint32_t Gpu_CurrentFrequency (EVE_HalContext *host)
 
void Gpu_ClockSelect (EVE_HalContext *host, GPU_PLL_SOURCE_T pllsource)
 
void Gpu_PLL_FreqSelect (EVE_HalContext *host, GPU_PLL_FREQ_T freq)
 
void Gpu_PowerModeSwitch (EVE_HalContext *host, GPU_POWER_MODE_T pwrmode)
 
void Gpu_CoreReset (EVE_HalContext *host)
 
void Gpu_Hal_Updatecmdfifo (EVE_HalContext *host, uint32_t count)
 
uint16_t Gpu_Cmdfifo_Freespace (EVE_HalContext *host)
 
void Gpu_Hal_WrCmdBuf (EVE_HalContext *host, uint8_t *buffer, uint32_t count)
 
void Gpu_Hal_CheckCmdBuffer (EVE_HalContext *host, uint32_t count)
 
void EVE_Cmd_waitFlush (EVE_HalContext *host)
 
void Gpu_Hal_WrCmdBuf_nowait (EVE_HalContext *host, uint8_t *buffer, uint32_t count)
 
uint8_t EVE_Cmd_waitFlush_status (EVE_HalContext *host)
 
void Gpu_Hal_WaitLogo_Finish (EVE_HalContext *host)
 
void Gpu_Hal_ResetCmdFifo (EVE_HalContext *host)
 
void Gpu_Hal_WrCmd32 (EVE_HalContext *host, uint32_t cmd)
 
void Gpu_Hal_ResetDLBuffer (EVE_HalContext *host)
 
int32_t Gpu_Hal_Dec2Ascii (char8_t *pSrc, int32_t value)
 
void Fifo_Init (Fifo_t *pFifo, uint32_t StartAddress, uint32_t Length, uint32_t HWReadRegAddress, uint32_t HWWriteRegAddress)
 
void Fifo_Update (EVE_HalContext *host, Fifo_t *pFifo)
 
uint32_t Fifo_Write (EVE_HalContext *host, Fifo_t *pFifo, uint8_t *buffer, uint32_t NumbytetoWrite)
 
void Fifo_Write32 (EVE_HalContext *host, Fifo_t *pFifo, uint32_t WriteWord)
 
void Fifo_WriteWait (EVE_HalContext *host, Fifo_t *pFifo, uint8_t *buffer, uint32_t Numbyte)
 
uint32_t Fifo_GetFreeSpace (EVE_HalContext *host, Fifo_t *pFifo)
 
int32_t Gpu_ClockTrimming (EVE_HalContext *host, int32_t LowFreq)
 
void Gpu_ClearScreen (EVE_HalContext *host)
 
void BootupConfig (EVE_HalContext *host)
 
void Gpu_Hal_LoadImageToMemory (EVE_HalContext *host, char8_t *fileName, uint32_t destination, uint8_t type)
 

Variables

const uint8_t DLCODE_BOOTUP [12]
 

Detailed Description

GPU APIs.

Author
Bridgetek
Date
2018

MIT License

Copyright (c) [2019] [Bridgetek Pte Ltd (BRTChip)]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file Gpu_Hal.cpp.

Function Documentation

◆ BootupConfig()

void BootupConfig ( EVE_HalContext host)

Definition at line 1186 of file Gpu_Hal.cpp.

1187{
1189
1190 /* FT81x will be in SPI Single channel after POR
1191 If we are here with FT4222 in multi channel, then
1192 an explicit switch to single channel is essential
1193 */
1194#ifdef FT81X_ENABLE
1196#endif
1197
1198 /* Set the clk to external clock */
1199#if (!defined(ME800A_HV35R) && !defined(ME810A_HV35R) && !defined(ME812AU_WH50R) && !defined(ME813AU_WH50C) && !defined(ME810AU_WH70R) && !defined(ME811AU_WH70C))
1201 Gpu_Hal_Sleep(10);
1202#endif
1203
1204 /* Access address 0 to wake up the chip */
1206 Gpu_Hal_Sleep(300);
1207
1208#ifdef UPDATE_OTP
1209 #if defined(FT811_ENABLE) || defined(FT813_ENABLE)
1210 /* Download new firmware to JTouch to fix bug pen up */
1211 Gpu_Hal_WrCmdBuf(host, OTP_DATA_U8, OTP_DATA_LEN);
1212 EVE_Cmd_waitFlush(host);
1213 #elif defined(BT815_ENABLE) || defined(BT816_ENABLE) || defined(BT81x_ENABLE)
1214 Gpu_Hal_Wr8(host, REG_CPURESET, 3);
1216 Gpu_Hal_WrMem(host, RAM_JTBOOT, OTP_DATA_U8, OTP_DATA_LEN);
1217 //Gpu_Hal_WrCmdBuf_nowait(host, OTP_DATA_U8, OTP_DATA_LEN);
1218 //EVE_Cmd_waitFlush(host);
1219 Gpu_Hal_Wr8(host, REG_J1_COLD, 1);
1220 Gpu_Hal_Wr8(host, REG_CPURESET, 2);
1221 //Gpu_Hal_Sleep(10);
1222 //Gpu_Hal_Wr8(host, REG_CPURESET, 0);
1223 Gpu_Hal_Sleep(300);
1224 #endif
1225#endif
1226
1227 /* Read REG_CHIPID to confirm 0x7C is returned */
1228 {
1229 uint8_t chipid;
1230 //Read Register ID to check if chip ID series is correct.
1231 chipid = Gpu_Hal_Rd8(host, REG_ID);
1232 while(chipid != 0x7C)
1233 {
1234 chipid = Gpu_Hal_Rd8(host, REG_ID);
1235 delay(100);
1236 }
1237
1238 printf("VC1 register ID after wake up %x\n",chipid);
1239
1240 }
1241
1242 /* Read REG_CPURESET to confirm 0 is returned */
1243 {
1244 uint8_t engine_status;
1245 /* Read REG_CPURESET to check if engines are ready.
1246 Bit 0 for coprocessor engine,
1247 Bit 1 for touch engine,
1248 Bit 2 for audio engine.
1249 */
1250 engine_status = Gpu_Hal_Rd8(host, REG_CPURESET);
1251 while(engine_status != 0x00)
1252 {
1253 if (engine_status & 0x01){
1254 printf("coprocessor engine is not ready \n");
1255 }
1256 if (engine_status & 0x02){
1257 printf("touch engine is not ready \n");
1258 }
1259 if (engine_status & 0x04){
1260 printf("audio engine is not ready \n");
1261 }
1262
1263 engine_status = Gpu_Hal_Rd8(host, REG_CPURESET);
1264 delay(100);
1265 }
1266 printf("All engines are ready \n");
1267 }
1268
1269 /* Configuration of LCD display */
1270
1271#if defined(ME800A_HV35R)
1272 /* After recognizing the type of chip, perform the trimming if necessary */
1274#endif
1275
1276 Gpu_Hal_Wr16(host, REG_HCYCLE, DispHCycle);
1277 Gpu_Hal_Wr16(host, REG_HOFFSET, DispHOffset);
1278 Gpu_Hal_Wr16(host, REG_HSYNC0, DispHSync0);
1279 Gpu_Hal_Wr16(host, REG_HSYNC1, DispHSync1);
1280 Gpu_Hal_Wr16(host, REG_VCYCLE, DispVCycle);
1281 Gpu_Hal_Wr16(host, REG_VOFFSET, DispVOffset);
1282 Gpu_Hal_Wr16(host, REG_VSYNC0, DispVSync0);
1283 Gpu_Hal_Wr16(host, REG_VSYNC1, DispVSync1);
1284 Gpu_Hal_Wr8(host, REG_SWIZZLE, DispSwizzle);
1285 Gpu_Hal_Wr8(host, REG_PCLK_POL, DispPCLKPol);
1288 Gpu_Hal_Wr16(host, REG_CSPREAD, DispCSpread);
1289 Gpu_Hal_Wr16(host, REG_DITHER, DispDither);
1290
1291#if (defined(FT800_ENABLE) || defined(FT810_ENABLE) ||defined(FT812_ENABLE))
1292 /* Touch configuration - configure the resistance value to 1200 - this value is specific to customer requirement and derived by experiment */
1294#endif
1295#if defined(FT81X_ENABLE)
1296 Gpu_Hal_Wr16(host, REG_GPIOX_DIR, 0xffff);
1297 Gpu_Hal_Wr16(host, REG_GPIOX, 0xffff);
1298#else
1299 Gpu_Hal_Wr8(host, REG_GPIO_DIR,0xff);
1300 Gpu_Hal_Wr8(host, REG_GPIO,0xff);
1301#endif
1302
1303 /*Clear the screen */
1306 Gpu_Hal_Wr8(host, REG_PCLK,DispPCLK);//after this display is visible on the LCD
1307
1308#ifdef ENABLE_ILI9488_HVGA_PORTRAIT
1309 /* to cross check reset pin */
1310 Gpu_Hal_Wr8(host, REG_GPIO,0xff);
1311 delay(120);
1312 Gpu_Hal_Wr8(host, REG_GPIO,0x7f);
1313 delay(120);
1314 Gpu_Hal_Wr8(host, REG_GPIO,0xff);
1315
1316 /* Boot ILI9488 */
1317 ILI9488_Bootup();
1318
1319#endif
1320
1321 /* make the spi to quad mode - addition 2 bytes for silicon */
1322#ifdef FT81X_ENABLE
1323 /* api to set quad and numbe of dummy bytes */
1324#ifdef ENABLE_SPI_QUAD
1326#elif ENABLE_SPI_DUAL
1328#else
1330#endif
1331
1332#endif
1333
1334 host->cmd_fifo_wp = Gpu_Hal_Rd16(host,REG_CMD_WRITE);
1335
1336 #ifdef USE_SDCARD
1337 /* Init HW Hal */
1338 pinMode(SDCARD_CS,OUTPUT);
1339 digitalWrite(SDCARD_CS,HIGH);
1340 delay(100);
1341 /* Init ARDUINO SDcard */
1342 sd_present = imageFile.SD.begin(SDCARD_CS);
1343 SPI.setClockDivider(SPI_CLOCK_DIV2);
1344 SPI.setBitOrder(MSBFIRST);
1345 SPI.setDataMode(SPI_MODE0);
1346 if(!sd_present){
1347 while(1){
1348 Gpu_CoCmd_Dlstart(host); // start
1349 Gpu_Hal_WrCmd32(host,CLEAR(1,1,1));
1350 Gpu_Hal_WrCmd32(host,COLOR_RGB(255,255,255));
1351 Gpu_CoCmd_Text(host,DispWidth>>1,DispHeight>>1,29,OPT_CENTER,"Storage Device not Found");
1352 Gpu_Hal_WrCmd32(host,DISPLAY());
1353 Gpu_CoCmd_Swap(host);
1354 EVE_Cmd_waitFlush(host);
1355 }
1356 }
1357 #endif
1358
1359}
#define REG_PCLK_POL
#define REG_TOUCH_CONFIG
#define REG_VSYNC0
#define REG_GPIO_DIR
#define REG_HSIZE
#define REG_J1_COLD
#define CLEAR(c, s, t)
#define REG_DLSWAP
#define REG_HSYNC1
#define REG_GPIOX
#define REG_VSIZE
#define DISPLAY()
#define REG_DITHER
#define REG_TOUCH_RZTHRESH
#define COLOR_RGB(red, green, blue)
#define REG_CSPREAD
#define REG_HCYCLE
#define REG_CMD_WRITE
#define RAM_DL
Definition EVE_GpuDefs.h:95
#define RAM_JTBOOT
#define REG_CPURESET
#define OPT_CENTER
#define REG_VSYNC1
#define DLSWAP_FRAME
#define REG_ID
#define REG_VCYCLE
#define REG_HOFFSET
#define REG_GPIOX_DIR
#define LOW_FREQ_BOUND
Definition EVE_GpuDefs.h:99
#define REG_GPIO
#define REG_VOFFSET
#define REG_PCLK
#define REG_HSYNC0
#define REG_SWIZZLE
unsigned char uint8_t
#define Gpu_CoCmd_Dlstart
Definition Gpu_CoCmd.h:262
#define Gpu_CoCmd_Text
Definition Gpu_CoCmd.h:210
#define Gpu_CoCmd_Swap
Definition Gpu_CoCmd.h:222
void EVE_Cmd_waitFlush(EVE_HalContext *host)
Definition Gpu_Hal.cpp:775
const uint8_t DLCODE_BOOTUP[12]
Definition Gpu_Hal.cpp:44
#define GPU_SPI_ONEDUMMY
Definition Gpu_Hal.h:359
#define GPU_ACTIVE_M
Definition Gpu_Hal.h:305
#define GPU_SPI_QUAD_CHANNEL
Definition Gpu_Hal.h:356
#define DispHeight
Definition Gpu_Hal.h:106
#define GPU_EXTERNAL_OSC
Definition Gpu_Hal.h:297
#define delay(x)
Definition Gpu_Hal.h:468
#define GPU_SPI_SINGLE_CHANNEL
Definition Gpu_Hal.h:354
#define Gpu_ClockTrimming
Definition Gpu_Hal.h:393
#define DispWidth
Definition Gpu_Hal.h:105
#define Gpu_Hal_WrMem
Definition Gpu_Hal.h:211
#define Gpu_Hal_WrCmd32
Definition Gpu_Hal.h:225
#define Gpu_Hal_Wr8
Definition Gpu_Hal.h:207
#define Gpu_Hal_Sleep
Definition Gpu_Hal.h:385
#define Gpu_Hal_Rd16
Definition Gpu_Hal.h:205
#define GPU_SPI_DUAL_CHANNEL
Definition Gpu_Hal.h:355
#define Gpu_Hal_Wr16
Definition Gpu_Hal.h:208
#define Gpu_Hal_SetSPI
Definition Gpu_Hal.h:390
#define Gpu_HostCommand
Definition Gpu_Hal.h:387
#define Gpu_Hal_WrCmdBuf
Definition Gpu_Hal.h:230
#define Gpu_Hal_Powercycle
Definition Gpu_Hal.h:389
#define GPU_SPI_TWODUMMY
Definition Gpu_Hal.h:360
#define Gpu_Hal_Rd8
Definition Gpu_Hal.h:204
#define SDCARD_CS
Definition Platform.h:53
#define TRUE
Definition Platform.h:197
#define RESISTANCE_THRESHOLD
Definition Platform.h:59

◆ EVE_Cmd_waitFlush()

void EVE_Cmd_waitFlush ( EVE_HalContext phost)

Wait for the command buffer to fully empty. Returns false in case a coprocessor fault occurred

Definition at line 775 of file Gpu_Hal.cpp.

776{
778
779 host->cmd_fifo_wp = Gpu_Hal_Rd16(host,REG_CMD_WRITE);
780}
#define REG_CMD_READ

◆ EVE_Cmd_waitFlush_status()

uint8_t EVE_Cmd_waitFlush_status ( EVE_HalContext host)

Definition at line 829 of file Gpu_Hal.cpp.

830{
832 {
833 return 0;
834 }
835 else
836 {
837 host->cmd_fifo_wp = Gpu_Hal_Rd16(host,REG_CMD_WRITE);
838 return 1;
839 }
840}

◆ Fifo_GetFreeSpace()

uint32_t Fifo_GetFreeSpace ( EVE_HalContext host,
Fifo_t pFifo 
)

Definition at line 1111 of file Gpu_Hal.cpp.

1112{
1113 uint32_t FreeSpace = 0;
1114
1115 Fifo_Update(host,pFifo);
1116
1117 if(pFifo->fifo_wp >= pFifo->fifo_rp)
1118 {
1119 FreeSpace = pFifo->fifo_len - pFifo->fifo_wp + pFifo->fifo_rp;
1120 }
1121 else
1122 {
1123 FreeSpace = pFifo->fifo_rp - pFifo->fifo_wp;
1124 }
1125
1126 if(FreeSpace >= 4)
1127 {
1128 FreeSpace -= 4;//make sure 1 word space is maintained between rd and wr pointers
1129 }
1130 return FreeSpace;
1131}
unsigned int uint32_t
void Fifo_Update(EVE_HalContext *host, Fifo_t *pFifo)
Definition Gpu_Hal.cpp:1001
int32_t fifo_len
Definition Gpu_Hal.h:155
int32_t fifo_wp
Definition Gpu_Hal.h:156
int32_t fifo_rp
Definition Gpu_Hal.h:157

◆ Fifo_Init()

void Fifo_Init ( Fifo_t pFifo,
uint32_t  StartAddress,
uint32_t  Length,
uint32_t  HWReadRegAddress,
uint32_t  HWWriteRegAddress 
)

Definition at line 982 of file Gpu_Hal.cpp.

983{
984 /* update the context parameters */
985 pFifo->fifo_buff = StartAddress;
986 pFifo->fifo_len = Length;
987 pFifo->fifo_rp = pFifo->fifo_wp = 0;
988
989 /* update the hardware register addresses - specific to FT800 series chips */
990 pFifo->HW_Read_Reg = HWReadRegAddress;
991 pFifo->HW_Write_Reg = HWWriteRegAddress;
992}
uint32_t fifo_buff
Definition Gpu_Hal.h:154
uint32_t HW_Write_Reg
Definition Gpu_Hal.h:161
uint32_t HW_Read_Reg
Definition Gpu_Hal.h:160

◆ Fifo_Update()

void Fifo_Update ( EVE_HalContext host,
Fifo_t pFifo 
)

Definition at line 1001 of file Gpu_Hal.cpp.

1002{
1003 pFifo->fifo_rp = Gpu_Hal_Rd32(host,pFifo->HW_Read_Reg);
1004 //Gpu_Hal_Wr32(host,pFifo->HW_Write_Reg,pFifo->fifo_wp);
1005}
#define Gpu_Hal_Rd32
Definition Gpu_Hal.h:206

◆ Fifo_Write()

uint32_t Fifo_Write ( EVE_HalContext host,
Fifo_t pFifo,
uint8_t buffer,
uint32_t  NumbytetoWrite 
)

Definition at line 1014 of file Gpu_Hal.cpp.

1015{
1016 uint32_t FreeSpace = Fifo_GetFreeSpace(host,pFifo),TotalBytes = NumbytetoWrite;
1017
1018 if(NumbytetoWrite > FreeSpace)
1019 {
1020 /* update the read pointer and get the free space */
1021 Fifo_Update(host,pFifo);
1022 FreeSpace = Fifo_GetFreeSpace(host,pFifo);
1023
1024 if(NumbytetoWrite > FreeSpace)
1025 {
1026 TotalBytes = FreeSpace;
1027 }
1028 }
1029
1030 /* sanity check */
1031 if(TotalBytes <= 0)
1032 {
1033 //printf("no space in fifo write %d %d %d %d\n",TotalBytes,FreeSpace,pFifo->fifo_wp,pFifo->fifo_rp);
1034 return 0;//error condition
1035 }
1036 /* check for the loopback conditions */
1037 if((pFifo->fifo_wp + TotalBytes) >= pFifo->fifo_len)
1038 {
1039 uint32_t partialchunk = pFifo->fifo_len - pFifo->fifo_wp,secpartialchunk = TotalBytes - partialchunk;
1040
1041 Gpu_Hal_WrMem(host,pFifo->fifo_buff + pFifo->fifo_wp,buffer,partialchunk);
1042 if(secpartialchunk > 0)
1043 {
1044 Gpu_Hal_WrMem(host,pFifo->fifo_buff,buffer + partialchunk,secpartialchunk);
1045 }
1046 pFifo->fifo_wp = secpartialchunk;
1047 //printf("partial chunks %d %d %d %d\n",partialchunk,secpartialchunk,pFifo->fifo_wp,pFifo->fifo_rp);
1048
1049 }
1050 else
1051 {
1052 Gpu_Hal_WrMem(host,pFifo->fifo_buff + pFifo->fifo_wp,buffer,TotalBytes);
1053 pFifo->fifo_wp += TotalBytes;
1054 }
1055
1056 /* update the write pointer address in write register */
1057 Gpu_Hal_Wr32(host,pFifo->HW_Write_Reg,pFifo->fifo_wp);
1058
1059 return TotalBytes;
1060}
static ft_uint32_t ft_uint8_t * buffer
Definition FT_Gpu_Hal.h:139
uint32_t Fifo_GetFreeSpace(EVE_HalContext *host, Fifo_t *pFifo)
Definition Gpu_Hal.cpp:1111
#define Gpu_Hal_Wr32
Definition Gpu_Hal.h:209

◆ Fifo_Write32()

void Fifo_Write32 ( EVE_HalContext host,
Fifo_t pFifo,
uint32_t  WriteWord 
)

Definition at line 1069 of file Gpu_Hal.cpp.

1070{
1071 Fifo_WriteWait(host,pFifo,(uint8_t *)&WriteWord,4);
1072}
void Fifo_WriteWait(EVE_HalContext *host, Fifo_t *pFifo, uint8_t *buffer, uint32_t Numbyte)
Definition Gpu_Hal.cpp:1082

◆ Fifo_WriteWait()

void Fifo_WriteWait ( EVE_HalContext host,
Fifo_t pFifo,
uint8_t buffer,
uint32_t  Numbyte 
)

Definition at line 1082 of file Gpu_Hal.cpp.

1083{
1084 uint32_t TotalBytes = Numbyte,currchunk = 0,FreeSpace;
1085 uint8_t *pbuff = buffer;
1086 /* blocking call, manage to check for the error case and break in case of error */
1087 while(TotalBytes > 0)
1088 {
1089 currchunk = TotalBytes;
1090 FreeSpace = Fifo_GetFreeSpace(host,pFifo);
1091 if(currchunk > FreeSpace)
1092 {
1093 currchunk = FreeSpace;
1094 }
1095
1096 Fifo_Write(host,pFifo,pbuff,currchunk);
1097 pbuff += currchunk;
1098 TotalBytes -= currchunk;
1099
1100 }
1101}
uint32_t Fifo_Write(EVE_HalContext *host, Fifo_t *pFifo, uint8_t *buffer, uint32_t NumbytetoWrite)
Definition Gpu_Hal.cpp:1014

◆ Gpu_ClearScreen()

void Gpu_ClearScreen ( EVE_HalContext host)

Definition at line 1162 of file Gpu_Hal.cpp.

1163{
1166}

◆ Gpu_ClockSelect()

void Gpu_ClockSelect ( EVE_HalContext host,
GPU_PLL_SOURCE_T  pllsource 
)

Definition at line 556 of file Gpu_Hal.cpp.

557{
558 Gpu_HostCommand(host,pllsource);
559}

◆ Gpu_ClockTrimming()

int32_t Gpu_ClockTrimming ( EVE_HalContext host,
int32_t  LowFreq 
)

Definition at line 1139 of file Gpu_Hal.cpp.

1140{
1141 uint32_t f;
1142 uint8_t i;
1143
1144 /* Trim the internal clock by increase the REG_TRIM register till the measured frequency is within the acceptable range.*/
1145 for (i=0; (i < 31) && ((f= Gpu_CurrentFrequency(host)) < LowFreq); i++)
1146 {
1147 Gpu_Hal_Wr8(host,REG_TRIM, i); /* increase the REG_TRIM register value automatically increases the internal clock */
1148
1149 }
1150
1151 Gpu_Hal_Wr32(host,REG_FREQUENCY,f); /* Set the final frequency to be used for internal operations */
1152
1153 return f;
1154}
static uint32_t f
Definition Common.c:41
#define REG_TRIM
#define REG_FREQUENCY
#define Gpu_CurrentFrequency
Definition Gpu_Hal.h:391

◆ Gpu_Cmdfifo_Freespace()

uint16_t Gpu_Cmdfifo_Freespace ( EVE_HalContext host)

Definition at line 697 of file Gpu_Hal.cpp.

698{
699 uint16_t fullness,retval;
700
701 //host->cmd_fifo_wp = Gpu_Hal_Rd16(host,REG_CMD_WRITE);
702
703 fullness = (host->cmd_fifo_wp - Gpu_Hal_Rd16(host,REG_CMD_READ)) & FIFO_SIZE_MASK;
704 retval = (CMD_FIFO_SIZE - 4) - fullness;
705 return (retval);
706}
unsigned short uint16_t
#define FIFO_SIZE_MASK
Definition FT_Gpu_Hal.h:71

◆ Gpu_CoreReset()

void Gpu_CoreReset ( EVE_HalContext host)

Definition at line 589 of file Gpu_Hal.cpp.

590{
592}
#define GPU_CORE_RESET
Definition Gpu_Hal.h:349

◆ Gpu_CurrentFrequency()

uint32_t Gpu_CurrentFrequency ( EVE_HalContext host)

Definition at line 536 of file Gpu_Hal.cpp.

537{
538 uint32_t t0, t1;
540 uint8_t spidata[4];
541 int32_t r = 15625;
542
543 t0 = Gpu_Hal_Rd32(host,REG_CLOCK); /* t0 read */
544 delayMicroseconds(15625);
545
546 t1 = Gpu_Hal_Rd32(host,REG_CLOCK); /* t1 read */
547 return ((t1 - t0) * 64); /* bitshift 6 places is the same as multiplying 64 */
548}
#define REG_CLOCK
int int32_t
static ft_uint32_t addr
Definition FT_Gpu_Hal.h:139

◆ Gpu_Hal_CheckCmdBuffer()

void Gpu_Hal_CheckCmdBuffer ( EVE_HalContext host,
uint32_t  count 
)

Definition at line 759 of file Gpu_Hal.cpp.

760{
761 uint16_t getfreespace;
762 do{
763 getfreespace = Gpu_Cmdfifo_Freespace(host);
764 }while(getfreespace < count);
765}
uint16_t Gpu_Cmdfifo_Freespace(EVE_HalContext *host)
Definition Gpu_Hal.cpp:697

◆ Gpu_Hal_Close()

void Gpu_Hal_Close ( EVE_HalContext host)

Definition at line 99 of file Gpu_Hal.cpp.

100{
101 host->status = GPU_HAL_CLOSED;
102 SPI.end();
103}
#define GPU_HAL_CLOSED
Definition Gpu_Hal.h:113

◆ Gpu_Hal_Dec2Ascii()

int32_t Gpu_Hal_Dec2Ascii ( char8_t pSrc,
int32_t  value 
)

Definition at line 902 of file Gpu_Hal.cpp.

903{
904 int16_t Length;
905 char8_t *pdst,charval;
906 int32_t CurrVal = value,tmpval,i;
907 char8_t tmparray[16],idx = 0;
908
909 Length = strlen(pSrc);
910 pdst = pSrc + Length;
911
912 if(0 == value)
913 {
914 *pdst++ = '0';
915 *pdst++ = '\0';
916 return 0;
917 }
918
919 if(CurrVal < 0)
920 {
921 *pdst++ = '-';
922 CurrVal = - CurrVal;
923 }
924 /* insert the value */
925 while(CurrVal > 0){
926 tmpval = CurrVal;
927 CurrVal /= 10;
928 tmpval = tmpval - CurrVal*10;
929 charval = '0' + tmpval;
930 tmparray[idx++] = charval;
931 }
932
933 for(i=0;i<idx;i++)
934 {
935 *pdst++ = tmparray[idx - i - 1];
936 }
937 *pdst++ = '\0';
938
939 return 0;
940}
short int16_t

◆ Gpu_Hal_DeInit()

void Gpu_Hal_DeInit ( )

Definition at line 111 of file Gpu_Hal.cpp.

112{
113 //Nothing to do
114}

◆ Gpu_Hal_DLSwap()

void Gpu_Hal_DLSwap ( EVE_HalContext host,
uint8_t  DL_Swap_Type 
)

Definition at line 496 of file Gpu_Hal.cpp.

497{
498 uint8_t Swap_Type = DLSWAP_FRAME,Swap_Done = DLSWAP_FRAME;
499
500 if(DL_Swap_Type == DLSWAP_LINE)
501 {
502 Swap_Type = DLSWAP_LINE;
503 }
504
505 /* Perform a new DL swap */
506 Gpu_Hal_Wr8(host,REG_DLSWAP,Swap_Type);
507
508 /* Wait till the swap is done */
509 while(Swap_Done)
510 {
511 Swap_Done = Gpu_Hal_Rd8(host,REG_DLSWAP);
512 if(DLSWAP_DONE != Swap_Done)
513 {
514 Gpu_Hal_Sleep(1);//wait for 1ms
515 }
516 }
517}
#define DLSWAP_DONE
#define DLSWAP_LINE

◆ Gpu_Hal_EndTransfer()

void Gpu_Hal_EndTransfer ( EVE_HalContext host)

Definition at line 244 of file Gpu_Hal.cpp.

245{
246 digitalWrite(host->hal_config.spi_cs_pin_no, HIGH);
247 host->status = GPU_HAL_OPENED;
248}
#define GPU_HAL_OPENED
Definition Gpu_Hal.h:114

◆ Gpu_Hal_Init()

bool_t Gpu_Hal_Init ( Gpu_HalInit_t halinit)

Definition at line 59 of file Gpu_Hal.cpp.

60{
61 return TRUE;
62}

◆ Gpu_Hal_LoadImageToMemory()

void Gpu_Hal_LoadImageToMemory ( EVE_HalContext host,
char8_t fileName,
uint32_t  destination,
uint8_t  type 
)

Definition at line 1361 of file Gpu_Hal.cpp.

1361 {
1362
1363 #ifdef USE_SDCARD
1364 int32_t FileLen = 0;
1365 uint8_t imbuff[512]; //the SD library requires a mandatory of 512 bytes of buffer during its operation.
1366 //uint16_t blocklen;
1367 byte file;
1368
1369 if(type==LOADIMAGE){ //loadimage command takes destination address and options before the actual bitmap data
1371 Gpu_Hal_WrCmd32(host, destination);
1373 }
1374 else if(type==INFLATE){ //inflate command takes destination address before the actual bitmap
1376 Gpu_Hal_WrCmd32(host, destination);
1377 }
1378 else if(type==LOAD){ //load bitmaps directly
1379 }
1380
1381 file = imageFile.openfile(fileName);
1382
1383 if(file){
1384 while (imageFile.offset < imageFile.size)
1385 {
1386 uint16_t n = min(512, imageFile.size - imageFile.offset);
1387 n = (n + 3) & ~3; // force 32-bit alignment
1388 imageFile.readsector(imbuff);
1389 if(type==LOAD)
1390 {
1391 Gpu_Hal_WrMem(host,destination,imbuff, n);//alignment is already taken care by this api
1392 destination += n;
1393 }
1394 else
1395 {
1396 Gpu_Hal_WrCmdBuf_nowait(host,imbuff, n);//transfer data completely and check/wait for the last chunk only
1397 }
1398
1399 }
1400 }
1401 else
1402 {
1403 Gpu_CoCmd_Dlstart(host); // start
1404 Gpu_Hal_WrCmd32(host,CLEAR(1,1,1));
1405 Gpu_Hal_WrCmd32(host,COLOR_RGB(255,255,255));
1406 Gpu_CoCmd_Text(host,DispWidth>>1,DispHeight>>1,29,OPT_CENTER,"File not Found");
1407 Gpu_CoCmd_Text(host,DispWidth>>1,(DispHeight>>1)+30,29,OPT_CENTER,fileName);
1408 Gpu_Hal_WrCmd32(host,DISPLAY());
1409 Gpu_CoCmd_Swap(host);
1410 EVE_Cmd_waitFlush(host);
1411 }
1412 #endif
1413
1414}
#define OPT_NODL
#define CMD_INFLATE
#define CMD_LOADIMAGE
#define Gpu_Hal_WrCmdBuf_nowait
Definition Gpu_Hal.h:231
#define LOAD
Definition Platform.h:184
#define LOADIMAGE
Definition Platform.h:182
#define INFLATE
Definition Platform.h:183

◆ Gpu_Hal_Open()

bool_t Gpu_Hal_Open ( EVE_HalContext host)

Definition at line 72 of file Gpu_Hal.cpp.

73{
74 bool_t ret = TRUE;
75
76 pinMode(host->hal_config.pdn_pin_no, OUTPUT);
77 digitalWrite(host->hal_config.pdn_pin_no, HIGH);
78 pinMode(host->hal_config.spi_cs_pin_no, OUTPUT);
79 digitalWrite(host->hal_config.spi_cs_pin_no, HIGH);
80 SPI.begin();
81 SPI.setClockDivider(SPI_CLOCK_DIV2);
82 SPI.setBitOrder(MSBFIRST);
83 SPI.setDataMode(SPI_MODE0);
84
85 /* Initialize the context valriables */
86 host->cmd_fifo_wp = host->dl_buff_wp = 0;
87 host->spinumdummy = GPU_SPI_ONEDUMMY; //by default ft800/801/810/811 goes with single dummy byte for read
88 host->status = GPU_HAL_OPENED;
89
90 return ret;
91}
boolean bool_t
Definition Platform.h:196

◆ Gpu_Hal_Powercycle()

void Gpu_Hal_Powercycle ( EVE_HalContext host,
bool_t  up 
)

Definition at line 408 of file Gpu_Hal.cpp.

409{
410
411 if (up)
412 {
413 digitalWrite(host->hal_config.pdn_pin_no, LOW);
414 Gpu_Hal_Sleep(20);
415
416 digitalWrite(host->hal_config.pdn_pin_no, HIGH);
417 Gpu_Hal_Sleep(20);
418 }
419 else
420 {
421 digitalWrite(host->hal_config.pdn_pin_no, HIGH);
422 Gpu_Hal_Sleep(20);
423
424 digitalWrite(host->hal_config.pdn_pin_no, LOW);
425 Gpu_Hal_Sleep(20);
426 }
427}

◆ Gpu_Hal_Rd16()

uint16_t Gpu_Hal_Rd16 ( EVE_HalContext host,
uint32_t  addr 
)

Definition at line 303 of file Gpu_Hal.cpp.

304{
305 uint16_t value;
306
308 value = Gpu_Hal_Transfer16(host,0);
310
311 return value;
312}
#define Gpu_Hal_Transfer16
Definition Gpu_Hal.h:200
#define Gpu_Hal_EndTransfer
Definition Gpu_Hal.h:202
#define GPU_READ
Definition Gpu_Hal.h:120
#define Gpu_Hal_StartTransfer
Definition Gpu_Hal.h:198

◆ Gpu_Hal_Rd32()

uint32_t Gpu_Hal_Rd32 ( EVE_HalContext host,
uint32_t  addr 
)

Definition at line 320 of file Gpu_Hal.cpp.

321{
322 uint32_t value;
323
325 value = Gpu_Hal_Transfer32(host,0);
327
328 return value;
329}
#define Gpu_Hal_Transfer32
Definition Gpu_Hal.h:201

◆ Gpu_Hal_Rd8()

uint8_t Gpu_Hal_Rd8 ( EVE_HalContext host,
uint32_t  addr 
)

Definition at line 286 of file Gpu_Hal.cpp.

287{
288 uint8_t value = 0;
289
291 value = Gpu_Hal_Transfer8(host,0);
293
294 return value;
295}
#define Gpu_Hal_Transfer8
Definition Gpu_Hal.h:199

◆ Gpu_Hal_RdMem()

void Gpu_Hal_RdMem ( EVE_HalContext host,
uint32_t  addr,
uint8_t buffer,
uint32_t  length 
)

Definition at line 474 of file Gpu_Hal.cpp.

475{
476 uint32_t SizeTransfered = 0;
478
479 while (length--) {
480 *buffer = Gpu_Hal_Transfer8(host,0);
481 buffer++;
482 }
484
485}
static ft_uint32_t ft_uint8_t ft_uint32_t length
Definition FT_Gpu_Hal.h:140

◆ Gpu_Hal_ResetCmdFifo()

void Gpu_Hal_ResetCmdFifo ( EVE_HalContext host)

Definition at line 865 of file Gpu_Hal.cpp.

866{
867 host->cmd_fifo_wp = 0;
868}

◆ Gpu_Hal_ResetDLBuffer()

void Gpu_Hal_ResetDLBuffer ( EVE_HalContext host)

Definition at line 891 of file Gpu_Hal.cpp.

892{
893 host->dl_buff_wp = 0;
894}

◆ Gpu_Hal_Sleep()

void Gpu_Hal_Sleep ( uint32_t  ms)

Definition at line 525 of file Gpu_Hal.cpp.

526{
527 delay(ms);
528}

◆ Gpu_Hal_StartCmdTransfer()

void Gpu_Hal_StartCmdTransfer ( EVE_HalContext host,
GPU_TRANSFERDIR_T  rw,
uint16_t  count 
)

Definition at line 155 of file Gpu_Hal.cpp.

156{
157 Gpu_Hal_StartTransfer(host,rw,host->cmd_fifo_wp + RAM_CMD);
158}
#define RAM_CMD

◆ Gpu_Hal_StartTransfer()

void Gpu_Hal_StartTransfer ( EVE_HalContext host,
GPU_TRANSFERDIR_T  rw,
uint32_t  addr 
)

Definition at line 123 of file Gpu_Hal.cpp.

124{
125 if (GPU_READ == rw)
126 {
127 //EVE mem read
128 digitalWrite(host->hal_config.spi_cs_pin_no, LOW);
129 SPI.transfer(addr >> 16);
130 SPI.transfer(highByte(addr));
131 SPI.transfer(lowByte(addr));
132
133 SPI.transfer(0); //Dummy Read Byte
134
135 host->status = GPU_HAL_READING;
136 }
137 else
138 {
139 //EVE mem write
140 digitalWrite(host->hal_config.spi_cs_pin_no, LOW);
141 SPI.transfer(0x80 | (addr >> 16));
142 SPI.transfer(highByte(addr));
143 SPI.transfer(lowByte(addr));
144
145 host->status = GPU_HAL_WRITING;
146 }
147}
#define GPU_HAL_WRITING
Definition Gpu_Hal.h:116
#define GPU_HAL_READING
Definition Gpu_Hal.h:115

◆ Gpu_Hal_Transfer16()

uint16_t Gpu_Hal_Transfer16 ( EVE_HalContext host,
uint16_t  value 
)

Definition at line 193 of file Gpu_Hal.cpp.

194{
195 uint16_t retVal = 0;
196
197 if (host->status == GPU_HAL_WRITING)
198 {
199 SPI.transfer(value & 0xFF);//LSB first
200 SPI.transfer((value >> 8) & 0xFF);
201 }
202 else
203 {
204 retVal = SPI.transfer(0);
205 retVal |= (uint16_t)SPI.transfer(0) << 8;
206 }
207
208 return retVal;
209}

◆ Gpu_Hal_Transfer32()

uint32_t Gpu_Hal_Transfer32 ( EVE_HalContext host,
uint32_t  value 
)

Definition at line 217 of file Gpu_Hal.cpp.

218{
219 uint32_t retVal = 0;
220
221 if (host->status == GPU_HAL_WRITING)
222 {
223 SPI.transfer(value & 0xFF);//LSB first
224 SPI.transfer((value >> 8) & 0xFF);
225 SPI.transfer((value >> 16) & 0xFF);
226 SPI.transfer((value >> 24) & 0xFF);
227 }
228 else
229 {
230 retVal = SPI.transfer(0);
231 retVal |= (uint32_t)SPI.transfer(0) << 8;
232 retVal |= (uint32_t)SPI.transfer(0) << 16;
233 retVal |= (uint32_t)SPI.transfer(0) << 24;
234 }
235 return retVal;
236}

◆ Gpu_Hal_Transfer8()

uint8_t Gpu_Hal_Transfer8 ( EVE_HalContext host,
uint8_t  value 
)

Definition at line 183 of file Gpu_Hal.cpp.

184{
185 return SPI.transfer(value);
186}

◆ Gpu_Hal_TransferString()

void Gpu_Hal_TransferString ( EVE_HalContext host,
const char8_t string 
)

Definition at line 166 of file Gpu_Hal.cpp.

167{
168 uint16_t length = strlen(string);
169 while(length --)
170 {
171 Gpu_Hal_Transfer8(host,*string);
172 string ++;
173 }
174 //Append one null as ending flag
175 Gpu_Hal_Transfer8(host,0);
176}

◆ Gpu_Hal_Updatecmdfifo()

void Gpu_Hal_Updatecmdfifo ( EVE_HalContext host,
uint32_t  count 
)

Definition at line 680 of file Gpu_Hal.cpp.

681{
682 host->cmd_fifo_wp = (host->cmd_fifo_wp + count) & FIFO_SIZE_MASK;
683
684 //4 byte alignment
685 host->cmd_fifo_wp = (host->cmd_fifo_wp + 3) & FIFO_BYTE_ALIGNMENT_MASK;
686 Gpu_Hal_Wr16(host,REG_CMD_WRITE,host->cmd_fifo_wp);
687}
#define FIFO_BYTE_ALIGNMENT_MASK
Definition FT_Gpu_Hal.h:72

◆ Gpu_Hal_WaitLogo_Finish()

void Gpu_Hal_WaitLogo_Finish ( EVE_HalContext host)

Definition at line 848 of file Gpu_Hal.cpp.

849{
850 int16_t cmdrdptr,cmdwrptr;
851
852 do{
853 cmdrdptr = Gpu_Hal_Rd16(host,REG_CMD_READ);
854 cmdwrptr = Gpu_Hal_Rd16(host,REG_CMD_WRITE);
855 }while ((cmdwrptr != cmdrdptr) || (cmdrdptr != 0));
856 host->cmd_fifo_wp = 0;
857}

◆ Gpu_Hal_Wr16()

void Gpu_Hal_Wr16 ( EVE_HalContext host,
uint32_t  addr,
uint16_t  v 
)

Definition at line 350 of file Gpu_Hal.cpp.

351{
353 Gpu_Hal_Transfer16(host,v);
355}
#define GPU_WRITE
Definition Gpu_Hal.h:121

◆ Gpu_Hal_Wr32()

void Gpu_Hal_Wr32 ( EVE_HalContext host,
uint32_t  addr,
uint32_t  v 
)

Definition at line 363 of file Gpu_Hal.cpp.

364{
366 Gpu_Hal_Transfer32(host,v);
368}

◆ Gpu_Hal_Wr8()

void Gpu_Hal_Wr8 ( EVE_HalContext host,
uint32_t  addr,
uint8_t  v 
)

Definition at line 337 of file Gpu_Hal.cpp.

338{
340 Gpu_Hal_Transfer8(host,v);
342}

◆ Gpu_Hal_WrCmd32()

void Gpu_Hal_WrCmd32 ( EVE_HalContext host,
uint32_t  cmd 
)

Definition at line 876 of file Gpu_Hal.cpp.

877{
878 Gpu_Hal_CheckCmdBuffer(host,sizeof(cmd));
879
880 Gpu_Hal_Wr32(host,RAM_CMD + host->cmd_fifo_wp,cmd);
881
882 Gpu_Hal_Updatecmdfifo(host,sizeof(cmd));
883}
static ft_void_t ft_uint32_t * cmd
Definition FT_Gpu_Hal.h:184
void Gpu_Hal_CheckCmdBuffer(EVE_HalContext *host, uint32_t count)
Definition Gpu_Hal.cpp:759
void Gpu_Hal_Updatecmdfifo(EVE_HalContext *host, uint32_t count)
Definition Gpu_Hal.cpp:680

◆ Gpu_Hal_WrCmdBuf()

void Gpu_Hal_WrCmdBuf ( EVE_HalContext host,
uint8_t buffer,
uint32_t  count 
)

Definition at line 717 of file Gpu_Hal.cpp.

718{
719 uint32_t length =0, SizeTransfered = 0,availablefreesize;
720
721 do
722 {
723 length = count;
724 availablefreesize = Gpu_Cmdfifo_Freespace(host);
725
726 if (length > availablefreesize)
727 {
728 length = availablefreesize;
729 }
731
733
734 SizeTransfered = 0;
735 while (length--) {
737 buffer++;
738 SizeTransfered ++;
739 }
740 length = SizeTransfered;
741
744
745 EVE_Cmd_waitFlush(host);
746
747 count -= length;
748 }while (count > 0);
749}
void Gpu_Hal_StartCmdTransfer(EVE_HalContext *host, GPU_TRANSFERDIR_T rw, uint16_t count)
Definition Gpu_Hal.cpp:155

◆ Gpu_Hal_WrCmdBuf_nowait()

void Gpu_Hal_WrCmdBuf_nowait ( EVE_HalContext host,
uint8_t buffer,
uint32_t  count 
)

Definition at line 788 of file Gpu_Hal.cpp.

789{
790 uint32_t length =0, SizeTransfered = 0 , availablefreesize;
791
792 do {
793 length = count;
794 availablefreesize = Gpu_Cmdfifo_Freespace(host);
795
796 if (length > availablefreesize)
797 {
798 length = availablefreesize;
799 }
801
803
804 SizeTransfered = 0;
805 while (length--)
806 {
808 buffer++;
809 SizeTransfered ++;
810 }
811 length = SizeTransfered;
812
814
816
817 // EVE_Cmd_waitFlush(host);
818
819 count -= length;
820 }while (count > 0);
821}

◆ Gpu_Hal_WrCmdBufFromFlash()

void Gpu_Hal_WrCmdBufFromFlash ( EVE_HalContext host,
PROGMEM prog_uchar8_t buffer,
uint32_t  count 
)

Definition at line 250 of file Gpu_Hal.cpp.

251{
252 uint32_t length =0, SizeTransfered = 0, getfreespace;
253 do {
254 length = count;
255 getfreespace = Gpu_Cmdfifo_Freespace(host);
256 if (length > getfreespace){
257 length = getfreespace;
258 }
260
262
263 SizeTransfered = 0;
264 while (length--) {
266 buffer++;
267 SizeTransfered ++;
268 }
269 length = SizeTransfered;
270
273
274 EVE_Cmd_waitFlush(host);
275
276 count -= length;
277 }while (count > 0);
278}
#define pgm_read_byte_near(x)
Definition Gpu_Hal.h:465

◆ Gpu_Hal_WrMem()

void Gpu_Hal_WrMem ( EVE_HalContext host,
uint32_t  addr,
const uint8_t buffer,
uint32_t  length 
)

Definition at line 455 of file Gpu_Hal.cpp.

456{
457 uint32_t SizeTransfered = 0;
459 while (length--)
460 {
462 buffer++;
463 }
465
466}

◆ Gpu_Hal_WrMemFromFlash()

void Gpu_Hal_WrMemFromFlash ( EVE_HalContext host,
uint32_t  addr,
const prog_uchar8_t buffer,
uint32_t  length 
)

Definition at line 436 of file Gpu_Hal.cpp.

437{
438 uint32_t SizeTransfered = 0;
439
441 while (length--) {
443 buffer++;
444 }
446}

◆ Gpu_HostCommand()

void Gpu_HostCommand ( EVE_HalContext host,
uint8_t  cmd 
)

Definition at line 377 of file Gpu_Hal.cpp.

378{
379 digitalWrite(host->hal_config.spi_cs_pin_no, LOW);
380 SPI.transfer(cmd);
381 SPI.transfer(0);
382 SPI.transfer(0);
383 digitalWrite(host->hal_config.spi_cs_pin_no, HIGH);
384}

◆ Gpu_HostCommand_Ext3()

void Gpu_HostCommand_Ext3 ( EVE_HalContext host,
uint32_t  cmd 
)

Definition at line 392 of file Gpu_Hal.cpp.

393{
394 digitalWrite(host->hal_config.spi_cs_pin_no, LOW);
395 SPI.transfer(cmd);
396 SPI.transfer((cmd>>8) & 0xff);
397 SPI.transfer((cmd>>16) & 0xff);
398 digitalWrite(host->hal_config.spi_cs_pin_no, HIGH);
399
400}

◆ Gpu_PLL_FreqSelect()

void Gpu_PLL_FreqSelect ( EVE_HalContext host,
GPU_PLL_FREQ_T  freq 
)

Definition at line 567 of file Gpu_Hal.cpp.

568{
569 Gpu_HostCommand(host,freq);
570}

◆ Gpu_PowerModeSwitch()

void Gpu_PowerModeSwitch ( EVE_HalContext host,
GPU_POWER_MODE_T  pwrmode 
)

Definition at line 578 of file Gpu_Hal.cpp.

579{
580 Gpu_HostCommand(host,pwrmode);
581}

Variable Documentation

◆ DLCODE_BOOTUP

const uint8_t DLCODE_BOOTUP[12]
Initial value:
=
{
0,0,0,2,
7,0,0,38,
0,0,0,0,
}

Definition at line 44 of file Gpu_Hal.cpp.

45{
46 0,0,0,2,//GPU instruction CLEAR_COLOR_RGB
47 7,0,0,38, //GPU instruction CLEAR
48
49 0,0,0,0, //GPU instruction DISPLAY
50};