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
EVE_HalImpl_FT9XX.c
Go to the documentation of this file.
1
32#include "EVE_HalImpl.h"
33#include "EVE_Platform.h"
34#if defined(FT9XX_PLATFORM)
35
36void ticker();
37#if defined(__FT930__)
38static const uint8_t s_SpimGpioSS[5] = { GPIO30_SPIM_SS0, GPIO_SPIM_SS1, GPIO_SPIM_SS2, GPIO_SPIM_SS3, 29 };
39static const pad_dir_t s_SpimFuncSS[5] = { pad30_spim_ss0, pad_spim_ss1, pad_spim_ss2, pad_spim_ss3, pad29_spim_ss0 };
40#else
41static const uint8_t s_SpimGpioSS[4] = { GPIO_SPIM_SS0, GPIO_SPIM_SS1, GPIO_SPIM_SS2, 35 };
42static const pad_dir_t s_SpimFuncSS[4] = { pad_spim_ss0, pad_spim_ss1, pad_spim_ss2, pad_spim_ss3 };
43#endif
44#define GPIO_SS_NB (sizeof(s_SpimGpioSS) / sizeof(s_SpimGpioSS[0]))
45
46/*********
47** INIT **
48*********/
49
52
60
66{
67#ifndef PANL_APPLET
68 spi_uninit(SPIM);
69#endif
70}
71
77{
78 return 1;
79}
80
87EVE_HAL_EXPORT void EVE_Hal_info(EVE_DeviceInfo *deviceInfo, size_t deviceIdx)
88{
89 memset(deviceInfo, 0, sizeof(EVE_DeviceInfo));
90 strcpy_s(deviceInfo->DisplayName, sizeof(deviceInfo->DisplayName), "FT9XX");
91 strcpy_s(deviceInfo->SerialNumber, sizeof(deviceInfo->SerialNumber), "FT9XX");
92 deviceInfo->Host = EVE_HOST_EMBEDDED;
93}
94
103EVE_HAL_EXPORT bool EVE_Hal_isDevice(EVE_HalContext *phost, size_t deviceIdx)
104{
105 return true;
106}
107
116bool EVE_HalImpl_defaults(EVE_HalParameters *parameters, size_t deviceIdx)
117{
118 parameters->PowerDownPin = GPIO_FT800_PWD;
119 parameters->SpiCsPin = deviceIdx < GPIO_SS_NB ? deviceIdx : 0; // SS0-3
120 return true;
121}
122
130void setSPI(EVE_HalContext *phost, EVE_SPI_CHANNELS_T numchnls, uint8_t numdummy)
131{
132 uint8_t spimGpio = s_SpimGpioSS[phost->SpiCsPin];
133 pad_dir_t spimFunc = s_SpimFuncSS[phost->SpiCsPin];
134
135 /* Reconfigure the SPI */
136 eve_assert_do(!sys_enable(sys_device_spi_master));
137 gpio_function(GPIO_SPIM_CLK, pad_spim_sck); /* GPIO27 to SPIM_CLK */
138 gpio_function(spimGpio, spimFunc); /* GPIO as SS0-SS4 */
139 gpio_function(GPIO_SPIM_MOSI, pad_spim_mosi); /* GPIO29 to SPIM_MOSI */
140 gpio_function(GPIO_SPIM_MISO, pad_spim_miso); /* GPIO30 to SPIM_MISO */
141
142 gpio_dir(GPIO_SPIM_CLK, pad_dir_output);
143 gpio_dir(spimGpio, pad_dir_output);
144 gpio_dir(GPIO_SPIM_MOSI, pad_dir_output);
145 gpio_dir(GPIO_SPIM_MISO, pad_dir_input);
146
147 if (numchnls > EVE_SPI_SINGLE_CHANNEL)
148 {
149 /* Initialize IO2 and IO3 pad/pin for dual and quad settings */
150 gpio_function(GPIO_SPIM_IO2, pad_spim_io2);
151 gpio_function(GPIO_SPIM_IO3, pad_spim_io3);
152 gpio_dir(GPIO_SPIM_IO2, pad_dir_output);
153 gpio_dir(GPIO_SPIM_IO3, pad_dir_output);
154 }
155
156 gpio_write(spimGpio, 1);
157
158 /* Change clock frequency to 25 MHz (100 MHz / 4) */
159 eve_assert_do(!spi_init(SPIM, spi_dir_master, spi_mode_0, 4));
160
161 /* Enable FIFO of QSPI */
162 spi_option(SPIM, spi_option_fifo_size, 64);
163 spi_option(SPIM, spi_option_fifo, 1);
164 spi_option(SPIM, spi_option_fifo_receive_trigger, 1);
165
166 switch (numchnls)
167 {
169 spi_option(SPIM, spi_option_bus_width, 4);
170 break;
172 spi_option(SPIM, spi_option_bus_width, 2);
173 break;
175 spi_option(SPIM, spi_option_bus_width, 1);
176 break;
177 }
178
179 phost->SpiChannels = numchnls;
180 phost->SpiDummyBytes = numdummy;
181}
182
191bool EVE_HalImpl_open(EVE_HalContext *phost, const EVE_HalParameters *parameters)
192{
193 phost->SpiCsPin = parameters->SpiCsPin < GPIO_SS_NB ? parameters->SpiCsPin : 0;
194 phost->PowerDownPin = parameters->PowerDownPin;
195 eve_printf_debug("EVE open PWD: %d, SS: %d\n",
196 (unsigned int)phost->PowerDownPin, (unsigned int)s_SpimGpioSS[phost->SpiCsPin]);
197
198#ifdef EVE_MULTI_GRAPHICS_TARGET
199 phost->GpuDefs = &EVE_GpuDefs_FT80X;
200#endif
201
202 gpio_function(phost->PowerDownPin, pad_func_0);
203 gpio_dir(phost->PowerDownPin, pad_dir_output);
204 gpio_write(phost->PowerDownPin, 0);
205
206 /* Initialize single channel */
208
209 gpio_write(phost->PowerDownPin, 1);
210
211 /* Initialize the context variables */
212 phost->Status = EVE_STATUS_OPENED;
214
215 return true;
216}
217
224{
225 phost->Status = EVE_STATUS_CLOSED;
227#ifndef PANL_APPLET
228 spi_close(SPIM, phost->SpiCsPin);
229#endif
230}
231
238{
239 /* no-op */
240}
242
243/*************
244** TRANSFER **
245*************/
246
249
258{
260
261 if (rw == EVE_TRANSFER_READ)
262 {
263 eve_assert(3 + phost->SpiDummyBytes <= 5);
264 uint8_t spidata[5]; // FIXME: phost->SpiDummyBytes // ?
265 spidata[0] = (addr >> 16);
266 spidata[1] = (addr >> 8);
267 spidata[2] = addr & 0xff;
268 spi_open(SPIM, phost->SpiCsPin);
269 spi_writen(SPIM, spidata, 3 + phost->SpiDummyBytes);
270 phost->Status = EVE_STATUS_READING;
271 }
272 else
273 {
274 uint8_t spidata[4];
275 spidata[0] = (0x80 | (addr >> 16));
276 spidata[1] = (addr >> 8);
277 spidata[2] = addr;
278
279 spi_open(SPIM, phost->SpiCsPin);
280 spi_writen(SPIM, spidata, 3);
281
282 phost->Status = EVE_STATUS_WRITING;
283 }
284}
285
292{
294
295 spi_close(SPIM, phost->SpiCsPin);
296 phost->Status = EVE_STATUS_OPENED;
297}
298
305{
307 /* no-op */
308}
309
317static inline void rdBuffer(EVE_HalContext *phost, uint8_t *buffer, uint32_t size)
318{
319 spi_readn(SPIM, buffer, size);
320}
321
329static inline void wrBuffer(EVE_HalContext *phost, const uint8_t *buffer, uint32_t size)
330{
331 spi_writen(SPIM, buffer, size);
332}
333
341static inline uint8_t transfer8(EVE_HalContext *phost, uint8_t value)
342{
343 if (phost->Status == EVE_STATUS_READING)
344 {
345 spi_read(SPIM, value);
346 return value;
347 }
348 else
349 {
350 spi_write(SPIM, value);
351 return 0;
352 }
353}
354
363{
364 return transfer8(phost, value);
365}
366
375{
376 uint8_t buffer[2];
377 if (phost->Status == EVE_STATUS_READING)
378 {
379 rdBuffer(phost, buffer, 2);
380 return (uint16_t)buffer[0]
381 | (uint16_t)buffer[1] << 8;
382 }
383 else
384 {
385 buffer[0] = value & 0xFF;
386 buffer[1] = value >> 8;
387 wrBuffer(phost, buffer, 2);
388 return 0;
389 }
390}
391
400{
401 uint8_t buffer[4];
402 if (phost->Status == EVE_STATUS_READING)
403 {
404 rdBuffer(phost, buffer, 4);
405 return (uint32_t)buffer[0]
406 | (uint32_t)buffer[1] << 8
407 | (uint32_t)buffer[2] << 16
408 | (uint32_t)buffer[3] << 24;
409 }
410 else
411 {
412 buffer[0] = value & 0xFF;
413 buffer[1] = (value >> 8) & 0xFF;
414 buffer[2] = (value >> 16) & 0xFF;
415 buffer[3] = value >> 24;
416 wrBuffer(phost, buffer, 4);
417 return 0;
418 }
419}
420
430{
431 if (!size)
432 return;
433
434 if (result && buffer)
435 {
436 /* not implemented */
438 }
439 else if (result)
440 {
441 rdBuffer(phost, result, size);
442 }
443 else if (buffer)
444 {
445 wrBuffer(phost, buffer, size);
446 }
447}
448
458{
459 if (!size)
460 return;
461
462 if (result && buffer)
463 {
464 /* not implemented */
466 }
467 else if (result)
468 {
469 /* not implemented */
471 }
472 else if (buffer)
473 {
474 eve_assert(!((uintptr_t)buffer & 0x3)); // must be 32-bit aligned
475 eve_assert(!(size & 0x3)); // must be 32-bit aligned
477 size >>= 2;
478 while (size--)
479 {
480 uint32_t value = *(buf32++);
481 wrBuffer(phost, (uint8_t *)(&value), 4);
482 }
483 }
484}
485
496uint32_t EVE_Hal_transferString(EVE_HalContext *phost, const char *str, uint32_t index, uint32_t size, uint32_t padMask)
497{
498 if (!size)
499 {
500 /* TODO: Support different padding options */
501 eve_assert(padMask == 0x3);
502 EVE_Hal_transfer32(phost, 0);
503 return 4;
504 }
505
507 uint32_t transferred = 0;
508 if (phost->Status == EVE_STATUS_WRITING)
509 {
510 transferred += (uint32_t)strnlen(str, size) + 1;
511 eve_assert(str[transferred - 1] == '\0');
512 wrBuffer(phost, (uint8_t *)str, transferred);
513 if (transferred & padMask)
514 {
515 uint32_t pad = 4 - (transferred & padMask);
516 uint8_t padding[4] = { 0 };
517 wrBuffer(phost, padding, pad);
518 transferred += pad;
519 eve_assert(!(transferred & 0x3));
520 }
521 }
522 else
523 {
524 /* not implemented */
526 }
527 return transferred;
528}
530
531/************
532** UTILITY **
533************/
534
537
545{
547
548 uint8_t hcmd[4] = { 0 };
549 hcmd[0] = cmd;
550 hcmd[1] = 0;
551 hcmd[2] = 0;
552 hcmd[3] = 0;
553
554 spi_open(SPIM, phost->SpiCsPin);
555 spi_writen(SPIM, hcmd, 3);
556 spi_close(SPIM, phost->SpiCsPin);
557}
558
566{
568
569 uint8_t hcmd[4] = { 0 };
570 hcmd[0] = cmd & 0xff;
571 hcmd[1] = (cmd >> 8) & 0xff;
572 hcmd[2] = (cmd >> 16) & 0xff;
573 hcmd[3] = 0;
574
575 spi_open(SPIM, phost->SpiCsPin);
576 spi_writen(SPIM, hcmd, 3);
577 spi_close(SPIM, phost->SpiCsPin);
578}
579
589{
590 if (up)
591 {
592 gpio_write(phost->PowerDownPin, 0);
593 EVE_sleep(20);
595 gpio_write(phost->PowerDownPin, 1);
596 EVE_sleep(20);
597 }
598 else
599 {
600 gpio_write(phost->PowerDownPin, 1);
601 EVE_sleep(20);
602 gpio_write(phost->PowerDownPin, 0);
603 EVE_sleep(20);
604 }
605 return true;
606}
607
616{
617 if (EVE_CHIPID < EVE_FT810)
618 return;
619
620 uint8_t writebyte = 0;
621
622 if ((numchnls > EVE_SPI_QUAD_CHANNEL) || (numdummy > 2) || (numdummy < 1))
623 return; // error
624
625 // Switch EVE to multi channel SPI mode
626 writebyte = numchnls;
627 if (numdummy == 2)
628 writebyte |= EVE_SPI_TWO_DUMMY_BYTES;
629 EVE_Hal_wr8(phost, REG_SPI_WIDTH, writebyte);
630 EVE_Hal_flush(phost);
631
632 // Switch FT9XX to multi channel SPI mode
633 setSPI(phost, numchnls, numdummy);
634}
635
637{
638 if (EVE_CHIPID < EVE_FT810)
639 return;
640
641 setSPI(phost, phost->SpiChannels, phost->SpiDummyBytes);
642}
643
651{
652 uint32_t t0;
653 uint32_t t1;
654 int32_t r = 15625;
655
656 t0 = EVE_Hal_rd32(phost, REG_CLOCK); /* t0 read */
657
658 __asm__(
659 " move.l $r0,%0 \n\t"
660 " mul.l $r0,$r0,100 \n\t"
661 "1: \n\t"
662 " sub.l $r0,$r0,3 \n\t" /* Subtract the loop time = 4 cycles */
663 " cmp.l $r0,0 \n\t" /* Check that the counter is equal to 0 */
664 " jmpc gt, 1b \n\t"
665 : /* Outputs */
666 : "r"(r) /* Inputs */
667 : "$r0"); /* Using */
668
669 t1 = EVE_Hal_rd32(phost, REG_CLOCK); /* t1 read */
670 return ((t1 - t0) << 6); /* bitshift 6 places is the same as multiplying 64 */
671}
673
674/*********
675** MISC **
676*********/
677
680
685static void initSdHost()
686{
687#ifndef PANL_APPLET
688#if 1
689 /* All SD Host pins except CLK need a pull-up to work. The MM900EV*A module does not have external pull-up, so enable internal one */
690 gpio_function(GPIO_SD_CLK, pad_sd_clk);
691 gpio_pull(GPIO_SD_CLK, pad_pull_none);
692 gpio_function(GPIO_SD_CMD, pad_sd_cmd);
693 gpio_pull(GPIO_SD_CMD, pad_pull_pullup);
694 gpio_function(GPIO_SD_DAT3, pad_sd_data3);
695 gpio_pull(GPIO_SD_DAT3, pad_pull_pullup);
696 gpio_function(GPIO_SD_DAT2, pad_sd_data2);
697 gpio_pull(GPIO_SD_DAT2, pad_pull_pullup);
698 gpio_function(GPIO_SD_DAT1, pad_sd_data1);
699 gpio_pull(GPIO_SD_DAT1, pad_pull_pullup);
700 gpio_function(GPIO_SD_DAT0, pad_sd_data0);
701 gpio_pull(GPIO_SD_DAT0, pad_pull_pullup);
702 gpio_function(GPIO_SD_CD, pad_sd_cd);
703 gpio_pull(GPIO_SD_CD, pad_pull_pullup);
704 gpio_function(GPIO_SD_WP, pad_sd_wp);
705 gpio_pull(GPIO_SD_WP, pad_pull_pullup);
706
707 /* Start up the SD Card */
708 sys_enable(sys_device_sd_card);
709#else
710 sdhost_sys_init();
711#endif
712 sdhost_init();
713#endif
714}
715
721{
722#ifndef PANL_APPLET
723 sys_reset_all();
724
725 interrupt_enable_globally();
726
727 sys_enable(sys_device_uart0);
728 gpio_function(GPIO_UART0_TX, pad_uart0_txd); /* UART0 TXD */
729 gpio_function(GPIO_UART0_RX, pad_uart0_rxd); /* UART0 RXD */
730 uart_open(UART0, /* Device */
731 1, /* Prescaler = 1 */
732 UART_DIVIDER_115200_BAUD, /* Divider = 1302 */
733 uart_data_bits_8, /* No. Data Bits */
734 uart_parity_none, /* Parity */
735 uart_stop_bits_1); /* No. Stop Bits */
736#endif
737
738#if (defined(ENABLE_ILI9488_HVGA_PORTRAIT) || defined(ENABLE_KD2401_HVGA_PORTRAIT))
739 /* assign all the respective pins to GPIO and set them to default values */
740 gpio_function(GPIO_ILI9488_DCX, pad_ili9488_dcx);
741 gpio_dir(GPIO_ILI9488_DCX, pad_dir_output);
742 gpio_write(GPIO_ILI9488_DCX, 1);
743
744 gpio_function(GPIO_SPIM_CLK, pad_spim_sck);
745 gpio_dir(GPIO_SPIM_CLK, pad_dir_output);
746 gpio_write(GPIO_SPIM_CLK, 1);
747
748 gpio_function(GPIO_SPIM_MOSI, pad_spim_mosi);
749 gpio_dir(GPIO_SPIM_MOSI, pad_dir_output);
750 gpio_write(GPIO_SPIM_MOSI, 1);
751
752 gpio_function(GPIO_ILI9488_CS1, pad_ili9488_cs1);
753 gpio_dir(GPIO_ILI9488_CS1, pad_dir_output);
754 gpio_write(GPIO_ILI9488_CS1, 1);
755
756 gpio_function(GPIO_SPIM_MISO, pad_spim_miso);
757 gpio_dir(GPIO_SPIM_MISO, pad_dir_output);
758 gpio_write(GPIO_SPIM_MISO, 1);
759
760 gpio_function(GPIO_SPIM_SS0, pad_spim_ss0);
761 gpio_dir(GPIO_SPIM_SS0, pad_dir_output);
762 gpio_write(GPIO_SPIM_SS0, 1);
763
764 gpio_function(GPIO_FT800_PWD, pad_func_0); /* FIXME: This needs to be done at open, not init */
765 gpio_dir(GPIO_FT800_PWD, pad_dir_output);
766 gpio_write(GPIO_FT800_PWD, 1);
767
768 gpio_write(GPIO_ILI9488_DCX, 1);
769 gpio_write(GPIO_SPIM_SS0, 1);
770 gpio_write(GPIO_FT800_PWD, 1);
771 gpio_write(GPIO_ILI9488_CS1, 1);
772#endif
773
774 initSdHost();
775}
776
782{
783 /* no-op */
784}
786
787/*********
788** MISC **
789*********/
790
791/* Globals for interrupt implementation */
794
797
803{
805#if !defined(PANL_APPLET)
806 sys_enable(sys_device_timer_wdt);
807#if defined(FT900_PLATFORM)
808 timer_prescaler(FT900_TIMER_PRESCALE_VALUE);
809#else
811#endif
812 timer_init(FT900_FT_MILLIS_TIMER, FT900_TIMER_OVERFLOW_VALUE, timer_direction_up, timer_prescaler_select_on, timer_mode_continuous);
813
814 interrupt_attach(interrupt_timers, 17, ticker);
815 /* enabling the interrupts for timer */
816 timer_enable_interrupt(FT900_FT_MILLIS_TIMER);
817
818 timer_start(FT900_FT_MILLIS_TIMER);
819#endif
820}
821
827{
828#if !defined(PANL_APPLET)
829 timer_stop(FT900_FT_MILLIS_TIMER);
830 timer_disable_interrupt(FT900_FT_MILLIS_TIMER);
831#endif
832}
833
843{
844#if defined(PANL_APPLET)
845 uint32_t ms = panl_timer_get_time();
847 s_TotalMilliseconds64 += (1 << 32);
849 s_TotalMilliseconds64 = (s_TotalMilliseconds64 & ~0xFFFFFFFFULL) | (uint64_t)ms;
850#endif
851 return s_TotalMilliseconds;
852}
853
863{
864#if defined(PANL_APPLET)
865 uint32_t ms = panl_timer_get_time();
867 s_TotalMilliseconds64 += (1 << 32);
869 s_TotalMilliseconds64 = (s_TotalMilliseconds64 & ~0xFFFFFFFFULL) | (uint64_t)ms;
870#endif
872}
873
878void ticker()
879{
880#if !defined(PANL_APPLET)
882
883 timer_disable_interrupt(FT900_FT_MILLIS_TIMER);
884 /* Clear the interrupt and increment the counter */
885 timer_is_interrupted(FT900_FT_MILLIS_TIMER);
886 timer_enable_interrupt(FT900_FT_MILLIS_TIMER);
887#endif
888}
889
896{
897 delayms(ms);
898}
900
901/*********
902** MISC **
903*********/
904
907
916{
917 return true;
918}
919
921#endif /* #if defined(FT9XX_PLATFORM) */
922
923/* end of file */
#define EVE_CMD_STRING_MAX
Definition EVE_Cmd.h:44
#define strcpy_s(dst, sz, src)
#define EVE_HAL_EXPORT
#define EVE_CHIPID
#define eve_progmem_const
#define EVE_FT810
Definition EVE_Config.h:58
#define REG_SPI_WIDTH
#define REG_CLOCK
@ EVE_SPI_TWO_DUMMY_BYTES
EVE_SPI_CHANNELS_T
@ EVE_SPI_QUAD_CHANNEL
@ EVE_SPI_SINGLE_CHANNEL
@ EVE_SPI_DUAL_CHANNEL
EVE_HalPlatform g_HalPlatform
Definition EVE_Hal.c:43
EVE_HAL_EXPORT uint32_t EVE_Hal_rd32(EVE_HalContext *phost, uint32_t addr)
Read 4 bytes from Coprocessor's memory.
Definition EVE_Hal.c:189
EVE_HAL_EXPORT void EVE_Hal_wr8(EVE_HalContext *phost, uint32_t addr, uint8_t v)
Write 8 bits to Coprocessor's memory.
Definition EVE_Hal.c:220
@ EVE_STATUS_READING
Definition EVE_HalDefs.h:59
@ EVE_STATUS_CLOSED
Definition EVE_HalDefs.h:57
@ EVE_STATUS_OPENED
Definition EVE_HalDefs.h:58
@ EVE_STATUS_WRITING
Definition EVE_HalDefs.h:60
EVE_TRANSFER_T
Definition EVE_HalDefs.h:65
@ EVE_TRANSFER_READ
Definition EVE_HalDefs.h:67
@ EVE_HOST_EMBEDDED
Eve_Hal framework APIs.
static const pad_dir_t s_SpimFuncSS[4]
static uint32_t s_TotalMilliseconds
static uint64_t s_TotalMilliseconds64
static const uint8_t s_SpimGpioSS[4]
uint32_t EVE_Hal_transferString(EVE_HalContext *phost, const char *str, uint32_t index, uint32_t size, uint32_t padMask)
Transfer a string to EVE platform.
bool EVE_HalImpl_open(EVE_HalContext *phost, const EVE_HalParameters *parameters)
Opens a new HAL context using the specified parameters.
uint8_t EVE_Hal_transfer8(EVE_HalContext *phost, uint8_t value)
Write 8 bits to Coprocessor.
void EVE_Mcu_initialize()
Init FT9x host MCU.
EVE_HAL_EXPORT bool EVE_Hal_isDevice(EVE_HalContext *phost, size_t deviceIdx)
Check whether the context is the specified device.
EVE_HAL_EXPORT void EVE_Hal_info(EVE_DeviceInfo *deviceInfo, size_t deviceIdx)
Get info of the specified device. Devices of type EVE_HOST_UNKNOWN should be ignored.
#define GPIO_SS_NB
void EVE_Hal_hostCommandExt3(EVE_HalContext *phost, uint32_t cmd)
This API sends a 3byte command to the phost.
bool EVE_HalImpl_defaults(EVE_HalParameters *parameters, size_t deviceIdx)
Get the default configuration parameters.
void EVE_Millis_release()
Release FT9x timer.
static void initSdHost()
Sdcard initialization.
void EVE_Hal_transferProgMem(EVE_HalContext *phost, uint8_t *result, eve_progmem_const uint8_t *buffer, uint32_t size)
Transfer a block data from program memory.
void EVE_Hal_restoreSPI(EVE_HalContext *phost)
void ticker()
Clear the interrupt and increment the counter.
EVE_HAL_EXPORT size_t EVE_Hal_list()
List the available devices.
static uint8_t transfer8(EVE_HalContext *phost, uint8_t value)
Write 8 bit to Coprocessor.
void EVE_HalImpl_close(EVE_HalContext *phost)
Close a HAL context.
uint32_t EVE_Hal_currentFrequency(EVE_HalContext *phost)
Get current system clock of Coprocessor.
void EVE_Mcu_release()
Release FT9x host MCU.
void EVE_Hal_endTransfer(EVE_HalContext *phost)
End data transfer.
void EVE_Hal_transferMem(EVE_HalContext *phost, uint8_t *result, const uint8_t *buffer, uint32_t size)
Transfer (read/write) a block data to Coprocessor.
void EVE_Hal_startTransfer(EVE_HalContext *phost, EVE_TRANSFER_T rw, uint32_t addr)
Start data transfer to Coprocessor.
uint32_t EVE_millis()
Get clock in miliseond.
bool EVE_Hal_powerCycle(EVE_HalContext *phost, bool up)
Toggle PD_N pin of FT800 board for a power cycle.
void EVE_HalImpl_initialize()
Initialize HAL platform.
void EVE_Millis_initialize()
Init FT9x timer.
void EVE_Hal_flush(EVE_HalContext *phost)
Flush data to Coprocessor.
void setSPI(EVE_HalContext *phost, EVE_SPI_CHANNELS_T numchnls, uint8_t numdummy)
Set number of SPI channel.
bool EVE_UtilImpl_bootupDisplayGpio(EVE_HalContext *phost)
Display GPIO pins.
uint64_t EVE_millis64()
Get clock in miliseond.
uint16_t EVE_Hal_transfer16(EVE_HalContext *phost, uint16_t value)
Write 2 bytes to Coprocessor.
static void wrBuffer(EVE_HalContext *phost, const uint8_t *buffer, uint32_t size)
Write a block data to Coprocessor.
void EVE_sleep(uint32_t ms)
Sleep in milisecond.
void EVE_Hal_setSPI(EVE_HalContext *phost, EVE_SPI_CHANNELS_T numchnls, uint8_t numdummy)
Set number of SPI channel.
void EVE_HalImpl_idle(EVE_HalContext *phost)
Idle. Call regularly to update frequently changing internal state.
void EVE_HalImpl_release()
Release HAL platform.
static void rdBuffer(EVE_HalContext *phost, uint8_t *buffer, uint32_t size)
Read a block data from Coprocessor.
void EVE_Hal_hostCommand(EVE_HalContext *phost, uint8_t cmd)
Send a host command to Coprocessor.
uint32_t EVE_Hal_transfer32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor.
unsigned short uint16_t
int int32_t
unsigned int uint32_t
unsigned long long uint64_t
unsigned char uint8_t
Platform selector.
#define eve_assert(cond)
#define eve_printf_debug(fmt,...)
#define eve_assert_do(cond)
#define eve_debug_break()
#define FT900_FT_MILLIS_TIMER
#define FT900_TIMER_PRESCALE_VALUE
#define FT900_TIMER_OVERFLOW_VALUE
static ft_uint32_t ft_uint8_t * buffer
Definition FT_Gpu_Hal.h:139
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
char DisplayName[256]
char SerialNumber[16]
EVE_HOST_T Host
uint8_t PowerDownPin
EVE_SPI_CHANNELS_T SpiChannels
EVE_STATUS_T Status
uint8_t SpiDummyBytes
uint32_t OpenedDevices