U08Usb.c - Motorola USB08 Reference Manual

Universal serial bus evaluation board using the mc68hc908jb8
Table of Contents

Advertisement

Source Code Files

U08USB.C

//============================================================================
// File: U08USB.C
// Func: USB Implementation Module for USB08 Demo Application
// Ver.: 1.00
// Auth: (C)2000,2001 by Oliver Thamm, MCT Elektronikladen GbR
//
http://hc08web.de/usb08
// Rem.: View/Edit this File with TAB-Size=4
//============================================================================
//----------------------------------------------------------------------------
#include "u08usb.h"
#include "u08desc.c"
//----------------------------------------------------------------------------
// Source Code Option - set as required by Hardware!
//
#define USB_IPUE1
//-- Variables ---------------------------------------------------------------
volatile uchar USB_State;
#define MAX_TXBUF_SIZE 16
volatile uchar TxBuffer[MAX_TXBUF_SIZE];
volatile uchar TxBuf_RdIdx;
volatile uchar TxBuf_WrIdx;
#define MAX_RXBUF_SIZE 16
volatile uchar RxBuffer[MAX_RXBUF_SIZE];
volatile uchar RxBuf_RdIdx;
volatile uchar RxBuf_WrIdx;
volatile uchar SuspendCounter;
setup_buffer SetupBuffer;
uchar SetupSize;
uchar * SetupDataPtr;
uchar R0Sequence;
uchar R2Sequence;
//----------------------------------------------------------------------------
// Force STALL Condition for EP0 (both IN and OUT)
// as a Response to an invalid SETUP Request
// Flags will be auto-cleared by the next SETUP Token
//
void forceSTALL() {
UCR3 |= BM_OSTALL0 + BM_ISTALL0;
}
Designer Reference Manual
104
// Definitions for USB Data Types & Constants
// const USB Descriptor Data
// Internal Pull-up Enable
// 1=Enable(use build-in Pull-up Resistor)
// 0=Disable (external Pull-up required)
// must be 2^x!
// must be 2^x!
// DATA0/1 Flag for EP0 Rx
// DATA0/1 Flag for EP2 Rx
Source Code Files
USB08 Evaluation Board
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68hc908jb8

Table of Contents