Place generic USB header and source files into the documentation tree.

This commit is contained in:
Ken Sarkies
2013-03-11 09:36:57 +10:30
parent 2288e35739
commit 1374d2622b
15 changed files with 571 additions and 0 deletions

View File

@@ -1,3 +1,18 @@
/** @defgroup usb_drivers_file Generic USB Drivers
@ingroup USB
@brief <b>Generic USB Drivers</b>
@version 1.0.0
@author @htmlonly &copy; @endhtmlonly 2010 Gareth McMullin <gareth@blacksphere.co.nz>
@date 10 March 2013
LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@@ -17,6 +32,8 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#include <string.h>
#include <libopencm3/usb/usbd.h>
#include "usb_private.h"
@@ -150,3 +167,6 @@ void usbd_ep_nak_set(usbd_device *usbd_dev, u8 addr, u8 nak)
{
usbd_dev->driver->ep_nak_set(usbd_dev, addr, nak);
}
/**@}*/

View File

@@ -1,3 +1,18 @@
/** @defgroup usb_control_file Generic USB Control Requests
@ingroup USB
@brief <b>Generic USB Control Requests</b>
@version 1.0.0
@author @htmlonly &copy; @endhtmlonly 2010 Gareth McMullin <gareth@blacksphere.co.nz>
@date 10 March 2013
LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@@ -17,6 +32,8 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#include <stdlib.h>
#include <libopencm3/usb/usbd.h>
#include "usb_private.h"
@@ -151,6 +168,9 @@ static void usb_control_setup_write(usbd_device *usbd_dev,
usbd_dev->control_state.state = LAST_DATA_OUT;
}
/* Do not appear to belong to the API, so are omitted from docs */
/**@}*/
void _usbd_control_setup(usbd_device *usbd_dev, u8 ea)
{
struct usb_setup_data *req = &usbd_dev->control_state.req;
@@ -241,3 +261,4 @@ void _usbd_control_in(usbd_device *usbd_dev, u8 ea)
usbd_ep_stall_set(usbd_dev, 0, 1);
}
}

View File

@@ -1,3 +1,18 @@
/** @defgroup usb_private_defines USB Private Structures
@brief <b>Defined Constants and Types for the USB Private Structures</b>
@ingroup USB_defines
@version 1.0.0
@author @htmlonly &copy; @endhtmlonly 2010 Gareth McMullin <gareth@blacksphere.co.nz>
@date 10 March 2013
LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@@ -17,6 +32,8 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#ifndef __USB_PRIVATE_H
#define __USB_PRIVATE_H
@@ -95,6 +112,9 @@ enum _usbd_transaction {
USB_TRANSACTION_SETUP,
};
/* Do not appear to belong to the API, so are omitted from docs */
/**@}*/
void _usbd_control_in(usbd_device *usbd_dev, u8 ea);
void _usbd_control_out(usbd_device *usbd_dev, u8 ea);
void _usbd_control_setup(usbd_device *usbd_dev, u8 ea);
@@ -135,3 +155,4 @@ struct _usbd_driver {
};
#endif

View File

@@ -1,3 +1,18 @@
/** @defgroup usb_standard_file Generic USB Standard Request Interface
@ingroup USB
@brief <b>Generic USB Standard Request Interface</b>
@version 1.0.0
@author @htmlonly &copy; @endhtmlonly 2010 Gareth McMullin <gareth@blacksphere.co.nz>
@date 10 March 2013
LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@@ -17,6 +32,8 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#include <string.h>
#include <libopencm3/usb/usbd.h>
#include "usb_private.h"
@@ -333,6 +350,9 @@ static int usb_standard_endpoint_unstall(usbd_device *usbd_dev,
return 1;
}
/* Do not appear to belong to the API, so are omitted from docs */
/**@}*/
int _usbd_standard_request_device(usbd_device *usbd_dev,
struct usb_setup_data *req, u8 **buf,
u16 *len)
@@ -466,3 +486,4 @@ int _usbd_standard_request(usbd_device *usbd_dev,
return 0;
}
}