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_CoCmd.c File Reference

EVE's co-processor commmands. More...

#include "EVE_Platform.h"

Go to the source code of this file.

Functions

EVE_HAL_EXPORT void EVE_CoCmd_d (EVE_HalContext *phost, uint32_t cmd)
 
EVE_HAL_EXPORT void EVE_CoCmd_dd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1)
 
EVE_HAL_EXPORT void EVE_CoCmd_dddd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint32_t d2)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddddd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint32_t d2, uint32_t d3)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddww (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint16_t w1, uint16_t w2)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddwww (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint16_t w1, uint16_t w2, uint16_t w3)
 
EVE_HAL_EXPORT void EVE_CoCmd_dddwwww (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwdd (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint32_t d2, uint32_t d3)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwdwwd (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint32_t d2, uint16_t w3, uint16_t w4, uint32_t d5)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdw (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4, uint16_t w5)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4, uint16_t w5, uint16_t w6)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwd (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, uint16_t w6)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, uint16_t w6, uint16_t w7)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, const char *s)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz_s (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, const char *s, uint32_t len)
 
EVE_HAL_EXPORT bool EVE_CoCmd_getMatrix (EVE_HalContext *phost, int32_t *m)
 Send CMD_GETMATRIX.
 
EVE_HAL_EXPORT void EVE_CoCmd_setRotate (EVE_HalContext *phost, uint32_t r)
 CMD_SETROTATE.
 
EVE_HAL_EXPORT uint32_t EVE_CoCmd_calibrate (EVE_HalContext *phost)
 Send CMD_CALIBRATE.
 
EVE_HAL_EXPORT bool EVE_CoCmd_animStart (EVE_HalContext *phost, int32_t ch, uint32_t aoptr, uint32_t loop)
 Send CMD_ANIMSTART.
 

Detailed Description

EVE's co-processor commmands.

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 EVE_CoCmd.c.

Function Documentation

◆ EVE_CoCmd_animStart()

EVE_HAL_EXPORT bool EVE_CoCmd_animStart ( EVE_HalContext phost,
int32_t  ch,
uint32_t  aoptr,
uint32_t  loop 
)

Send CMD_ANIMSTART.

Parameters
phostPointer to Hal context
chChannel
aoptrThe address of the animation object in flash memory
loopLoop flags
Returns
bool False on coprocessor fault

Definition at line 526 of file EVE_CoCmd.c.

527{
528 uint32_t flashStatus;
529
531
532#if EVE_CMD_HOOKS
533 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_ANIMSTART, ch))
534 return false;
535#endif
536
537 if (!EVE_Cmd_waitFlush(phost))
538 return false;
539 flashStatus = EVE_Hal_rd32(phost, REG_FLASH_STATUS);
540 if (flashStatus < FLASH_STATUS_FULL)
541 {
542 // Don't attempt to start animation without full flash speed, it hangs the coprocessor
543 eve_printf_debug("Attempt to send CMD_ANIMSTART without FLASH_STATUS_FULL (REG_FLASH_STATUS: %i)\n", (int)flashStatus);
544 return false;
545 }
546
547 EVE_Cmd_startFunc(phost);
549 EVE_Cmd_wr32(phost, ch);
550 EVE_Cmd_wr32(phost, aoptr);
551 EVE_Cmd_wr32(phost, loop);
552 EVE_Cmd_endFunc(phost);
553 return EVE_Cmd_waitFlush(phost);
554}
EVE_HAL_EXPORT void EVE_Cmd_startFunc(EVE_HalContext *phost)
Begin writing a function, keeps the transfer open.
Definition EVE_Cmd.c:262
EVE_HAL_EXPORT void EVE_Cmd_endFunc(EVE_HalContext *phost)
End writing a function, closes the transfer.
Definition EVE_Cmd.c:274
EVE_HAL_EXPORT bool EVE_Cmd_wr32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor's command fifo.
Definition EVE_Cmd.c:394
#define EVE_MULTI_TARGET_CHECK_RETURN(cmd, condition, res)
Definition EVE_CoCmd.h:138
#define EVE_BT815
Definition EVE_Config.h:66
#define EVE_CHIPID
#define CMD_ANIMSTART
#define FLASH_STATUS_FULL
#define REG_FLASH_STATUS
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
unsigned int uint32_t
#define eve_printf_debug(fmt,...)
void EVE_Cmd_waitFlush(EVE_HalContext *host)
Definition Gpu_Hal.cpp:775

