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
Go to the documentation of this file.
1
32#include "Platform.h"
33#include "Gpu.h"
34#include "Hal_Config.h"
35
36#ifdef USE_SDCARD
37#include "sdcard.h"
38static uint8_t sd_present=0;
39
40Reader imageFile;
41#endif
42/* Boot up for FT800 followed by graphics primitive sample cases */
43/* Initial boot up DL - make the back ground green color */
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};
51
52/***************************************************************************
53* Interface Description : API for USB-to-SPI/I2C bridge IC LIB initialize
54* Implementation :
55* Return Value : bool_t
56* TRUE , FALSE
57* Author :
58****************************************************************************/
60{
61 return TRUE;
62}
63
64/***************************************************************************
65* Interface Description : To obtain handle for interface communication
66* Implementation :
67* Return Value : bool_t
68* TRUE - Configuration successful
69* FALSE - Configuration failed
70* Author :
71****************************************************************************/
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}
92
93/***************************************************************************
94* Interface Description : Free global wr_buf, release SPI communication handle
95* Implementation :
96* Return Value : void
97* Author :
98****************************************************************************/
100{
101 host->status = GPU_HAL_CLOSED;
102 SPI.end();
103}
104
105/***************************************************************************
106* Interface Description : Uninitialize
107* Implementation :
108* Return Value : void
109* Author :
110****************************************************************************/
112{
113 //Nothing to do
114}
115
116/***************************************************************************
117* Interface Description : The APIs for reading/writing transfer continuously
118* only with small buffer system
119* Implementation :
120* Return Value : void
121* Author :
122****************************************************************************/
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}
148
149/***************************************************************************
150* Interface Description : The APIs for writing transfer continuously to RAM_CMD
151* Implementation :
152* Return Value : void
153* Author :
154****************************************************************************/
156{
157 Gpu_Hal_StartTransfer(host,rw,host->cmd_fifo_wp + RAM_CMD);
158}
159
160/***************************************************************************
161* Interface Description :
162* Implementation :
163* Return Value : void
164* Author :
165****************************************************************************/
166void Gpu_Hal_TransferString(EVE_HalContext *host,const char8_t *string)
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}
177/***************************************************************************
178* Interface Description :Function to tranfer byte using SPI_Write()
179* Implementation :
180* Return Value : void
181* Author :
182****************************************************************************/
184{
185 return SPI.transfer(value);
186}
187/***************************************************************************
188* Interface Description :
189* Implementation :
190* Return Value : void
191* Author :
192****************************************************************************/
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}
210
211/***************************************************************************
212* Interface Description :
213* Implementation :
214* Return Value : void
215* Author :
216****************************************************************************/
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}
237
238/***************************************************************************
239* Interface Description : Inactivate CS
240* Implementation :
241* Return Value : void
242* Author :
243****************************************************************************/
245{
246 digitalWrite(host->hal_config.spi_cs_pin_no, HIGH);
247 host->status = GPU_HAL_OPENED;
248}
249
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}
279
280/***************************************************************************
281* Interface Description : EVE mem read API for 1 byte
282* Implementation :
283* Return Value : uint8_t
284* Author :
285****************************************************************************/
287{
288 uint8_t value = 0;
289
291 value = Gpu_Hal_Transfer8(host,0);
293
294 return value;
295}
296
297/***************************************************************************
298* Interface Description : EVE mem read API for 2 byte
299* Implementation :
300* Return Value : uint8_t
301* Author :
302****************************************************************************/
304{
305 uint16_t value;
306
308 value = Gpu_Hal_Transfer16(host,0);
310
311 return value;
312}
313
314/***************************************************************************
315* Interface Description : EVE mem read API for 4 byte
316* Implementation :
317* Return Value : uint8_t
318* Author :
319****************************************************************************/
321{
322 uint32_t value;
323
325 value = Gpu_Hal_Transfer32(host,0);
327
328 return value;
329}
330
331/***************************************************************************
332* Interface Description : EVE mem write API for 1 byte
333* Implementation :
334* Return Value : void
335* Author :
336****************************************************************************/
343
344/***************************************************************************
345* Interface Description : EVE mem write API for 2 byte
346* Implementation :
347* Return Value : void
348* Author :
349****************************************************************************/
356
357/***************************************************************************
358* Interface Description : EVE mem write API for 4 byte
359* Implementation :
360* Return Value : void
361* Author :
362****************************************************************************/
369
370/***************************************************************************
371* Interface Description : Function to transfer the HOST CMD from host to
372* EVE through lib service
373* Implementation :
374* Return Value : void
375* Author :
376****************************************************************************/
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}
385
386/***************************************************************************
387* Interface Description : This API sends a 3byte command from host to EVE
388* Implementation :
389* Return Value : void
390* Author :
391****************************************************************************/
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}
401
402/***************************************************************************
403* Interface Description : Toggle PD_N pin of FT800 board for a power cycle
404* Implementation :
405* Return Value : void
406* Author :
407****************************************************************************/
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}
428
429/***************************************************************************
430* Interface Description : Gpu_Hal_WrMemFromFlash and Gpu_Hal_WrMem ideally
431* perform same operation.Find why was 2 created?
432* Implementation :
433* Return Value : void
434* Author :
435****************************************************************************/
437{
438 uint32_t SizeTransfered = 0;
439
441 while (length--) {
443 buffer++;
444 }
446}
447
448/***************************************************************************
449* Interface Description :
450*
451* Implementation :
452* Return Value : void
453* Author :
454****************************************************************************/
456{
457 uint32_t SizeTransfered = 0;
459 while (length--)
460 {
462 buffer++;
463 }
465
466}
467
468/***************************************************************************
469* Interface Description :
470* Implementation :
471* Return Value : void
472* Author :
473****************************************************************************/
475{
476 uint32_t SizeTransfered = 0;
478
479 while (length--) {
480 *buffer = Gpu_Hal_Transfer8(host,0);
481 buffer++;
482 }
484
485}
486
487/***************************************************************************
488* Interface Description : API to check the status of previous DLSWAP and
489 perform DLSWAP of new DL.
490 Check for the status of previous DLSWAP and if
491 still not done wait for few ms and check again
492* Implementation :
493* Return Value : void
494* Author :
495****************************************************************************/
496void Gpu_Hal_DLSwap(EVE_HalContext *host, uint8_t DL_Swap_Type)
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}
518
519/***************************************************************************
520* Interface Description : Calls platform specific sleep call
521* Implementation :
522* Return Value : void
523* Author :
524****************************************************************************/
526{
527 delay(ms);
528}
529
530/***************************************************************************
531* Interface Description :
532* Implementation :
533* Return Value : void
534* Author :
535****************************************************************************/
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}
549
550/***************************************************************************
551* Interface Description : API to select clock source
552* Implementation :
553* Return Value : void
554* Author :
555****************************************************************************/
557{
558 Gpu_HostCommand(host,pllsource);
559}
560
561/***************************************************************************
562* Interface Description : API to select frequency
563* Implementation :
564* Return Value : void
565* Author :
566****************************************************************************/
568{
569 Gpu_HostCommand(host,freq);
570}
571
572/***************************************************************************
573* Interface Description :
574* Implementation :
575* Return Value : void
576* Author :
577****************************************************************************/
579{
580 Gpu_HostCommand(host,pwrmode);
581}
582
583/***************************************************************************
584* Interface Description :
585* Implementation :
586* Return Value : void
587* Author :
588****************************************************************************/
593
594/***************************************************************************
595* Interface Description : This API can only be called when PLL is stopped
596* (SLEEP mode).For compatibility, set frequency to
597* the GPU_12MHZ option in the GPU_SETPLLSP1_T
598* table.
599* Implementation :
600* Return Value : void
601* Author :
602****************************************************************************/
603#ifdef FT81X_ENABLE
605{
606 if(GPU_SYSCLK_72M == freq)
607 Gpu_HostCommand_Ext3(host, (uint32_t)0x61 | (0x40 << 8) | (0x06 << 8));
608 else if(GPU_SYSCLK_60M == freq)
609 Gpu_HostCommand_Ext3(host, (uint32_t)0x61 | (0x40 << 8) | (0x05 << 8));
610 else if(GPU_SYSCLK_48M == freq)
611 Gpu_HostCommand_Ext3(host, (uint32_t)0x61 | (0x40 << 8) | (0x04 << 8));
612 else if(GPU_SYSCLK_36M == freq)
613 Gpu_HostCommand_Ext3(host, (uint32_t)0x61 | (0x03 << 8));
614 else if(GPU_SYSCLK_24M == freq)
615 Gpu_HostCommand_Ext3(host, (uint32_t)0x61 | (0x02 << 8));
616 else if(GPU_SYSCLK_DEFAULT == freq)//default clock
617 Gpu_HostCommand_Ext3(host, 0x61);
618}
619
620/***************************************************************************
621* Interface Description : Power down or up ROMs and ADCs.
622* Implementation :
623* Return Value : void
624* Author :
625****************************************************************************/
627{
628 Gpu_HostCommand_Ext3(host, (uint32_t)0x49 | (val<<8));
629}
630
631/***************************************************************************
632* Interface Description : this API sets the current strength of supported
633* GPIO/IO group(s)
634* Implementation :
635* Return Value : void
636* Author :
637****************************************************************************/
639{
640 Gpu_HostCommand_Ext3(host, (uint32_t)0x70 | (group << 8) | (strength << 8));
641}
642
643/***************************************************************************
644* Interface Description : this API will hold the system reset active,
645* Gpu_81X_ResetRemoval() must be called to
646* release the system reset.
647* Implementation :
648* Return Value : void
649* Author :
650****************************************************************************/
652{
654}
655
656/***************************************************************************
657* Interface Description : This API will release the system reset, and the
658* system will exit reset and behave as after POR,
659* settings done through SPI commands will not be
660* affected.
661* Implementation :
662* Return Value : void
663* Author :
664****************************************************************************/
666{
668}
669#endif
670
671/***************************************************************************
672* Interface Description : Function to update global HAL context variable
673* cmd_fifo_wp pointer and write to REG_CMD_WRITE
674* to indicate GPU to start processing new commands
675* in RAM_CMD
676* Implementation :
677* Return Value : void
678* Author :
679****************************************************************************/
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}
688
689/***************************************************************************
690* Interface Description : Function to compute available freespace in RAM_CMD.
691* RAM_CMD is 4K in size.
692* REG_CMD_READ reg provides command buffer read pointer
693* Implementation :
694* Return Value : uint16_t
695* Author :
696****************************************************************************/
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}
707
708/***************************************************************************
709* Interface Description : Continuous write to RAM_CMD with wait with start
710* address as host->cmd_fifo_wp + RAM_CMD.
711* FT81x RAM_CMD size is 4K (4096 bytes)
712* Hence one SPI write is adequate.
713* Implementation :
714* Return Value : uint16_t
715* Author :
716****************************************************************************/
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}
750
751/***************************************************************************
752* Interface Description : Blocking function call
753* Blocks until "count" number of bytes gets available
754* in RAM_CMD
755* Implementation :
756* Return Value : void
757* Author :
758****************************************************************************/
760{
761 uint16_t getfreespace;
762 do{
763 getfreespace = Gpu_Cmdfifo_Freespace(host);
764 }while(getfreespace < count);
765}
766
767/***************************************************************************
768* Interface Description : Blocking function call
769* Blocks until all commands in RAM_CMD are executed and
770* it is fully empty
771* Implementation :
772* Return Value : void
773* Author :
774****************************************************************************/
776{
778
779 host->cmd_fifo_wp = Gpu_Hal_Rd16(host,REG_CMD_WRITE);
780}
781
782/***************************************************************************
783* Interface Description : Continuous write to RAM_CMD with no wait
784* Implementation :
785* Return Value : void
786* Author :
787****************************************************************************/
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}
822
823/***************************************************************************
824* Interface Description :
825* Implementation :
826* Return Value : void
827* Author :
828****************************************************************************/
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}
841
842/***************************************************************************
843* Interface Description :
844* Implementation :
845* Return Value : void
846* Author :
847****************************************************************************/
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}
858
859/***************************************************************************
860* Interface Description :
861* Implementation :
862* Return Value : void
863* Author :
864****************************************************************************/
866{
867 host->cmd_fifo_wp = 0;
868}
869
870/***************************************************************************
871* Interface Description :
872* Implementation :
873* Return Value : void
874* Author :
875****************************************************************************/
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}
884
885/***************************************************************************
886* Interface Description :
887* Implementation :
888* Return Value : void
889* Author :
890****************************************************************************/
892{
893 host->dl_buff_wp = 0;
894}
895
896/***************************************************************************
897* Interface Description : Helper api for dec to ascii
898* Implementation :
899* Return Value : void
900* Author :
901****************************************************************************/
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}
941
942/***************************************************************************
943* Interface Description : Set EVE spi communication mode
944* Set USB bridge communication mode
945* Update global variable
946* Implementation :
947* Return Value : void
948* -1 - Error, 0 - Success
949* Author :
950****************************************************************************/
951#ifdef FT81X_ENABLE
953{
954 uint8_t writebyte = 0;
955
956 if((numchnls > GPU_SPI_QUAD_CHANNEL) || (numdummy > GPU_SPI_TWODUMMY) || (numdummy < GPU_SPI_ONEDUMMY))
957 {
958 return -1;//error
959 }
960
961 //swicth EVE to multi channel SPI mode
962 writebyte = numchnls;
963 if(numdummy == GPU_SPI_TWODUMMY)
964 writebyte |= SPI_TWO_DUMMY_BYTE;
965 Gpu_Hal_Wr8(host, REG_SPI_WIDTH, writebyte);
966
967 //FT81x swicthed to dual/quad mode, now update global HAL context
968 host->spichannel = numchnls;
969 host->spinumdummy = numdummy;
970
971 return 0;
972}
973#endif
974
975/***************************************************************************
976* Interface Description : FIFO related apis
977* Init all the parameters of fifo buffer
978* Implementation :
979* Return Value : void
980* Author :
981****************************************************************************/
982void Fifo_Init(Fifo_t *pFifo,uint32_t StartAddress,uint32_t Length,uint32_t HWReadRegAddress,uint32_t HWWriteRegAddress)
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}
993
994/***************************************************************************
995* Interface Description : FIFO related apis
996* update both the read and write pointers
997* Implementation :
998* Return Value : void
999* Author :
1000****************************************************************************/
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}
1006
1007/***************************************************************************
1008* Interface Description : FIFO related apis
1009* just write and update the write register
1010* Implementation :
1011* Return Value : void
1012* Author :
1013****************************************************************************/
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}
1061
1062/***************************************************************************
1063* Interface Description : FIFO related apis
1064* just write one word and update the write register
1065* Implementation :
1066* Return Value : void
1067* Author :
1068****************************************************************************/
1069void Fifo_Write32(EVE_HalContext *host,Fifo_t *pFifo,uint32_t WriteWord)
1070{
1071 Fifo_WriteWait(host,pFifo,(uint8_t *)&WriteWord,4);
1072}
1073
1074/***************************************************************************
1075* Interface Description : FIFO related apis
1076* write and wait for the fifo to be empty. handle cases even if
1077* the Numbytes are more than freespace
1078* Implementation :
1079* Return Value : void
1080* Author :
1081****************************************************************************/
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}
1102
1103/***************************************************************************
1104* Interface Description : FIFO related apis
1105* get the free space in the fifo - make sure the
1106* return value is maximum of (LENGTH - 4)
1107* Implementation :
1108* Return Value : void
1109* Author :
1110****************************************************************************/
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}
1132
1133/***************************************************************************
1134* Interface Description :
1135* Implementation :
1136* Return Value : void
1137* Author :
1138****************************************************************************/
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}
1155
1156/***************************************************************************
1157* Interface Description : Clear the screen
1158* Implementation :
1159* Return Value : void
1160* Author :
1161****************************************************************************/
1167
1168#if defined(FT811_ENABLE) || defined(FT813_ENABLE)
1169#define OTP_DATA_LEN 1172
1170
1171static uint8_t OTP_DATA_U8 []={
1172 26,255,255,255,32,32,48,0,4,0,0,0,2,0,0,0,34,255,255,255,0,176,48,0,120,218,237,84,255,107,92,69,16,159,125,155,107,141,201,121,247,106,130,9,225,244,238,37,246,146,52,63,53,98,172,53,48,243,8,36,166,182,63,136,216,246,7,205,219,75,122,119,185,139,196,128,34,33,136,123,65,240,7,31,44,105,41,69,72,12,210,166,6,17,12,104,64,165,73,133,134,98,80,74,43,148,22,20,133,40,20,34,233,15,82,250,131,10,113,246,229,106,197,191,161,111,217,55,179,59,59,59,243,153,47,251,135,15,58,204,11,109,114,89,149,84,169,242,172,2,109,10,73,53,167,92,158,89,21,6,89,230,236,126,86,89,206,242,169,178,61,187,115,62,85,190,199,133,129,44,132,249,90,12,243,124,67,49,169,76,81,22,195,60,211,113,40,133,249,253,104,114,113,148,197,131,105,169,158,3,19,132,65,28,187,240,25,112,3,147,99,235,163,80,98,63,10,123,181,208,73,213,29,24,246,226,121,112,199,146,74,98,56,22,195,135,245,32,14,194,17,180,182,100,46,169,220,114,244,103,171,114,252,41,222,143,97,150,53,64,167,202,110,240,86,186,45,16,90,14,191,158,110,196,163,216,130,241,232,159,42,251,88,4,169,90,80,42,163,226,248,168,206,97,132,136,169,69,113,20,27,245,203,40,131,12,54,87,37,143,253,43,105,97,137,9,172,103,181,26,172,79,163,102,184,142,57,83,0,61,139,144,159,79,135,193,62,61,0,157,250,5,20,186,67,91,255,133,238,140,104,167,30,192,197,72,2,85,137,221,89,134,101,140,177,191,238,137,75,105,137,23,97,18,226,31,175,98,31,174,165,141,90,193,21,88,194,117,60,207,243,115,248,202,254,171,171,37,248,20,87,112,17,59,180,59,246,35,199,177,83,175,35,140,93,224,187,172,45,169,172,108,29,47,192,59,186,70,159,1,208,155,136,40,71,190,195,101,222,117,131,221,90,142,110,48,221,85,165,177,42,173,169,82,89,165,78,149,138,136,110,224,13,108,200,0,132,1,50,103,114,55,176,145,254,51,132,208,183,177,137,64,111,128,192,13,104,162,86,145,165,198,255,141,86,209,68,79,146,84,87,33,163,95,132,39,120,182,242,76,115,78,123,40,142,7,200,227,21,103,50,103,171,109,123,27,242,115,193,0,197,176,70,63,141,125,212,35,14,8,95,28,20,246,116,155,30,132,152,118,3,40,29,162,62,60,158,9,131,8,197,120,49,99,115,35,39,228,200,168,48,81,197,2,175,221,224,205,140,173,148,4,87,13,148,94,19,235,216,205,62,212,179,14,199,221,234,21,223,207,112,254,163,90,169,197,247,50,110,249,16,249,156,113,137,83,98,146,163,23,215,115,16,146,173,102,142,158,74,160,205,181,28,217,67,93,156,121,40,156,202,76,130,169,184,193,12,9,125,82,132,149,121,209,65,219,198,12,47,80,7,15,182,163,97,52,171,206,211,20,186,229,195,148,42,15,137,45,116,244,29,188,138,105,177,76,139,149,18,113,141,160,192,1,218,222,14,131,101,90,224,17,195,239,51,113,156,194,111,245,21,49,137,171,100,61,238,21,166,50,67,95,83,63,154,202,71,116,141,45,205,208,37,94,133,188,186,201,177,134,82,86,117,84,109,46,137,52,237,214,102,248,22,253,82,41,137,91,148,37,29,97,147,195,86,126,89,156,165,45,214,188,43,54,43,160,63,36,139,169,142,17,73,175,31,255,230,232,164,175,244,161,197,38,71,118,121,70,109,226,43,252,14,100,249,142,135,180,156,48,185,45,172,176,247,71,244,29,104,240,25,3,37,216,78,179,159,101,171,9,63,225,95,166,6,126,71,24,29,156,165,199,253,126,108,119,88,51,146,216,19,191,137,102,191,107,186,68,109,78,247,244,95,130,99,94,134,49,183,128,158,84,207,58,245,129,9,220,145,78,16,218,85,102,226,94,102,142,121,247,51,243,146,119,63,51,3,14,71,157,94,245,86,169,151,134,156,99,212,206,189,148,208,9,109,239,43,242,125,57,135,249,19,111,120,245,182,79,121,218,62,110,231,222,203,57,220,245,52,237,217,126,246,253,183,89,95,59,59,145,238,165,15,28,91,45,86,239,140,215,231,199,56,34,59,239,154,239,159,244,38,57,63,167,156,41,126,95,14,83,82,189,203,183,244,51,186,33,39,12,234,244,105,156,79,111,161,100,186,232,37,25,187,195,253,252,137,35,245,2,243,54,207,243,8,176,143,109,175,225,57,92,131,71,248,220,151,222,113,255,28,26,114,131,139,17,130,111,24,65,63,235,157,198,90,188,238,213,251,63,120,130,59,151,187,130,95,193,207,252,26,214,221,175,215,240,186,211,85,217,197,107,67,123,113,15,217,42,252,201,155,245,133,94,131,122,255,87,207,80,143,215,238,91,47,126,247,106,248,204,159,153,187,116,219,49,116,45,115,147,182,48,242,4,190,240,127,118,224,193,247,224,3,89,247,15,148,99,211,103,26,255,255,255,20,33,48,0,4,0,0,0,15,0,0,0,26,255,255,255,32,32,48,0,4,0,0,0,0,0,0,0};
1173#elif defined(BT815_ENABLE) || defined(BT816_ENABLE) || defined(BT81X_ENABLE)
1174#define OTP_DATA_LEN 2048
1175#if BT816_ENABLE //816
1176static uint8_t OTP_DATA_U8[] = {
1177 0x1c, 0xff, 0xff, 0xff, 0x24, 0x91, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00, 0x22, 0xff, 0xff, 0xff, 0x00, 0x98, 0x30, 0x00, 0x78, 0xda, 0xed, 0x53, 0x5f, 0x4b, 0x54, 0x41, 0x14, 0x3f, 0xd7, 0x59, 0x57, 0xdd, 0xb6, 0xed, 0x8e, 0x84, 0x45, 0xb8, 0xb4, 0x77, 0x53, 0xae, 0x10, 0x52, 0x21, 0x9a, 0x49, 0xc9, 0x19, 0x2a, 0xb0, 0x2c, 0x0c, 0x7c, 0xc8, 0xde, 0x66, 0x76, 0xd7, 0x7b, 0x57, 0xef, 0x86, 0xf4, 0x16, 0xd2, 0xc3, 0x88, 0xaf, 0x13, 0xf7, 0x4d, 0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0x2f, 0x71, 0xbf, 0x58, 0x13, 0xbb, 0x34, 0x03, 0xbe, 0x1a, 0x16, 0x43, 0x82, 0x55, 0x3e, 0x13, 0x06, 0x7b, 0x1a, 0x11, 0xeb, 0xe2, 0xa3, 0xf7, 0x54, 0x7c, 0x72, 0xfa, 0xc9, 0xbe, 0x26, 0xc6, 0x70, 0xcb, 0xc9, 0x47, 0xeb, 0xa2, 0x47, 0xb2, 0x72, 0x06, 0x37, 0x3c, 0x1b, 0x37, 0x86, 0x3c, 0xfa, 0x46, 0x3e, 0xdf, 0x13, 0x9f, 0x4e, 0xfb, 0xb6, 0xda, 0x25, 0xdc, 0x22, 0xdb, 0x07, 0xe7, 0x8d, 0x03, 0x4d, 0x6a, 0x52, 0x93, 0x9a, 0xf4, 0x17, 0x31, 0xf7, 0x48, 0x47, 0xdd, 0xde, 0xe5, 0xc0, 0x4f, 0x9e, 0x6a, 0x2a, 0xf7, 0x00, 0x00, 0x1a, 0xff, 0xff, 0xff, 0xf0, 0x20, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xff, 0xff, 0xff, 0x00, 0xa0, 0x30, 0x00, 0x78, 0xda, 0xed, 0x53, 0xcf, 0x4b, 0x14, 0x51, 0x1c, 0x7f, 0xe3, 0x13, 0xb7, 0x64, 0x91, 0x19, 0x4a, 0x5b, 0xc9, 0x95, 0x45, 0xb6, 0xb6, 0x61, 0x63, 0x31, 0x48, 0x10, 0x73, 0xe8, 0xad, 0x73, 0x68, 0x61, 0xc5, 0x40, 0xc1, 0xc3, 0x6a, 0x69, 0x0a, 0xba, 0x5a, 0x42, 0x4b, 0x18, 0x1d, 0xde, 0xe1, 0x49, 0x06, 0x1b, 0x6c, 0xac, 0x42, 0x10, 0x82, 0x08, 0x51, 0x97, 0x3a, 0x75, 0x30, 0x08, 0x3a, 0xf4, 0x9e, 0xa3, 0xae, 0x32, 0x3a, 0x42, 0x08, 0x56, 0x1b, 0x74, 0x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a, 0x54, 0xcc, 0x40, 0xbc, 0x66, 0xbe, 0xf4, 0x1c, 0x5a, 0xad, 0x68, 0xcb, 0x56, 0xcc, 0x96, 0x38, 0x47, 0x99, 0x72, 0x1c, 0xee, 0x2a, 0xa6, 0x4f, 0xbc, 0xf9, 0xfe, 0xc3, 0x03, 0xfe, 0xcf, 0x6c, 0x94, 0xe6, 0x4a, 0x6f, 0xf8, 0xc4, 0x0c, 0xfe, 0x2f, 0x6d, 0x34, 0xfa, 0xb6, 0xb5, 0x90, 0x2f, 0x43, 0x47, 0x08, 0xc8, 0xed, 0x71, 0xce, 0x1f, 0x69, 0x5d, 0x5c, 0xdb, 0xe7, 0xda, 0x9c, 0x76, 0x81, 0x6b, 0xef, 0xb9, 0xb6, 0xac, 0xf5, 0x77, 0x4a, 0x44, 0x54, 0x36, 0xee, 0xf0, 0xf2, 0xf0, 0x35, 0xb4, 0xc6, 0xb8, 0x35, 0xc0, 0xad, 0x93, 0x5d, 0xa5, 0xaa, 0x54, 0xa5, 0x2a, 0x55, 0xf9, 0x4f, 0xf9, 0xa0, 0xfd, 0x05, 0x52, 0xea, 0xc3, 0x13, 0x00, 0x1a, 0xff, 0xff, 0xff, 0xf0, 0x20, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1a, 0xff, 0xff, 0xff, 0x00, 0xb0, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x08, 0x16, 0x01, 0x00
1178};
1179#else
1180static uint8_t OTP_DATA_U8[] = {
1181 0x1c, 0xff, 0xff, 0xff, 0x24, 0x91, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00, 0x22, 0xff, 0xff, 0xff, 0x00, 0x98, 0x30, 0x00, 0x78, 0xda, 0xed, 0x14, 0x4d, 0x6c, 0x94, 0x45, 0xf4, 0xcd, 0x37, 0xcb, 0x5a, 0x4b, 0xdd, 0xee, 0x47, 0x14, 0x85, 0x74, 0xcd, 0x7e, 0x9f, 0xc5, 0x05, 0xba, 0x34, 0x26, 0x68, 0xc0, 0x04, 0xc9, 0x7b, 0x8b, 0x8d, 0x85, 0x4d, 0xb1, 0x41, 0x13, 0xb9, 0x60, 0xbe, 0xd9, 0x96, 0x6d, 0xb7, 0xbb, 0x52, 0xeb, 0xc9, 0x34, 0x8d, 0xbc, 0x6a, 0x34, 0x1e, 0xbe, 0xe4, 0x03, 0x53, 0x05, 0x8d, 0x25, 0x25, 0x69, 0x4b, 0x38, 0x68, 0x42, 0x20, 0x98, 0x10, 0x5b, 0x49, 0xdc, 0x00, 0x1e, 0x2c, 0x5c, 0xe0, 0x22, 0x09, 0x1e, 0x4c, 0x7a, 0x32, 0x24, 0x35, 0x21, 0x81, 0xcb, 0xfa, 0xe6, 0x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a6, 0x4f, 0xbc, 0xf9, 0xfe, 0xc3, 0x03, 0xfe, 0xcf, 0x6c, 0x94, 0xe6, 0x4a, 0x6f, 0xf8, 0xc4, 0x0c, 0xfe, 0x2f, 0x6d, 0x34, 0xfa, 0xb6, 0xb5, 0x90, 0x2f, 0x43, 0x47, 0x08, 0xc8, 0xed, 0x71, 0xce, 0x1f, 0x69, 0x5d, 0x5c, 0xdb, 0xe7, 0xda, 0x9c, 0x76, 0x81, 0x6b, 0xef, 0xb9, 0xb6, 0xac, 0xf5, 0x77, 0x4a, 0x44, 0x54, 0x36, 0xee, 0xf0, 0xf2, 0xf0, 0x35, 0xb4, 0xc6, 0xb8, 0x35, 0xc0, 0xad, 0x93, 0x5d, 0xa5, 0xaa, 0x54, 0xa5, 0x2a, 0x55, 0xf9, 0x4f, 0xf9, 0xa0, 0xfd, 0x05, 0x52, 0xea, 0xc3, 0x13, 0x00, 0x1a, 0xff, 0xff, 0xff, 0xf0, 0x20, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1a, 0xff, 0xff, 0xff, 0x00, 0xb0, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x08, 0x15, 0x01, 0x00
1182};
1183#endif
1184#endif
1185
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}
1360
1361void Gpu_Hal_LoadImageToMemory(EVE_HalContext *host, char8_t* fileName, uint32_t destination, uint8_t type){
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}
1415
1416/*==========================================================================
1417*
1418* FOR ARDUINO PLATFORMS ONLY
1419*
1420*=========================================================================*/
1421
static uint32_t f
Definition Common.c:41
#define REG_PCLK_POL
#define REG_TOUCH_CONFIG
#define DLSWAP_DONE
#define REG_VSYNC0
#define REG_GPIO_DIR
#define DLSWAP_LINE
#define REG_HSIZE
#define REG_J1_COLD
#define CLEAR(c, s, t)
#define REG_DLSWAP
#define OPT_NODL
#define REG_HSYNC1
#define REG_GPIOX
#define RAM_CMD
#define REG_VSIZE
#define DISPLAY()
#define REG_DITHER
#define REG_TRIM
#define REG_TOUCH_RZTHRESH
#define COLOR_RGB(red, green, blue)
#define CMD_INFLATE
#define REG_CSPREAD
#define REG_HCYCLE
#define REG_CMD_WRITE
#define REG_FREQUENCY
#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_SPI_WIDTH
#define REG_GPIOX_DIR
#define CMD_LOADIMAGE
#define LOW_FREQ_BOUND
Definition EVE_GpuDefs.h:99
#define REG_GPIO
#define REG_CLOCK
#define REG_CMD_READ
#define REG_VOFFSET
#define REG_PCLK
#define REG_HSYNC0
#define REG_SWIZZLE
unsigned short uint16_t
int int32_t
unsigned int uint32_t
short int16_t
unsigned char uint8_t
static ft_uint32_t ft_uint8_t * buffer
Definition FT_Gpu_Hal.h:139
static ft_uint32_t ft_uint8_t ft_uint32_t length
Definition FT_Gpu_Hal.h:140
#define FIFO_BYTE_ALIGNMENT_MASK
Definition FT_Gpu_Hal.h:72
#define FIFO_SIZE_MASK
Definition FT_Gpu_Hal.h:71
static ft_void_t ft_uint32_t * cmd
Definition FT_Gpu_Hal.h:184
static ft_uint32_t addr
Definition FT_Gpu_Hal.h:139
GPU APIs.
#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
int32_t Gpu_Hal_Dec2Ascii(char8_t *pSrc, int32_t value)
Definition Gpu_Hal.cpp:902
uint32_t Fifo_Write(EVE_HalContext *host, Fifo_t *pFifo, uint8_t *buffer, uint32_t NumbytetoWrite)
Definition Gpu_Hal.cpp:1014
void Fifo_Update(EVE_HalContext *host, Fifo_t *pFifo)
Definition Gpu_Hal.cpp:1001
void Gpu_Hal_ResetDLBuffer(EVE_HalContext *host)
Definition Gpu_Hal.cpp:891
void EVE_Cmd_waitFlush(EVE_HalContext *host)
Definition Gpu_Hal.cpp:775
bool_t Gpu_Hal_Open(EVE_HalContext *host)
Definition Gpu_Hal.cpp:72
void Gpu_Hal_CheckCmdBuffer(EVE_HalContext *host, uint32_t count)
Definition Gpu_Hal.cpp:759
void Fifo_Write32(EVE_HalContext *host, Fifo_t *pFifo, uint32_t WriteWord)
Definition Gpu_Hal.cpp:1069
void Gpu_Hal_RdMem(EVE_HalContext *host, uint32_t addr, uint8_t *buffer, uint32_t length)
Definition Gpu_Hal.cpp:474
void Fifo_WriteWait(EVE_HalContext *host, Fifo_t *pFifo, uint8_t *buffer, uint32_t Numbyte)
Definition Gpu_Hal.cpp:1082
uint16_t Gpu_Cmdfifo_Freespace(EVE_HalContext *host)
Definition Gpu_Hal.cpp:697
bool_t Gpu_Hal_Init(Gpu_HalInit_t *halinit)
Definition Gpu_Hal.cpp:59
void Gpu_Hal_StartCmdTransfer(EVE_HalContext *host, GPU_TRANSFERDIR_T rw, uint16_t count)
Definition Gpu_Hal.cpp:155
uint8_t EVE_Cmd_waitFlush_status(EVE_HalContext *host)
Definition Gpu_Hal.cpp:829
void Gpu_Hal_DeInit()
Definition Gpu_Hal.cpp:111
uint32_t Fifo_GetFreeSpace(EVE_HalContext *host, Fifo_t *pFifo)
Definition Gpu_Hal.cpp:1111
void Gpu_Hal_Updatecmdfifo(EVE_HalContext *host, uint32_t count)
Definition Gpu_Hal.cpp:680
void Gpu_Hal_DLSwap(EVE_HalContext *host, uint8_t DL_Swap_Type)
Definition Gpu_Hal.cpp:496
void Gpu_Hal_ResetCmdFifo(EVE_HalContext *host)
Definition Gpu_Hal.cpp:865
void Gpu_Hal_LoadImageToMemory(EVE_HalContext *host, char8_t *fileName, uint32_t destination, uint8_t type)
Definition Gpu_Hal.cpp:1361
void Fifo_Init(Fifo_t *pFifo, uint32_t StartAddress, uint32_t Length, uint32_t HWReadRegAddress, uint32_t HWWriteRegAddress)
Definition Gpu_Hal.cpp:982
void Gpu_Hal_TransferString(EVE_HalContext *host, const char8_t *string)
Definition Gpu_Hal.cpp:166
const uint8_t DLCODE_BOOTUP[12]
Definition Gpu_Hal.cpp:44
#define GPU_81X_RESET_ACTIVE
Definition Gpu_Hal.h:345
#define Gpu_Hal_Transfer16
Definition Gpu_Hal.h:200
#define GPU_HAL_OPENED
Definition Gpu_Hal.h:114
#define GPU_SPI_ONEDUMMY
Definition Gpu_Hal.h:359
#define GPU_CORE_RESET
Definition Gpu_Hal.h:349
#define Gpu_Hal_WrMemFromFlash
Definition Gpu_Hal.h:213
#define GPU_TRANSFERDIR_T
Definition Gpu_Hal.h:119
#define Gpu_81X_ResetActive
Definition Gpu_Hal.h:404
#define GPU_81X_GPIO_DRIVE_STRENGTH_T
Definition Gpu_Hal.h:324
#define Gpu_Hal_EndTransfer
Definition Gpu_Hal.h:202
#define Gpu_81X_SelectSysCLK
Definition Gpu_Hal.h:401
#define Gpu_Hal_Rd32
Definition Gpu_Hal.h:206
#define GPU_81X_GPIO_GROUP_T
Definition Gpu_Hal.h:343
#define GPU_ACTIVE_M
Definition Gpu_Hal.h:305
#define GPU_READ
Definition Gpu_Hal.h:120
#define Gpu_Hal_Wr32
Definition Gpu_Hal.h:209
#define BootupConfig
Definition Gpu_Hal.h:150
#define GPU_81X_PLL_FREQ_T
Definition Gpu_Hal.h:318
#define GPU_81X_PadDriveStrength
Definition Gpu_Hal.h:403
#define GPU_PLL_SOURCE_T
Definition Gpu_Hal.h:298
#define GPU_HAL_CLOSED
Definition Gpu_Hal.h:113
#define GPU_SPI_QUAD_CHANNEL
Definition Gpu_Hal.h:356
#define DispHeight
Definition Gpu_Hal.h:106
#define Gpu_Hal_Transfer8
Definition Gpu_Hal.h:199
#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_CurrentFrequency
Definition Gpu_Hal.h:391
#define Gpu_ClockTrimming
Definition Gpu_Hal.h:393
#define GPU_HAL_WRITING
Definition Gpu_Hal.h:116
#define DispWidth
Definition Gpu_Hal.h:105
#define Gpu_Hal_WrMem
Definition Gpu_Hal.h:211
#define GPU_WRITE
Definition Gpu_Hal.h:121
#define GPU_SPI_NUMDUMMYBYTES
Definition Gpu_Hal.h:358
#define Gpu_81X_ResetRemoval
Definition Gpu_Hal.h:405
#define Gpu_Hal_WrCmdBuf_nowait
Definition Gpu_Hal.h:231
#define GPU_SYSCLK_24M
Definition Gpu_Hal.h:317
#define GPU_SYSCLK_36M
Definition Gpu_Hal.h:316
#define PROGMEM
Definition Gpu_Hal.h:72
#define GPU_PLL_FREQ_T
Definition Gpu_Hal.h:303
#define GPU_SYSCLK_72M
Definition Gpu_Hal.h:313
#define Gpu_Hal_WrCmd32
Definition Gpu_Hal.h:225
#define GPU_81X_RESET_REMOVAL
Definition Gpu_Hal.h:346
#define Gpu_Hal_Wr8
Definition Gpu_Hal.h:207
#define Gpu_ClearScreen
Definition Gpu_Hal.h:410
#define Gpu_ClockSelect
Definition Gpu_Hal.h:395
#define Gpu_Hal_Sleep
Definition Gpu_Hal.h:385
#define Gpu_PowerModeSwitch
Definition Gpu_Hal.h:397
#define Gpu_Hal_Rd16
Definition Gpu_Hal.h:205
#define Gpu_HostCommand_Ext3
Definition Gpu_Hal.h:388
#define GPU_POWER_MODE_T
Definition Gpu_Hal.h:309
#define GPU_SPI_DUAL_CHANNEL
Definition Gpu_Hal.h:355
#define GPU_SYSCLK_DEFAULT
Definition Gpu_Hal.h:312
#define Gpu_Hal_Close
Definition Gpu_Hal.h:193
#define Gpu_Hal_Wr16
Definition Gpu_Hal.h:208
#define Gpu_Hal_Transfer32
Definition Gpu_Hal.h:201
#define Gpu_Hal_SetSPI
Definition Gpu_Hal.h:390
#define GPU_HAL_READING
Definition Gpu_Hal.h:115
#define Gpu_Hal_WaitLogo_Finish
Definition Gpu_Hal.h:371
#define GPU_SYSCLK_48M
Definition Gpu_Hal.h:315
#define Gpu_HostCommand
Definition Gpu_Hal.h:387
#define SPI_TWO_DUMMY_BYTE
Definition Gpu_Hal.h:367
#define GPU_SPI_NUMCHANNELS_T
Definition Gpu_Hal.h:353
#define GPU_81X_PowerOffComponents
Definition Gpu_Hal.h:402
#define Gpu_CoreReset
Definition Gpu_Hal.h:398
#define Gpu_Hal_WrCmdBufFromFlash
Definition Gpu_Hal.h:234
#define Gpu_Hal_WrCmdBuf
Definition Gpu_Hal.h:230
#define pgm_read_byte_near(x)
Definition Gpu_Hal.h:465
#define Gpu_Hal_Powercycle
Definition Gpu_Hal.h:389
#define Gpu_PLL_FreqSelect
Definition Gpu_Hal.h:396
#define GPU_SPI_TWODUMMY
Definition Gpu_Hal.h:360
#define Gpu_Hal_Rd8
Definition Gpu_Hal.h:204
#define Gpu_Hal_StartTransfer
Definition Gpu_Hal.h:198
#define GPU_SYSCLK_60M
Definition Gpu_Hal.h:314
HAL layer congiguration.
#define LOAD
Definition Platform.h:184
#define LOADIMAGE
Definition Platform.h:182
#define INFLATE
Definition Platform.h:183
#define SDCARD_CS
Definition Platform.h:53
#define TRUE
Definition Platform.h:197
PROGMEM const unsigned char prog_uchar8_t
Definition Platform.h:204
boolean bool_t
Definition Platform.h:196
#define RESISTANCE_THRESHOLD
Definition Platform.h:59
int openfile(const char *filename)
Definition sdcard.h:305
void readsector()
Definition sdcard.h:361
uint32_t offset
Definition sdcard.h:393
uint32_t size
Definition sdcard.h:394
sdcard SD
Definition sdcard.h:304
uint8_t begin(byte p)
Definition sdcard.h:128
Platform APIs.
This file contains apis related to sdcard.
uint32_t fifo_buff
Definition Gpu_Hal.h:154
uint32_t HW_Write_Reg
Definition Gpu_Hal.h:161
int32_t fifo_len
Definition Gpu_Hal.h:155
int32_t fifo_wp
Definition Gpu_Hal.h:156
uint32_t HW_Read_Reg
Definition Gpu_Hal.h:160
int32_t fifo_rp
Definition Gpu_Hal.h:157