Read about our upcoming Code of Conduct on this issue

Commit c5a995f1 authored by hudson@kremvax's avatar hudson@kremvax
Browse files

Doxygen comments

parent aed8312c7acb
......@@ -9,6 +9,12 @@
* Handlers for operations can be registered by calling ptp_register_handler()
* and will be called when the host initiates that operation.
*/
/** \group PTP IDs
*
* These are some of the "well known" Canon PTP commands.
* @{
*/
#define PTP_FM_OBJECTSIZE 0x910a
#define PTP_SET_DEVICE_PROP 0x9110
#define PTP_HD_CAPACITY 0x911a
......@@ -27,8 +33,13 @@
#define PTP_RC_OK 0x2001
#define PTP_RC_ERROR 0x2002
/** @} */
struct ptp_handle;
/** PTP message on the USB wire.
*
*/
struct ptp_msg
{
uint32_t id;
......@@ -40,6 +51,13 @@ struct ptp_msg
SIZE_CHECK_STRUCT( ptp_msg, 0x24 );
/** DryOS PTP callback context.
*
* When a handler is registered it will be called with a ptp_context
* as its first argument. These callbacks are to be used to reply
* to the host.
*/
struct ptp_context
{
struct ptp_handle * handle; // off_0x00;
......@@ -78,6 +96,8 @@ struct ptp_context
};
/** DryOS function to register a USB PTP handler.
*/
extern void
ptp_register_handler(
uint32_t id,
......@@ -91,7 +111,12 @@ ptp_register_handler(
);
/* PTP handlers */
/** Magic Lantern PTP handler segment.
*
* \internal These are generated by the PTP_HANDLER() macro to
* create a list of handlers that will be automatically registered
* when Magic Lantern boots.
*/
struct ptp_handler
{
uint32_t id;
......@@ -99,6 +124,11 @@ struct ptp_handler
void * priv;
};
/** Register a compile-time Magic Lantern PTP handler.
*
* \internal Typically PTP_HANDLER() is a better choice.
*/
#define REGISTER_PTP_HANDLER( ID, HANDLER, PRIV ) \
struct ptp_handler \
__attribute__((section(".ptp_handlers"))) \
......@@ -109,6 +139,12 @@ __ptp_handler_##ID = { \
}
/** Register a compile-time Magic Lantern PTP handler.
*
* Register a PTP handler with the ID. Magic Lantern will automatically
* call the DryOS functions to register all the handlers that are
* in the .ptp_handlers segment.
*/
#define PTP_HANDLER( ID, PRIV ) \
static int ptp_handler_##ID(); \
REGISTER_PTP_HANDLER( ID, ptp_handler_##ID, PRIV ); \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment