Library for FT810 EVE chip

Fork of FT810 by Curtis Mattull

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers FT_CoPro_Cmds.cpp Source File

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::Rotate( ft_int32_t a)
00209 {
00210   StartFunc( FT_CMD_SIZE*2);
00211   SendCmd(  CMD_ROTATE);
00212   SendCmd(  a);
00213   EndFunc( (FT_CMD_SIZE*2));
00214 }
00215 
00216 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)
00217 {
00218   StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1);
00219   SendCmd(  CMD_BUTTON);
00220   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00221   SendCmd(  (((ft_uint32_t)h<<16)|w));
00222   SendCmd( (((ft_uint32_t)options<<16)|font));       // patch from Ivano Pelicella to draw flat buttons
00223   SendStr(  s);
00224   EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1));
00225 }
00226 
00227 ft_void_t FT800::MemWrite( ft_uint32_t ptr, ft_uint32_t num)
00228 {
00229   StartFunc( FT_CMD_SIZE*3);
00230   SendCmd(  CMD_MEMWRITE);
00231   SendCmd(  ptr);
00232   SendCmd(  num);
00233   EndFunc( (FT_CMD_SIZE*3));
00234 }
00235 
00236 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)
00237 {
00238   StartFunc( FT_CMD_SIZE*5);
00239   SendCmd(  CMD_SCROLLBAR);
00240   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00241   SendCmd(  (((ft_uint32_t)h<<16)|w));
00242   SendCmd(  (((ft_uint32_t)val<<16)|options));
00243   SendCmd(  (((ft_uint32_t)range<<16)|size));
00244   EndFunc( (FT_CMD_SIZE*5));
00245 }
00246 
00247 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)
00248 {
00249   StartFunc( FT_CMD_SIZE*7);
00250   SendCmd(  CMD_GETMATRIX);
00251   SendCmd(  a);
00252   SendCmd(  b);
00253   SendCmd(  c);
00254   SendCmd(  d);
00255   SendCmd(  e);
00256   SendCmd(  f);
00257   EndFunc( (FT_CMD_SIZE*7));
00258 }
00259 
00260 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)
00261 {
00262   StartFunc( FT_CMD_SIZE*5);
00263   SendCmd(  CMD_SKETCH);
00264   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00265   SendCmd(  (((ft_uint32_t)h<<16)|w));
00266   SendCmd(  ptr);
00267   SendCmd(  format);
00268   EndFunc( (FT_CMD_SIZE*5));
00269 }
00270 ft_void_t FT800::MemSet( ft_uint32_t ptr, ft_uint32_t value, ft_uint32_t num)
00271 {
00272   StartFunc( FT_CMD_SIZE*4);
00273   SendCmd(  CMD_MEMSET);
00274   SendCmd(  ptr);
00275   SendCmd(  value);
00276   SendCmd(  num);
00277   EndFunc( (FT_CMD_SIZE*4));
00278 }
00279 ft_void_t FT800::GradColor( ft_uint32_t c)
00280 {
00281   StartFunc( FT_CMD_SIZE*2);
00282   SendCmd(  CMD_GRADCOLOR);
00283   SendCmd(  c);
00284   EndFunc( (FT_CMD_SIZE*2));
00285 }
00286 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)
00287 {
00288   StartFunc( FT_CMD_SIZE*6*2+FT_CMD_SIZE*2);
00289   SendCmd(  CMD_BITMAP_TRANSFORM);
00290   SendCmd(  x0);
00291   SendCmd(  y0);
00292   SendCmd(  x1);
00293   SendCmd(  y1);
00294   SendCmd(  x2);
00295   SendCmd(  y2);
00296   SendCmd(  tx0);
00297   SendCmd(  ty0);
00298   SendCmd(  tx1);
00299   SendCmd(  ty1);
00300   SendCmd(  tx2);
00301   SendCmd(  ty2);
00302   SendCmd(  result);
00303   EndFunc( (FT_CMD_SIZE*6*2+FT_CMD_SIZE*2));
00304 }
00305 ft_void_t FT800::Calibrate( ft_uint32_t result)
00306 {
00307   StartFunc( FT_CMD_SIZE*2);
00308   SendCmd(  CMD_CALIBRATE);
00309   SendCmd(  result);
00310   EndFunc( (FT_CMD_SIZE*2));
00311   WaitCmdfifo_empty( );
00312 
00313 }
00314 ft_void_t FT800::SetFont( ft_uint32_t font, ft_uint32_t ptr)
00315 {
00316   StartFunc( FT_CMD_SIZE*3);
00317   SendCmd(  CMD_SETFONT);
00318   SendCmd(  font);
00319   SendCmd(  ptr);
00320   EndFunc( (FT_CMD_SIZE*3));
00321 }
00322 //Curtis Mattull added this function on 11/14/16, copied from above...
00323 ft_void_t FT800::RomFont( ft_uint32_t rom_slot, ft_uint32_t font)
00324 {
00325   StartFunc( FT_CMD_SIZE*3);
00326   SendCmd(  CMD_ROMFONT);
00327   SendCmd(  rom_slot);
00328   SendCmd(  font);
00329   EndFunc( (FT_CMD_SIZE*3));
00330 }
00331 
00332 
00333 ft_void_t FT800::Logo(  )
00334 {
00335   StartFunc( FT_CMD_SIZE*1);
00336   SendCmd(  CMD_LOGO);
00337   EndFunc( FT_CMD_SIZE*1);
00338 }
00339 ft_void_t FT800::Append( ft_uint32_t ptr, ft_uint32_t num)
00340 {
00341   StartFunc( FT_CMD_SIZE*3);
00342   SendCmd(  CMD_APPEND);
00343   SendCmd(  ptr);
00344   SendCmd(  num);
00345   EndFunc( (FT_CMD_SIZE*3));
00346 }
00347 ft_void_t FT800::MemZero( ft_uint32_t ptr, ft_uint32_t num)
00348 {
00349   StartFunc( FT_CMD_SIZE*3);
00350   SendCmd(  CMD_MEMZERO);
00351   SendCmd(  ptr);
00352   SendCmd(  num);
00353   EndFunc( (FT_CMD_SIZE*3));
00354 }
00355 ft_void_t FT800::Scale( ft_int32_t sx, ft_int32_t sy)
00356 {
00357   StartFunc( FT_CMD_SIZE*3);
00358   SendCmd(  CMD_SCALE);
00359   SendCmd(  sx);
00360   SendCmd(  sy);
00361   EndFunc( (FT_CMD_SIZE*3));
00362 }
00363 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)
00364 {
00365   StartFunc( FT_CMD_SIZE*5);
00366   SendCmd(  CMD_CLOCK);
00367   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00368   SendCmd(  (((ft_uint32_t)options<<16)|r));
00369   SendCmd(  (((ft_uint32_t)m<<16)|h));
00370   SendCmd(  (((ft_uint32_t)ms<<16)|s));
00371   EndFunc( (FT_CMD_SIZE*5));
00372 }
00373 
00374 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)
00375 {
00376   StartFunc( FT_CMD_SIZE*5);
00377   SendCmd(  CMD_GRADIENT);
00378   SendCmd(  (((ft_uint32_t)y0<<16)|(x0 & 0xffff)));
00379   SendCmd(  rgb0);
00380   SendCmd(  (((ft_uint32_t)y1<<16)|(x1 & 0xffff)));
00381   SendCmd(  rgb1);
00382   EndFunc( (FT_CMD_SIZE*5));
00383 }
00384 
00385 ft_void_t FT800::SetMatrix(  )
00386 {
00387   StartFunc( FT_CMD_SIZE*1);
00388   SendCmd(  CMD_SETMATRIX);
00389   EndFunc( (FT_CMD_SIZE*1));
00390 }
00391 
00392 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)
00393 {
00394   StartFunc( FT_CMD_SIZE*4);
00395   SendCmd(  CMD_TRACK);
00396   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00397   SendCmd(  (((ft_uint32_t)h<<16)|w));
00398   SendCmd(  tag);
00399   EndFunc( (FT_CMD_SIZE*4));
00400 }
00401 
00402 ft_void_t FT800::GetPtr( ft_uint32_t result)
00403 {
00404   StartFunc( FT_CMD_SIZE*2);
00405   SendCmd(  CMD_GETPTR);
00406   SendCmd(  result);
00407   EndFunc( (FT_CMD_SIZE*2));
00408 }
00409 
00410 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)
00411 {
00412   StartFunc( FT_CMD_SIZE*5);
00413   SendCmd(  CMD_PROGRESS);
00414   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00415   SendCmd(  (((ft_uint32_t)h<<16)|w));
00416   SendCmd(  (((ft_uint32_t)val<<16)|options));
00417   SendCmd(  range);
00418   EndFunc( (FT_CMD_SIZE*5));
00419 }
00420 
00421 ft_void_t FT800::ColdStart(  )
00422 {
00423   StartFunc( FT_CMD_SIZE*1);
00424   SendCmd(  CMD_COLDSTART);
00425   EndFunc( (FT_CMD_SIZE*1));
00426 }
00427 
00428 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)
00429 {
00430   StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1);
00431   SendCmd(  CMD_KEYS);
00432   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00433   SendCmd(  (((ft_uint32_t)h<<16)|w));
00434   SendCmd(  (((ft_uint32_t)options<<16)|font));
00435   SendStr(  s);
00436   EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1));
00437 }
00438 
00439 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)
00440 {
00441   StartFunc( FT_CMD_SIZE*4);
00442   SendCmd(  CMD_DIAL);
00443   SendCmd(  (((ft_uint32_t)y<<16)|(x & 0xffff)));
00444   SendCmd(  (((ft_uint32_t)options<<16)|r));
00445   SendCmd(  val);
00446   EndFunc( (FT_CMD_SIZE*4));
00447 }
00448 
00449 ft_void_t FT800::LoadImage( ft_uint32_t ptr, ft_uint32_t options)
00450 {
00451   StartFunc( FT_CMD_SIZE*3);
00452   SendCmd(  CMD_LOADIMAGE);
00453   SendCmd(  ptr);
00454   SendCmd(  options);
00455   EndFunc( (FT_CMD_SIZE*3));
00456 }
00457 
00458 ft_void_t FT800::DLstart(  )
00459 {
00460   StartFunc( FT_CMD_SIZE*1);
00461   SendCmd(  CMD_DLSTART);
00462   EndFunc( (FT_CMD_SIZE*1));
00463 }
00464 
00465 ft_void_t FT800::Snapshot( ft_uint32_t ptr)
00466 {
00467   StartFunc( FT_CMD_SIZE*2);
00468   SendCmd(  CMD_SNAPSHOT);
00469   SendCmd(  ptr);
00470   EndFunc( (FT_CMD_SIZE*2));
00471 }
00472 
00473 ft_void_t FT800::ScreenSaver(  )
00474 {
00475   StartFunc( FT_CMD_SIZE*1);
00476   SendCmd(  CMD_SCREENSAVER);
00477   EndFunc( (FT_CMD_SIZE*1));
00478 }
00479 
00480 ft_void_t FT800::MemCrc( ft_uint32_t ptr, ft_uint32_t num, ft_uint32_t result)
00481 {
00482   StartFunc( FT_CMD_SIZE*4);
00483   SendCmd(  CMD_MEMCRC);
00484   SendCmd(  ptr);
00485   SendCmd(  num);
00486   SendCmd(  result);
00487   EndFunc( (FT_CMD_SIZE*4));
00488 }
00489 
00490 
00491 ft_void_t FT800::DL(ft_uint32_t cmd)
00492 {
00493    WrCmd32(cmd);
00494    /* Increment the command index */
00495    CmdBuffer_Index += FT_CMD_SIZE;
00496 }
00497 
00498 ft_void_t FT800::WrDlCmd_Buffer(ft_uint32_t cmd)
00499 {
00500    Wr32((RAM_DL+DlBuffer_Index),cmd);
00501    /* Increment the command index */
00502    DlBuffer_Index += FT_CMD_SIZE;
00503 }
00504 
00505 ft_void_t FT800::Flush_DL_Buffer()
00506 {
00507    DlBuffer_Index = 0;
00508 
00509 }
00510 
00511 ft_void_t FT800::Flush_Co_Buffer()
00512 {
00513    CmdBuffer_Index = 0;
00514 }
00515 
00516 
00517 /* API to check the status of previous DLSWAP and perform DLSWAP of new DL */
00518 /* Check for the status of previous DLSWAP and if still not done wait for few ms and check again */
00519 ft_void_t FT800::DLSwap(ft_uint8_t DL_Swap_Type)
00520 {
00521     ft_uint8_t Swap_Type = DLSWAP_FRAME,Swap_Done = DLSWAP_FRAME;
00522 
00523     if(DL_Swap_Type == DLSWAP_LINE)
00524     {
00525         Swap_Type = DLSWAP_LINE;
00526     }
00527 
00528     /* Perform a new DL swap */
00529     Wr8(REG_DLSWAP,Swap_Type);
00530 
00531     /* Wait till the swap is done */
00532     while(Swap_Done)
00533     {
00534         Swap_Done = Rd8(REG_DLSWAP);
00535 
00536         if(DLSWAP_DONE != Swap_Done)
00537         {
00538             Sleep(10);//wait for 10ms
00539         }
00540     }
00541 }
00542 
00543 
00544 
00545 /* Nothing beyond this */
00546 
00547 
00548 
00549