25.12.2013 Aufrufe

Gecko3 - CCC Event Weblog

Gecko3 - CCC Event Weblog

Gecko3 - CCC Event Weblog

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

E. Quellcode<br />

216<br />

221<br />

}<br />

return f a l s e ;<br />

bool QGecko : : admConfigure ( QFile &configData ) {<br />

i f ( geckoAdm != 0) {<br />

// send t h e vendor r e q u e s t to s t a r t t h e f p g a c o n f i g u r a t i o n<br />

int b = u s b c o n t r o l m s g ( geckoAdm , USB TYPE VENDOR, GECKO CONFIGURE FPGA, 0 , 0 ,<br />

”” , 0 , 1000) ;<br />

i f ( b>=0){<br />

// w r i t e s t h e b i t s t r e a m i n t o t h e f pga<br />

i f ( admWrite ( configData ) ) {<br />

char done [ 2 ] ;<br />

226 // checks i f t h e done s i g n a l from t h e f p g a i s a s s e r t e d<br />

int w = u s b c o n t r o l m s g ( geckoAdm , USB TYPE VENDOR | USB ENDPOINT DIR MASK,<br />

GECKO CONFIGURE DONE, 0 , 0 , done , 1 , 1000) ;<br />

i f (w>=0 && done [ 0 ] == char (GECKO CONFIGURE DONE) ) {<br />

return true ;<br />

231 }<br />

}<br />

}<br />

}<br />

return f a l s e ;<br />

236 }<br />

bool QGecko : : admDownload ( QFile &configData , int p l a c e ) {<br />

i f ( geckoAdm != 0) {<br />

// send t h e vendor r e q u e s t to s t a r t t h e download o f a b i t s t r e a m to t h e f l a s h ,<br />

i n c l u d i n g t h e d e s i r e d memory s l o t<br />

241 int b = u s b c o n t r o l m s g ( geckoAdm , USB TYPE VENDOR, GECKO SEND CONFIGURATION,<br />

place , 0 , ”” , 0 , 1000) ;<br />

i f ( b>=0){<br />

// w r i t e s t h e b i t s t r e a m i n t o t h e s p i f l a s h<br />

i f ( admWrite ( configData ) ) {<br />

// send t h e vendor r e q u e s t to s i g n a l i s e t h e end o f t h e b i t s t r e a m download<br />

246 int w = u s b c o n t r o l m s g ( geckoAdm , USB TYPE VENDOR, GECKO SEND END, 0 , 0 , ”” ,<br />

0 , 1000) ;<br />

i f (w>=0) {<br />

return true ;<br />

}<br />

}<br />

251 }<br />

}<br />

return f a l s e ;<br />

}<br />

256 bool QGecko : : admFirmware ( QFile &configData ) {<br />

i f ( geckoAdm != 0) {<br />

// send t h e vendor r e q u e s t to s t a r t t h e download o f a c y p r e s s firmware f i l e ( in<br />

t h e i i c format )<br />

int b = u s b c o n t r o l m s g ( geckoAdm , USB TYPE VENDOR, GECKO SEND FW, 0 , 0 , ”” , 0 ,<br />

1000) ;<br />

i f ( b>=0){<br />

261 // w r i t e s t h e b i t s t r e a m i n t o t h e eeprom<br />

i f ( admWrite ( configData ) ) {<br />

// send t h e vendor r e q u e s t to s i g n a l i s e t h e end o f t h e firmware download<br />

int w = u s b c o n t r o l m s g ( geckoAdm , USB TYPE VENDOR, GECKO SEND END, 0 , 0 , ”” ,<br />

0 , 1000) ;<br />

i f (w>=0) {<br />

266 return true ;<br />

}<br />

}<br />

}<br />

}<br />

271 return f a l s e ;<br />

108 Matthias Zurbrügg, Christoph Zimmermann

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!