Browse Source

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

pull/136/head
Ken Sarkies 12 years ago
parent
commit
1374d2622b
  1. 33
      doc/usb/Doxyfile
  2. 40
      doc/usb/Doxyfile_latex
  3. 199
      doc/usb/DoxygenLayout_usb.xml
  4. 61
      doc/usb/header_usb.tex
  5. 19
      include/libopencm3/stm32/f1/usb.h
  6. 20
      include/libopencm3/usb/cdc.h
  7. 20
      include/libopencm3/usb/dfu.h
  8. 32
      include/libopencm3/usb/doc-usb.h
  9. 20
      include/libopencm3/usb/hid.h
  10. 20
      include/libopencm3/usb/usbd.h
  11. 24
      include/libopencm3/usb/usbstd.h
  12. 20
      lib/usb/usb.c
  13. 21
      lib/usb/usb_control.c
  14. 21
      lib/usb/usb_private.h
  15. 21
      lib/usb/usb_standard.c

33
doc/usb/Doxyfile

@ -0,0 +1,33 @@
# HTML Documentation for USB code level
# 10 March 2013
# (C) Ken Sarkies <ksarkies@internode.on.net>
#---------------------------------------------------------------------------
# Common Include File
#---------------------------------------------------------------------------
@INCLUDE = ../Doxyfile_common
#---------------------------------------------------------------------------
# Local settings
#---------------------------------------------------------------------------
WARN_LOGFILE = doxygen_usb.log
INPUT = ../../include/libopencm3/license.dox \
../../include/libopencm3/usb
INPUT += ../../lib/usb
EXCLUDE_PATTERNS =
LAYOUT_FILE = DoxygenLayout_usb.xml
TAGFILES =
GENERATE_TAGFILE = usb.tag
ENABLE_PREPROCESSING = NO

40
doc/usb/Doxyfile_latex

@ -0,0 +1,40 @@
# LaTeX Documentation for USB code level
# 10 March 2013
# (C) Ken Sarkies <ksarkies@internode.on.net>
#---------------------------------------------------------------------------
# Common Include File
#---------------------------------------------------------------------------
@INCLUDE = ../Doxyfile_common
#---------------------------------------------------------------------------
# Local settings
#---------------------------------------------------------------------------
WARN_LOGFILE = doxygen_usb_latex.log
WARN_LOGFILE = doxygen_usb.log
INPUT = ../../include/libopencm3/license.dox \
../../include/libopencm3/usb
INPUT += ../../lib/usb
EXCLUDE_PATTERNS =
LAYOUT_FILE = DoxygenLayout_usb.xml
TAGFILES =
GENERATE_TAGFILE = usb.tag
ENABLE_PREPROCESSING = NO
GENERATE_HTML = NO
GENERATE_LATEX = YES
LATEX_HEADER = header_usb.tex

199
doc/usb/DoxygenLayout_usb.xml

@ -0,0 +1,199 @@
<doxygenlayout version="1.0">
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title="libopencm3"/>
<tab type="pages" visible="yes" title="General Information" intro=""/>
<tab type="user" visible="yes" url="../../html/index.html" title="Back to Top" intro=""/>
<tab type="user" visible="yes" url="../../cm3/html/modules.html" title="CM3 Core" intro=""/>
<tab type="modules" visible="yes" title="Generic USB" intro=""/>
<tab type="user" visible="yes" url="../../stm32f1/html/modules.html" title="STM32F1" intro=""/>
<tab type="user" visible="yes" url="../../stm32f2/html/modules.html" title="STM32F2" intro=""/>
<tab type="user" visible="yes" url="../../stm32f4/html/modules.html" title="STM32F4" intro=""/>
<tab type="user" visible="yes" url="../../stm32l1/html/modules.html" title="STM32L1" intro=""/>
<tab type="user" visible="yes" url="../../lm3s/html/modules.html" title="LM3S" intro=""/>
<tab type="user" visible="yes" url="../../lm4f/html/modules.html" title="LM4F" intro=""/>
<tab type="user" visible="yes" url="../../lpc13xx/html/modules.html" title="LPC13" intro=""/>
<tab type="user" visible="yes" url="../../lpc17xx/html/modules.html" title="LPC17" intro=""/>
<tab type="user" visible="yes" url="../../lpc43xx/html/modules.html" title="LPC43" intro=""/>
<tab type="user" visible="yes" url="../../emf32g/html/modules.html" title="EMF32 Gecko" intro=""/>
<tab type="user" visible="yes" url="../../emf32gg/html/modules.html" title="EMF32 Giant Gecko" intro=""/>
<tab type="user" visible="yes" url="../../emf32lg/html/modules.html" title="EMF32 Leopard Gecko" intro=""/>
<tab type="user" visible="yes" url="../../emf32tg/html/modules.html" title="EMF32 Tiny Gecko" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespaces" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classes" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="files" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<allmemberslink visible="yes"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<typedefs title=""/>
<enums title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<dirs visible="yes" title=""/>
<nestedgroups visible="yes" title=""/>
<files visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

61
doc/usb/header_usb.tex

