Ok for EveConnect
Dependents: FT800_RGB_demo-for_ConnectEve
FT_CoPro_Cmds.cpp
00001 /* mbed Library for FTDI FT800 Enbedded Video Engine "EVE" 00002 * based on Original Code Sample from FTDI 00003 * ported to mbed by Peter Drescher, DC2PD 2014 00004 * Released under the MIT License: http://mbed.org/license/mit */ 00005 00006 #include "FT_Platform.h" 00007 00008 00009 ft_void_t FT800::SendCmd( ft_uint32_t cmd) 00010 { 00011 Transfer32( cmd); 00012 } 00013 00014 ft_void_t FT800::SendStr( const ft_char8_t *s) 00015 { 00016 TransferString( s); 00017 } 00018 00019 00020 ft_void_t FT800::StartFunc( ft_uint16_t count) 00021 { 00022 CheckCmdBuffer( count); 00023 StartCmdTransfer( FT_GPU_WRITE,count); 00024 } 00025 00026 ft_void_t FT800::EndFunc( ft_uint16_t count) 00027 { 00028 EndTransfer( ); 00029 Updatecmdfifo( count); 00030 } 00031 00032 ft_void_t FT800::Text( ft_int16_t x, ft_int16_t y, ft_int16_t font, ft_uint16_t options, const ft_char8_t* s) 00033 { 00034 StartFunc( FT_CMD_SIZE*3 + strlen(s) + 1); 00035 SendCmd( CMD_TEXT); 00036 //Copro_SendCmd( (((ft_uint32_t)y<<16)|(ft_uint32_t)x)); 00037 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00038 SendCmd( (((ft_uint32_t)options<<16)|(ft_uint32_t)font)); 00039 SendStr( s); 00040 EndFunc( (FT_CMD_SIZE*3 + strlen(s) + 1)); 00041 } 00042 00043 ft_void_t FT800::Number( ft_int16_t x, ft_int16_t y, ft_int16_t font, ft_uint16_t options, ft_int32_t n) 00044 { 00045 StartFunc( FT_CMD_SIZE*4); 00046 SendCmd( CMD_NUMBER); 00047 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00048 SendCmd( (((ft_uint32_t)options<<16)|font)); 00049 SendCmd( n); 00050 EndFunc( (FT_CMD_SIZE*4)); 00051 } 00052 00053 ft_void_t FT800::LoadIdentity( ) 00054 { 00055 StartFunc( FT_CMD_SIZE*1); 00056 SendCmd( CMD_LOADIDENTITY); 00057 EndFunc( (FT_CMD_SIZE*1)); 00058 } 00059 00060 ft_void_t FT800::Toggle( ft_int16_t x, ft_int16_t y, ft_int16_t w, ft_int16_t font, ft_uint16_t options, ft_uint16_t state, const ft_char8_t* s) 00061 { 00062 StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1); 00063 SendCmd( CMD_TOGGLE); 00064 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00065 SendCmd( (((ft_uint32_t)font<<16)|w)); 00066 SendCmd( (((ft_uint32_t)state<<16)|options)); 00067 SendStr( s); 00068 EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1)); 00069 } 00070 00071 /* Error handling for val is not done, so better to always use range of 65535 in order that needle is drawn within display region */ 00072 ft_void_t FT800::Gauge( ft_int16_t x, ft_int16_t y, ft_int16_t r, ft_uint16_t options, ft_uint16_t major, ft_uint16_t minor, ft_uint16_t val, ft_uint16_t range) 00073 { 00074 StartFunc( FT_CMD_SIZE*5); 00075 SendCmd( CMD_GAUGE); 00076 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00077 SendCmd( (((ft_uint32_t)options<<16)|r)); 00078 SendCmd( (((ft_uint32_t)minor<<16)|major)); 00079 SendCmd( (((ft_uint32_t)range<<16)|val)); 00080 EndFunc( (FT_CMD_SIZE*5)); 00081 } 00082 00083 ft_void_t FT800::RegRead( ft_uint32_t ptr, ft_uint32_t result) 00084 { 00085 StartFunc( FT_CMD_SIZE*3); 00086 SendCmd( CMD_REGREAD); 00087 SendCmd( ptr); 00088 SendCmd( 0); 00089 EndFunc( (FT_CMD_SIZE*3)); 00090 00091 } 00092 00093 ft_void_t FT800::GetProps( ft_uint32_t ptr, ft_uint32_t w, ft_uint32_t h) 00094 { 00095 StartFunc( FT_CMD_SIZE*4); 00096 SendCmd( CMD_GETPROPS); 00097 SendCmd( ptr); 00098 SendCmd( w); 00099 SendCmd( h); 00100 EndFunc( (FT_CMD_SIZE*4)); 00101 } 00102 00103 ft_void_t FT800::Memcpy( ft_uint32_t dest, ft_uint32_t src, ft_uint32_t num) 00104 { 00105 StartFunc( FT_CMD_SIZE*4); 00106 SendCmd( CMD_MEMCPY); 00107 SendCmd( dest); 00108 SendCmd( src); 00109 SendCmd( num); 00110 EndFunc( (FT_CMD_SIZE*4)); 00111 } 00112 00113 ft_void_t FT800::Spinner( ft_int16_t x, ft_int16_t y, ft_uint16_t style, ft_uint16_t scale) 00114 { 00115 StartFunc( FT_CMD_SIZE*3); 00116 SendCmd( CMD_SPINNER); 00117 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00118 SendCmd( (((ft_uint32_t)scale<<16)|style)); 00119 EndFunc( (FT_CMD_SIZE*3)); 00120 } 00121 00122 ft_void_t FT800::BgColor( ft_uint32_t c) 00123 { 00124 StartFunc( FT_CMD_SIZE*2); 00125 SendCmd( CMD_BGCOLOR); 00126 SendCmd( c); 00127 EndFunc( (FT_CMD_SIZE*2)); 00128 } 00129 00130 ft_void_t FT800::Swap() 00131 { 00132 StartFunc( FT_CMD_SIZE*1); 00133 SendCmd( CMD_SWAP); 00134 EndFunc( (FT_CMD_SIZE*1)); 00135 } 00136 00137 ft_void_t FT800::Inflate( ft_uint32_t ptr) 00138 { 00139 StartFunc( FT_CMD_SIZE*2); 00140 SendCmd( CMD_INFLATE); 00141 SendCmd( ptr); 00142 EndFunc( (FT_CMD_SIZE*2)); 00143 } 00144 00145 ft_void_t FT800::Translate( ft_int32_t tx, ft_int32_t ty) 00146 { 00147 StartFunc( FT_CMD_SIZE*3); 00148 SendCmd( CMD_TRANSLATE); 00149 SendCmd( tx); 00150 SendCmd( ty); 00151 EndFunc( (FT_CMD_SIZE*3)); 00152 } 00153 00154 ft_void_t FT800::Stop() 00155 { 00156 StartFunc( FT_CMD_SIZE*1); 00157 SendCmd( CMD_STOP); 00158 EndFunc( (FT_CMD_SIZE*1)); 00159 } 00160 00161 ft_void_t FT800::Slider( ft_int16_t x, ft_int16_t y, ft_int16_t w, ft_int16_t h, ft_uint16_t options, ft_uint16_t val, ft_uint16_t range) 00162 { 00163 StartFunc( FT_CMD_SIZE*5); 00164 SendCmd( CMD_SLIDER); 00165 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00166 SendCmd( (((ft_uint32_t)h<<16)|w)); 00167 SendCmd( (((ft_uint32_t)val<<16)|options)); 00168 SendCmd( range); 00169 EndFunc( (FT_CMD_SIZE*5)); 00170 } 00171 00172 ft_void_t FT800::TouchTransform( ft_int32_t x0, ft_int32_t y0, ft_int32_t x1, ft_int32_t y1, ft_int32_t x2, ft_int32_t y2, ft_int32_t tx0, ft_int32_t ty0, ft_int32_t tx1, ft_int32_t ty1, ft_int32_t tx2, ft_int32_t ty2, ft_uint16_t result) 00173 { 00174 StartFunc( FT_CMD_SIZE*6*2+FT_CMD_SIZE*2); 00175 SendCmd( CMD_TOUCH_TRANSFORM); 00176 SendCmd( x0); 00177 SendCmd( y0); 00178 SendCmd( x1); 00179 SendCmd( y1); 00180 SendCmd( x2); 00181 SendCmd( y2); 00182 SendCmd( tx0); 00183 SendCmd( ty0); 00184 SendCmd( tx1); 00185 SendCmd( ty1); 00186 SendCmd( tx2); 00187 SendCmd( ty2); 00188 SendCmd( result); 00189 EndFunc( (FT_CMD_SIZE*6*2+FT_CMD_SIZE*2)); 00190 } 00191 00192 ft_void_t FT800::Interrupt( ft_uint32_t ms) 00193 { 00194 StartFunc( FT_CMD_SIZE*2); 00195 SendCmd( CMD_INTERRUPT); 00196 SendCmd( ms); 00197 EndFunc( (FT_CMD_SIZE*2)); 00198 } 00199 00200 ft_void_t FT800::FgColor( ft_uint32_t c) 00201 { 00202 StartFunc( FT_CMD_SIZE*2); 00203 SendCmd( CMD_FGCOLOR); 00204 SendCmd( c); 00205 EndFunc( (FT_CMD_SIZE*2)); 00206 } 00207 00208 ft_void_t FT800::luminosite( ft_int32_t lum) 00209 { 00210 DLstart(); // wait until after the swap 00211 MemWrite(REG_PWM_DUTY, 4); // write to the PWM_DUTY register 00212 StartFunc( FT_CMD_SIZE*1); 00213 SendCmd(lum); 00214 EndFunc( (FT_CMD_SIZE*1)); 00215 Flush_Co_Buffer(); // Download the command list into fifo 00216 WaitCmdfifo_empty(); 00217 } 00218 00219 ft_void_t FT800::Rotate( ft_int32_t a) 00220 { 00221 StartFunc( FT_CMD_SIZE*2); 00222 SendCmd( CMD_ROTATE); 00223 SendCmd( a); 00224 EndFunc( (FT_CMD_SIZE*2)); 00225 } 00226 00227 ft_void_t FT800::Button( ft_int16_t x, ft_int16_t y, ft_int16_t w, ft_int16_t h, ft_int16_t font, ft_uint16_t options, const ft_char8_t* s) 00228 { 00229 StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1); 00230 SendCmd( CMD_BUTTON); 00231 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00232 SendCmd( (((ft_uint32_t)h<<16)|w)); 00233 SendCmd( (((ft_uint32_t)y<<16)|font)); 00234 SendStr( s); 00235 EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1)); 00236 } 00237 00238 00239 00240 ft_void_t FT800::MemWrite( ft_uint32_t ptr, ft_uint32_t num) 00241 { 00242 StartFunc( FT_CMD_SIZE*3); 00243 SendCmd( CMD_MEMWRITE); 00244 SendCmd( ptr); 00245 SendCmd( num); 00246 EndFunc( (FT_CMD_SIZE*3)); 00247 } 00248 00249 00250 00251 ft_void_t FT800::Scrollbar( ft_int16_t x, ft_int16_t y, ft_int16_t w, ft_int16_t h, ft_uint16_t options, ft_uint16_t val, ft_uint16_t size, ft_uint16_t range) 00252 { 00253 StartFunc( FT_CMD_SIZE*5); 00254 SendCmd( CMD_SCROLLBAR); 00255 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00256 SendCmd( (((ft_uint32_t)h<<16)|w)); 00257 SendCmd( (((ft_uint32_t)val<<16)|options)); 00258 SendCmd( (((ft_uint32_t)range<<16)|size)); 00259 EndFunc( (FT_CMD_SIZE*5)); 00260 } 00261 00262 ft_void_t FT800::GetMatrix( ft_int32_t a, ft_int32_t b, ft_int32_t c, ft_int32_t d, ft_int32_t e, ft_int32_t f) 00263 { 00264 StartFunc( FT_CMD_SIZE*7); 00265 SendCmd( CMD_GETMATRIX); 00266 SendCmd( a); 00267 SendCmd( b); 00268 SendCmd( c); 00269 SendCmd( d); 00270 SendCmd( e); 00271 SendCmd( f); 00272 EndFunc( (FT_CMD_SIZE*7)); 00273 } 00274 00275 ft_void_t FT800::Sketch( ft_int16_t x, ft_int16_t y, ft_uint16_t w, ft_uint16_t h, ft_uint32_t ptr, ft_uint16_t format) 00276 { 00277 StartFunc( FT_CMD_SIZE*5); 00278 SendCmd( CMD_SKETCH); 00279 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00280 SendCmd( (((ft_uint32_t)h<<16)|w)); 00281 SendCmd( ptr); 00282 SendCmd( format); 00283 EndFunc( (FT_CMD_SIZE*5)); 00284 } 00285 ft_void_t FT800::MemSet( ft_uint32_t ptr, ft_uint32_t value, ft_uint32_t num) 00286 { 00287 StartFunc( FT_CMD_SIZE*4); 00288 SendCmd( CMD_MEMSET); 00289 SendCmd( ptr); 00290 SendCmd( value); 00291 SendCmd( num); 00292 EndFunc( (FT_CMD_SIZE*4)); 00293 } 00294 ft_void_t FT800::GradColor( ft_uint32_t c) 00295 { 00296 StartFunc( FT_CMD_SIZE*2); 00297 SendCmd( CMD_GRADCOLOR); 00298 SendCmd( c); 00299 EndFunc( (FT_CMD_SIZE*2)); 00300 } 00301 ft_void_t FT800::BitmapTransform( ft_int32_t x0, ft_int32_t y0, ft_int32_t x1, ft_int32_t y1, ft_int32_t x2, ft_int32_t y2, ft_int32_t tx0, ft_int32_t ty0, ft_int32_t tx1, ft_int32_t ty1, ft_int32_t tx2, ft_int32_t ty2, ft_uint16_t result) 00302 { 00303 StartFunc( FT_CMD_SIZE*6*2+FT_CMD_SIZE*2); 00304 SendCmd( CMD_BITMAP_TRANSFORM); 00305 SendCmd( x0); 00306 SendCmd( y0); 00307 SendCmd( x1); 00308 SendCmd( y1); 00309 SendCmd( x2); 00310 SendCmd( y2); 00311 SendCmd( tx0); 00312 SendCmd( ty0); 00313 SendCmd( tx1); 00314 SendCmd( ty1); 00315 SendCmd( tx2); 00316 SendCmd( ty2); 00317 SendCmd( result); 00318 EndFunc( (FT_CMD_SIZE*6*2+FT_CMD_SIZE*2)); 00319 } 00320 ft_void_t FT800::Calibrate( ft_uint32_t result) 00321 { 00322 StartFunc( FT_CMD_SIZE*2); 00323 SendCmd( CMD_CALIBRATE); 00324 SendCmd( result); 00325 EndFunc( (FT_CMD_SIZE*2)); 00326 WaitCmdfifo_empty( ); 00327 00328 } 00329 ft_void_t FT800::SetFont( ft_uint32_t font, ft_uint32_t ptr) 00330 { 00331 StartFunc( FT_CMD_SIZE*3); 00332 SendCmd( CMD_SETFONT); 00333 SendCmd( font); 00334 SendCmd( ptr); 00335 EndFunc( (FT_CMD_SIZE*3)); 00336 } 00337 ft_void_t FT800::Logo( ) 00338 { 00339 StartFunc( FT_CMD_SIZE*1); 00340 SendCmd( CMD_LOGO); 00341 EndFunc( FT_CMD_SIZE*1); 00342 } 00343 ft_void_t FT800::Append( ft_uint32_t ptr, ft_uint32_t num) 00344 { 00345 StartFunc( FT_CMD_SIZE*3); 00346 SendCmd( CMD_APPEND); 00347 SendCmd( ptr); 00348 SendCmd( num); 00349 EndFunc( (FT_CMD_SIZE*3)); 00350 } 00351 ft_void_t FT800::MemZero( ft_uint32_t ptr, ft_uint32_t num) 00352 { 00353 StartFunc( FT_CMD_SIZE*3); 00354 SendCmd( CMD_MEMZERO); 00355 SendCmd( ptr); 00356 SendCmd( num); 00357 EndFunc( (FT_CMD_SIZE*3)); 00358 } 00359 ft_void_t FT800::Scale( ft_int32_t sx, ft_int32_t sy) 00360 { 00361 StartFunc( FT_CMD_SIZE*3); 00362 SendCmd( CMD_SCALE); 00363 SendCmd( sx); 00364 SendCmd( sy); 00365 EndFunc( (FT_CMD_SIZE*3)); 00366 } 00367 ft_void_t FT800::Clock( ft_int16_t x, ft_int16_t y, ft_int16_t r, ft_uint16_t options, ft_uint16_t h, ft_uint16_t m, ft_uint16_t s, ft_uint16_t ms) 00368 { 00369 StartFunc( FT_CMD_SIZE*5); 00370 SendCmd( CMD_CLOCK); 00371 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00372 SendCmd( (((ft_uint32_t)options<<16)|r)); 00373 SendCmd( (((ft_uint32_t)m<<16)|h)); 00374 SendCmd( (((ft_uint32_t)ms<<16)|s)); 00375 EndFunc( (FT_CMD_SIZE*5)); 00376 } 00377 00378 ft_void_t FT800::Gradient( ft_int16_t x0, ft_int16_t y0, ft_uint32_t rgb0, ft_int16_t x1, ft_int16_t y1, ft_uint32_t rgb1) 00379 { 00380 StartFunc( FT_CMD_SIZE*5); 00381 SendCmd( CMD_GRADIENT); 00382 SendCmd( (((ft_uint32_t)y0<<16)|(x0 & 0xffff))); 00383 SendCmd( rgb0); 00384 SendCmd( (((ft_uint32_t)y1<<16)|(x1 & 0xffff))); 00385 SendCmd( rgb1); 00386 EndFunc( (FT_CMD_SIZE*5)); 00387 } 00388 00389 ft_void_t FT800::SetMatrix( ) 00390 { 00391 StartFunc( FT_CMD_SIZE*1); 00392 SendCmd( CMD_SETMATRIX); 00393 EndFunc( (FT_CMD_SIZE*1)); 00394 } 00395 00396 ft_void_t FT800::Track( ft_int16_t x, ft_int16_t y, ft_int16_t w, ft_int16_t h, ft_int16_t tag) 00397 { 00398 StartFunc( FT_CMD_SIZE*4); 00399 SendCmd( CMD_TRACK); 00400 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00401 SendCmd( (((ft_uint32_t)h<<16)|w)); 00402 SendCmd( tag); 00403 EndFunc( (FT_CMD_SIZE*4)); 00404 } 00405 00406 ft_void_t FT800::GetPtr( ft_uint32_t result) 00407 { 00408 StartFunc( FT_CMD_SIZE*2); 00409 SendCmd( CMD_GETPTR); 00410 SendCmd( result); 00411 EndFunc( (FT_CMD_SIZE*2)); 00412 } 00413 00414 ft_void_t FT800::Progress( ft_int16_t x, ft_int16_t y, ft_int16_t w, ft_int16_t h, ft_uint16_t options, ft_uint16_t val, ft_uint16_t range) 00415 { 00416 StartFunc( FT_CMD_SIZE*5); 00417 SendCmd( CMD_PROGRESS); 00418 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00419 SendCmd( (((ft_uint32_t)h<<16)|w)); 00420 SendCmd( (((ft_uint32_t)val<<16)|options)); 00421 SendCmd( range); 00422 EndFunc( (FT_CMD_SIZE*5)); 00423 } 00424 00425 ft_void_t FT800::ColdStart( ) 00426 { 00427 StartFunc( FT_CMD_SIZE*1); 00428 SendCmd( CMD_COLDSTART); 00429 EndFunc( (FT_CMD_SIZE*1)); 00430 } 00431 00432 ft_void_t FT800::Keys( ft_int16_t x, ft_int16_t y, ft_int16_t w, ft_int16_t h, ft_int16_t font, ft_uint16_t options, const ft_char8_t* s) 00433 { 00434 StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1); 00435 SendCmd( CMD_KEYS); 00436 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00437 SendCmd( (((ft_uint32_t)h<<16)|w)); 00438 SendCmd( (((ft_uint32_t)options<<16)|font)); 00439 SendStr( s); 00440 EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1)); 00441 } 00442 00443 ft_void_t FT800::Dial( ft_int16_t x, ft_int16_t y, ft_int16_t r, ft_uint16_t options, ft_uint16_t val) 00444 { 00445 StartFunc( FT_CMD_SIZE*4); 00446 SendCmd( CMD_DIAL); 00447 SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); 00448 SendCmd( (((ft_uint32_t)options<<16)|r)); 00449 SendCmd( val); 00450 EndFunc( (FT_CMD_SIZE*4)); 00451 } 00452 00453 ft_void_t FT800::LoadImage( ft_uint32_t ptr, ft_uint32_t options) 00454 { 00455 StartFunc( FT_CMD_SIZE*3); 00456 SendCmd( CMD_LOADIMAGE); 00457 SendCmd( ptr); 00458 SendCmd( options); 00459 EndFunc( (FT_CMD_SIZE*3)); 00460 } 00461 00462 ft_void_t FT800::DLstart( ) 00463 { 00464 StartFunc( FT_CMD_SIZE*1); 00465 SendCmd( CMD_DLSTART); 00466 EndFunc( (FT_CMD_SIZE*1)); 00467 } 00468 00469 ft_void_t FT800::Snapshot( ft_uint32_t ptr) 00470 { 00471 StartFunc( FT_CMD_SIZE*2); 00472 SendCmd( CMD_SNAPSHOT); 00473 SendCmd( ptr); 00474 EndFunc( (FT_CMD_SIZE*2)); 00475 } 00476 00477 ft_void_t FT800::ScreenSaver( ) 00478 { 00479 StartFunc( FT_CMD_SIZE*1); 00480 SendCmd( CMD_SCREENSAVER); 00481 EndFunc( (FT_CMD_SIZE*1)); 00482 } 00483 00484 ft_void_t FT800::MemCrc( ft_uint32_t ptr, ft_uint32_t num, ft_uint32_t result) 00485 { 00486 StartFunc( FT_CMD_SIZE*4); 00487 SendCmd( CMD_MEMCRC); 00488 SendCmd( ptr); 00489 SendCmd( num); 00490 SendCmd( result); 00491 EndFunc( (FT_CMD_SIZE*4)); 00492 } 00493 00494 00495 ft_void_t FT800::DL(ft_uint32_t cmd) 00496 { 00497 WrCmd32(cmd); 00498 /* Increment the command index */ 00499 CmdBuffer_Index += FT_CMD_SIZE; 00500 } 00501 00502 ft_void_t FT800::WrDlCmd_Buffer(ft_uint32_t cmd) 00503 { 00504 Wr32((RAM_DL+DlBuffer_Index),cmd); 00505 /* Increment the command index */ 00506 DlBuffer_Index += FT_CMD_SIZE; 00507 } 00508 00509 ft_void_t FT800::Flush_DL_Buffer() 00510 { 00511 DlBuffer_Index = 0; 00512 00513 } 00514 00515 ft_void_t FT800::Flush_Co_Buffer() 00516 { 00517 CmdBuffer_Index = 0; 00518 } 00519 00520 00521 /* API to check the status of previous DLSWAP and perform DLSWAP of new DL */ 00522 /* Check for the status of previous DLSWAP and if still not done wait for few ms and check again */ 00523 ft_void_t FT800::DLSwap(ft_uint8_t DL_Swap_Type) 00524 { 00525 ft_uint8_t Swap_Type = DLSWAP_FRAME,Swap_Done = DLSWAP_FRAME; 00526 00527 if(DL_Swap_Type == DLSWAP_LINE) 00528 { 00529 Swap_Type = DLSWAP_LINE; 00530 } 00531 00532 /* Perform a new DL swap */ 00533 Wr8(REG_DLSWAP,Swap_Type); 00534 00535 /* Wait till the swap is done */ 00536 while(Swap_Done) 00537 { 00538 Swap_Done = Rd8(REG_DLSWAP); 00539 00540 if(DLSWAP_DONE != Swap_Done) 00541 { 00542 Sleep(10);//wait for 10ms 00543 } 00544 } 00545 } 00546 00547 00548 00549 /* Nothing beyond this */ 00550 00551 00552 00553 00554
Generated on Mon Jul 18 2022 06:04:53 by 1.7.2