Gecko3 - CCC Event Weblog
Gecko3 - CCC Event Weblog
Gecko3 - CCC Event Weblog
Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.
YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.
E.1. Firmware<br />
i f (SETUPDAT[ 2 ] == 0)<br />
{<br />
321 ∗(BYTE xdata ∗) epcs (SETUPDAT[ 4 ] ) &= ˜bmEPSTALL;<br />
EZUSB RESET DATA TOGGLE( SETUPDAT[ 4 ] ) ;<br />
}<br />
else<br />
EZUSB STALL EP0 ( ) ; // S t a l l End Point 0<br />
326 break ;<br />
}<br />
break ;<br />
case SC SET FEATURE : // ∗∗∗ Set Feature<br />
i f ( DR SetFeature ( ) )<br />
331 switch (SETUPDAT[ 0 ] )<br />
{<br />
case FT DEVICE : // Device<br />
i f (SETUPDAT[ 2 ] == 1)<br />
Rwuen = TRUE; // Enable Remote Wakeup<br />
336 else i f (SETUPDAT[ 2 ] == 2)<br />
// Set Feature Test Mode . The core h andles t h i s r e q u e s t .<br />
However , i t i s<br />
// n e c e s s a r y f o r t h e firmware to complete t h e handshake phase o f<br />
t h e<br />
// c o n t r o l t r a n s f e r b e f o r e t h e c hip w i l l e n t e r t e s t mode . I t i s<br />
a l s o<br />
// n e c e s s a r y f o r FX2 to be p h y s i c a l l y d i s c o n n e c t e d (D+ and D−)<br />
341 // from t h e h o s t b e f o r e i t w i l l e n t e r t e s t mode .<br />
break ;<br />
else<br />
EZUSB STALL EP0 ( ) ; // S t a l l End Point 0<br />
break ;<br />
346 case FT ENDPOINT: // End Point<br />
∗(BYTE xdata ∗) epcs (SETUPDAT[ 4 ] ) |= bmEPSTALL;<br />
break ;<br />
}<br />
break ;<br />
351 default : // ∗∗∗ I n v a l i d Command<br />
i f (DR VendorCmnd ( ) )<br />
EZUSB STALL EP0 ( ) ; // S t a l l End Point 0<br />
}<br />
356 // Acknowledge handshake phase o f d e v i c e r e q u e s t<br />
EP0CS |= bmHSNAK;<br />
}<br />
// Wake−up i n t e r r u p t handler<br />
361 void r e s u m e i s r ( void ) i n t e r r u p t WKUP VECT<br />
{<br />
EZUSB CLEAR RSMIRQ( ) ;<br />
}<br />
E.1.2. Firmware<br />
1 #pragma NOIV // Do not g e n e r a t e i n t e r r u p t v e c t o r s<br />
/∗ ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗<br />
∗ Diplomwork :<br />
∗ <strong>Gecko3</strong> SoC HW/SW Development Board<br />
∗<br />
6 ∗ ( ‘ \ ( ) ( ) ( )<br />
∗ | ( ) ) | ( | | | | Berne U n i v e r s i t y o f Applied S c i e n c e s<br />
∗ | < ’| ) | | School o f Engineering and<br />
∗ | ( ) ) | | | | | | Information Technology<br />
∗ ( / ’( ) ( ) ( )<br />
11 ∗<br />
∗<br />
Project Report 63