Satellite Observers Workbench. NOT yet complete, just published for forum posters to \"cherry pick\" pieces of code as requiered as an example.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers usbeh_endpoint.h Source File

usbeh_endpoint.h

00001 /****************************************************************************
00002  *    Copyright 2010 Andy Kirkham, Stellar Technologies Ltd
00003  *    
00004  *    This file is part of the Satellite Observers Workbench (SOWB).
00005  *
00006  *    SOWB is free software: you can redistribute it and/or modify
00007  *    it under the terms of the GNU General Public License as published by
00008  *    the Free Software Foundation, either version 3 of the License, or
00009  *    (at your option) any later version.
00010  *
00011  *    SOWB is distributed in the hope that it will be useful,
00012  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *    GNU General Public License for more details.
00015  *
00016  *    You should have received a copy of the GNU General Public License
00017  *    along with SOWB.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  *    $Id: main.cpp 5 2010-07-12 20:51:11Z ajk $
00020  *    
00021  ***************************************************************************/
00022  
00023 #ifndef USBEH_ENDPOINT_H
00024 #define USBEH_ENDPOINT_H
00025 
00026 #ifndef USBEH_H
00027 #include "usbeh.h"
00028 #endif
00029 
00030 class USBEH_Endpoint {
00031 
00032     public:
00033     USBEH_HCED  endpointDescriptor;
00034     USBEH_HCTD  tdHead;
00035     
00036     // State definitions.
00037     enum state {
00038         free,               // 0
00039         notQueued,          // 1
00040         idle,               // 2
00041         setupQueued,        // 3
00042         dataQueued,         // 4
00043         statusQueued,       // 5
00044         callbackPending     // 6
00045     };
00046 
00047     // Local data.
00048     volatile USBEH_U08  currentState;
00049     USBEH_U08           flags;
00050     USBEH_U16           length;
00051     USBEH_U08           *data;
00052     USBEH_callback      callback;
00053     void                *userData;
00054     
00055     // Member functions.
00056     int address(void);
00057     int device(void);
00058     int status(void);
00059     USBEH_U32 queue(USBEH_U32);
00060 };
00061 
00062 // END #ifndef USBEH_ENDPOINT_H
00063 #endif