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_WIN32.c
Go to the documentation of this file.
1
32#ifdef _MSC_VER
33#pragma warning(push)
34#pragma warning(disable : 28159) // Use GetTickCount64 instead of GetTickCount
35#endif
36
37#include "EVE_HalImpl.h"
38#include "EVE_Platform.h"
39#if defined(_WIN32)
40
41/************
42** UTILITY **
43************/
44
47
55{
56 uint32_t t0;
57 uint32_t t1;
58
59 t0 = EVE_Hal_rd32(phost, REG_CLOCK); /* t0 read */
60 /* may not be precise */
61 EVE_sleep(15625 / 1000);
62
63 t1 = EVE_Hal_rd32(phost, REG_CLOCK); /* t1 read */
64 return ((t1 - t0) * 64); /* bitshift 6 places is the same as multiplying 64 */
65}
67
68/*********
69** MISC **
70*********/
71
74
80{
81 /* no-op */
82}
83
88void EVE_Mcu_release()
89{
90 /* no-op */
91}
93
94/*********
95** MISC **
96*********/
97
98static DWORD s_Millis_Start;
99static ULONGLONG s_Millis64_Start;
102
108{
109 s_Millis_Start = GetTickCount();
110 s_Millis64_Start = GetTickCount64();
111}
112
118{
119 /* no-op */
120}
121
130{
131 return GetTickCount() - s_Millis_Start;
132}
133
140{
141 return GetTickCount64() - s_Millis64_Start;
142}
143
144#if defined(ESD_SIMULATION)
145int Ft_Sleep__ESD(int ms);
146#endif
147
153void EVE_sleep(uint32_t ms)
154{
155#if defined(ESD_SIMULATION)
156 Ft_Sleep__ESD(ms);
157#else
158 Sleep(ms);
159#endif
160}
162
163#endif
164
165#ifdef _MSC_VER
166#pragma warning(pop)
167#endif
168
169/* end of file */
#define REG_CLOCK
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 uint64_t EVE_millis64()
Get clock in miliseond.
EVE_HAL_EXPORT uint32_t EVE_millis()
Get clock in miliseond.
EVE_HAL_EXPORT void EVE_sleep(uint32_t ms)
Sleep in milisecond.
EVE_HAL_EXPORT uint32_t EVE_Hal_currentFrequency(EVE_HalContext *phost)
Get current system clock of Coprocessor.
Eve_Hal framework APIs.
void EVE_Mcu_initialize()
Init FT9x host MCU.
void EVE_Millis_release()
Release FT9x timer.
void EVE_Mcu_release()
Release FT9x host MCU.
void EVE_Millis_initialize()
Init FT9x timer.
unsigned int uint32_t
unsigned long long uint64_t
Platform selector.
unsigned long long int ULONGLONG
Definition WinTypes.h:65
unsigned long DWORD
Definition ff.h:61