Designer Reference Manual
USB08 Evaluation Board
112
Source Code Files
MOTOROLA
Source Code Files
// USB Interrupt Handler
// All Interrupt Sources of the JB8’s integrated USB peripheral
// will be treated by this ISR
//
@interrupt void isrUSB() {
if(UIR1 & BM_EOPF) {
// End of Packet detected?
SuspendCounter = 0;
// reset 3ms-Suspend Counter
UIR2 = BM_EOPFR;
// reset EOP Intr Flag
}
else if(UIR1 & BM_RXD0F) {
// has EP0 received some data?
if(USR0 & BM_SETUP)
// was it a SETUP Packet?
handleSETUP();
else
// or a normal OUT Packet
handleOUT();
}
else if(UIR1 & BM_TXD0F) {
// has EP0 sent Data?
handleIN();
}
else if(UIR1 & BM_TXD1F) {
// has EP1 sent Data?
handleIN1();
}
else if(UIR1 & BM_RXD2F) {
// has EP2 received Data?
handleOUT2();
}
else if(UIR1 & BM_RSTF) {
// USB Reset Signal State detected?
initUSB();
// Soft Reset of USB Systems
UCR3 |= BM_BM_ENABLE2;
// Enable EP1 and EP2
UIR0 = BM_ BM_
// EP0 Rx/Tx Intr Enable and
BM_ BM_
// EP1 Tx and EP2 Rx Intr Enable
BM_EOPIE;
// and End-of-Packet Intr Enable
UCR0 |= BM_RX0E;
// EP0 Receive Enable
USB_State = US_DEFAULT;
// Device is powered and reset
}
}
//============================================================================
Содержание 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 ...