◆ EVE_CoCmd_calibrate()

EVE_HAL_EXPORT uint32_t EVE_CoCmd_calibrate ( EVE_HalContext phost)

Send CMD_CALIBRATE.

Parameters
phostPointer to Hal context
Returns
uint32_t

Definition at line 500 of file EVE_CoCmd.c.

501{
502 uint16_t resAddr;
503
504#if EVE_CMD_HOOKS
505 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_CALIBRATE, 0))
506 return 0;
507#endif
508
509 EVE_Cmd_startFunc(phost);
511 resAddr = EVE_Cmd_moveWp(phost, 4);
512 EVE_Cmd_endFunc(phost);
513
514#if (EVE_DL_OPTIMIZE)
515 phost->DlPrimitive = 0;
516#endif
517
518 /* Wait for the result */
519 if (!EVE_Cmd_waitFlush(phost))
520 return 0;
521 return EVE_Hal_rd32(phost, RAM_CMD + resAddr);
522}
EVE_HAL_EXPORT uint16_t EVE_Cmd_moveWp(EVE_HalContext *phost, uint16_t bytes)
Move the write pointer forward by the specified number of bytes. Returns the previous write pointer.
Definition EVE_Cmd.c:446
#define RAM_CMD
#define CMD_CALIBRATE
unsigned short uint16_t
uint8_t DlPrimitive

◆ EVE_CoCmd_d()

EVE_HAL_EXPORT void EVE_CoCmd_d ( EVE_HalContext phost,
uint32_t  cmd 
)

Definition at line 39 of file EVE_CoCmd.c.

40{
41#if EVE_CMD_HOOKS
42 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
43 return;
44#endif
45
46 EVE_Cmd_wr32(phost, cmd);
47}
static ft_void_t ft_uint32_t * cmd
Definition FT_Gpu_Hal.h:184

◆ EVE_CoCmd_dd()

EVE_HAL_EXPORT void EVE_CoCmd_dd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0 
)

Definition at line 49 of file EVE_CoCmd.c.

50{
51#if EVE_CMD_HOOKS
52 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
53 return;
54#endif
55
56 EVE_Cmd_startFunc(phost);
57 EVE_Cmd_wr32(phost, cmd);
58 EVE_Cmd_wr32(phost, d0);
59 EVE_Cmd_endFunc(phost);
60}

◆ EVE_CoCmd_ddd()

EVE_HAL_EXPORT void EVE_CoCmd_ddd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1 
)

Definition at line 62 of file EVE_CoCmd.c.

63{
64#if EVE_CMD_HOOKS
65 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
66 return;
67#endif
68
69 EVE_Cmd_startFunc(phost);
70 EVE_Cmd_wr32(phost, cmd);
71 EVE_Cmd_wr32(phost, d0);
72 EVE_Cmd_wr32(phost, d1);
73 EVE_Cmd_endFunc(phost);
74}

◆ EVE_CoCmd_dddd()

EVE_HAL_EXPORT void EVE_CoCmd_dddd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1,
uint32_t  d2 
)

Definition at line 76 of file EVE_CoCmd.c.

77{
78#if EVE_CMD_HOOKS
79 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
80 return;
81#endif
82
83 EVE_Cmd_startFunc(phost);
84 EVE_Cmd_wr32(phost, cmd);
85 EVE_Cmd_wr32(phost, d0);
86 EVE_Cmd_wr32(phost, d1);
87 EVE_Cmd_wr32(phost, d2);
88 EVE_Cmd_endFunc(phost);
89}

