improve doxygen output.

This commit is contained in:
Ryan Pavlik
2011-05-02 10:05:45 -05:00
parent eb2a133c18
commit 51674ce9de
12 changed files with 108 additions and 50 deletions

View File

@@ -39,20 +39,27 @@
/**
* @mainpage
*
* @section intro Introduction
*
* WiiUse is a cross-platform C library for accessing the Nintendo Wii
* Remote and its related expansions and variations.
*
* @section project Project
*
* This is a friendly fork of the original WiiUse project, which seems
* to have gone defunct. This updated version is maintained at:
* to have gone defunct. This updated version incorporates improvements
* from a number of internal forks found across the Internet, and is
* intended to be the new "upstream" of the project. The new homepage is
* on GitHub, where the source is maintained:
*
* - http://github.com/rpavlik/wiiuse
*
* Contributions (under the GPL 3+) are welcome and encouraged!
*
* @section publicapisec Public API
*
* The full public API for WiiUse is found in @ref wiiuse.h
*
* @section quicklinks API Docs Quick Links
* - @ref wiiuse.h
* - @ref wiimote structure
* - @ref publicapi "Public API" - entirely within @ref wiiuse.h
* - @ref wiimote "Wiimote device structure"
*
*/
#ifndef WIIUSE_H_INCLUDED
@@ -84,14 +91,20 @@
#include <stdint.h>
#endif
/* led bit masks */
/** @defgroup publicapi External API */
/** @{ */
/** @name LED bit masks */
/** @{ */
#define WIIMOTE_LED_NONE 0x00
#define WIIMOTE_LED_1 0x10
#define WIIMOTE_LED_2 0x20
#define WIIMOTE_LED_3 0x40
#define WIIMOTE_LED_4 0x80
/** @} */
/* button codes */
/** @name Button codes */
/** @{ */
#define WIIMOTE_BUTTON_TWO 0x0001
#define WIIMOTE_BUTTON_ONE 0x0002
#define WIIMOTE_BUTTON_B 0x0004
@@ -109,13 +122,17 @@
#define WIIMOTE_BUTTON_ZACCEL_BIT5 0x4000
#define WIIMOTE_BUTTON_UNKNOWN 0x8000
#define WIIMOTE_BUTTON_ALL 0x1F9F
/** @} */
/* nunchul button codes */
/** @name Nunchuk button codes */
/** @{ */
#define NUNCHUK_BUTTON_Z 0x01
#define NUNCHUK_BUTTON_C 0x02
#define NUNCHUK_BUTTON_ALL 0x03
/** @} */
/* classic controller button codes */
/** @name Classic controller button codes */
/** @{ */
#define CLASSIC_CTRL_BUTTON_UP 0x0001
#define CLASSIC_CTRL_BUTTON_LEFT 0x0002
#define CLASSIC_CTRL_BUTTON_ZR 0x0004
@@ -132,8 +149,10 @@
#define CLASSIC_CTRL_BUTTON_DOWN 0x4000
#define CLASSIC_CTRL_BUTTON_RIGHT 0x8000
#define CLASSIC_CTRL_BUTTON_ALL 0xFEFF
/** @} */
/* guitar hero 3 button codes */
/** @name Guitar Hero 3 button codes */
/** @{ */
#define GUITAR_HERO_3_BUTTON_STRUM_UP 0x0001
#define GUITAR_HERO_3_BUTTON_YELLOW 0x0008
#define GUITAR_HERO_3_BUTTON_GREEN 0x0010
@@ -144,29 +163,36 @@
#define GUITAR_HERO_3_BUTTON_MINUS 0x1000
#define GUITAR_HERO_3_BUTTON_STRUM_DOWN 0x4000
#define GUITAR_HERO_3_BUTTON_ALL 0xFEFF
/** @} */
/* wiimote option flags */
/** @name Wiimote option flags */
/** @{ */
#define WIIUSE_SMOOTHING 0x01
#define WIIUSE_CONTINUOUS 0x02
#define WIIUSE_ORIENT_THRESH 0x04
#define WIIUSE_INIT_FLAGS (WIIUSE_SMOOTHING | WIIUSE_ORIENT_THRESH)
#define WIIUSE_ORIENT_PRECISION 100.0f
/** @} */
/* expansion codes */
/** @name Expansion codes */
/** @{ */
#define EXP_NONE 0
#define EXP_NUNCHUK 1
#define EXP_CLASSIC 2
#define EXP_GUITAR_HERO_3 3
#define EXP_WII_BOARD 4
/** @} */
/* IR correction types */
/** @brief IR correction types */
typedef enum ir_position_t {
WIIUSE_IR_ABOVE,
WIIUSE_IR_BELOW
} ir_position_t;
/** @name Device Inquiry Macros */
/** @{ */
/**
* @brief Check if a button is pressed.
* @param dev Pointer to a wiimote_t or expansion structure.
@@ -224,6 +250,7 @@ typedef enum ir_position_t {
#define WIIUSE_USING_SPEAKER(wm) ((wm->state & 0x100) == 0x100)
#define WIIUSE_IS_LED_SET(wm, num) ((wm->leds & WIIMOTE_LED_##num) == WIIMOTE_LED_##num)
/** @} */
/*
* Largest known payload is 21 bytes.
@@ -266,7 +293,6 @@ typedef void (*wiiuse_read_cb)(struct wiimote_t* wm, byte* data, uint16_t len);
/**
* @struct read_req_t
* @brief Data read request structure.
*/
struct read_req_t {
@@ -282,7 +308,6 @@ struct read_req_t {
/**
* @struct vec2b_t
* @brief Unsigned x,y byte vector.
*/
typedef struct vec2b_t {
@@ -291,7 +316,6 @@ typedef struct vec2b_t {
/**
* @struct vec3b_t
* @brief Unsigned x,y,z byte vector.
*/
typedef struct vec3b_t {
@@ -300,7 +324,6 @@ typedef struct vec3b_t {
/**
* @struct vec3f_t
* @brief Signed x,y,z float struct.
*/
typedef struct vec3f_t {
@@ -309,7 +332,6 @@ typedef struct vec3f_t {
/**
* @struct orient_t
* @brief Orientation struct.
*
* Yaw, pitch, and roll range from -180 to 180 degrees.
@@ -325,7 +347,6 @@ typedef struct orient_t {
/**
* @struct gforce_t
* @brief Gravity force struct.
*/
typedef struct gforce_t {
@@ -334,7 +355,6 @@ typedef struct gforce_t {
/**
* @struct accel_t
* @brief Accelerometer struct. For any device with an accelerometer.
*/
typedef struct accel_t {
@@ -348,7 +368,6 @@ typedef struct accel_t {
/**
* @struct ir_dot_t
* @brief A single IR source.
*/
typedef struct ir_dot_t {
@@ -367,7 +386,6 @@ typedef struct ir_dot_t {
/**
* @enum aspect_t
* @brief Screen aspect ratio.
*/
typedef enum aspect_t {
@@ -377,7 +395,6 @@ typedef enum aspect_t {
/**
* @struct ir_t
* @brief IR struct. Hold all data related to the IR tracking.
*/
typedef struct ir_t {
@@ -404,7 +421,6 @@ typedef struct ir_t {
/**
* @struct joystick_t
* @brief Joystick calibration structure.
*
* The angle \a ang is relative to the positive y-axis into quadrant I
@@ -429,7 +445,6 @@ typedef struct joystick_t {
/**
* @struct nunchuk_t
* @brief Nunchuk expansion device.
*/
typedef struct nunchuk_t {
@@ -452,7 +467,6 @@ typedef struct nunchuk_t {
/**
* @struct classic_ctrl_t
* @brief Classic controller expansion device.
*/
typedef struct classic_ctrl_t {
@@ -469,7 +483,6 @@ typedef struct classic_ctrl_t {
/**
* @struct guitar_hero_3_t
* @brief Guitar Hero 3 expansion device.
*/
typedef struct guitar_hero_3_t {
@@ -482,9 +495,12 @@ typedef struct guitar_hero_3_t {
struct joystick_t js; /**< joystick calibration */
} guitar_hero_3_t;
/*
Wii board
*/
/**
* @brief Wii Balance Board "expansion" device.
*
* A Balance Board presents itself as a Wiimote with a permanently-attached
* Balance Board expansion device.
*/
typedef struct wii_board_t {
float tl; /* Interpolated */
float tr;
@@ -503,7 +519,6 @@ typedef struct wii_board_t {
/**
* @struct expansion_t
* @brief Generic expansion device plugged into wiimote.
*/
typedef struct expansion_t {
@@ -519,7 +534,6 @@ typedef struct expansion_t {
/**
* @enum win32_bt_stack_t
* @brief Available bluetooth stacks for Windows.
*/
typedef enum win_bt_stack_t {
@@ -530,7 +544,6 @@ typedef enum win_bt_stack_t {
/**
* @struct wiimote_state_t
* @brief Significant data from the previous event.
*/
typedef struct wiimote_state_t {
@@ -564,7 +577,6 @@ typedef struct wiimote_state_t {
/**
* @enum WIIUSE_EVENT_TYPE
* @brief Events that wiiuse can generate from a poll.
*/
typedef enum WIIUSE_EVENT_TYPE {
@@ -586,8 +598,9 @@ typedef enum WIIUSE_EVENT_TYPE {
} WIIUSE_EVENT_TYPE;
/**
* @struct wiimote_t
* @brief Wiimote structure.
* @brief Main Wiimote device structure.
*
* You need one of these to do pretty much anything with this library.
*/
typedef struct wiimote_t {
WCONST int unid; /**< user specified id */
@@ -638,7 +651,6 @@ typedef struct wiimote_t {
} wiimote;
/**
* @enum WIIUSE_LOGLEVEL
* @brief Loglevels supported by wiiuse.
*/
typedef enum wiiuse_loglevel {
@@ -674,6 +686,10 @@ extern "C" {
/* wiiuse.c */
WIIUSE_EXPORT extern const char* wiiuse_version();
/** @brief Define indicating the presence of the feature allowing you to
* redirect output for one or more logging levels within the library.
*/
#define WIIUSE_HAS_OUTPUT_REDIRECTION
WIIUSE_EXPORT extern void wiiuse_set_output(enum wiiuse_loglevel loglevel, FILE *logtarget);
@@ -723,6 +739,7 @@ WIIUSE_EXPORT extern void wiiuse_set_wii_board_calib(struct wiimote_t *wm);
}
#endif
/** @} */
#endif /* WIIUSE_H_INCLUDED */