diff --git a/boards/ansi_escape.h b/boards/ansi_escape.h index c0b59c07..d8573a52 100644 --- a/boards/ansi_escape.h +++ b/boards/ansi_escape.h @@ -36,18 +36,9 @@ */ /**************************************************************************/ -/** \file - * \brief TBD - * - * \note TBD - */ - -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ +/** \ingroup group_board + * \defgroup group_ansi_esc ANSI Esacpe Code + * @{ */ #ifndef _TUSB_ANSI_ESC_CODE_H_ #define _TUSB_ANSI_ESC_CODE_H_ @@ -61,21 +52,29 @@ #define CSI_SGR(x) CSI_CODE(#x) "m" //------------- Cursor movement -------------// -#define ANSI_CURSOR_UP(n) CSI_CODE(#n "A") -#define ANSI_CURSOR_DOWN(n) CSI_CODE(#n "B") -#define ANSI_CURSOR_FORWARD(n) CSI_CODE(#n "C") -#define ANSI_CURSOR_BACKWARD(n) CSI_CODE(#n "D") -#define ANSI_CURSOR_LINE_DOWN(n) CSI_CODE(#n "E") -#define ANSI_CURSOR_LINE_UP(n) CSI_CODE(#n "F") -#define ANSI_CURSOR_POSITION(n, m) CSI_CODE(#n ";" #m "H") +/** \defgroup group_ansi_cursor Cursor Movement + * @{ */ +#define ANSI_CURSOR_UP(n) CSI_CODE(#n "A") ///< Move cursor up +#define ANSI_CURSOR_DOWN(n) CSI_CODE(#n "B") ///< Move cursor down +#define ANSI_CURSOR_FORWARD(n) CSI_CODE(#n "C") ///< Move cursor forward +#define ANSI_CURSOR_BACKWARD(n) CSI_CODE(#n "D") ///< Move cursor backward +#define ANSI_CURSOR_LINE_DOWN(n) CSI_CODE(#n "E") ///< Move cursor to the beginning of the line (n) down +#define ANSI_CURSOR_LINE_UP(n) CSI_CODE(#n "F") ///< Move cursor to the beginning of the line (n) up +#define ANSI_CURSOR_POSITION(n, m) CSI_CODE(#n ";" #m "H") ///< Move cursor to position (n, m) +/** @} */ -#define ANSI_ERASE_SCREEN(n) CSI_CODE(#n "J") -#define ANSI_ERASE_LINE(n) CSI_CODE(#n "K") +//------------- Screen -------------// +/** \defgroup group_ansi_screen Screen Control + * @{ */ +#define ANSI_ERASE_SCREEN(n) CSI_CODE(#n "J") ///< Erase the screen +#define ANSI_ERASE_LINE(n) CSI_CODE(#n "K") ///< Erase the line (n) +#define ANSI_SCROLL_UP(n) CSI_CODE(#n "S") ///< Scroll the whole page up (n) lines +#define ANSI_SCROLL_DOWN(n) CSI_CODE(#n "T") ///< Scroll the whole page down (n) lines +/** @} */ -#define ANSI_SCROLL_UP(n) CSI_CODE(#n "S") -#define ANSI_SCROLL_DOWN(n) CSI_CODE(#n "T") - -/** text color */ +//------------- Text Color -------------// +/** \defgroup group_ansi_text Text Color + * @{ */ #define ANSI_TEXT_BLACK CSI_SGR(30) #define ANSI_TEXT_RED CSI_SGR(31) #define ANSI_TEXT_GREEN CSI_SGR(32) @@ -85,8 +84,11 @@ #define ANSI_TEXT_CYAN CSI_SGR(36) #define ANSI_TEXT_WHITE CSI_SGR(37) #define ANSI_TEXT_DEFAULT CSI_SGR(39) +/** @} */ -/** background color */ +//------------- Background Color -------------// +/** \defgroup group_ansi_background Background Color + * @{ */ #define ANSI_BG_BLACK CSI_SGR(40) #define ANSI_BG_RED CSI_SGR(41) #define ANSI_BG_GREEN CSI_SGR(42) @@ -96,6 +98,7 @@ #define ANSI_BG_CYAN CSI_SGR(46) #define ANSI_BG_WHITE CSI_SGR(47) #define ANSI_BG_DEFAULT CSI_SGR(49) +/** @} */ #ifdef __cplusplus } diff --git a/boards/board.h b/boards/board.h index e4497784..92909b6e 100644 --- a/boards/board.h +++ b/boards/board.h @@ -36,12 +36,8 @@ */ /**************************************************************************/ -/** - * \defgroup Group_Board Boards - * \brief TBD - * - * @{ - */ +/** \defgroup group_board Boards Abstraction Layer + * @{ */ #ifndef _TUSB_BOARD_H_ #define _TUSB_BOARD_H_ @@ -59,28 +55,38 @@ //--------------------------------------------------------------------+ // BOARD DEFINE //--------------------------------------------------------------------+ -#define BOARD_RF1GHZNODE 1100 -#define BOARD_LPCXPRESSO1347 1300 -#define BOARD_LPCXPRESSO1769 1700 +/** \defgroup group_supported_board Supported Boards + * @{ */ +#define BOARD_RF1GHZNODE 1100 ///< LPC11U37 from microbuilder http://www.microbuilder.eu/Blog/13-03-14/LPC1xxx_1GHZ_Wireless_Board_Preview.aspx +#define BOARD_LPCXPRESSO1347 1300 ///< LPCXpresso 1347, some APIs requires the base board +#define BOARD_LPCXPRESSO1769 1700 ///< LPCXpresso 1769, some APIs requires the base board -#define BOARD_NGX4330 4300 -#define BOARD_EA4357 4301 -#define BOARD_MCB4300 4302 -#define BOARD_HITEX4350 4303 +#define BOARD_NGX4330 4300 ///< NGX 4330 Xplorer +#define BOARD_EA4357 4301 ///< Embedded Artists LPC4357 developer kit +#define BOARD_MCB4300 4302 ///< Keil MCB4300 +#define BOARD_HITEX4350 4303 ///< Hitex 4350 #define BOARD_LPC4357USB 4304 -#define BOARD_LPCLINK2 4370 +#define BOARD_LPCLINK2 4370 ///< LPClink2 uses as LPC4370 development board +/** @} */ //--------------------------------------------------------------------+ // PRINTF TARGET DEFINE //--------------------------------------------------------------------+ -#define PRINTF_TARGET_SEMIHOST 1 -#define PRINTF_TARGET_UART 2 -#define PRINTF_TARGET_SWO 3 // aka SWV, ITM -#define PRINTF_TARGET_NONE 4 +/** \defgroup group_printf Printf Retarget + * \brief Retarget the standard stdio printf/getchar to other IOs + * @{ */ +#define PRINTF_TARGET_SEMIHOST 1 ///< Using the semihost support from toolchain, requires no hardware but is the slowest +#define PRINTF_TARGET_UART 2 ///< Using UART as stdio, this is the default for most of the board +#define PRINTF_TARGET_SWO 3 ///< Using non-instructive serial wire output (SWO), is the best option since it does not slow down MCU but requires supported from debugger and IDE +#define PRINTF_TARGET_NONE 4 ///< Using none at all. +/** @} */ #define PRINTF(...) printf(__VA_ARGS__) +//--------------------------------------------------------------------+ +// BOARD INCLUDE +//--------------------------------------------------------------------+ #if BOARD == BOARD_NGX4330 #include "ngx/board_ngx4330.h" #elif BOARD == BOARD_LPCXPRESSO1347 @@ -106,24 +112,52 @@ //--------------------------------------------------------------------+ // Common Configuration //--------------------------------------------------------------------+ -#define CFG_UART_BAUDRATE 115200 +#define CFG_UART_BAUDRATE 115200 ///< Baudrate for UART //--------------------------------------------------------------------+ // Board Common API //--------------------------------------------------------------------+ -// Init board peripherals : Clock, UART, LEDs, Buttons +/** \defgroup group_board_api Board API + * \brief All the board must support these APIs. + * @{ */ + +/// Initialize all required peripherals on board including uart, led, buttons etc ... void board_init(void); +/** \brief Turns on and off leds on the board + * \param[in] on_mask Bitmask for LED's numbers is turning ON + * \param[out] off_mask Bitmask for LED's numbers is turning OFF + * \note the \a on_mask is more priority then \a off_mask, if an led's number is present on both. + * It will be turned ON. + */ void board_leds(uint32_t on_mask, uint32_t off_mask); + +/** \brief Get the current state of the buttons on the board + * \return Bitmask where a '1' means active (pressed), a '0' means inactive. + */ uint32_t board_buttons(void); +/** \brief Get a character input from UART + * \return ASCII code of the input character or zero if none. + */ uint8_t board_uart_getchar(void); + +/** \brief Send a character to UART + * \param[in] c the character to be sent + */ void board_uart_putchar(uint8_t c); +/** @} */ + //------------- Board Application -------------// OSAL_TASK_FUNCTION( led_blinking_task , p_task_para); +/// Initialize the LED blinking task application. The initial blinking rate is 1 Hert (1 per second) void led_blinking_init(void); + +/** \brief Change the blinking rate. + * \param[in] ms The interval between on and off. + */ void led_blinking_set_interval(uint32_t ms); #ifdef __cplusplus diff --git a/boards/embedded_artists/ea4357/board_ea4357.h b/boards/embedded_artists/ea4357/board_ea4357.h index 3c0de9a4..92c69706 100644 --- a/boards/embedded_artists/ea4357/board_ea4357.h +++ b/boards/embedded_artists/ea4357/board_ea4357.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_EA4357_H_ #define _TUSB_BOARD_EA4357_H_ @@ -70,5 +63,3 @@ #endif #endif /* _TUSB_BOARD_EA4357_H_ */ - -/** @} */ diff --git a/boards/hitex/board_hitex4350.h b/boards/hitex/board_hitex4350.h index 0d7a5366..f52c83fa 100644 --- a/boards/hitex/board_hitex4350.h +++ b/boards/hitex/board_hitex4350.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_HITEX4350_H_ #define _TUSB_BOARD_HITEX4350_H_ @@ -63,5 +56,3 @@ #endif #endif /* _TUSB_BOARD_HITEX4350_H_ */ - -/** @} */ diff --git a/boards/keil/board_mcb4300.h b/boards/keil/board_mcb4300.h index e0c5526a..ef8f36ec 100644 --- a/boards/keil/board_mcb4300.h +++ b/boards/keil/board_mcb4300.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_MCB4300_H_ #define _TUSB_BOARD_MCB4300_H_ @@ -64,5 +57,3 @@ #endif #endif /* _TUSB_BOARD_MCB4300_H_ */ - -/** @} */ diff --git a/boards/lpcxpresso/board_lpclink2.h b/boards/lpcxpresso/board_lpclink2.h index 7c947cbd..3169c4db 100644 --- a/boards/lpcxpresso/board_lpclink2.h +++ b/boards/lpcxpresso/board_lpclink2.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_LPCLINK2_H_ #define _TUSB_BOARD_LPCLINK2_H_ @@ -64,5 +57,3 @@ #endif #endif /* _TUSB_BOARD_LPCLINK2_H_ */ - -/** @} */ diff --git a/boards/lpcxpresso/board_lpcxpresso1347.h b/boards/lpcxpresso/board_lpcxpresso1347.h index fb62d5b0..14be1796 100644 --- a/boards/lpcxpresso/board_lpcxpresso1347.h +++ b/boards/lpcxpresso/board_lpcxpresso1347.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_LPCXPRESSO1347_H_ #define _TUSB_BOARD_LPCXPRESSO1347_H_ @@ -61,5 +54,3 @@ #endif #endif /* _TUSB_BOARD_LPCXPRESSO1347_H_ */ - -/** @} */ diff --git a/boards/lpcxpresso/board_lpcxpresso1769.h b/boards/lpcxpresso/board_lpcxpresso1769.h index 30841d32..06520e16 100644 --- a/boards/lpcxpresso/board_lpcxpresso1769.h +++ b/boards/lpcxpresso/board_lpcxpresso1769.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_LPCXPRESSO1769_H_ #define _TUSB_BOARD_LPCXPRESSO1769_H_ @@ -66,5 +59,3 @@ #endif #endif /* _TUSB_BOARD_LPCXPRESSO1769_H_ */ - -/** @} */ diff --git a/boards/microbuilder/board_lpc4357usb.h b/boards/microbuilder/board_lpc4357usb.h index 96d535c7..5529dd15 100644 --- a/boards/microbuilder/board_lpc4357usb.h +++ b/boards/microbuilder/board_lpc4357usb.h @@ -36,19 +36,6 @@ */ /**************************************************************************/ -/** \file - * \brief TBD - * - * \note TBD - */ - -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_LPC4357USB_H_ #define _TUSB_BOARD_LPC4357USB_H_ @@ -71,5 +58,3 @@ #endif #endif /* _TUSB_BOARD_LPC4357USB_H_ */ - -/** @} */ diff --git a/boards/microbuilder/board_rf1ghznode.h b/boards/microbuilder/board_rf1ghznode.h index 9ad9778c..d5bee0fb 100644 --- a/boards/microbuilder/board_rf1ghznode.h +++ b/boards/microbuilder/board_rf1ghznode.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_RF1GHZNODE_H_ #define _TUSB_BOARD_RF1GHZNODE_H_ @@ -62,5 +55,3 @@ #endif #endif /* _TUSB_BOARD_RF1GHZNODE_H_ */ - -/** @} */ diff --git a/boards/ngx/board_ngx4330.h b/boards/ngx/board_ngx4330.h index 7d913231..c5e2d0e2 100644 --- a/boards/ngx/board_ngx4330.h +++ b/boards/ngx/board_ngx4330.h @@ -36,13 +36,6 @@ */ /**************************************************************************/ -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - #ifndef _TUSB_BOARD_NGX4330_H_ #define _TUSB_BOARD_NGX4330_H_ @@ -64,5 +57,3 @@ #endif #endif /* _TUSB_BOARD_NGX4330_H_ */ - -/** @} */ diff --git a/demos/host/host_os_none/.cproject b/demos/host/host_os_none/.cproject index 5497fa4e..4c6ed357 100644 --- a/demos/host/host_os_none/.cproject +++ b/demos/host/host_os_none/.cproject @@ -1,23 +1,25 @@ - + + + - + + + - - @@ -91,24 +93,25 @@ + - + + + - - @@ -184,24 +187,25 @@ + - + + + - - @@ -275,24 +279,25 @@ + - + + + - - @@ -366,24 +371,25 @@ + - + + + - - @@ -454,28 +460,29 @@ + - + + + - - - + @@ -527,7 +534,7 @@ @@ -554,11 +562,8 @@ <?xml version="1.0" encoding="UTF-8"?> <TargetConfig> -<Properties property_0="" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="60100"/> -<infoList vendor="NXP"> -<info chip="LPC4357" flash_driver="LPC18x7_43x7_2x512_BootA.cfx" match_id="0x0" name="LPC4357" resetscript="LPC18LPC43InternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"> -<chip> -<name>LPC4357</name> +<Properties property_0="" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="1"/> +<infoList vendor="NXP"><info chip="LPC4357" flash_driver="LPC18x7_43x7_2x512_BootA.cfx" match_id="0x0" name="LPC4357" resetscript="LPC18LPC43InternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"><chip><name>LPC4357</name> <family>LPC43xx</family> <vendor>NXP (formerly Philips)</vendor> <reset board="None" core="Real" sys="Real"/> @@ -633,8 +638,7 @@ <peripheralInstance derived_from="SPI" determined="infoFile" id="SPI" location="0x40100000"/> <peripheralInstance derived_from="SGPIO" determined="infoFile" id="SGPIO" location="0x40101000"/> </chip> -<processor> -<name gcc_name="cortex-m4">Cortex-M4</name> +<processor><name gcc_name="cortex-m4">Cortex-M4</name> <family>Cortex-M</family> </processor> <link href="nxp_lpc43xx_peripheral.xme" show="embed" type="simple"/> diff --git a/tinyusb.Doxyfile b/tinyusb.Doxyfile index 8fc07d04..5bf2aa81 100644 --- a/tinyusb.Doxyfile +++ b/tinyusb.Doxyfile @@ -743,8 +743,10 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = tinyusb \ - readme.md +INPUT = tinyusb/doxygen/group_def.txt \ + readme.md \ + tinyusb \ + boards # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -805,7 +807,8 @@ FILE_PATTERNS = *.c \ *.ucf \ *.qsf \ *.as \ - *.js + *.js \ + *.txt # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. diff --git a/tinyusb/class/cdc.h b/tinyusb/class/cdc.h index aaab2ace..8253e9c7 100644 --- a/tinyusb/class/cdc.h +++ b/tinyusb/class/cdc.h @@ -36,7 +36,7 @@ */ /**************************************************************************/ -/** \ingroup ClassDriver Class Driver +/** \ingroup group_class * \defgroup ClassDriver_CDC Communication Device Class (CDC) * Currently only Abstract Control Model subclass is supported * @{ */ diff --git a/tinyusb/class/custom_class.h b/tinyusb/class/custom_class.h index 0070e2d5..f1c7bfd9 100644 --- a/tinyusb/class/custom_class.h +++ b/tinyusb/class/custom_class.h @@ -36,11 +36,9 @@ */ /**************************************************************************/ -/** \addtogroup ClassDriver Class Driver - * @{ +/** \ingroup group_class * \defgroup Group_Custom Custom Class (not supported yet) - * @{ - */ + * @{ */ #ifndef _TUSB_CUSTOM_CLASS_H_ #define _TUSB_CUSTOM_CLASS_H_ @@ -88,4 +86,3 @@ void cush_close(uint8_t dev_addr); #endif /* _TUSB_CUSTOM_CLASS_H_ */ /** @} */ -/** @} */ diff --git a/tinyusb/class/hid.h b/tinyusb/class/hid.h index 91a7ece3..c95cfa24 100644 --- a/tinyusb/class/hid.h +++ b/tinyusb/class/hid.h @@ -36,8 +36,7 @@ */ /**************************************************************************/ -/** \addtogroup ClassDriver Class Driver - * @{ +/** \ingroup group_class * \defgroup ClassDriver_HID Human Interface Device (HID) * @{ */ @@ -524,4 +523,3 @@ enum { #endif /* _TUSB_HID_H__ */ /// @} -/// @} diff --git a/tinyusb/class/msc.h b/tinyusb/class/msc.h index 0183b3fa..727dd038 100644 --- a/tinyusb/class/msc.h +++ b/tinyusb/class/msc.h @@ -36,8 +36,7 @@ */ /**************************************************************************/ -/** \addtogroup ClassDriver Class Driver - * @{ +/** \ingroup group_class * \defgroup ClassDriver_MSC MassStorage (MSC) * @{ */ @@ -358,4 +357,3 @@ STATIC_ASSERT(sizeof(scsi_write10_t) == 10, "size is not correct"); /// @} /// @} -/// @} diff --git a/tinyusb/common/std_descriptors.h b/tinyusb/common/std_descriptors.h index 9c9d06c4..bf34008e 100644 --- a/tinyusb/common/std_descriptors.h +++ b/tinyusb/common/std_descriptors.h @@ -36,8 +36,7 @@ */ /**************************************************************************/ -/** \brief Types & Declaration by USB Specs. All documents sources mentioned here (eg section 3.5) is referring to USB 2.0 Specs unless state otherwise - */ +/// \brief Types & Declaration by USB Specs. All documents sources mentioned here (eg section 3.5) is referring to USB 2.0 Specs unless state otherwise /** \addtogroup group_usb_definitions USB Definitions * @{ diff --git a/tinyusb/doxygen/configuration.h b/tinyusb/doxygen/configuration.txt similarity index 88% rename from tinyusb/doxygen/configuration.h rename to tinyusb/doxygen/configuration.txt index 33a31479..3821dce8 100644 --- a/tinyusb/doxygen/configuration.h +++ b/tinyusb/doxygen/configuration.txt @@ -18,8 +18,8 @@ */ #define TUSB_CFG_ATTR_USBRAM -#define TUSB_CFG_MCU ///< Select one of the supported MCU, the value must be from \ref config_mcu_selection -#define TUSB_CFG_OS ///< Select one of the supported RTOS, the value must be from \ref TUSB_OS RTOS. +#define TUSB_CFG_MCU ///< Select one of the supported MCU, the value must be from \ref group_mcu +#define TUSB_CFG_OS ///< Select one of the supported RTOS, the value must be from \ref group_supported_os. #define TUSB_CFG_OS_TASK_PRIO ///< If \ref TUSB_CFG_OS is configured to use a real RTOS (other than TUSB_OS_NONE). This determines the priority of the usb stack task. #define TUSB_CFG_TICKS_HZ ///< The rate ticks in hert. This is used in conjunction with \ref tusb_tick_get to calculate timing. @@ -60,6 +60,10 @@ #define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE ///< Max packet size of Cotnrol Endpoint, default is 64 +/// Application MUST define this variable and initialize its pointers's member to all required USB descriptors including +/// Device Descriptor, Configuration Descriptor, String Descriptors, HID Report Descriptors etc ... +tusbd_descriptor_pointer_t tusbd_descriptor_pointers; + /** \defgroup config_device_class Class Driver * \brief For each Class Driver a value of 1 means enable, value of 0 mean disable * @{ */ @@ -70,6 +74,6 @@ #define TUSB_CFG_DEVICE_CDC ///< Enable Virtual Serial (Communication Device Class) /** @} */ - /** @} */ // group Device +/** @} */ // group Device /** @} */ diff --git a/tinyusb/doxygen/group_def.txt b/tinyusb/doxygen/group_def.txt new file mode 100644 index 00000000..cfc59d85 --- /dev/null +++ b/tinyusb/doxygen/group_def.txt @@ -0,0 +1,9 @@ +// define all the modules group to have the desired ordering since doxygen order module group by +// the order of files it is feed + +/// \defgroup group_class Application - Class Driver API + +/// \defgroup group_application_api Application - Stack API +/// \brief Non-Class driver API + +/// \defgroup group_configuration Configuration tusb_config.h diff --git a/tinyusb/hal/hal.h b/tinyusb/hal/hal.h index 8029685f..650c16ec 100644 --- a/tinyusb/hal/hal.h +++ b/tinyusb/hal/hal.h @@ -39,15 +39,6 @@ #ifndef _TUSB_HAL_H_ #define _TUSB_HAL_H_ -/** \ingroup group_usbd - * \ingroup group_usbh - * \defgroup group_hal Hardware Abtract Layer (HAL) - * Hardware Abstraction Layer (HAL) is an abstraction layer, between the physical hardware and the tinyusb stack. - * Its function is to hide differences in hardware from most of MCUs, so that most of the stack code does not need to be changed to - * run on systems with a different MCU. - * HAL are sets of routines that emulate some platform-specific details, giving programs direct access to the hardware resources. - * @{ */ - //--------------------------------------------------------------------+ // INCLUDES //--------------------------------------------------------------------+ @@ -56,11 +47,19 @@ #include "common/tusb_errors.h" #include "common/compiler/compiler.h" +// callback from tusb.h +extern void tusb_isr(uint8_t coreid); + //--------------------------------------------------------------------+ // HAL API //--------------------------------------------------------------------+ -// callback from tusb.h -extern void tusb_isr(uint8_t coreid); +/** \ingroup group_mcu + * \defgroup group_hal Hardware Abtract Layer (HAL) + * Hardware Abstraction Layer (HAL) is an abstraction layer, between the physical hardware and the tinyusb stack. + * Its function is to hide differences in hardware from most of MCUs, so that most of the stack code does not need to be changed to + * run on systems with a different MCU. + * HAL are sets of routines that emulate some platform-specific details, giving programs direct access to the hardware resources. + * @{ */ /** \brief Initialize USB controller hardware * \returns \ref tusb_error_t type to indicate success or error condition. diff --git a/tinyusb/hal/hal_lpc11uxx.h b/tinyusb/hal/hal_lpc11uxx.h index b497d377..d94aa3dd 100644 --- a/tinyusb/hal/hal_lpc11uxx.h +++ b/tinyusb/hal/hal_lpc11uxx.h @@ -36,10 +36,6 @@ */ /**************************************************************************/ -/** \ingroup group_hal - * \defgroup group_hal_lpc11u LPC11uxx - * @{ */ - #ifndef _TUSB_HAL_LPC11UXX_H_ #define _TUSB_HAL_LPC11UXX_H_ @@ -66,5 +62,3 @@ static inline void hal_interrupt_disable(uint8_t coreid) #endif #endif /* _TUSB_HAL_LPC11UXX_H_ */ - -/** @} */ diff --git a/tinyusb/hal/hal_lpc13uxx.h b/tinyusb/hal/hal_lpc13uxx.h index 552fe6b5..c5dc8afd 100644 --- a/tinyusb/hal/hal_lpc13uxx.h +++ b/tinyusb/hal/hal_lpc13uxx.h @@ -36,10 +36,6 @@ */ /**************************************************************************/ -/** \ingroup group_hal - * \defgroup group_hal_lpc13u LPC13uxx (12-bit ADC) - * @{ */ - #ifndef _TUSB_HAL_LPC13UXX_H_ #define _TUSB_HAL_LPC13UXX_H_ @@ -67,4 +63,3 @@ static inline void hal_interrupt_disable(uint8_t coreid) #endif /* _TUSB_HAL_LPC13UXX_H_ */ -/** @} */ diff --git a/tinyusb/hal/hal_lpc175x_6x.h b/tinyusb/hal/hal_lpc175x_6x.h index 47658c6a..74445411 100644 --- a/tinyusb/hal/hal_lpc175x_6x.h +++ b/tinyusb/hal/hal_lpc175x_6x.h @@ -36,10 +36,6 @@ */ /**************************************************************************/ -/** \ingroup group_hal - * \defgroup group_hal_lpc175x_6x LPC175x_6x - * @{ */ - #ifndef _TUSB_HAL_LPC175X_6X_H_ #define _TUSB_HAL_LPC175X_6X_H_ @@ -53,15 +49,15 @@ //--------------------------------------------------------------------+ // //--------------------------------------------------------------------+ -static inline void hal_interrupt_enable(uint8_t controller_id) +static inline void hal_interrupt_enable(uint8_t coreid) { - (void) controller_id; // discard compiler's warning + (void) coreid; // discard compiler's warning NVIC_EnableIRQ(USB_IRQn); } -static inline void hal_interrupt_disable(uint8_t controller_id) +static inline void hal_interrupt_disable(uint8_t coreid) { - (void) controller_id; // discard compiler's warning + (void) coreid; // discard compiler's warning NVIC_DisableIRQ(USB_IRQn); } @@ -71,4 +67,3 @@ static inline void hal_interrupt_disable(uint8_t controller_id) #endif /* _TUSB_HAL_LPC175X_6X_H_ */ -/** @} */ diff --git a/tinyusb/hal/hal_lpc43xx.h b/tinyusb/hal/hal_lpc43xx.h index 4aafc1e3..6360384e 100644 --- a/tinyusb/hal/hal_lpc43xx.h +++ b/tinyusb/hal/hal_lpc43xx.h @@ -36,9 +36,6 @@ */ /**************************************************************************/ -/** \ingroup group_hal - * \defgroup group_hal_lpc143xx LPC43xx - * @{ */ #ifndef _TUSB_HAL_LPC43XX_H_ #define _TUSB_HAL_LPC43XX_H_ @@ -64,4 +61,3 @@ static inline void hal_interrupt_disable(uint8_t coreid) #endif /* _TUSB_HAL_LPC43XX_H_ */ -/** @} */ diff --git a/tinyusb/host/hub.h b/tinyusb/host/hub.h index 6097e15e..6ecba96f 100644 --- a/tinyusb/host/hub.h +++ b/tinyusb/host/hub.h @@ -36,8 +36,7 @@ */ /**************************************************************************/ -/** \addtogroup ClassDriver - * @{ +/** \ingroup group_class * \defgroup ClassDriver_Hub Hub (Host only) * \details Like most PC's OS, Hub support is completely hidden from Application. In fact, application cannot determine whether * a device is mounted directly via roothub or via a hub's port. All Hub-related procedures are performed and managed @@ -209,4 +208,3 @@ void hub_close(uint8_t dev_addr); #endif /* _TUSB_HUB_H_ */ /** @} */ -/** @} */ diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index ca4015a2..ebbade9d 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -39,9 +39,15 @@ #ifndef _TUSB_OSAL_H_ #define _TUSB_OSAL_H_ -/** \ingroup group_configuration - * \defgroup TUSB_OS RTOS Integration Selection - * \brief TUSB_CFG_OS must be defined to one of these +#ifdef __cplusplus + extern "C" { +#endif + +/** \defgroup group_osal OS Abstraction Layer (OSAL) + * @{ */ + +/** \defgroup group_supported_os Supported RTOS + * \brief \ref TUSB_CFG_OS must be defined to one of these * @{ */ #define TUSB_OS_NONE 1 ///< No RTOS is used #define TUSB_OS_FREERTOS 2 ///< FreeRTOS is used @@ -49,14 +55,6 @@ #define TUSB_OS_UCOS3 4 ///< MicroC OS III is used (not supported yet) /** @} */ - -/** \defgroup group_osal OS Abstraction Layer (OSAL) - * @{ */ - -#ifdef __cplusplus - extern "C" { -#endif - #include "tusb_option.h" #ifndef _TEST_ diff --git a/tinyusb/tusb.c b/tinyusb/tusb.c index 8a0d1be5..15aa1fae 100644 --- a/tinyusb/tusb.c +++ b/tinyusb/tusb.c @@ -63,15 +63,19 @@ tusb_error_t tusb_init(void) return TUSB_ERROR_NONE; } -// called from hal layer -void tusb_isr(uint8_t controller_id) +/** \ingroup group_application_api + * \brief USB interrupt handler + * \param[in] coreid Controller ID where the interrupt happened + * \note This function must be called by HAL layer or Application for the stack to manage USB events/transfers. + */ +void tusb_isr(uint8_t coreid) { #if MODE_HOST_SUPPORTED - hcd_isr(controller_id); + hcd_isr(coreid); #endif #if MODE_DEVICE_SUPPORTED - dcd_isr(controller_id); + dcd_isr(coreid); #endif } diff --git a/tinyusb/tusb.h b/tinyusb/tusb.h index 2d40c1fe..606803ae 100644 --- a/tinyusb/tusb.h +++ b/tinyusb/tusb.h @@ -93,7 +93,7 @@ //--------------------------------------------------------------------+ // APPLICATION API //--------------------------------------------------------------------+ -/** \defgroup application_setup Application Setup +/** \ingroup group_application_api * @{ */ /** \brief Initialize the usb stack diff --git a/tinyusb/tusb_option.h b/tinyusb/tusb_option.h index 467abf39..0cfb4ae4 100644 --- a/tinyusb/tusb_option.h +++ b/tinyusb/tusb_option.h @@ -45,18 +45,15 @@ #define TUSB_VERSION_NAME "alpha" #define TUSB_VERSION XSTRING_(TUSB_VERSION_YEAR) "." XSTRING_(TUSB_VERSION_MONTH) -/** \defgroup group_configuration Configuration tusb_config.h - * @{ */ - -/** \defgroup config_mcu_selection MCU Selection - * \brief TUSB_CFG_MCU must be defined to one of these +/** \defgroup group_mcu Supported MCU + * \ref TUSB_CFG_MCU must be defined to one of these * @{ */ #define MCU_LPC13UXX 1 ///< NXP LPC13xx 12 bit ADC family with USB on-chip Rom Driver (not supported yet) -#define MCU_LPC13XX 2 ///< NXP LPC13xx 10 bit ADC family (not supported yet) -#define MCU_LPC11UXX 3 ///< NXP LPC11Uxx family (not supported yet) +#define MCU_LPC13XX 2 ///< NXP LPC13xx 10 bit ADC family +#define MCU_LPC11UXX 3 ///< NXP LPC11Uxx family #define MCU_LPC43XX 4 ///< NXP LPC43xx family #define MCU_LPC18XX 5 ///< NXP LPC18xx family (not supported yet) -#define MCU_LPC175X_6X 6 ///< NXP LPC175x, LPC176x family (not supported yet) +#define MCU_LPC175X_6X 6 ///< NXP LPC175x, LPC176x family #define MCU_LPC177X_8X 7 ///< NXP LPC177x, LPC178x family (not supported yet) /** @} */ @@ -68,6 +65,9 @@ #include TUSB_CFG_CONFIG_FILE +/** \ingroup group_configuration + * @{ */ + //--------------------------------------------------------------------+ // CONTROLLER //--------------------------------------------------------------------+