Motorola USB08 Reference Manual page 106

Universal serial bus evaluation board using the mc68hc908jb8
Table of Contents

Advertisement

Source Code Files
// SET_CONFIGURATION Standard Device Request Handler
// called by handleSETUP();
//
void setConfiguration() {
if( SetupBuffer.wIndex.hi ||
SetupBuffer.wIndex.lo ||
SetupBuffer.wLength.hi ||
SetupBuffer.wLength.lo ||
SetupBuffer.wValue.hi ||
(SetupBuffer.wValue.lo > 1) ||
(USB_State == US_DEFAULT)) {
forceSTALL();
}
else {
if(SetupBuffer.wValue.lo > 0) {
// no need to remember the Configuration Value
// since we support only one Configuration anyway
USB_State = US_CONFIGURED;
// Activate Interrupt Endpoints, reset STALL and DATA-Toggle
UCR1 = BM_TX1E + 0;
UCR2 = BM_RX2E;
}
else {
// Zero means: go back to Adressed State
USB_State = US_ADDRESSED;
UCR1 = 0;
UCR2 = 0;
}
// prepare to send empty DATA1 at next IN Transaction
UCR0 = BM_T0SEQ + BM_TX0E + 0;
}
}
//----------------------------------------------------------------------------
Designer Reference Manual
106
// EP1 Tx Enable, Data Size is 0
// EP2 Rx Enable
// deactivate EP1
// deactivate EP2
Source Code Files
USB08 Evaluation Board
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68hc908jb8

Table of Contents