@ -0,0 +1,61 @@
\documentclass{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=2.5cm,right=2.5cm]{geometry}
\usepackage{makeidx}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{float}
\usepackage{listings}
\usepackage{color}
\usepackage{ifthen}
\usepackage[table]{xcolor}
\usepackage{textcomp}
\usepackage{alltt}
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex,
pagebackref=true,
colorlinks=true,
linkcolor=blue,
unicode
]{hyperref}
\else
\usepackage[ps2pdf,
pagebackref=true,
colorlinks=true,
linkcolor=blue,
unicode
]{hyperref}
\usepackage{pspicture}
\fi
\usepackage[utf8]{inputenc}
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{sectsty}
\usepackage{amssymb}
\usepackage[titles]{tocloft}
\usepackage{doxygen}
\lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=4,numbers=left }
\makeindex
\setcounter{tocdepth}{3}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\familydefault}{\sfdefault}
\hfuzz=15pt
\setlength{\emergencystretch}{15pt}
\hbadness=750
\tolerance=750
\begin{document}
\hypersetup{pageanchor=false,citecolor=blue}
\begin{titlepage}
\vspace*{7cm}
\begin{center}
{\Huge libopencm3: API Reference\\ Cortex M3 Generic USB}\\
\vspace*{1cm}
{\large Generated by Doxygen 1.8.2}\\
\vspace*{0.5cm}
{\small Thu 10 March 2013 23:26:45}\\
\end{center}
\end{titlepage}
\pagenumbering{arabic}
\hypersetup{pageanchor=true,citecolor=blue}

19
include/libopencm3/stm32/f1/usb.h

@ -1,3 +1,17 @@
/** @defgroup adc_defines USB Defines
@brief <b>Defined Constants and Types for the STM32F1xx USB Module</b>
@ingroup STM32F1xx_defines
@version 1.0.0
@author @htmlonly &copy; @endhtmlonly 2009 Piotr Esden-Tempski <piotr@esden.net>
@date 11 March 2013
LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@ -17,6 +31,8 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#ifndef LIBOPENCM3_USB_H
#define LIBOPENCM3_USB_H
@ -257,3 +273,6 @@
(USB_PMA_BASE + (u8 *)(USB_GET_EP_RX_ADDR(EP) * 2))
#endif
/**@}*/

20
include/libopencm3/usb/cdc.h

@ -1,3 +1,18 @@
/** @defgroup usb_cdc_defines USB CDC Type Definitions
@brief <b>Defined Constants and Types for the USB CDC Type Definitions</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 __CDC_H
#define __CDC_H
@ -125,3 +142,6 @@ struct usb_cdc_notification {
} __attribute__((packed));
#endif
/**@}*/

20
include/libopencm3/usb/dfu.h

@ -1,3 +1,18 @@
/** @defgroup usb_dfu_defines USB DFU Type Definitions
@brief <b>Defined Constants and Types for the USB DFU Type Definitions</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 __DFU_H
#define __DFU_H
@ -79,3 +96,6 @@ struct usb_dfu_descriptor {
} __attribute__((packed));
#endif
/**@}*/

32
include/libopencm3/usb/doc-usb.h

@ -0,0 +1,32 @@
/** @mainpage libopencm3 Generic USB
@version 1.0.0
@date 10 March 2013
API documentation for Generic USB.
LGPL License Terms @ref lgpl_license
*/
/** @defgroup USB Generic USB
Libraries for Generic USB.
@version 1.0.0
@date 10 March 2013
LGPL License Terms @ref lgpl_license
*/
/** @defgroup USB_defines Generic USB Defines
@brief Defined Constants and Types for Generic USB.
@version 1.0.0
@date 10 March 2013
LGPL License Terms @ref lgpl_license
*/

20
include/libopencm3/usb/hid.h

@ -1,3 +1,18 @@
/** @defgroup usb_hid_defines USB HID Type Definitions
@brief <b>Defined Constants and Types for the USB HID Type Definitions</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 __HID_H
#define __HID_H
@ -36,3 +53,6 @@ struct usb_hid_descriptor {
} __attribute__((packed));
#endif
/**@}*/

20
include/libopencm3/usb/usbd.h

@ -1,3 +1,18 @@
/** @defgroup usb_driver_defines USB Drivers
@brief <b>Defined Constants and Types for the USB Drivers</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 __USBD_H
#define __USBD_H
@ -100,3 +117,6 @@ extern void usbd_cable_connect(usbd_device *usbd_dev, u8 on);
END_DECLS
#endif
/**@}*/

24
include/libopencm3/usb/usbstd.h

@ -1,3 +1,22 @@
/** @defgroup usb_type_defines USB Standard Structure Definitions
@brief <b>Defined Constants and Types for the USB Standard Structure Definitions</b>
@ingroup USB_defines
@version 1.0.0
@author @htmlonly &copy; @endhtmlonly 2010 Gareth McMullin <gareth@blacksphere.co.nz>
@date 10 March 2013
A set of structure definitions for the USB control structures
defined in chapter 9 of the "Univeral Serial Bus Specification Revision 2.0"
Available from the USB Implementers Forum - http://www.usb.org/
LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@ -17,6 +36,8 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#ifndef __USBSTD_H
#define __USBSTD_H
@ -227,3 +248,6 @@ enum usb_language_id {
USB_LANGID_ENGLISH_US = 0x409,
};
#endif
/**@}*/

20
lib/usb/usb.c

@ -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);
}
/**@}*/

21
lib/usb/usb_control.c

@ -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);
}
}

21
lib/usb/usb_private.h

@ -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

21
lib/usb/usb_standard.c

@ -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;
}
}

Loading…
Cancel
Save