XenevaOS
Loading...
Searching...
No Matches
usbendpoint.h
Go to the documentation of this file.
1//
2// usbendpoint.h
3//
4// USPi - An USB driver for Raspberry Pi written in C
5// Copyright (C) 2014 R. Stange <rsta2@o2online.de>
6//
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19//
20#ifndef _uspi_usbendpoint_h
21#define _uspi_usbendpoint_h
22
23#include "uspi/usb.h"
24#include "uspi/usbdevice.h"
25#include "uspi/types.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
39
51
52void USBEndpoint (TUSBEndpoint *pThis, TUSBDevice *pDevice); // control endpoint 0
53void USBEndpoint2 (TUSBEndpoint *pThis, TUSBDevice *pDevice, const TUSBEndpointDescriptor *pDesc);
54void USBEndpointCopy (TUSBEndpoint *pThis, TUSBEndpoint *pEndpoint, TUSBDevice *pDevice);
55void _USBEndpoint (TUSBEndpoint *pThis);
56
58
62
63void USBEndpointSetMaxPacketSize (TUSBEndpoint *pThis, u32 nMaxPacketSize);
65
66unsigned USBEndpointGetInterval (TUSBEndpoint *pThis); // Milliseconds
67
68TUSBPID USBEndpointGetNextPID (TUSBEndpoint *pThis, boolean bStatusStage);
69void USBEndpointSkipPID (TUSBEndpoint *pThis, unsigned nPackets, boolean bStatusStage);
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif
TUSBPID
Definition usb.h:27
uint8_t u8
Definition kernel.h:20
uint32_t u32
Definition kernel.h:22
Definition usbdevice.h:48
Definition usb.h:155
Definition usbendpoint.h:41
unsigned m_nInterval
Definition usbendpoint.h:47
TUSBDevice * m_pDevice
Definition usbendpoint.h:42
TUSBPID m_NextPID
Definition usbendpoint.h:48
u32 m_nMaxPacketSize
Definition usbendpoint.h:46
TEndpointType m_Type
Definition usbendpoint.h:44
boolean m_bDirectionIn
Definition usbendpoint.h:45
u8 m_ucNumber
Definition usbendpoint.h:43
unsigned USBEndpointGetInterval(TUSBEndpoint *pThis)
Definition usbendpoint.c:165
u32 USBEndpointGetMaxPacketSize(TUSBEndpoint *pThis)
Definition usbendpoint.c:159
void USBEndpointCopy(TUSBEndpoint *pThis, TUSBEndpoint *pEndpoint, TUSBDevice *pDevice)
Definition usbendpoint.c:105
boolean USBEndpointIsDirectionIn(TUSBEndpoint *pThis)
Definition usbendpoint.c:147
TEndpointType USBEndpointGetType(TUSBEndpoint *pThis)
Definition usbendpoint.c:141
void USBEndpointSetMaxPacketSize(TUSBEndpoint *pThis, u32 nMaxPacketSize)
Definition usbendpoint.c:153
void USBEndpointSkipPID(TUSBEndpoint *pThis, unsigned nPackets, boolean bStatusStage)
Definition usbendpoint.c:186
TUSBDevice * USBEndpointGetDevice(TUSBEndpoint *pThis)
Definition usbendpoint.c:128
u8 USBEndpointGetNumber(TUSBEndpoint *pThis)
Definition usbendpoint.c:135
void USBEndpoint2(TUSBEndpoint *pThis, TUSBDevice *pDevice, const TUSBEndpointDescriptor *pDesc)
Definition usbendpoint.c:37
TEndpointType
Definition usbendpoint.h:32
@ EndpointTypeControl
Definition usbendpoint.h:33
@ EndpointTypeIsochronous
Definition usbendpoint.h:36
@ EndpointTypeInterrupt
Definition usbendpoint.h:35
@ EndpointTypeBulk
Definition usbendpoint.h:34
TUSBPID USBEndpointGetNextPID(TUSBEndpoint *pThis, boolean bStatusStage)
Definition usbendpoint.c:173
void USBEndpointResetPID(TUSBEndpoint *pThis)
Definition usbendpoint.c:228
void USBEndpoint(TUSBEndpoint *pThis, TUSBDevice *pDevice)
Definition usbendpoint.c:23
void _USBEndpoint(TUSBEndpoint *pThis)
Definition usbendpoint.c:122