◆ EVE_CoCmd_ddddd()

EVE_HAL_EXPORT void EVE_CoCmd_ddddd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1,
uint32_t  d2,
uint32_t  d3 
)

Definition at line 91 of file EVE_CoCmd.c.

92{
93#if EVE_CMD_HOOKS
94 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
95 return;
96#endif
97
98 EVE_Cmd_startFunc(phost);
99 EVE_Cmd_wr32(phost, cmd);
100 EVE_Cmd_wr32(phost, d0);
101 EVE_Cmd_wr32(phost, d1);
102 EVE_Cmd_wr32(phost, d2);
103 EVE_Cmd_wr32(phost, d3);
104 EVE_Cmd_endFunc(phost);
105}

◆ EVE_CoCmd_dddwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dddwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5 
)

Definition at line 141 of file EVE_CoCmd.c.

144{
145#if EVE_CMD_HOOKS
146 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
147 return;
148#endif
149
150 EVE_Cmd_startFunc(phost);
151 EVE_Cmd_wr32(phost, cmd);
152 EVE_Cmd_wr32(phost, d0);
153 EVE_Cmd_wr32(phost, d1);
154 EVE_Cmd_wr16(phost, w2);
155 EVE_Cmd_wr16(phost, w3);
156 EVE_Cmd_wr16(phost, w4);
157 EVE_Cmd_wr16(phost, w5);
158 EVE_Cmd_endFunc(phost);
159}
EVE_HAL_EXPORT bool EVE_Cmd_wr16(EVE_HalContext *phost, uint16_t value)
Write 2 bytes to Coprocessor's command fifo.
Definition EVE_Cmd.c:366

◆ EVE_CoCmd_ddww()

EVE_HAL_EXPORT void EVE_CoCmd_ddww ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint16_t  w1,
uint16_t  w2 
)

Definition at line 107 of file EVE_CoCmd.c.

109{
110#if EVE_CMD_HOOKS
111 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
112 return;
113#endif
114
115 EVE_Cmd_startFunc(phost);
116 EVE_Cmd_wr32(phost, cmd);
117 EVE_Cmd_wr32(phost, d0);
118 EVE_Cmd_wr16(phost, w1);
119 EVE_Cmd_wr16(phost, w2);
120 EVE_Cmd_endFunc(phost);
121}

◆ EVE_CoCmd_ddwww()

EVE_HAL_EXPORT void EVE_CoCmd_ddwww ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3 
)

Definition at line 123 of file EVE_CoCmd.c.

125{
126#if EVE_CMD_HOOKS
127 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
128 return;
129#endif
130
131 EVE_Cmd_startFunc(phost);
132 EVE_Cmd_wr32(phost, cmd);
133 EVE_Cmd_wr32(phost, d0);
134 EVE_Cmd_wr16(phost, w1);
135 EVE_Cmd_wr16(phost, w2);
136 EVE_Cmd_wr16(phost, w3);
137 EVE_Cmd_wr16(phost, 0);
138 EVE_Cmd_endFunc(phost);
139}

◆ EVE_CoCmd_dwwdd()

EVE_HAL_EXPORT void EVE_CoCmd_dwwdd ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint32_t  d2,
uint32_t  d3 
)

Definition at line 161 of file EVE_CoCmd.c.

163{
164#if EVE_CMD_HOOKS
165 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
166 return;
167#endif
168
169 EVE_Cmd_startFunc(phost);
170 EVE_Cmd_wr32(phost, cmd);
171 EVE_Cmd_wr16(phost, w0);
172 EVE_Cmd_wr16(phost, w1);
173 EVE_Cmd_wr32(phost, d2);
174 EVE_Cmd_wr32(phost, d3);
175 EVE_Cmd_endFunc(phost);
176}

◆ EVE_CoCmd_dwwdwwd()

EVE_HAL_EXPORT void EVE_CoCmd_dwwdwwd ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint32_t  d2,
uint16_t  w3,
uint16_t  w4,
uint32_t  d5 
)

