Ok for EveConnect
Dependents: FT800_RGB_demo-for_ConnectEve
FT_CoPro_Cmds.cpp@0:352efe1d072f, 2019-03-11 (annotated)
- Committer:
- schnf30
- Date:
- Mon Mar 11 19:14:19 2019 +0000
- Revision:
- 0:352efe1d072f
Programme demo FT800 for ConnectEve. It's Ok.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
schnf30 | 0:352efe1d072f | 1 | /* mbed Library for FTDI FT800 Enbedded Video Engine "EVE" |
schnf30 | 0:352efe1d072f | 2 | * based on Original Code Sample from FTDI |
schnf30 | 0:352efe1d072f | 3 | * ported to mbed by Peter Drescher, DC2PD 2014 |
schnf30 | 0:352efe1d072f | 4 | * Released under the MIT License: http://mbed.org/license/mit */ |
schnf30 | 0:352efe1d072f | 5 | |
schnf30 | 0:352efe1d072f | 6 | #include "FT_Platform.h" |
schnf30 | 0:352efe1d072f | 7 | |
schnf30 | 0:352efe1d072f | 8 | |
schnf30 | 0:352efe1d072f | 9 | ft_void_t FT800::SendCmd( ft_uint32_t cmd) |
schnf30 | 0:352efe1d072f | 10 | { |
schnf30 | 0:352efe1d072f | 11 | Transfer32( cmd); |
schnf30 | 0:352efe1d072f | 12 | } |
schnf30 | 0:352efe1d072f | 13 | |
schnf30 | 0:352efe1d072f | 14 | ft_void_t FT800::SendStr( const ft_char8_t *s) |
schnf30 | 0:352efe1d072f | 15 | { |
schnf30 | 0:352efe1d072f | 16 | TransferString( s); |
schnf30 | 0:352efe1d072f | 17 | } |
schnf30 | 0:352efe1d072f | 18 | |
schnf30 | 0:352efe1d072f | 19 | |
schnf30 | 0:352efe1d072f | 20 | ft_void_t FT800::StartFunc( ft_uint16_t count) |
schnf30 | 0:352efe1d072f | 21 | { |
schnf30 | 0:352efe1d072f | 22 | CheckCmdBuffer( count); |
schnf30 | 0:352efe1d072f | 23 | StartCmdTransfer( FT_GPU_WRITE,count); |
schnf30 | 0:352efe1d072f | 24 | } |
schnf30 | 0:352efe1d072f | 25 | |
schnf30 | 0:352efe1d072f | 26 | ft_void_t FT800::EndFunc( ft_uint16_t count) |
schnf30 | 0:352efe1d072f | 27 | { |
schnf30 | 0:352efe1d072f | 28 | EndTransfer( ); |
schnf30 | 0:352efe1d072f | 29 | Updatecmdfifo( count); |
schnf30 | 0:352efe1d072f | 30 | } |
schnf30 | 0:352efe1d072f | 31 | |
schnf30 | 0:352efe1d072f | 32 | 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) |
schnf30 | 0:352efe1d072f | 33 | { |
schnf30 | 0:352efe1d072f | 34 | StartFunc( FT_CMD_SIZE*3 + strlen(s) + 1); |
schnf30 | 0:352efe1d072f | 35 | SendCmd( CMD_TEXT); |
schnf30 | 0:352efe1d072f | 36 | //Copro_SendCmd( (((ft_uint32_t)y<<16)|(ft_uint32_t)x)); |
schnf30 | 0:352efe1d072f | 37 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 38 | SendCmd( (((ft_uint32_t)options<<16)|(ft_uint32_t)font)); |
schnf30 | 0:352efe1d072f | 39 | SendStr( s); |
schnf30 | 0:352efe1d072f | 40 | EndFunc( (FT_CMD_SIZE*3 + strlen(s) + 1)); |
schnf30 | 0:352efe1d072f | 41 | } |
schnf30 | 0:352efe1d072f | 42 | |
schnf30 | 0:352efe1d072f | 43 | 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) |
schnf30 | 0:352efe1d072f | 44 | { |
schnf30 | 0:352efe1d072f | 45 | StartFunc( FT_CMD_SIZE*4); |
schnf30 | 0:352efe1d072f | 46 | SendCmd( CMD_NUMBER); |
schnf30 | 0:352efe1d072f | 47 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 48 | SendCmd( (((ft_uint32_t)options<<16)|font)); |
schnf30 | 0:352efe1d072f | 49 | SendCmd( n); |
schnf30 | 0:352efe1d072f | 50 | EndFunc( (FT_CMD_SIZE*4)); |
schnf30 | 0:352efe1d072f | 51 | } |
schnf30 | 0:352efe1d072f | 52 | |
schnf30 | 0:352efe1d072f | 53 | ft_void_t FT800::LoadIdentity( ) |
schnf30 | 0:352efe1d072f | 54 | { |
schnf30 | 0:352efe1d072f | 55 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 56 | SendCmd( CMD_LOADIDENTITY); |
schnf30 | 0:352efe1d072f | 57 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 58 | } |
schnf30 | 0:352efe1d072f | 59 | |
schnf30 | 0:352efe1d072f | 60 | 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) |
schnf30 | 0:352efe1d072f | 61 | { |
schnf30 | 0:352efe1d072f | 62 | StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1); |
schnf30 | 0:352efe1d072f | 63 | SendCmd( CMD_TOGGLE); |
schnf30 | 0:352efe1d072f | 64 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 65 | SendCmd( (((ft_uint32_t)font<<16)|w)); |
schnf30 | 0:352efe1d072f | 66 | SendCmd( (((ft_uint32_t)state<<16)|options)); |
schnf30 | 0:352efe1d072f | 67 | SendStr( s); |
schnf30 | 0:352efe1d072f | 68 | EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1)); |
schnf30 | 0:352efe1d072f | 69 | } |
schnf30 | 0:352efe1d072f | 70 | |
schnf30 | 0:352efe1d072f | 71 | /* Error handling for val is not done, so better to always use range of 65535 in order that needle is drawn within display region */ |
schnf30 | 0:352efe1d072f | 72 | 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) |
schnf30 | 0:352efe1d072f | 73 | { |
schnf30 | 0:352efe1d072f | 74 | StartFunc( FT_CMD_SIZE*5); |
schnf30 | 0:352efe1d072f | 75 | SendCmd( CMD_GAUGE); |
schnf30 | 0:352efe1d072f | 76 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 77 | SendCmd( (((ft_uint32_t)options<<16)|r)); |
schnf30 | 0:352efe1d072f | 78 | SendCmd( (((ft_uint32_t)minor<<16)|major)); |
schnf30 | 0:352efe1d072f | 79 | SendCmd( (((ft_uint32_t)range<<16)|val)); |
schnf30 | 0:352efe1d072f | 80 | EndFunc( (FT_CMD_SIZE*5)); |
schnf30 | 0:352efe1d072f | 81 | } |
schnf30 | 0:352efe1d072f | 82 | |
schnf30 | 0:352efe1d072f | 83 | ft_void_t FT800::RegRead( ft_uint32_t ptr, ft_uint32_t result) |
schnf30 | 0:352efe1d072f | 84 | { |
schnf30 | 0:352efe1d072f | 85 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 86 | SendCmd( CMD_REGREAD); |
schnf30 | 0:352efe1d072f | 87 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 88 | SendCmd( 0); |
schnf30 | 0:352efe1d072f | 89 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 90 | |
schnf30 | 0:352efe1d072f | 91 | } |
schnf30 | 0:352efe1d072f | 92 | |
schnf30 | 0:352efe1d072f | 93 | ft_void_t FT800::GetProps( ft_uint32_t ptr, ft_uint32_t w, ft_uint32_t h) |
schnf30 | 0:352efe1d072f | 94 | { |
schnf30 | 0:352efe1d072f | 95 | StartFunc( FT_CMD_SIZE*4); |
schnf30 | 0:352efe1d072f | 96 | SendCmd( CMD_GETPROPS); |
schnf30 | 0:352efe1d072f | 97 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 98 | SendCmd( w); |
schnf30 | 0:352efe1d072f | 99 | SendCmd( h); |
schnf30 | 0:352efe1d072f | 100 | EndFunc( (FT_CMD_SIZE*4)); |
schnf30 | 0:352efe1d072f | 101 | } |
schnf30 | 0:352efe1d072f | 102 | |
schnf30 | 0:352efe1d072f | 103 | ft_void_t FT800::Memcpy( ft_uint32_t dest, ft_uint32_t src, ft_uint32_t num) |
schnf30 | 0:352efe1d072f | 104 | { |
schnf30 | 0:352efe1d072f | 105 | StartFunc( FT_CMD_SIZE*4); |
schnf30 | 0:352efe1d072f | 106 | SendCmd( CMD_MEMCPY); |
schnf30 | 0:352efe1d072f | 107 | SendCmd( dest); |
schnf30 | 0:352efe1d072f | 108 | SendCmd( src); |
schnf30 | 0:352efe1d072f | 109 | SendCmd( num); |
schnf30 | 0:352efe1d072f | 110 | EndFunc( (FT_CMD_SIZE*4)); |
schnf30 | 0:352efe1d072f | 111 | } |
schnf30 | 0:352efe1d072f | 112 | |
schnf30 | 0:352efe1d072f | 113 | ft_void_t FT800::Spinner( ft_int16_t x, ft_int16_t y, ft_uint16_t style, ft_uint16_t scale) |
schnf30 | 0:352efe1d072f | 114 | { |
schnf30 | 0:352efe1d072f | 115 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 116 | SendCmd( CMD_SPINNER); |
schnf30 | 0:352efe1d072f | 117 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 118 | SendCmd( (((ft_uint32_t)scale<<16)|style)); |
schnf30 | 0:352efe1d072f | 119 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 120 | } |
schnf30 | 0:352efe1d072f | 121 | |
schnf30 | 0:352efe1d072f | 122 | ft_void_t FT800::BgColor( ft_uint32_t c) |
schnf30 | 0:352efe1d072f | 123 | { |
schnf30 | 0:352efe1d072f | 124 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 125 | SendCmd( CMD_BGCOLOR); |
schnf30 | 0:352efe1d072f | 126 | SendCmd( c); |
schnf30 | 0:352efe1d072f | 127 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 128 | } |
schnf30 | 0:352efe1d072f | 129 | |
schnf30 | 0:352efe1d072f | 130 | ft_void_t FT800::Swap() |
schnf30 | 0:352efe1d072f | 131 | { |
schnf30 | 0:352efe1d072f | 132 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 133 | SendCmd( CMD_SWAP); |
schnf30 | 0:352efe1d072f | 134 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 135 | } |
schnf30 | 0:352efe1d072f | 136 | |
schnf30 | 0:352efe1d072f | 137 | ft_void_t FT800::Inflate( ft_uint32_t ptr) |
schnf30 | 0:352efe1d072f | 138 | { |
schnf30 | 0:352efe1d072f | 139 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 140 | SendCmd( CMD_INFLATE); |
schnf30 | 0:352efe1d072f | 141 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 142 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 143 | } |
schnf30 | 0:352efe1d072f | 144 | |
schnf30 | 0:352efe1d072f | 145 | ft_void_t FT800::Translate( ft_int32_t tx, ft_int32_t ty) |
schnf30 | 0:352efe1d072f | 146 | { |
schnf30 | 0:352efe1d072f | 147 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 148 | SendCmd( CMD_TRANSLATE); |
schnf30 | 0:352efe1d072f | 149 | SendCmd( tx); |
schnf30 | 0:352efe1d072f | 150 | SendCmd( ty); |
schnf30 | 0:352efe1d072f | 151 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 152 | } |
schnf30 | 0:352efe1d072f | 153 | |
schnf30 | 0:352efe1d072f | 154 | ft_void_t FT800::Stop() |
schnf30 | 0:352efe1d072f | 155 | { |
schnf30 | 0:352efe1d072f | 156 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 157 | SendCmd( CMD_STOP); |
schnf30 | 0:352efe1d072f | 158 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 159 | } |
schnf30 | 0:352efe1d072f | 160 | |
schnf30 | 0:352efe1d072f | 161 | 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) |
schnf30 | 0:352efe1d072f | 162 | { |
schnf30 | 0:352efe1d072f | 163 | StartFunc( FT_CMD_SIZE*5); |
schnf30 | 0:352efe1d072f | 164 | SendCmd( CMD_SLIDER); |
schnf30 | 0:352efe1d072f | 165 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 166 | SendCmd( (((ft_uint32_t)h<<16)|w)); |
schnf30 | 0:352efe1d072f | 167 | SendCmd( (((ft_uint32_t)val<<16)|options)); |
schnf30 | 0:352efe1d072f | 168 | SendCmd( range); |
schnf30 | 0:352efe1d072f | 169 | EndFunc( (FT_CMD_SIZE*5)); |
schnf30 | 0:352efe1d072f | 170 | } |
schnf30 | 0:352efe1d072f | 171 | |
schnf30 | 0:352efe1d072f | 172 | 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) |
schnf30 | 0:352efe1d072f | 173 | { |
schnf30 | 0:352efe1d072f | 174 | StartFunc( FT_CMD_SIZE*6*2+FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 175 | SendCmd( CMD_TOUCH_TRANSFORM); |
schnf30 | 0:352efe1d072f | 176 | SendCmd( x0); |
schnf30 | 0:352efe1d072f | 177 | SendCmd( y0); |
schnf30 | 0:352efe1d072f | 178 | SendCmd( x1); |
schnf30 | 0:352efe1d072f | 179 | SendCmd( y1); |
schnf30 | 0:352efe1d072f | 180 | SendCmd( x2); |
schnf30 | 0:352efe1d072f | 181 | SendCmd( y2); |
schnf30 | 0:352efe1d072f | 182 | SendCmd( tx0); |
schnf30 | 0:352efe1d072f | 183 | SendCmd( ty0); |
schnf30 | 0:352efe1d072f | 184 | SendCmd( tx1); |
schnf30 | 0:352efe1d072f | 185 | SendCmd( ty1); |
schnf30 | 0:352efe1d072f | 186 | SendCmd( tx2); |
schnf30 | 0:352efe1d072f | 187 | SendCmd( ty2); |
schnf30 | 0:352efe1d072f | 188 | SendCmd( result); |
schnf30 | 0:352efe1d072f | 189 | EndFunc( (FT_CMD_SIZE*6*2+FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 190 | } |
schnf30 | 0:352efe1d072f | 191 | |
schnf30 | 0:352efe1d072f | 192 | ft_void_t FT800::Interrupt( ft_uint32_t ms) |
schnf30 | 0:352efe1d072f | 193 | { |
schnf30 | 0:352efe1d072f | 194 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 195 | SendCmd( CMD_INTERRUPT); |
schnf30 | 0:352efe1d072f | 196 | SendCmd( ms); |
schnf30 | 0:352efe1d072f | 197 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 198 | } |
schnf30 | 0:352efe1d072f | 199 | |
schnf30 | 0:352efe1d072f | 200 | ft_void_t FT800::FgColor( ft_uint32_t c) |
schnf30 | 0:352efe1d072f | 201 | { |
schnf30 | 0:352efe1d072f | 202 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 203 | SendCmd( CMD_FGCOLOR); |
schnf30 | 0:352efe1d072f | 204 | SendCmd( c); |
schnf30 | 0:352efe1d072f | 205 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 206 | } |
schnf30 | 0:352efe1d072f | 207 | |
schnf30 | 0:352efe1d072f | 208 | ft_void_t FT800::luminosite( ft_int32_t lum) |
schnf30 | 0:352efe1d072f | 209 | { |
schnf30 | 0:352efe1d072f | 210 | DLstart(); // wait until after the swap |
schnf30 | 0:352efe1d072f | 211 | MemWrite(REG_PWM_DUTY, 4); // write to the PWM_DUTY register |
schnf30 | 0:352efe1d072f | 212 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 213 | SendCmd(lum); |
schnf30 | 0:352efe1d072f | 214 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 215 | Flush_Co_Buffer(); // Download the command list into fifo |
schnf30 | 0:352efe1d072f | 216 | WaitCmdfifo_empty(); |
schnf30 | 0:352efe1d072f | 217 | } |
schnf30 | 0:352efe1d072f | 218 | |
schnf30 | 0:352efe1d072f | 219 | ft_void_t FT800::Rotate( ft_int32_t a) |
schnf30 | 0:352efe1d072f | 220 | { |
schnf30 | 0:352efe1d072f | 221 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 222 | SendCmd( CMD_ROTATE); |
schnf30 | 0:352efe1d072f | 223 | SendCmd( a); |
schnf30 | 0:352efe1d072f | 224 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 225 | } |
schnf30 | 0:352efe1d072f | 226 | |
schnf30 | 0:352efe1d072f | 227 | 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) |
schnf30 | 0:352efe1d072f | 228 | { |
schnf30 | 0:352efe1d072f | 229 | StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1); |
schnf30 | 0:352efe1d072f | 230 | SendCmd( CMD_BUTTON); |
schnf30 | 0:352efe1d072f | 231 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 232 | SendCmd( (((ft_uint32_t)h<<16)|w)); |
schnf30 | 0:352efe1d072f | 233 | SendCmd( (((ft_uint32_t)y<<16)|font)); |
schnf30 | 0:352efe1d072f | 234 | SendStr( s); |
schnf30 | 0:352efe1d072f | 235 | EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1)); |
schnf30 | 0:352efe1d072f | 236 | } |
schnf30 | 0:352efe1d072f | 237 | |
schnf30 | 0:352efe1d072f | 238 | |
schnf30 | 0:352efe1d072f | 239 | |
schnf30 | 0:352efe1d072f | 240 | ft_void_t FT800::MemWrite( ft_uint32_t ptr, ft_uint32_t num) |
schnf30 | 0:352efe1d072f | 241 | { |
schnf30 | 0:352efe1d072f | 242 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 243 | SendCmd( CMD_MEMWRITE); |
schnf30 | 0:352efe1d072f | 244 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 245 | SendCmd( num); |
schnf30 | 0:352efe1d072f | 246 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 247 | } |
schnf30 | 0:352efe1d072f | 248 | |
schnf30 | 0:352efe1d072f | 249 | |
schnf30 | 0:352efe1d072f | 250 | |
schnf30 | 0:352efe1d072f | 251 | 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) |
schnf30 | 0:352efe1d072f | 252 | { |
schnf30 | 0:352efe1d072f | 253 | StartFunc( FT_CMD_SIZE*5); |
schnf30 | 0:352efe1d072f | 254 | SendCmd( CMD_SCROLLBAR); |
schnf30 | 0:352efe1d072f | 255 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 256 | SendCmd( (((ft_uint32_t)h<<16)|w)); |
schnf30 | 0:352efe1d072f | 257 | SendCmd( (((ft_uint32_t)val<<16)|options)); |
schnf30 | 0:352efe1d072f | 258 | SendCmd( (((ft_uint32_t)range<<16)|size)); |
schnf30 | 0:352efe1d072f | 259 | EndFunc( (FT_CMD_SIZE*5)); |
schnf30 | 0:352efe1d072f | 260 | } |
schnf30 | 0:352efe1d072f | 261 | |
schnf30 | 0:352efe1d072f | 262 | 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) |
schnf30 | 0:352efe1d072f | 263 | { |
schnf30 | 0:352efe1d072f | 264 | StartFunc( FT_CMD_SIZE*7); |
schnf30 | 0:352efe1d072f | 265 | SendCmd( CMD_GETMATRIX); |
schnf30 | 0:352efe1d072f | 266 | SendCmd( a); |
schnf30 | 0:352efe1d072f | 267 | SendCmd( b); |
schnf30 | 0:352efe1d072f | 268 | SendCmd( c); |
schnf30 | 0:352efe1d072f | 269 | SendCmd( d); |
schnf30 | 0:352efe1d072f | 270 | SendCmd( e); |
schnf30 | 0:352efe1d072f | 271 | SendCmd( f); |
schnf30 | 0:352efe1d072f | 272 | EndFunc( (FT_CMD_SIZE*7)); |
schnf30 | 0:352efe1d072f | 273 | } |
schnf30 | 0:352efe1d072f | 274 | |
schnf30 | 0:352efe1d072f | 275 | 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) |
schnf30 | 0:352efe1d072f | 276 | { |
schnf30 | 0:352efe1d072f | 277 | StartFunc( FT_CMD_SIZE*5); |
schnf30 | 0:352efe1d072f | 278 | SendCmd( CMD_SKETCH); |
schnf30 | 0:352efe1d072f | 279 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 280 | SendCmd( (((ft_uint32_t)h<<16)|w)); |
schnf30 | 0:352efe1d072f | 281 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 282 | SendCmd( format); |
schnf30 | 0:352efe1d072f | 283 | EndFunc( (FT_CMD_SIZE*5)); |
schnf30 | 0:352efe1d072f | 284 | } |
schnf30 | 0:352efe1d072f | 285 | ft_void_t FT800::MemSet( ft_uint32_t ptr, ft_uint32_t value, ft_uint32_t num) |
schnf30 | 0:352efe1d072f | 286 | { |
schnf30 | 0:352efe1d072f | 287 | StartFunc( FT_CMD_SIZE*4); |
schnf30 | 0:352efe1d072f | 288 | SendCmd( CMD_MEMSET); |
schnf30 | 0:352efe1d072f | 289 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 290 | SendCmd( value); |
schnf30 | 0:352efe1d072f | 291 | SendCmd( num); |
schnf30 | 0:352efe1d072f | 292 | EndFunc( (FT_CMD_SIZE*4)); |
schnf30 | 0:352efe1d072f | 293 | } |
schnf30 | 0:352efe1d072f | 294 | ft_void_t FT800::GradColor( ft_uint32_t c) |
schnf30 | 0:352efe1d072f | 295 | { |
schnf30 | 0:352efe1d072f | 296 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 297 | SendCmd( CMD_GRADCOLOR); |
schnf30 | 0:352efe1d072f | 298 | SendCmd( c); |
schnf30 | 0:352efe1d072f | 299 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 300 | } |
schnf30 | 0:352efe1d072f | 301 | 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) |
schnf30 | 0:352efe1d072f | 302 | { |
schnf30 | 0:352efe1d072f | 303 | StartFunc( FT_CMD_SIZE*6*2+FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 304 | SendCmd( CMD_BITMAP_TRANSFORM); |
schnf30 | 0:352efe1d072f | 305 | SendCmd( x0); |
schnf30 | 0:352efe1d072f | 306 | SendCmd( y0); |
schnf30 | 0:352efe1d072f | 307 | SendCmd( x1); |
schnf30 | 0:352efe1d072f | 308 | SendCmd( y1); |
schnf30 | 0:352efe1d072f | 309 | SendCmd( x2); |
schnf30 | 0:352efe1d072f | 310 | SendCmd( y2); |
schnf30 | 0:352efe1d072f | 311 | SendCmd( tx0); |
schnf30 | 0:352efe1d072f | 312 | SendCmd( ty0); |
schnf30 | 0:352efe1d072f | 313 | SendCmd( tx1); |
schnf30 | 0:352efe1d072f | 314 | SendCmd( ty1); |
schnf30 | 0:352efe1d072f | 315 | SendCmd( tx2); |
schnf30 | 0:352efe1d072f | 316 | SendCmd( ty2); |
schnf30 | 0:352efe1d072f | 317 | SendCmd( result); |
schnf30 | 0:352efe1d072f | 318 | EndFunc( (FT_CMD_SIZE*6*2+FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 319 | } |
schnf30 | 0:352efe1d072f | 320 | ft_void_t FT800::Calibrate( ft_uint32_t result) |
schnf30 | 0:352efe1d072f | 321 | { |
schnf30 | 0:352efe1d072f | 322 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 323 | SendCmd( CMD_CALIBRATE); |
schnf30 | 0:352efe1d072f | 324 | SendCmd( result); |
schnf30 | 0:352efe1d072f | 325 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 326 | WaitCmdfifo_empty( ); |
schnf30 | 0:352efe1d072f | 327 | |
schnf30 | 0:352efe1d072f | 328 | } |
schnf30 | 0:352efe1d072f | 329 | ft_void_t FT800::SetFont( ft_uint32_t font, ft_uint32_t ptr) |
schnf30 | 0:352efe1d072f | 330 | { |
schnf30 | 0:352efe1d072f | 331 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 332 | SendCmd( CMD_SETFONT); |
schnf30 | 0:352efe1d072f | 333 | SendCmd( font); |
schnf30 | 0:352efe1d072f | 334 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 335 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 336 | } |
schnf30 | 0:352efe1d072f | 337 | ft_void_t FT800::Logo( ) |
schnf30 | 0:352efe1d072f | 338 | { |
schnf30 | 0:352efe1d072f | 339 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 340 | SendCmd( CMD_LOGO); |
schnf30 | 0:352efe1d072f | 341 | EndFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 342 | } |
schnf30 | 0:352efe1d072f | 343 | ft_void_t FT800::Append( ft_uint32_t ptr, ft_uint32_t num) |
schnf30 | 0:352efe1d072f | 344 | { |
schnf30 | 0:352efe1d072f | 345 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 346 | SendCmd( CMD_APPEND); |
schnf30 | 0:352efe1d072f | 347 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 348 | SendCmd( num); |
schnf30 | 0:352efe1d072f | 349 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 350 | } |
schnf30 | 0:352efe1d072f | 351 | ft_void_t FT800::MemZero( ft_uint32_t ptr, ft_uint32_t num) |
schnf30 | 0:352efe1d072f | 352 | { |
schnf30 | 0:352efe1d072f | 353 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 354 | SendCmd( CMD_MEMZERO); |
schnf30 | 0:352efe1d072f | 355 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 356 | SendCmd( num); |
schnf30 | 0:352efe1d072f | 357 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 358 | } |
schnf30 | 0:352efe1d072f | 359 | ft_void_t FT800::Scale( ft_int32_t sx, ft_int32_t sy) |
schnf30 | 0:352efe1d072f | 360 | { |
schnf30 | 0:352efe1d072f | 361 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 362 | SendCmd( CMD_SCALE); |
schnf30 | 0:352efe1d072f | 363 | SendCmd( sx); |
schnf30 | 0:352efe1d072f | 364 | SendCmd( sy); |
schnf30 | 0:352efe1d072f | 365 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 366 | } |
schnf30 | 0:352efe1d072f | 367 | 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) |
schnf30 | 0:352efe1d072f | 368 | { |
schnf30 | 0:352efe1d072f | 369 | StartFunc( FT_CMD_SIZE*5); |
schnf30 | 0:352efe1d072f | 370 | SendCmd( CMD_CLOCK); |
schnf30 | 0:352efe1d072f | 371 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 372 | SendCmd( (((ft_uint32_t)options<<16)|r)); |
schnf30 | 0:352efe1d072f | 373 | SendCmd( (((ft_uint32_t)m<<16)|h)); |
schnf30 | 0:352efe1d072f | 374 | SendCmd( (((ft_uint32_t)ms<<16)|s)); |
schnf30 | 0:352efe1d072f | 375 | EndFunc( (FT_CMD_SIZE*5)); |
schnf30 | 0:352efe1d072f | 376 | } |
schnf30 | 0:352efe1d072f | 377 | |
schnf30 | 0:352efe1d072f | 378 | 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) |
schnf30 | 0:352efe1d072f | 379 | { |
schnf30 | 0:352efe1d072f | 380 | StartFunc( FT_CMD_SIZE*5); |
schnf30 | 0:352efe1d072f | 381 | SendCmd( CMD_GRADIENT); |
schnf30 | 0:352efe1d072f | 382 | SendCmd( (((ft_uint32_t)y0<<16)|(x0 & 0xffff))); |
schnf30 | 0:352efe1d072f | 383 | SendCmd( rgb0); |
schnf30 | 0:352efe1d072f | 384 | SendCmd( (((ft_uint32_t)y1<<16)|(x1 & 0xffff))); |
schnf30 | 0:352efe1d072f | 385 | SendCmd( rgb1); |
schnf30 | 0:352efe1d072f | 386 | EndFunc( (FT_CMD_SIZE*5)); |
schnf30 | 0:352efe1d072f | 387 | } |
schnf30 | 0:352efe1d072f | 388 | |
schnf30 | 0:352efe1d072f | 389 | ft_void_t FT800::SetMatrix( ) |
schnf30 | 0:352efe1d072f | 390 | { |
schnf30 | 0:352efe1d072f | 391 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 392 | SendCmd( CMD_SETMATRIX); |
schnf30 | 0:352efe1d072f | 393 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 394 | } |
schnf30 | 0:352efe1d072f | 395 | |
schnf30 | 0:352efe1d072f | 396 | 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) |
schnf30 | 0:352efe1d072f | 397 | { |
schnf30 | 0:352efe1d072f | 398 | StartFunc( FT_CMD_SIZE*4); |
schnf30 | 0:352efe1d072f | 399 | SendCmd( CMD_TRACK); |
schnf30 | 0:352efe1d072f | 400 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 401 | SendCmd( (((ft_uint32_t)h<<16)|w)); |
schnf30 | 0:352efe1d072f | 402 | SendCmd( tag); |
schnf30 | 0:352efe1d072f | 403 | EndFunc( (FT_CMD_SIZE*4)); |
schnf30 | 0:352efe1d072f | 404 | } |
schnf30 | 0:352efe1d072f | 405 | |
schnf30 | 0:352efe1d072f | 406 | ft_void_t FT800::GetPtr( ft_uint32_t result) |
schnf30 | 0:352efe1d072f | 407 | { |
schnf30 | 0:352efe1d072f | 408 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 409 | SendCmd( CMD_GETPTR); |
schnf30 | 0:352efe1d072f | 410 | SendCmd( result); |
schnf30 | 0:352efe1d072f | 411 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 412 | } |
schnf30 | 0:352efe1d072f | 413 | |
schnf30 | 0:352efe1d072f | 414 | 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) |
schnf30 | 0:352efe1d072f | 415 | { |
schnf30 | 0:352efe1d072f | 416 | StartFunc( FT_CMD_SIZE*5); |
schnf30 | 0:352efe1d072f | 417 | SendCmd( CMD_PROGRESS); |
schnf30 | 0:352efe1d072f | 418 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 419 | SendCmd( (((ft_uint32_t)h<<16)|w)); |
schnf30 | 0:352efe1d072f | 420 | SendCmd( (((ft_uint32_t)val<<16)|options)); |
schnf30 | 0:352efe1d072f | 421 | SendCmd( range); |
schnf30 | 0:352efe1d072f | 422 | EndFunc( (FT_CMD_SIZE*5)); |
schnf30 | 0:352efe1d072f | 423 | } |
schnf30 | 0:352efe1d072f | 424 | |
schnf30 | 0:352efe1d072f | 425 | ft_void_t FT800::ColdStart( ) |
schnf30 | 0:352efe1d072f | 426 | { |
schnf30 | 0:352efe1d072f | 427 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 428 | SendCmd( CMD_COLDSTART); |
schnf30 | 0:352efe1d072f | 429 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 430 | } |
schnf30 | 0:352efe1d072f | 431 | |
schnf30 | 0:352efe1d072f | 432 | 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) |
schnf30 | 0:352efe1d072f | 433 | { |
schnf30 | 0:352efe1d072f | 434 | StartFunc( FT_CMD_SIZE*4 + strlen(s) + 1); |
schnf30 | 0:352efe1d072f | 435 | SendCmd( CMD_KEYS); |
schnf30 | 0:352efe1d072f | 436 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 437 | SendCmd( (((ft_uint32_t)h<<16)|w)); |
schnf30 | 0:352efe1d072f | 438 | SendCmd( (((ft_uint32_t)options<<16)|font)); |
schnf30 | 0:352efe1d072f | 439 | SendStr( s); |
schnf30 | 0:352efe1d072f | 440 | EndFunc( (FT_CMD_SIZE*4 + strlen(s) + 1)); |
schnf30 | 0:352efe1d072f | 441 | } |
schnf30 | 0:352efe1d072f | 442 | |
schnf30 | 0:352efe1d072f | 443 | 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) |
schnf30 | 0:352efe1d072f | 444 | { |
schnf30 | 0:352efe1d072f | 445 | StartFunc( FT_CMD_SIZE*4); |
schnf30 | 0:352efe1d072f | 446 | SendCmd( CMD_DIAL); |
schnf30 | 0:352efe1d072f | 447 | SendCmd( (((ft_uint32_t)y<<16)|(x & 0xffff))); |
schnf30 | 0:352efe1d072f | 448 | SendCmd( (((ft_uint32_t)options<<16)|r)); |
schnf30 | 0:352efe1d072f | 449 | SendCmd( val); |
schnf30 | 0:352efe1d072f | 450 | EndFunc( (FT_CMD_SIZE*4)); |
schnf30 | 0:352efe1d072f | 451 | } |
schnf30 | 0:352efe1d072f | 452 | |
schnf30 | 0:352efe1d072f | 453 | ft_void_t FT800::LoadImage( ft_uint32_t ptr, ft_uint32_t options) |
schnf30 | 0:352efe1d072f | 454 | { |
schnf30 | 0:352efe1d072f | 455 | StartFunc( FT_CMD_SIZE*3); |
schnf30 | 0:352efe1d072f | 456 | SendCmd( CMD_LOADIMAGE); |
schnf30 | 0:352efe1d072f | 457 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 458 | SendCmd( options); |
schnf30 | 0:352efe1d072f | 459 | EndFunc( (FT_CMD_SIZE*3)); |
schnf30 | 0:352efe1d072f | 460 | } |
schnf30 | 0:352efe1d072f | 461 | |
schnf30 | 0:352efe1d072f | 462 | ft_void_t FT800::DLstart( ) |
schnf30 | 0:352efe1d072f | 463 | { |
schnf30 | 0:352efe1d072f | 464 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 465 | SendCmd( CMD_DLSTART); |
schnf30 | 0:352efe1d072f | 466 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 467 | } |
schnf30 | 0:352efe1d072f | 468 | |
schnf30 | 0:352efe1d072f | 469 | ft_void_t FT800::Snapshot( ft_uint32_t ptr) |
schnf30 | 0:352efe1d072f | 470 | { |
schnf30 | 0:352efe1d072f | 471 | StartFunc( FT_CMD_SIZE*2); |
schnf30 | 0:352efe1d072f | 472 | SendCmd( CMD_SNAPSHOT); |
schnf30 | 0:352efe1d072f | 473 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 474 | EndFunc( (FT_CMD_SIZE*2)); |
schnf30 | 0:352efe1d072f | 475 | } |
schnf30 | 0:352efe1d072f | 476 | |
schnf30 | 0:352efe1d072f | 477 | ft_void_t FT800::ScreenSaver( ) |
schnf30 | 0:352efe1d072f | 478 | { |
schnf30 | 0:352efe1d072f | 479 | StartFunc( FT_CMD_SIZE*1); |
schnf30 | 0:352efe1d072f | 480 | SendCmd( CMD_SCREENSAVER); |
schnf30 | 0:352efe1d072f | 481 | EndFunc( (FT_CMD_SIZE*1)); |
schnf30 | 0:352efe1d072f | 482 | } |
schnf30 | 0:352efe1d072f | 483 | |
schnf30 | 0:352efe1d072f | 484 | ft_void_t FT800::MemCrc( ft_uint32_t ptr, ft_uint32_t num, ft_uint32_t result) |
schnf30 | 0:352efe1d072f | 485 | { |
schnf30 | 0:352efe1d072f | 486 | StartFunc( FT_CMD_SIZE*4); |
schnf30 | 0:352efe1d072f | 487 | SendCmd( CMD_MEMCRC); |
schnf30 | 0:352efe1d072f | 488 | SendCmd( ptr); |
schnf30 | 0:352efe1d072f | 489 | SendCmd( num); |
schnf30 | 0:352efe1d072f | 490 | SendCmd( result); |
schnf30 | 0:352efe1d072f | 491 | EndFunc( (FT_CMD_SIZE*4)); |
schnf30 | 0:352efe1d072f | 492 | } |
schnf30 | 0:352efe1d072f | 493 | |
schnf30 | 0:352efe1d072f | 494 | |
schnf30 | 0:352efe1d072f | 495 | ft_void_t FT800::DL(ft_uint32_t cmd) |
schnf30 | 0:352efe1d072f | 496 | { |
schnf30 | 0:352efe1d072f | 497 | WrCmd32(cmd); |
schnf30 | 0:352efe1d072f | 498 | /* Increment the command index */ |
schnf30 | 0:352efe1d072f | 499 | CmdBuffer_Index += FT_CMD_SIZE; |
schnf30 | 0:352efe1d072f | 500 | } |
schnf30 | 0:352efe1d072f | 501 | |
schnf30 | 0:352efe1d072f | 502 | ft_void_t FT800::WrDlCmd_Buffer(ft_uint32_t cmd) |
schnf30 | 0:352efe1d072f | 503 | { |
schnf30 | 0:352efe1d072f | 504 | Wr32((RAM_DL+DlBuffer_Index),cmd); |
schnf30 | 0:352efe1d072f | 505 | /* Increment the command index */ |
schnf30 | 0:352efe1d072f | 506 | DlBuffer_Index += FT_CMD_SIZE; |
schnf30 | 0:352efe1d072f | 507 | } |
schnf30 | 0:352efe1d072f | 508 | |
schnf30 | 0:352efe1d072f | 509 | ft_void_t FT800::Flush_DL_Buffer() |
schnf30 | 0:352efe1d072f | 510 | { |
schnf30 | 0:352efe1d072f | 511 | DlBuffer_Index = 0; |
schnf30 | 0:352efe1d072f | 512 | |
schnf30 | 0:352efe1d072f | 513 | } |
schnf30 | 0:352efe1d072f | 514 | |
schnf30 | 0:352efe1d072f | 515 | ft_void_t FT800::Flush_Co_Buffer() |
schnf30 | 0:352efe1d072f | 516 | { |
schnf30 | 0:352efe1d072f | 517 | CmdBuffer_Index = 0; |
schnf30 | 0:352efe1d072f | 518 | } |
schnf30 | 0:352efe1d072f | 519 | |
schnf30 | 0:352efe1d072f | 520 | |
schnf30 | 0:352efe1d072f | 521 | /* API to check the status of previous DLSWAP and perform DLSWAP of new DL */ |
schnf30 | 0:352efe1d072f | 522 | /* Check for the status of previous DLSWAP and if still not done wait for few ms and check again */ |
schnf30 | 0:352efe1d072f | 523 | ft_void_t FT800::DLSwap(ft_uint8_t DL_Swap_Type) |
schnf30 | 0:352efe1d072f | 524 | { |
schnf30 | 0:352efe1d072f | 525 | ft_uint8_t Swap_Type = DLSWAP_FRAME,Swap_Done = DLSWAP_FRAME; |
schnf30 | 0:352efe1d072f | 526 | |
schnf30 | 0:352efe1d072f | 527 | if(DL_Swap_Type == DLSWAP_LINE) |
schnf30 | 0:352efe1d072f | 528 | { |
schnf30 | 0:352efe1d072f | 529 | Swap_Type = DLSWAP_LINE; |
schnf30 | 0:352efe1d072f | 530 | } |
schnf30 | 0:352efe1d072f | 531 | |
schnf30 | 0:352efe1d072f | 532 | /* Perform a new DL swap */ |
schnf30 | 0:352efe1d072f | 533 | Wr8(REG_DLSWAP,Swap_Type); |
schnf30 | 0:352efe1d072f | 534 | |
schnf30 | 0:352efe1d072f | 535 | /* Wait till the swap is done */ |
schnf30 | 0:352efe1d072f | 536 | while(Swap_Done) |
schnf30 | 0:352efe1d072f | 537 | { |
schnf30 | 0:352efe1d072f | 538 | Swap_Done = Rd8(REG_DLSWAP); |
schnf30 | 0:352efe1d072f | 539 | |
schnf30 | 0:352efe1d072f | 540 | if(DLSWAP_DONE != Swap_Done) |
schnf30 | 0:352efe1d072f | 541 | { |
schnf30 | 0:352efe1d072f | 542 | Sleep(10);//wait for 10ms |
schnf30 | 0:352efe1d072f | 543 | } |
schnf30 | 0:352efe1d072f | 544 | } |
schnf30 | 0:352efe1d072f | 545 | } |
schnf30 | 0:352efe1d072f | 546 | |
schnf30 | 0:352efe1d072f | 547 | |
schnf30 | 0:352efe1d072f | 548 | |
schnf30 | 0:352efe1d072f | 549 | /* Nothing beyond this */ |
schnf30 | 0:352efe1d072f | 550 | |
schnf30 | 0:352efe1d072f | 551 | |
schnf30 | 0:352efe1d072f | 552 | |
schnf30 | 0:352efe1d072f | 553 | |
schnf30 | 0:352efe1d072f | 554 |