Designer Reference Manual
USB08 Evaluation Board
108
Source Code Files
MOTOROLA
Source Code Files
void handleSETUP() {
UCR0 &= ~BM_RX0E;
// Deactivate EP0 Receiver
UIR2 = BM_RXD0FR;
// Reset EP0 Receive Flag
SetupBuffer = *(setup_buffer *)(&UE0D0);
if(USR0 != 0x48) {
// SETUP Transaction must be DATA0 with Size=8
forceSTALL();
// otherwise we have an Error Condition
}
else {
// now we will check the Request Type
if((SetupBuffer.bmRequestType & 0x60) != 0) {
forceSTALL();
// Non-Standard Requests will not be handled!
}
else {
// Standard Request Decoder:
switch(SetupBuffer.bRequest) {
case CLEAR_FEATURE:
// 1
clearFeature();
break;
case SET_ADDRESS:
// 5
setAddress();
break;
case GET_DESCRIPTOR:
// 6
getDescriptor();
break;
case SET_CONFIGURATION:
// 9
setConfiguration();
break;
default:
forceSTALL();
break;
}
}
}
UCR0 |= BM_RX0E;
// Activate EP0 Receiver
}
//----------------------------------------------------------------------------
void handleOUT() {
UCR0 &= ~(BM_TX0E);
// Deactivate EP0 Re Transmitter
UIR2 = BM_RXD0FR;
// Reset EP0 Receive Flag
// OUT Transactions over EP0 appear as Status Stage
// of a Standard Device Request only
UCR0 |= BM_RX0E;
// Activate EP0 Receiver
}
//----------------------------------------------------------------------------
Содержание MC68HC908JB8
Страница 2: ...blank ...
Страница 6: ...Designer Reference Manual USB08 Evaluation Board 6 List of Sections MOTOROLA List of Sections ...
Страница 16: ...Designer Reference Manual USB08 Evaluation Board 16 List of Tables MOTOROLA List of Tables ...
Страница 42: ...Designer Reference Manual USB08 Evaluation Board 42 Hardware Description MOTOROLA Hardware Description ...
Страница 88: ...Designer Reference Manual USB08 Evaluation Board 88 USB08 Descriptors MOTOROLA USB08 Descriptors ...
Страница 243: ...blank ...