Definition at line 178 of file EVE_CoCmd.c.

181{
182#if EVE_CMD_HOOKS
183 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
184 return;
185#endif
186
187 EVE_Cmd_startFunc(phost);
188 EVE_Cmd_wr32(phost, cmd);
189 EVE_Cmd_wr16(phost, w0);
190 EVE_Cmd_wr16(phost, w1);
191 EVE_Cmd_wr32(phost, d2);
192 EVE_Cmd_wr16(phost, w3);
193 EVE_Cmd_wr16(phost, w4);
194 EVE_Cmd_wr32(phost, d5);
195 EVE_Cmd_endFunc(phost);
196}

◆ EVE_CoCmd_dwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3 
)

Definition at line 240 of file EVE_CoCmd.c.

242{
243#if EVE_CMD_HOOKS
244 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
245 return;
246#endif
247
248 EVE_Cmd_startFunc(phost);
249 EVE_Cmd_wr32(phost, cmd);
250 EVE_Cmd_wr16(phost, w0);
251 EVE_Cmd_wr16(phost, w1);
252 EVE_Cmd_wr16(phost, w2);
253 EVE_Cmd_wr16(phost, w3);
254 EVE_Cmd_endFunc(phost);
255}

◆ EVE_CoCmd_dwwwwd()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwd ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint32_t  d4 
)

Definition at line 276 of file EVE_CoCmd.c.

278{
279#if EVE_CMD_HOOKS
280 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
281 return;
282#endif
283
284 EVE_Cmd_startFunc(phost);
285 EVE_Cmd_wr32(phost, cmd);
286 EVE_Cmd_wr16(phost, w0);
287 EVE_Cmd_wr16(phost, w1);
288 EVE_Cmd_wr16(phost, w2);
289 EVE_Cmd_wr16(phost, w3);
290 EVE_Cmd_wr32(phost, d4);
291 EVE_Cmd_endFunc(phost);
292}

◆ EVE_CoCmd_dwwwwdw()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdw ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint32_t  d4,
uint16_t  w5 
)

Definition at line 198 of file EVE_CoCmd.c.

201{
202#if EVE_CMD_HOOKS
203 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
204 return;
205#endif
206
207 EVE_Cmd_startFunc(phost);
208 EVE_Cmd_wr32(phost, cmd);
209 EVE_Cmd_wr16(phost, w0);
210 EVE_Cmd_wr16(phost, w1);
211 EVE_Cmd_wr16(phost, w2);
212 EVE_Cmd_wr16(phost, w3);
213 EVE_Cmd_wr32(phost, d4);
214 EVE_Cmd_wr16(phost, w5);
215 EVE_Cmd_wr16(phost, 0);
216 EVE_Cmd_endFunc(phost);
217}

◆ EVE_CoCmd_dwwwwdww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint32_t  d4,
uint16_t  w5,
uint16_t  w6 
)

Definition at line 219 of file EVE_CoCmd.c.

222{
223#if EVE_CMD_HOOKS
224 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
225 return;
226#endif
227
228 EVE_Cmd_startFunc(phost);
229 EVE_Cmd_wr32(phost, cmd);
230 EVE_Cmd_wr16(phost, w0);
231 EVE_Cmd_wr16(phost, w1);
232 EVE_Cmd_wr16(phost, w2);
233 EVE_Cmd_wr16(phost, w3);
234 EVE_Cmd_wr32(phost, d4);
235 EVE_Cmd_wr16(phost, w5);
236 EVE_Cmd_wr16(phost, w6);
237 EVE_Cmd_endFunc(phost);
238}

◆ EVE_CoCmd_dwwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4 
)

Definition at line 257 of file EVE_CoCmd.c.

259{
260#if EVE_CMD_HOOKS
261 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
262 return;
263#endif
264
265 EVE_Cmd_startFunc(phost);
266 EVE_Cmd_wr32(phost, cmd);
267 EVE_Cmd_wr16(phost, w0);
268 EVE_Cmd_wr16(phost, w1);
269 EVE_Cmd_wr16(phost, w2);
270 EVE_Cmd_wr16(phost, w3);
271 EVE_Cmd_wr16(phost, w4);
272 EVE_Cmd_wr16(phost, 0);
273 EVE_Cmd_endFunc(phost);
274}

◆ EVE_CoCmd_dwwwwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
uint16_t  w6 
)

Definition at line 294 of file EVE_CoCmd.c.

297{
298#if EVE_CMD_HOOKS
299 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
300 return;
301#endif
302
303 EVE_Cmd_startFunc(phost);
304 EVE_Cmd_wr32(phost, cmd);
305 EVE_Cmd_wr16(phost, w0);
306 EVE_Cmd_wr16(phost, w1);
307 EVE_Cmd_wr16(phost, w2);
308 EVE_Cmd_wr16(phost, w3);
309 EVE_Cmd_wr16(phost, w4);
310 EVE_Cmd_wr16(phost, w5);
311 EVE_Cmd_wr16(phost, w6);
312 EVE_Cmd_wr16(phost, 0);
313 EVE_Cmd_endFunc(phost);
314}

◆ EVE_CoCmd_dwwwwwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
uint16_t  w6,
uint16_t  w7 
)

Definition at line 316 of file EVE_CoCmd.c.

319{
320#if EVE_CMD_HOOKS
321 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
322 return;
323#endif
324
325 EVE_Cmd_startFunc(phost);
326 EVE_Cmd_wr32(phost, cmd);
327 EVE_Cmd_wr16(phost, w0);
328 EVE_Cmd_wr16(phost, w1);
329 EVE_Cmd_wr16(phost, w2);
330 EVE_Cmd_wr16(phost, w3);
331 EVE_Cmd_wr16(phost, w4);
332 EVE_Cmd_wr16(phost, w5);
333 EVE_Cmd_wr16(phost, w6);
334 EVE_Cmd_wr16(phost, w7);
335 EVE_Cmd_endFunc(phost);
336}

◆ EVE_CoCmd_dwwwwwwz()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
const char *  s 
)

Definition at line 338 of file EVE_CoCmd.c.

341{
342#if EVE_CMD_HOOKS
343 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
344 return;
345#endif
346
347 EVE_Cmd_startFunc(phost);
348 EVE_Cmd_wr32(phost, cmd);
349 EVE_Cmd_wr16(phost, w0);
350 EVE_Cmd_wr16(phost, w1);
351 EVE_Cmd_wr16(phost, w2);
352 EVE_Cmd_wr16(phost, w3);
353 EVE_Cmd_wr16(phost, w4);
354 EVE_Cmd_wr16(phost, w5);
356 EVE_Cmd_endFunc(phost);
357}
EVE_HAL_EXPORT uint32_t EVE_Cmd_wrString(EVE_HalContext *phost, const char *str, uint32_t maxLength)
Write a string into Coprocessor's command fifo.
Definition EVE_Cmd.c:322
#define EVE_CMD_STRING_MAX
Definition EVE_Cmd.h:44

◆ EVE_CoCmd_dwwwwwwz_s()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz_s ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
const char *  s,
uint32_t  len 
)

Definition at line 359 of file EVE_CoCmd.c.

362{
363#if EVE_CMD_HOOKS
364 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
365 return;
366#endif
367
368 EVE_Cmd_startFunc(phost);
369 EVE_Cmd_wr32(phost, cmd);
370 EVE_Cmd_wr16(phost, w0);
371 EVE_Cmd_wr16(phost, w1);
372 EVE_Cmd_wr16(phost, w2);
373 EVE_Cmd_wr16(phost, w3);
374 EVE_Cmd_wr16(phost, w4);
375 EVE_Cmd_wr16(phost, w5);
376 EVE_Cmd_wrString(phost, s, len);
377 EVE_Cmd_endFunc(phost);
378}

◆ EVE_CoCmd_getMatrix()

EVE_HAL_EXPORT bool EVE_CoCmd_getMatrix ( EVE_HalContext phost,
int32_t m 
)

Send CMD_GETMATRIX.

Parameters
phostPointer to Hal context
moutput parameters; 6 values; written with matrix coeffcients a, b, c, d, e, f

Definition at line 391 of file EVE_CoCmd.c.

392{
393 uint16_t resAddr;
394 int i;
395
396#if EVE_CMD_HOOKS
397 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_GETMATRIX, 0))
398 return false;
399#endif
400
401 EVE_Cmd_startFunc(phost);
403 resAddr = EVE_Cmd_moveWp(phost, 6 * 4);
404 EVE_Cmd_endFunc(phost);
405
406 /* Read result */
407 if (m)
408 {
409 if (!EVE_Cmd_waitFlush(phost))
410 return false;
412 for (i = 0; i < 6; ++i)
413 m[i] = EVE_Hal_transfer32(phost, 0);
414 EVE_Hal_endTransfer(phost);
415 }
416 return true;
417}
#define CMD_GETMATRIX
EVE_HAL_EXPORT void EVE_Hal_startTransfer(EVE_HalContext *phost, EVE_TRANSFER_T rw, uint32_t addr)
Start data transfer to Coprocessor.
@ EVE_TRANSFER_READ
Definition EVE_HalDefs.h:67
EVE_HAL_EXPORT void EVE_Hal_endTransfer(EVE_HalContext *phost)
End data transfer.
EVE_HAL_EXPORT uint32_t EVE_Hal_transfer32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor.

◆ EVE_CoCmd_setRotate()

EVE_HAL_EXPORT void EVE_CoCmd_setRotate ( EVE_HalContext phost,
uint32_t  r 
)

CMD_SETROTATE.

Parameters
phostPointer to Hal context
rnew rotation value 0-7

Definition at line 419 of file EVE_CoCmd.c.

420{
421#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
422 const bool swapXY = EVE_CHIPID >= EVE_FT810 ? r & 0x2 : false;
423#endif
424
425#if EVE_CMD_HOOKS
426 /* Check hook */
427 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_SETROTATE, r))
428 return;
429#endif
430
431#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
432 if (EVE_CHIPID >= EVE_FT810)
433 {
434 /* Update cached width and height based on rotation */
435 if (swapXY)
436 {
437 phost->Width = EVE_Hal_rd16(phost, REG_VSIZE);
438 phost->Height = EVE_Hal_rd16(phost, REG_HSIZE);
439 }
440 else
441 {
442 phost->Width = EVE_Hal_rd16(phost, REG_HSIZE);
443 phost->Height = EVE_Hal_rd16(phost, REG_VSIZE);
444 }
445
446 /* Command */
447 EVE_Cmd_startFunc(phost);
449 EVE_Cmd_wr32(phost, r);
450 EVE_Cmd_endFunc(phost);
451 }
452 else
453#endif
454 {
455 /* Software based fallback for FT80X */
456 EVE_Hal_wr32(phost, REG_ROTATE, r);
457
458 /* TODO: Adjust touch transform matrix */
459 }
460
461 /* Don't keep this in the write buffer */
462 EVE_Hal_flush(phost);
463}
#define EVE_FT810
Definition EVE_Config.h:58
#define REG_HSIZE
#define REG_ROTATE
#define REG_VSIZE
#define CMD_SETROTATE
EVE_HAL_EXPORT uint16_t EVE_Hal_rd16(EVE_HalContext *phost, uint32_t addr)
Read 2 bytes from Coprocessor's memory.
Definition EVE_Hal.c:173
EVE_HAL_EXPORT void EVE_Hal_wr32(EVE_HalContext *phost, uint32_t addr, uint32_t v)
Write 4 bytes to Coprocessor's memory.
Definition EVE_Hal.c:248
EVE_HAL_EXPORT void EVE_Hal_flush(EVE_HalContext *phost)
Flush data to Coprocessor.
uint32_t Height