diff --git a/boards/chronos/drivers/include/display.h b/boards/chronos/drivers/include/display.h index 3299876661..11de0ada31 100644 --- a/boards/chronos/drivers/include/display.h +++ b/boards/chronos/drivers/include/display.h @@ -50,27 +50,27 @@ extern "C" { /* ************************************************************************************************* * Global Variable section */ -/* Set of display flags */ +/** Set of display flags */ typedef union { struct { /* Line1 + Line2 + Icons*/ - uint16_t full_update : 1; /* 1 = Redraw all content */ - uint16_t partial_update : 1; /* 1 = Update changes */ + uint16_t full_update : 1; /**< 1 = Redraw all content */ + uint16_t partial_update : 1; /**< 1 = Update changes */ /* Line only */ - uint16_t line1_full_update : 1; /* 1 = Redraw Line1 content */ - uint16_t line2_full_update : 1; /* 1 = Redraw Line2 content */ + uint16_t line1_full_update : 1; /**< 1 = Redraw Line1 content */ + uint16_t line2_full_update : 1; /**< 1 = Redraw Line2 content */ /* Logic module data update flags */ - uint16_t update_time : 1; /* 1 = Time was updated */ - uint16_t update_stopwatch : 1; /* 1 = Stopwatch was updated */ - uint16_t update_temperature : 1; /* 1 = Temperature was updated */ - uint16_t update_battery_voltage : 1; /* 1 = Battery voltage was updated */ - uint16_t update_date : 1; /* 1 = Date was updated */ - uint16_t update_alarm : 1; /* 1 = Alarm time was updated */ - uint16_t update_acceleration : 1; /* 1 = Acceleration data was updated */ - } flag; - uint16_t all_flags; /* Shortcut to all display flags (for reset) */ + uint16_t update_time : 1; /**< 1 = Time was updated */ + uint16_t update_stopwatch : 1; /**< 1 = Stopwatch was updated */ + uint16_t update_temperature : 1; /**< 1 = Temperature was updated */ + uint16_t update_battery_voltage : 1; /**< 1 = Battery voltage was updated */ + uint16_t update_date : 1; /**< 1 = Date was updated */ + uint16_t update_alarm : 1; /**< 1 = Alarm time was updated */ + uint16_t update_acceleration : 1; /**< 1 = Acceleration data was updated */ + } flag; /**< Bitfield for the display flags */ + uint16_t all_flags; /**< Shortcut to all display flags (for reset) */ } s_display_flags_t; extern volatile s_display_flags_t display; diff --git a/boards/msba2-common/include/msba2_common.h b/boards/msba2-common/include/msba2_common.h index 84ef700dff..6c81ffc5e6 100644 --- a/boards/msba2-common/include/msba2_common.h +++ b/boards/msba2-common/include/msba2_common.h @@ -28,8 +28,10 @@ extern "C" { #endif -#define VICIntEnClear VICIntEnClr +/** + * @brief Feed sequence for PLL register + */ static inline void pllfeed(void) { PLLFEED = 0xAA; diff --git a/boards/msba2-common/tools/src/boot.h b/boards/msba2-common/tools/src/boot.h index 80464dcc3a..323e7d16a3 100644 --- a/boards/msba2-common/tools/src/boot.h +++ b/boards/msba2-common/tools/src/boot.h @@ -16,7 +16,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/** + * @brief structure to hold boot partition + */ + typedef struct { - int size; - const int *prog; + int size; /**< size of partition */ + const int *prog; /**< partition data */ } boot_t; diff --git a/boards/msba2-common/tools/src/chipinfo.h b/boards/msba2-common/tools/src/chipinfo.h index 41c1a9cc46..63b6dd8ffa 100644 --- a/boards/msba2-common/tools/src/chipinfo.h +++ b/boards/msba2-common/tools/src/chipinfo.h @@ -18,20 +18,26 @@ extern char *lpc_return_strings[]; +/** + * @brief struct defining sector information + */ struct sector_info_struct { /* an array of */ - int address; /* where each sector is located */ - int size; /* and how big it is */ + int address; /**< where each sector is located */ + int size; /**< and how big it is */ }; +/** + * @brief alksd + */ struct chip_info_struct { - char *part_number; /* human readable part number */ - char *id_string; /* id string sent by "J" command */ - unsigned int ram_addr; /* where to download into RAM */ - int chunk_size; /* download to ram chunk size */ - int num_sector; /* number of flash sectors */ - struct sector_info_struct *layout; /* layout of sectors */ - const unsigned int *bootprog; /* code that boots into user program - (NULL = DTR/RTS only) */ + char *part_number; /**< human readable part number */ + char *id_string; /**< id string sent by "J" command */ + unsigned int ram_addr; /**< where to download into RAM */ + int chunk_size; /**< download to ram chunk size */ + int num_sector; /**< number of flash sectors */ + struct sector_info_struct *layout; /**< layout of sectors */ + const unsigned int *bootprog; /**< code that boots into user program + (NULL = DTR/RTS only) */ }; extern struct chip_info_struct chip_info[]; diff --git a/boards/nucleo32-f042/include/board.h b/boards/nucleo32-f042/include/board.h index dfb15c46ca..8a2b7d9f18 100644 --- a/boards/nucleo32-f042/include/board.h +++ b/boards/nucleo32-f042/include/board.h @@ -36,7 +36,7 @@ extern "C" { #define LED0_ON (GPIOB->BSRR = LED0_MASK) #define LED0_OFF (GPIOB->BRR = LED0_MASK) #define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK) -/** }@ */ +/** @} */ /** * @brief Initialize board specific hardware, including clock, LEDs and std-IO diff --git a/boards/waspmote-pro/include/board.h b/boards/waspmote-pro/include/board.h index 84c497ad53..1243fb6b93 100644 --- a/boards/waspmote-pro/include/board.h +++ b/boards/waspmote-pro/include/board.h @@ -160,8 +160,10 @@ extern "C" { PCICR |= (1 << PCIE0); \ PCMSK0 |= (1 << PCINT5); \ } while (0) +/** @cond INTERNAL */ #define AVR_CONTEXT_SWAP_INTERRUPT_VECT PCINT0_vect #define AVR_CONTEXT_SWAP_TRIGGER PORTB ^= (1 << PB5) +/** @endcond */ /** * @brief xtimer configuration values diff --git a/cpu/atmega_common/avr-libc-extra/errno.h b/cpu/atmega_common/avr-libc-extra/errno.h index c418aa26ca..a8b21f75bb 100644 --- a/cpu/atmega_common/avr-libc-extra/errno.h +++ b/cpu/atmega_common/avr-libc-extra/errno.h @@ -55,7 +55,7 @@ extern "C" { #endif /** - * @brief Export errno value + * @brief number of last error */ extern int errno; diff --git a/cpu/cc26x0/doc.txt b/cpu/cc26x0/doc.txt index dbfecb2533..e7dbcc0a4e 100644 --- a/cpu/cc26x0/doc.txt +++ b/cpu/cc26x0/doc.txt @@ -5,7 +5,7 @@ */ /** - * @defgroup cpu_specific_peripheral_memory_map CC26x0 peripheral memory map + * @defgroup cpu_specific_peripheral_memory_map Texas Instruments CC26x0 peripheral memory map * @ingroup cpu */ diff --git a/cpu/x86/include/x86_rtc.h b/cpu/x86/include/x86_rtc.h index 9f9a95ad4d..a94505607a 100644 --- a/cpu/x86/include/x86_rtc.h +++ b/cpu/x86/include/x86_rtc.h @@ -50,7 +50,8 @@ typedef union x86_rtc_data { uint8_t second, minute, hour; uint8_t day, month, year, century; }; - uint64_t timestamp; + uint64_t timestamp; /**< The full timestamp as a 64bit integer + representation */ } x86_rtc_data_t; #define RTC_REG_SECOND (0x00) diff --git a/dist/tools/doccheck/check.sh b/dist/tools/doccheck/check.sh index 3449fba829..c82131a25e 100755 --- a/dist/tools/doccheck/check.sh +++ b/dist/tools/doccheck/check.sh @@ -6,52 +6,11 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. -TMP_ERR=$(mktemp) -TMP_WARN=$(mktemp) -TMP_DOC=$(mktemp) -ERR_DIFFFILTER="--diff-filter=AC" -WARN_DIFFFILTER="--diff-filter=MR" - -# If no branch but an option is given, unset BRANCH. -# Otherwise, consume this parameter. -BRANCH="${1}" -if echo "${BRANCH}" | grep -q '^-'; then - if [ $(git rev-parse --abbrev-ref HEAD) != "master" ]; then - BRANCH="master" - else - BRANCH="" - fi -else - if [ -n "${BRANCH}" ]; then - shift 1 - fi -fi - - -# select files to check -if [ -z "${BRANCH}" ]; then - git ls-tree -r --full-tree --name-only HEAD | grep -E '\.([sSch]|cpp)$' | sort | uniq > ${TMP_WARN} -else - git diff ${ERR_DIFFFILTER} --name-only $(git merge-base ${BRANCH} HEAD) | grep -E '\.([sSchp]|cpp)$' | sort | uniq > ${TMP_ERR} - git diff ${WARN_DIFFFILTER} --name-only $(git merge-base ${BRANCH} HEAD) | grep -E '\.([sSchp]|cpp)$' | sort | uniq > ${TMP_WARN} -fi - -make doc 2>&1 | grep '.*warning' | sed "s#.*${PWD}/\([^:]*\).*#\1#" | sort | uniq > ${TMP_DOC} - -WARNINGS=$(comm -1 -2 ${TMP_WARN} ${TMP_DOC}) -ERRORS=$(comm -1 -2 ${TMP_ERR} ${TMP_DOC}) - -rm ${TMP_ERR} ${TMP_WARN} ${TMP_DOC} - -if [ -n "${WARNINGS}" ] -then -echo "WARNING: The following modified files generate doxygen warnings:" -echo "${WARNINGS}" -fi +ERRORS=$(make doc 2>&1 | grep '.*warning' | sed "s#.*${PWD}/\([^:]*\).*#\1#" | sort | uniq) if [ -n "${ERRORS}" ] then - echo "ERROR: The following new files generate doxygen warnings:" + echo "ERROR: The following files generate doxygen warnings:" echo "${ERRORS}" exit 2 else diff --git a/doc/doxygen/riot.doxyfile b/doc/doxygen/riot.doxyfile index 5925eaa27b..ebc1fb610a 100644 --- a/doc/doxygen/riot.doxyfile +++ b/doc/doxygen/riot.doxyfile @@ -818,6 +818,8 @@ EXCLUDE_SYMLINKS = NO # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = */board/*/tools/* \ + *_params.h \ + */boards/x86-multiboot-common/include/multiboot.h \ */cpu/atmega_common/include/sys/*.h \ */cpu/msp430_common/include/stdatomic.h \ */cpu/msp430_common/include/sys/*.h \ @@ -827,6 +829,7 @@ EXCLUDE_PATTERNS = */board/*/tools/* \ */drivers/nrf24l01p/include/nrf24l01p_settings.h \ */pkg/*/*/* \ */pkg/tlsf/patch.txt \ + */sys/include/embUnit/* \ */sys/random/tinymt32/* \ */toolchain/* \ */vendor/* \ @@ -2332,7 +2335,7 @@ PLANTUML_JAR_PATH = # Minimum value: 0, maximum value: 10000, default value: 50. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_GRAPH_MAX_NODES = 50 +DOT_GRAPH_MAX_NODES = 100 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs # generated by dot. A depth value of 3 means that only nodes reachable from the diff --git a/drivers/include/hdc1000.h b/drivers/include/hdc1000.h index 340bc81b86..e912ea2d06 100644 --- a/drivers/include/hdc1000.h +++ b/drivers/include/hdc1000.h @@ -116,7 +116,7 @@ int hdc1000_init(hdc1000_t *dev, const hdc1000_params_t *params); * * After the conversion is triggered, one has to wait * @ref HDC1000_CONVERSION_TIME us until the results can be read using - * @ref hdc1000_reg_results(). + * @ref hdc1000_get_results(). * * @param[in] dev device descriptor of sensor */ diff --git a/drivers/include/lsm303dlhc.h b/drivers/include/lsm303dlhc.h index be7e5bd182..d6f0e4f506 100644 --- a/drivers/include/lsm303dlhc.h +++ b/drivers/include/lsm303dlhc.h @@ -31,9 +31,11 @@ extern "C" { /** * @brief The sensors default I2C address + * @{ */ #define LSM303DLHC_ACC_DEFAULT_ADDRESS (0x19) #define LSM303DLHC_MAG_DEFAULT_ADDRESS (0x1e) +/** @} */ /** * @brief Possible accelerometer sample rates @@ -92,9 +94,9 @@ typedef enum { * @brief 3d data container */ typedef struct { - int16_t x_axis; - int16_t y_axis; - int16_t z_axis; + int16_t x_axis; /**< holds the x axis value. WOW! */ + int16_t y_axis; /**< holds the y axis value. Not kidding. */ + int16_t z_axis; /**< surprise, holds the z axis value */ } lsm303dlhc_3d_data_t; /** diff --git a/drivers/include/mq3.h b/drivers/include/mq3.h index f10944e64d..364434aee0 100644 --- a/drivers/include/mq3.h +++ b/drivers/include/mq3.h @@ -27,6 +27,9 @@ extern "C" { #endif +/** + * @brief maximum unprocessed value fetched form the sensor + */ #define MQ3_MAX_RAW_VALUE (1023U) /** @@ -45,7 +48,7 @@ typedef struct { * can be made. * * @param[out] dev device descriptor of an MQ-3 sensor - * @param[in] adc the ADC device the sensor is connected to + * @param[in] adc_line the ADC device the sensor is connected to * * @return 0 on success * @return -1 on error diff --git a/drivers/include/periph/adc.h b/drivers/include/periph/adc.h index 557df3d5dc..49dc3131a6 100644 --- a/drivers/include/periph/adc.h +++ b/drivers/include/periph/adc.h @@ -116,7 +116,7 @@ int adc_init(adc_t line); * for the first to finish before its conversion starts. * * @param[in] line line to sample - * @param[in] resolution resolution to use for conversion + * @param[in] res resolution to use for conversion * * @return the sampled value on success * @return -1 if resolution is not applicable diff --git a/drivers/include/periph/timer.h b/drivers/include/periph/timer.h index cef145a777..b1fe7028a2 100644 --- a/drivers/include/periph/timer.h +++ b/drivers/include/periph/timer.h @@ -90,7 +90,7 @@ typedef struct { * * @param[in] dev the timer to initialize * @param[in] freq requested number of ticks per second - * @param[in] callback this callback is called in interrupt context, the + * @param[in] cb this callback is called in interrupt context, the * emitting channel is passed as argument * @param[in] arg argument to the callback * diff --git a/drivers/include/pir.h b/drivers/include/pir.h index a49476d8cf..098f4f12b8 100644 --- a/drivers/include/pir.h +++ b/drivers/include/pir.h @@ -36,10 +36,16 @@ typedef struct { kernel_pid_t msg_thread_pid; /**< thread to msg on irq */ } pir_t; +/** + * @brief value to configure sensitivity of sensore + */ #ifndef PIR_MSG_T_STATUS_START #define PIR_MSG_T_STATUS_START 150 #endif +/** + * @brief event type for a PIR sensor + */ typedef enum { PIR_STATUS_HI = PIR_MSG_T_STATUS_START, /**< motion was detected */ PIR_STATUS_LO, /**< no motion is detected */ diff --git a/drivers/include/rgbled.h b/drivers/include/rgbled.h index b952043177..8d41302ec7 100644 --- a/drivers/include/rgbled.h +++ b/drivers/include/rgbled.h @@ -32,10 +32,10 @@ extern "C" { * @brief Descriptor struct for rgbleds */ typedef struct { - pwm_t device; - int channel_r; - int channel_g; - int channel_b; + pwm_t device; /**< PWM device to use to control rgbleds */ + int channel_r; /**< set the R value in RGB */ + int channel_g; /**< set the G value in RGB */ + int channel_b; /**< set the B value in RGB */ } rgbled_t; diff --git a/drivers/include/sht11.h b/drivers/include/sht11.h index d347bc4a4f..f28f4a7b85 100644 --- a/drivers/include/sht11.h +++ b/drivers/include/sht11.h @@ -27,21 +27,21 @@ extern "C" { #endif -#define SHT11_NO_ACK (0) -#define SHT11_ACK (1) -//adr command r/w -#define SHT11_STATUS_REG_W (0x06) //000 0011 0 -#define SHT11_STATUS_REG_R (0x07) //000 0011 1 -#define SHT11_MEASURE_TEMP (0x03) //000 0001 1 -#define SHT11_MEASURE_HUMI (0x05) //000 0010 1 -#define SHT11_RESET (0x1E) //000 1111 0 +#define SHT11_NO_ACK (0) /**< don't ack read in `read_byte` */ +#define SHT11_ACK (1) /**< do acknowledge read in `read_byte` */ +/* adr command r/w */ +#define SHT11_STATUS_REG_W (0x06) /**< will write to status register */ +#define SHT11_STATUS_REG_R (0x07) /**< will read from status register */ +#define SHT11_MEASURE_TEMP (0x03) /**< tell sensor to measure temperature */ +#define SHT11_MEASURE_HUMI (0x05) /**< tell sensor to measure humidity */ +#define SHT11_RESET (0x1E) /**< reset the sensor */ -/* time to wait after toggling the data line */ +/** time to wait after toggling the data line */ #define SHT11_DATA_WAIT (1) -/* time to wait after toggling the clock line */ +/** time to wait after toggling the clock line */ #define SHT11_CLK_WAIT (1) -/* set measurement timeout to 1 second */ +/** set measurement timeout to 1 second */ #define SHT11_MEASURE_TIMEOUT (1000) /** diff --git a/sys/cpp11-compat/include/riot/chrono.hpp b/sys/cpp11-compat/include/riot/chrono.hpp index 4f94738714..46a89fa51e 100644 --- a/sys/cpp11-compat/include/riot/chrono.hpp +++ b/sys/cpp11-compat/include/riot/chrono.hpp @@ -14,7 +14,7 @@ * @brief C++11 chrono drop in replacement that adds the function now based on * xtimer/timex * @see - * std::thread, defined in header + * std::thread, defined in header thread * * * @author Raphael Hiesgen @@ -38,30 +38,37 @@ constexpr uint32_t microsecs_in_sec = 1000000; } // namespace anaonymous /** - * @brief time point to use for timed wait, as stdlib clocks are not available + * @brief A time point for timed wait, as clocks from the standard are not + * available on RIOT. */ class time_point { using native_handle_type = timex_t; public: /** - * @brief create a time point with seconds and microseconds set to 0 + * @brief Creates a time point with seconds and microseconds set to 0. */ inline time_point() : m_handle{0, 0} {} /** - * @brief create time point from timex_t struct + * @brief Create time point from timex_t struct. */ inline time_point(timex_t&& tp) : m_handle(tp) {} + /** + * @brief Use default copy constructor. + */ constexpr time_point(const time_point& tp) = default; + /** + * @brief Use default move constructor. + */ constexpr time_point(time_point&& tp) = default; /** - * @brief get access to the handle used to store the time information + * @brief Gives access to the native handle that stores the time information. */ inline native_handle_type native_handle() const { return m_handle; } /** - * @brief add a stdlib chrono::duration to this time point + * @brief Add a standard chrono::duration to this time point. */ template inline time_point& operator+=(const std::chrono::duration& d) { @@ -74,12 +81,12 @@ class time_point { } /** - * @brief returns seconds member as uint32_t + * @brief Returns seconds member as uint32_t. */ inline uint32_t seconds() const { return m_handle.seconds; } /** - * @brief returns microseconds member as uint32_t + * @brief Returns microseconds member as uint32_t. */ inline uint32_t microseconds() const { return m_handle.microseconds; } @@ -93,9 +100,9 @@ class time_point { }; /** - * @brief get the current time saved in a time point + * @brief Returns the current time saved in a time point. * - * @return time_point containing the current time + * @return time_point containing the current time. */ inline time_point now() { timex_t tp; @@ -104,7 +111,7 @@ inline time_point now() { } /** - * @brief compare two timepoints + * @brief Compares two timepoints. */ inline bool operator<(const time_point& lhs, const time_point& rhs) { return lhs.seconds() < rhs.seconds() @@ -113,21 +120,21 @@ inline bool operator<(const time_point& lhs, const time_point& rhs) { } /** - * @brief compare two timepoints + * @brief Compares two timepoints. */ inline bool operator>(const time_point& lhs, const time_point& rhs) { return rhs < lhs; } /** - * @brief compare two timepoints + * @brief Compares two timepoints. */ inline bool operator<=(const time_point& lhs, const time_point& rhs) { return !(rhs < lhs); } /** - * @brief compare two timepoints + * @brief Compare two timepoints. */ inline bool operator>=(const time_point& lhs, const time_point& rhs) { return !(lhs < rhs); diff --git a/sys/cpp11-compat/include/riot/condition_variable.hpp b/sys/cpp11-compat/include/riot/condition_variable.hpp index 3f0a3014ae..4b6b7ede6f 100644 --- a/sys/cpp11-compat/include/riot/condition_variable.hpp +++ b/sys/cpp11-compat/include/riot/condition_variable.hpp @@ -33,49 +33,110 @@ namespace riot { +/** + * @brief Status for timeout-based calls of the condition variable. + */ enum class cv_status { no_timeout, timeout }; /** - * @brief C++11 complient implementation of condition variable, uses the time - * point implemented in our chrono replacement instead of the - * specified one + * @brief C++11 compliant implementation of condition variable, uses the time + * point implemented in our chrono replacement instead of the + * specified one * @see * std::condition_variable * */ class condition_variable { - public: +public: + /** + * @brief The native handle type used by the condition variable. + */ using native_handle_type = priority_queue_t*; - inline condition_variable() { m_queue.first = NULL; } ~condition_variable(); + /** + * @brief Notify one thread waiting on this condition. + */ void notify_one() noexcept; + /** + * @brief Notify all threads waiting on this condition variable. + */ void notify_all() noexcept; + /** + * @brief Block until woken up through the condition variable. + * @param lock A lock that is locked by the current thread. + */ void wait(unique_lock& lock) noexcept; + /** + * @brief Block until woken up through the condition variable and a predicate + * is fulfilled. + * @param lock A lock that is locked by the current thread. + * @param pred A predicate that returns a bool to signify if the thread + * should continue to wait when woken up through the cv. + */ template void wait(unique_lock& lock, Predicate pred); + /** + * @brief Block until woken up through the condition variable or a specified + * point in time is reached. The lock is reacquired either way. + * @param lock A lock that is locked by the current thread. + * @param timeout_time Point in time when the thread is woken up + * independently of the condition variable. + * @return A status to signify if woken up due to a timeout or the cv. + */ cv_status wait_until(unique_lock& lock, const time_point& timeout_time); + /** + * @brief Block until woken up through the condition variable and a predicate + * is fulfilled or a specified point in time is reached. The lock is + * reacquired either way. + * @param lock A lock that is locked by the current thread. + * @param timeout_time Point in time when the thread is woken up + * independently of the condition variable. + * @param pred A predicate that returns a bool to signify if the + * thread should continue to wait when woken up through + * the cv. + * @return Result of the pred when the function returns. + */ template bool wait_until(unique_lock& lock, const time_point& timeout_time, Predicate pred); + /** + * @brief Blocks until woken up through the condition variable or when the + * thread has been blocked for a certain time. + * @param lock A lock that is locked by the current thread. + * @param rel_time The maximum time spent blocking. + * @return A status to signify if woken up due to a timeout or the cv. + */ template cv_status wait_for(unique_lock& lock, const std::chrono::duration& rel_time); + /** + * @brief Blocks until woken up through the condition variable and a predicate + * is fulfilled or when the thread has been blocked for a certain time. + * @param lock A lock that is locked by the current thread. + * @param rel_time The maximum time spent blocking. + * @param pred A predicate that returns a bool to signify if the thread + * should continue to wait when woken up through the cv. + * @return Result of the pred when the function returns. + */ template bool wait_for(unique_lock& lock, const std::chrono::duration& rel_time, Predicate pred); + /** + * @brief Returns the native handle of the condition variable. + */ inline native_handle_type native_handle() { return &m_queue; } - private: +private: condition_variable(const condition_variable&); condition_variable& operator=(const condition_variable&); diff --git a/sys/cpp11-compat/include/riot/detail/thread_util.hpp b/sys/cpp11-compat/include/riot/detail/thread_util.hpp index 6c1e76a2c2..1952df4bec 100644 --- a/sys/cpp11-compat/include/riot/detail/thread_util.hpp +++ b/sys/cpp11-compat/include/riot/detail/thread_util.hpp @@ -29,34 +29,49 @@ namespace riot { namespace detail { /** - * A list of integers (wraps a long... template parameter pack). + * @brief A list of integers (wraps a long... template parameter pack). */ template struct int_list {}; /** - * Creates indices for from `Pos` to `Max`. + * @brief Creates indices from `Pos` to `Max`. */ template > struct il_indices; +/** + * @brief End of recursion, `Pos` reached `Max`. + */ template struct il_indices> { + /** + * @brief Result is the list containing `Is...`. + */ using type = int_list; }; +/** + * @brief Recursion step. + */ template struct il_indices> { + /** + * @brief Append `Pos` to list and increment for the next step. + */ using type = typename il_indices>::type; }; +/** + * @brief Function to create a list of indices from `From` to `To`. + */ template typename il_indices::type get_indices() { return {}; } /** - * apply arguments to function + * @brief Apply arguments in a tuple to function. */ template inline auto apply_args(F& f, detail::int_list, Tuple&& tup) @@ -64,12 +79,20 @@ inline auto apply_args(F& f, detail::int_list, Tuple&& tup) return f(std::get(tup)...); } +/** + * @brief Prefix the argument tuple with additonal arguments. + * In this case the tuple is empty. + */ template inline auto apply_args_prefixed(F& f, detail::int_list<>, Tuple&, Ts&&... args) -> decltype(f(std::forward(args)...)) { return f(std::forward(args)...); } +/** + * @brief Prefix the argument tuple with additonal arguments. + * In this case the tuple is contains arguments. + */ template inline auto apply_args_prefixed(F& f, detail::int_list, Tuple& tup, Ts&&... args) @@ -77,6 +100,9 @@ inline auto apply_args_prefixed(F& f, detail::int_list, Tuple& tup, return f(std::forward(args)..., std::get(tup)...); } +/** + * @brief Suffix the tuple with additonal arguments. + */ template inline auto apply_args_suffxied(F& f, detail::int_list, Tuple& tup, Ts&&... args) diff --git a/sys/cpp11-compat/include/riot/mutex.hpp b/sys/cpp11-compat/include/riot/mutex.hpp index ca808cc9db..39cecad8ea 100644 --- a/sys/cpp11-compat/include/riot/mutex.hpp +++ b/sys/cpp11-compat/include/riot/mutex.hpp @@ -41,31 +41,66 @@ namespace riot { * */ class mutex { - public: +public: + /** + * The native handle type used by the mutex. + */ using native_handle_type = mutex_t*; inline constexpr mutex() noexcept : m_mtx{{0}} {} ~mutex(); + /** + * @brief Lock the mutex. + */ void lock(); + /** + * @brief Try to lock the mutex. + * @return `true` if the mutex was locked, `false` otherwise. + */ bool try_lock() noexcept; + /** + * @brief Unlock the mutex. + */ void unlock() noexcept; + /** + * @brief Provides access to the native handle. + * @return The native handle of the mutex. + */ inline native_handle_type native_handle() { return &m_mtx; } - private: +private: mutex(const mutex&); mutex& operator=(const mutex&); mutex_t m_mtx; }; +/** + * @brief Tag type for defer lock strategy. + */ struct defer_lock_t {}; +/** + * @brief Tag type for try lock strategy. + */ struct try_to_lock_t {}; +/** + * @brief Tag type for adopt lock strategy. + */ struct adopt_lock_t {}; +/** + * @brief Tag constant for defer lock strategy. + */ constexpr defer_lock_t defer_lock = defer_lock_t(); +/** + * @brief Tag constant for try lock strategy. + */ constexpr try_to_lock_t try_to_lock = try_to_lock_t(); +/** + * @brief Tag constant for adopt lock strategy. + */ constexpr adopt_lock_t adopt_lock = adopt_lock_t(); /** @@ -76,15 +111,24 @@ constexpr adopt_lock_t adopt_lock = adopt_lock_t(); */ template class lock_guard { - - public: +public: + /** + * The type of Mutex used by the lock_guard. + */ using mutex_type = Mutex; + /** + * @brief Constructs a lock_gurad from a Mutex and locks it. + */ inline explicit lock_guard(mutex_type& mtx) : m_mtx(mtx) { m_mtx.lock(); } + /** + * @brief Constructs a lock_guard from a Mutex, acquireing ownership without + * locking it. + */ inline lock_guard(mutex_type& mtx, adopt_lock_t) : m_mtx{mtx} {} inline ~lock_guard() { m_mtx.unlock(); } - private: +private: mutex_type& m_mtx; }; @@ -96,18 +140,33 @@ class lock_guard { */ template class unique_lock { - - public: +public: + /** + * The type of Mutex used by the lock. + */ using mutex_type = Mutex; inline unique_lock() noexcept : m_mtx{nullptr}, m_owns{false} {} + /** + * @brief Constructs a unique_lock from a Mutex and locks it. + */ inline explicit unique_lock(mutex_type& mtx) : m_mtx{&mtx}, m_owns{true} { m_mtx->lock(); } + /** + * @brief Constructs a unique_lock from a Mutex but does not lock it. + */ inline unique_lock(mutex_type& mtx, defer_lock_t) noexcept : m_mtx{&mtx}, m_owns{false} {} + /** + * @brief Constructs a unique_lock from a Mutex and tries to lock it. + */ inline unique_lock(mutex_type& mtx, try_to_lock_t) : m_mtx{&mtx}, m_owns{mtx.try_lock()} {} + /** + * @brief Constructs a unique_lock from a Mutex that is already owned by the + * thread. + */ inline unique_lock(mutex_type& mtx, adopt_lock_t) : m_mtx{&mtx}, m_owns{true} {} inline ~unique_lock() { @@ -115,11 +174,17 @@ class unique_lock { m_mtx->unlock(); } } + /** + * @brief Move constructor. + */ inline unique_lock(unique_lock&& lock) noexcept : m_mtx{lock.m_mtx}, m_owns{lock.m_owns} { lock.m_mtx = nullptr; lock.m_owns = false; } + /** + * @brief Move assignment operator. + */ inline unique_lock& operator=(unique_lock&& lock) noexcept { if (m_owns) { m_mtx->unlock(); @@ -131,16 +196,34 @@ class unique_lock { return *this; } + /** + * @brief Locks the associated mutex. + */ void lock(); + /** + * @brief Tries to lock the associated mutex. + * @return `true` if the mutex has been locked successfully, + * `false` otherwise. + */ bool try_lock(); - + /** + * @brief Unlocks the associated mutex. + */ void unlock(); + /** + * @brief Swap this unique_lock with another unique_lock. + */ inline void swap(unique_lock& lock) noexcept { std::swap(m_mtx, lock.m_mtx); std::swap(m_owns, lock.m_owns); } + /** + * @brief Disassociate this lock from its mutex. The caller is responsible to + * unlock the mutex if it was locked before. + * @return A pointer to the associated mutex or `nullptr` if there was none. + */ inline mutex_type* release() noexcept { mutex_type* mtx = m_mtx; m_mtx = nullptr; @@ -148,11 +231,25 @@ class unique_lock { return mtx; } + /** + * @brief Query ownership of the associate mutex. + * @return `true` if an associated mutex exists and the lock owns it, + * `false` otherwise. + */ inline bool owns_lock() const noexcept { return m_owns; } + /** + * @brief Operator to query the ownership of the associated mutex. + * @return `true` if an associated mutex exists and the lock owns it, + * `false` otherwise. + */ inline explicit operator bool() const noexcept { return m_owns; } + /** + * @brief Provides access to the associated mutex. + * @return A pointer to the associated mutex or nullptr it there was none. + */ inline mutex_type* mutex() const noexcept { return m_mtx; } - private: +private: unique_lock(unique_lock const&); unique_lock& operator=(unique_lock const&); @@ -203,6 +300,11 @@ void unique_lock::unlock() { m_owns = false; } +/** + * @brief Swaps two mutexes. + * @param[inout] lhs Reference to one mutex. + * @param[inout] rhs Reference to the other mutex. + */ template inline void swap(unique_lock& lhs, unique_lock& rhs) noexcept { lhs.swap(rhs); diff --git a/sys/cpp11-compat/include/riot/thread.hpp b/sys/cpp11-compat/include/riot/thread.hpp index 82ab32e5e7..cba69852d2 100644 --- a/sys/cpp11-compat/include/riot/thread.hpp +++ b/sys/cpp11-compat/include/riot/thread.hpp @@ -45,24 +45,39 @@ namespace riot { namespace { +/** + * @brief Identify uninitialized threads. + */ constexpr kernel_pid_t thread_uninitialized = -1; +/** + * @brief The stack size for new threads. + */ constexpr size_t stack_size = THREAD_STACKSIZE_MAIN; } +/** + * @brief Holds context data for the thread. + */ struct thread_data { thread_data() : ref_count{2}, joining_thread{thread_uninitialized} { // nop } + /** @cond INTERNAL */ std::atomic ref_count; kernel_pid_t joining_thread; char stack[stack_size]; + /** @endcond */ }; /** - * This deleter prevents our thread data from being destroyed if the thread - * object is destroyed before the thread had a chance to run + * @brief This deleter prevents our thread data from being destroyed if the + * thread object is destroyed before the thread had a chance to run. */ struct thread_data_deleter { + /** + * @brief Called by the deleter of a thread object to manage the lifetime of + * the thread internal management data. + */ void operator()(thread_data* ptr) { if (--ptr->ref_count == 0) { delete ptr; @@ -83,33 +98,60 @@ class thread_id { thread_id id); friend class thread; - public: +public: + /** + * @brief Creates a uninitialized thread id. + */ inline thread_id() noexcept : m_handle{thread_uninitialized} {} + /** + * @brief Create a thread id from a native handle. + */ inline thread_id(kernel_pid_t handle) : m_handle{handle} {} + /** + * @brief Comparison operator for thread ids. + */ inline bool operator==(thread_id other) noexcept { return m_handle == other.m_handle; } + /** + * @brief Comparison operator for thread ids. + */ inline bool operator!=(thread_id other) noexcept { return !(m_handle == other.m_handle); } + /** + * @brief Comparison operator for thread ids. + */ inline bool operator<(thread_id other) noexcept { return m_handle < other.m_handle; } + /** + * @brief Comparison operator for thread ids. + */ inline bool operator<=(thread_id other) noexcept { return !(m_handle > other.m_handle); } + /** + * @brief Comparison operator for thread ids. + */ inline bool operator>(thread_id other) noexcept { return m_handle > other.m_handle; } + /** + * @brief Comparison operator for thread ids. + */ inline bool operator>=(thread_id other) noexcept { return !(m_handle < other.m_handle); } - private: +private: kernel_pid_t m_handle; }; +/** + * @brief Enable printing of thread ids using output streams. + */ template inline std::basic_ostream& operator<<(std::basic_ostream & out, @@ -119,9 +161,23 @@ inline std::basic_ostream& operator<<(std::basic_ostream namespace this_thread { +/** + * @brief Access the id of the currently running thread. + */ inline thread_id get_id() noexcept { return thread_getpid(); } +/** + * @brief Yield the currently running thread. + */ inline void yield() noexcept { thread_yield(); } +/** + * @brief Puts the current thread to sleep. + * @param[in] ns Duration to sleep in nanoseconds. + */ void sleep_for(const std::chrono::nanoseconds& ns); +/** + * @brief Puts the current thread to sleep. + * @param[in] sleep_duration The duration to sleep. + */ template void sleep_for(const std::chrono::duration& sleep_duration) { using namespace std::chrono; @@ -139,6 +195,11 @@ void sleep_for(const std::chrono::duration& sleep_duration) { sleep_for(ns); } } +/** + * @brief Puts the current thread to sleep. + * @param[in] sleep_time A point in time that specifies when the thread + * should wake up. + */ inline void sleep_until(const riot::time_point& sleep_time) { mutex mtx; condition_variable cv; @@ -149,7 +210,7 @@ inline void sleep_until(const riot::time_point& sleep_time) { } } // namespace this_thread -/* +/** * @brief C++11 compliant implementation of thread, however uses the time * point from out chrono header instead of the specified one * @see @@ -157,44 +218,100 @@ inline void sleep_until(const riot::time_point& sleep_time) { * */ class thread { - public: +public: + /** + * @brief The id is of type `thread_id`- + */ using id = thread_id; + /** + * @brief The native handle type is the `kernel_pid_t` of RIOT. + */ using native_handle_type = kernel_pid_t; + /** + * @brief Per default, an uninitialized thread is created. + */ inline thread() noexcept : m_handle{thread_uninitialized} {} + /** + * @brief Create a thread from a functor and arguments for it. + * @param[in] f Functor to run as a thread. + * @param[in] args Arguments passed to the functor. + */ template explicit thread(F&& f, Args&&... args); - ~thread(); - thread(const thread&) = delete; + /** + * @brief Move constructor. + */ inline thread(thread&& t) noexcept : m_handle{t.m_handle} { t.m_handle = thread_uninitialized; std::swap(m_data, t.m_data); } + + ~thread(); + thread& operator=(const thread&) = delete; + /** + * @brief Move assignment operator. + */ thread& operator=(thread&&) noexcept; + /** + * @brief Swap threads. + * @param[inout] t Thread to swap data with. + */ void swap(thread& t) noexcept { std::swap(m_data, t.m_data); std::swap(m_handle, t.m_handle); } + /** + * @brief Query if the thread is joinable. + * @return `true` if the thread is joinable, `false` otherwise. + */ inline bool joinable() const noexcept { return m_handle != thread_uninitialized; } + /** + * @brief Block until the thread finishes. Leads to an error if the thread is + * not joinable or a thread joins itself. + */ void join(); + /** + * @brief Detaches a thread from its handle and allows it to execute + * independently. The thread cleans up its resources when it + * finishes. + */ void detach(); + /** + * @brief Returns the id of a thread. + */ inline id get_id() const noexcept { return m_handle; } + /** + * @brief Returns the native handle to a thread. + */ inline native_handle_type native_handle() noexcept { return m_handle; } + /** + * @brief Returns the number of concurrent threads supported by the + * underlying hardware. Since there is no RIOT API to query this + * information, the function always returns 1; + */ static unsigned hardware_concurrency() noexcept; +private: kernel_pid_t m_handle; std::unique_ptr m_data; }; +/** + * @brief Swaps two threads. + * @param[inout] lhs Reference to one thread. + * @param[inout] rhs Reference to the other thread. + */ void swap(thread& lhs, thread& rhs) noexcept; +/** @cond INTERNAL */ template void* thread_proxy(void* vp) { { // without this scope, the objects here are not cleaned up corrctly @@ -217,6 +334,7 @@ void* thread_proxy(void* vp) { sched_task_exit(); return nullptr; } +/** @endcond */ template thread::thread(F&& f, Args&&... args) @@ -224,7 +342,7 @@ thread::thread(F&& f, Args&&... args) using namespace std; using func_and_args = tuple ::type, typename decay::type...>; - std::unique_ptr p( + unique_ptr p( new func_and_args(m_data.get(), forward(f), forward(args)...)); m_handle = thread_create( m_data->stack, stack_size, THREAD_PRIORITY_MAIN - 1, 0, diff --git a/sys/include/color.h b/sys/include/color.h index 7ef303a56b..d4e6cd230b 100644 --- a/sys/include/color.h +++ b/sys/include/color.h @@ -91,7 +91,7 @@ void color_rgb2hex(const color_rgb_t *rgb, uint32_t *hex); * Expect unexpected behaviour, otherwise. * * @param[in] str Input color encoded as string of the form 'RRGGBB' - * @param[out] rgb Output color encoded in RGB space + * @param[out] color Output color encoded in RGB space */ void color_str2rgb(const char *str, color_rgb_t *color); diff --git a/sys/include/hashes/sha256.h b/sys/include/hashes/sha256.h index 7950d015b5..95b41a940a 100644 --- a/sys/include/hashes/sha256.h +++ b/sys/include/hashes/sha256.h @@ -120,17 +120,17 @@ void sha256_final(sha256_context_t *ctx, void *digest); * @brief A wrapper function to simplify the generation of a hash, this is * usefull for generating sha256 for one buffer * - * @param data pointer to the buffer to generate hash from - * @param len length of the buffer - * @param digest optional pointer to an array for the result, length must be - * SHA256_DIGEST_LENGTH - * if digest == NULL, one static buffer is used + * @param[in] data pointer to the buffer to generate hash from + * @param[in] len length of the buffer + * @param[out] digest optional pointer to an array for the result, length must + * be SHA256_DIGEST_LENGTH + * if digest == NULL, one static buffer is used */ void *sha256(const void *data, size_t len, void *digest); /** * @brief hmac_sha256_init HMAC SHA-256 calculation. Initiate calculation of a HMAC - * @param ctx hmac_context_t handle to use + * @param[in] ctx hmac_context_t handle to use * @param[in] key key used in the hmac-sha256 computation * @param[in] key_length the size in bytes of the key */ @@ -138,15 +138,15 @@ void hmac_sha256_init(hmac_context_t *ctx, const void *key, size_t key_length); /** * @brief hmac_sha256_update Add data bytes for HMAC calculation - * @param ctx hmac_context_t handle to use - * @param data[in] pointer to the buffer to generate hash from - * @param len[in] length of the buffer + * @param[in] ctx hmac_context_t handle to use + * @param[in] data pointer to the buffer to generate hash from + * @param[in] len length of the buffer */ void hmac_sha256_update(hmac_context_t *ctx, const void *data, size_t len); /** * @brief hmac_sha256_final HMAC SHA-256 finalization. Finish HMAC calculation and export the value - * @param ctx hmac_context_t handle to use + * @param[in] ctx hmac_context_t handle to use * @param[out] digest the computed hmac-sha256, * length MUST be SHA256_DIGEST_LENGTH * if digest == NULL, a static buffer is used diff --git a/sys/include/net/gnrc/ipv6/netif.h b/sys/include/net/gnrc/ipv6/netif.h index f3a913c355..c789d452df 100644 --- a/sys/include/net/gnrc/ipv6/netif.h +++ b/sys/include/net/gnrc/ipv6/netif.h @@ -38,9 +38,7 @@ extern "C" { #endif /** - * @def GNRC_IPV6_NETIF_ADDR_NUMOF - * - * @brief Number of IPv6 addresses per interface. + * @cond INTERNAL */ #ifdef MODULE_GNRC_RPL /* RPL needs all-RPL-nodes multicast address */ @@ -54,6 +52,12 @@ extern "C" { #else # define GNRC_IPV6_NETIF_RTR_ADDR (0) #endif +/** + * @endcond + */ +/** + * @brief Number of IPv6 addresses per interface. + */ #ifndef GNRC_IPV6_NETIF_ADDR_NUMOF #define GNRC_IPV6_NETIF_ADDR_NUMOF (6 + GNRC_IPV6_NETIF_RPL_ADDR + GNRC_IPV6_NETIF_RTR_ADDR) #endif diff --git a/sys/include/net/gnrc/mac/types.h b/sys/include/net/gnrc/mac/types.h index fd860ecee1..d69b2be3e8 100644 --- a/sys/include/net/gnrc/mac/types.h +++ b/sys/include/net/gnrc/mac/types.h @@ -54,7 +54,7 @@ typedef enum { * state machines. * This structure can be extended to contain more needed * states and parameters. Please guard them by appropriate - * #ifdef directives when applicable. + * \#ifdef directives when applicable. */ typedef struct { #if (GNRC_MAC_RX_QUEUE_SIZE != 0) || defined(DOXYGEN) @@ -137,7 +137,7 @@ typedef struct { * state machines. * This structure can be extended to contain more needed * states and parameters. Please guard them by appropriate - * #ifdef directives when applicable. + * \#ifdef directives when applicable. */ typedef struct { #if (GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN) diff --git a/sys/include/net/gnrc/netif/hdr.h b/sys/include/net/gnrc/netif/hdr.h index 425278d71d..3c75ba2651 100644 --- a/sys/include/net/gnrc/netif/hdr.h +++ b/sys/include/net/gnrc/netif/hdr.h @@ -36,6 +36,11 @@ extern "C" { * in bytes. */ #define GNRC_NETIF_HDR_L2ADDR_MAX_LEN (8) + +/** + * @brief Maximum length of the string representatiom of l2 addresses of the + * generic interface header in bytes. + */ #define GNRC_NETIF_HDR_L2ADDR_PRINT_LEN (GNRC_NETIF_HDR_L2ADDR_MAX_LEN * 3) /** @@ -199,7 +204,8 @@ gnrc_pktsnip_t *gnrc_netif_hdr_build(uint8_t *src, uint8_t src_len, uint8_t *dst */ void gnrc_netif_hdr_print(gnrc_netif_hdr_t *hdr); -/* @brief Fetch the netif header flags of a gnrc packet +/** + * @brief Fetch the netif header flags of a gnrc packet * * @param[in] pkt gnrc packet from whom to fetch * @@ -208,7 +214,8 @@ void gnrc_netif_hdr_print(gnrc_netif_hdr_t *hdr); */ uint8_t gnrc_netif_hdr_get_flag(gnrc_pktsnip_t* pkt); -/* @brief Extract the destination address out of a gnrc packet +/** + * @brief Extract the destination address out of a gnrc packet * * @param[in] pkt gnrc packet from whom to extract * @param[out] pointer_to_addr pointer to address will be stored here @@ -219,7 +226,8 @@ uint8_t gnrc_netif_hdr_get_flag(gnrc_pktsnip_t* pkt); */ int gnrc_netif_hdr_get_dstaddr(gnrc_pktsnip_t* pkt, uint8_t** pointer_to_addr); -/* @brief Extract the source address out of a gnrc packet +/** + * @brief Extract the source address out of a gnrc packet * * @param[in] pkt gnrc packet from whom to extract * @param[out] pointer_to_addr pointer to address will be stored here diff --git a/sys/include/net/gnrc/netreg.h b/sys/include/net/gnrc/netreg.h index 0e506683ed..92f5141b0c 100644 --- a/sys/include/net/gnrc/netreg.h +++ b/sys/include/net/gnrc/netreg.h @@ -37,6 +37,11 @@ extern "C" { #if defined(MODULE_GNRC_NETAPI_MBOX) || defined(MODULE_GNRC_NETAPI_CALLBACKS) || \ defined(DOXYGEN) +/** + * @brief The type of the netreg entry. + * + * Different types are availalbe dependent on the used modules. + */ typedef enum { GNRC_NETREG_TYPE_DEFAULT = 0, #if defined(MODULE_GNRC_NETAPI_MBOX) || defined(DOXYGEN) @@ -95,7 +100,7 @@ typedef enum { * * @param[in] demux_ctx The @ref gnrc_netreg_entry_t::demux_ctx "demux context" * for the netreg entry - * @param[in] cb Target callback for the registry entry + * @param[in] cbd Target callback for the registry entry * * @note Only available with @ref net_gnrc_netapi_callbacks. * @@ -108,7 +113,7 @@ typedef enum { /** * @brief Packet handler callback for netreg entries with callback. * - * @pre `cmd` $\in$ { @ref GNRC_NETAPI_MSG_TYPE_RCV, @ref GNRC_NETAPI_MSG_TYPE_SND } + * @pre `cmd` ∈ { @ref GNRC_NETAPI_MSG_TYPE_RCV, @ref GNRC_NETAPI_MSG_TYPE_SND } * * @note Only available with @ref net_gnrc_netapi_callbacks. * @@ -237,7 +242,7 @@ static inline void gnrc_netreg_entry_init_mbox(gnrc_netreg_entry_t *entry, * @param[out] entry A netreg entry * @param[in] demux_ctx The @ref gnrc_netreg_entry_t::demux_ctx "demux context" * for the netreg entry - * @param[in] mbox Target callback for the registry entry + * @param[in] cbd Target callback for the registry entry * * @note Only available with @ref net_gnrc_netapi_callbacks. */ diff --git a/sys/include/net/gnrc/rpl/structs.h b/sys/include/net/gnrc/rpl/structs.h index d61ceeea61..69afc52ea9 100644 --- a/sys/include/net/gnrc/rpl/structs.h +++ b/sys/include/net/gnrc/rpl/structs.h @@ -200,13 +200,23 @@ typedef struct __attribute__((packed)) { ipv6_addr_t prefix; /**< prefix used for Stateless Address Autoconfiguration */ } gnrc_rpl_opt_prefix_info_t; +/** + * @brief DODAG representation + */ typedef struct gnrc_rpl_dodag gnrc_rpl_dodag_t; -typedef struct gnrc_rpl_parent gnrc_rpl_parent_t; -typedef struct gnrc_rpl_instance gnrc_rpl_instance_t; /** * @brief Parent representation */ +typedef struct gnrc_rpl_parent gnrc_rpl_parent_t; + +/** + * @brief Instance representation + */ +typedef struct gnrc_rpl_instance gnrc_rpl_instance_t; + +/** + * @cond INTERNAL */ struct gnrc_rpl_parent { gnrc_rpl_parent_t *next; /**< pointer to the next parent */ uint8_t state; /**< 0 for unsued, 1 for used */ @@ -218,6 +228,9 @@ struct gnrc_rpl_parent { double link_metric; /**< metric of the link */ uint8_t link_metric_type; /**< type of the metric */ }; +/** + * @endcond + */ /** * @brief Objective function representation @@ -234,7 +247,7 @@ typedef struct { } gnrc_rpl_of_t; /** - * @brief DODAG representation + * @cond INTERNAL */ struct gnrc_rpl_dodag { ipv6_addr_t dodag_id; /**< id of the DODAG */ @@ -262,9 +275,6 @@ struct gnrc_rpl_dodag { trickle_t trickle; /**< trickle representation */ }; -/** - * @brief Instance representation - */ struct gnrc_rpl_instance { uint8_t id; /**< id of the instance */ uint8_t state; /**< 0 for unused, 1 for used */ @@ -275,6 +285,9 @@ struct gnrc_rpl_instance { uint16_t max_rank_inc; /**< max increase in the rank */ int8_t cleanup; /**< cleanup time in seconds */ }; +/** + * @endcond + */ #ifdef __cplusplus } diff --git a/sys/include/net/gnrc/sixlowpan/iphc.h b/sys/include/net/gnrc/sixlowpan/iphc.h index 14dcbb9fb0..82e0c76041 100644 --- a/sys/include/net/gnrc/sixlowpan/iphc.h +++ b/sys/include/net/gnrc/sixlowpan/iphc.h @@ -41,6 +41,7 @@ extern "C" { * @param[in] datagram_size Size of the full uncompressed IPv6 datagram. May be 0, if @p pkt * contains the full (unfragmented) IPv6 datagram. * @param[in] offset Offset of the IPHC dispatch in 6LoWPaN frame. + * @param[in, out] nh_len Pointer to next header length * * @return length of the HC dispatches + inline values on success. * @return 0 on error. diff --git a/sys/include/net/gnrc/sixlowpan/nd/router.h b/sys/include/net/gnrc/sixlowpan/nd/router.h index 99114c03ff..61d3701622 100644 --- a/sys/include/net/gnrc/sixlowpan/nd/router.h +++ b/sys/include/net/gnrc/sixlowpan/nd/router.h @@ -157,7 +157,7 @@ void gnrc_sixlowpan_nd_router_abr_remove(gnrc_sixlowpan_nd_router_abr_t *abr); /** * @brief Makes this node a new border router. * - * @per addr != NULL + * @pre addr != NULL * * @param[in] addr The local address to use in the ABROs * @param[in] ltime The lifetime to advertise in the ABROs. 0 assumes a default value of @@ -174,7 +174,7 @@ gnrc_sixlowpan_nd_router_abr_t *gnrc_sixlowpan_nd_router_abr_create(ipv6_addr_t * * @pre iface != NULL && prefix != NULL * - * @param[in] abr The local border router + * @param[in] abr The local border router. * @param[in] iface The IPv6 interface the prefix was added to. * @param[in] prefix The prefix. * @@ -188,7 +188,7 @@ int gnrc_sixlowpan_nd_router_abr_add_prf(gnrc_sixlowpan_nd_router_abr_t* abr, /** * @brief Removes a prefix from this border router. * - * @param[in] abr The local border router + * @param[in] abr The local border router. * @param[in] iface The IPv6 interface the prefix was added to. * @param[in] prefix The prefix. */ @@ -199,7 +199,7 @@ void gnrc_sixlowpan_nd_router_abr_rem_prf(gnrc_sixlowpan_nd_router_abr_t *abr, * @brief Adds a context for this border router to manage. * * @param[in] abr The local border router - * @param[in] ctx The context to be add. + * @param[in] cid The context to be add. * * @return 0, on success * @return -EINVAL, if @p ctx is greater than 15. @@ -210,8 +210,8 @@ int gnrc_sixlowpan_nd_router_abr_add_ctx(gnrc_sixlowpan_nd_router_abr_t *abr, ui /** * @brief Removes a context from this border router. * - * @param[in] abr The local border router - * @param[in] ctx The context to be remove. + * @param[in] abr The local border router. + * @param[in] cid The context to be remove. */ void gnrc_sixlowpan_nd_router_abr_rem_ctx(gnrc_sixlowpan_nd_router_abr_t *abr, uint8_t cid); #else diff --git a/sys/include/net/ipv6/ext/rh.h b/sys/include/net/ipv6/ext/rh.h index a02c4752fd..9f2b3c6a99 100644 --- a/sys/include/net/ipv6/ext/rh.h +++ b/sys/include/net/ipv6/ext/rh.h @@ -61,7 +61,7 @@ typedef struct __attribute__((packed)) { * @brief Process the routing header of an IPv6 packet. * * @param[in, out] ipv6 An IPv6 packet. - * @param[in] ext A routing header of @ipv6. + * @param[in] ext A routing header of @p ipv6. * * @return EXT_RH_CODE_ERROR * @return EXT_RH_CODE_FORWARD diff --git a/sys/include/random.h b/sys/include/random.h index 886244d018..85eb4bb13c 100644 --- a/sys/include/random.h +++ b/sys/include/random.h @@ -32,6 +32,9 @@ extern "C" { #endif +/** + * @brief Enables support for floating point random number generation + */ #ifndef PRNG_FLOAT # define PRNG_FLOAT (0) #endif diff --git a/sys/include/xtimer.h b/sys/include/xtimer.h index 8f12e5043e..eab6301f25 100644 --- a/sys/include/xtimer.h +++ b/sys/include/xtimer.h @@ -47,7 +47,7 @@ extern "C" { * @note This is a struct in order to make the xtimer API type strict */ typedef struct { - uint64_t ticks64; + uint64_t ticks64; /**< Tick count */ } xtimer_ticks64_t; /** @@ -56,7 +56,7 @@ typedef struct { * @note This is a struct in order to make the xtimer API type strict */ typedef struct { - uint32_t ticks32; + uint32_t ticks32; /**< Tick count */ } xtimer_ticks32_t; /** @@ -68,12 +68,12 @@ typedef void (*xtimer_callback_t)(void*); * @brief xtimer timer structure */ typedef struct xtimer { - struct xtimer *next; /**< reference to next timer in timer lists */ - uint32_t target; /**< lower 32bit absolute target time */ - uint32_t long_target; /**< upper 32bit absolute target time */ + struct xtimer *next; /**< reference to next timer in timer lists */ + uint32_t target; /**< lower 32bit absolute target time */ + uint32_t long_target; /**< upper 32bit absolute target time */ xtimer_callback_t callback; /**< callback function to call when timer expires */ - void *arg; /**< argument to pass to callback function */ + void *arg; /**< argument to pass to callback function */ } xtimer_t; /** diff --git a/sys/net/gnrc/sock/include/gnrc_sock_internal.h b/sys/net/gnrc/sock/include/gnrc_sock_internal.h index 98ba45e190..32e8812ee6 100644 --- a/sys/net/gnrc/sock/include/gnrc_sock_internal.h +++ b/sys/net/gnrc/sock/include/gnrc_sock_internal.h @@ -38,11 +38,23 @@ extern "C" { #endif /** - * @brief Default port range for dynamic source port allocation + * @brief Minimum port number in the dynamic portrange */ #define GNRC_SOCK_DYN_PORTRANGE_MIN (IANA_DYNAMIC_PORTRANGE_MIN) +/** + * @brief Maximum port number in the dynamic portrange + */ #define GNRC_SOCK_DYN_PORTRANGE_MAX (IANA_DYNAMIC_PORTRANGE_MAX) + +/** + * @brief Available ports in the range for dynamic source port allocation + */ #define GNRC_SOCK_DYN_PORTRANGE_NUM (GNRC_SOCK_DYN_PORTRANGE_MAX - GNRC_SOCK_DYN_PORTRANGE_MIN + 1) + +/** + * @brief Error value indicating that no free port could be found in the + * dynamic port range + */ #define GNRC_SOCK_DYN_PORTRANGE_ERR (0) /** diff --git a/sys/posix/include/semaphore.h b/sys/posix/include/semaphore.h index c10d4f76af..91dcaed3df 100644 --- a/sys/posix/include/semaphore.h +++ b/sys/posix/include/semaphore.h @@ -34,6 +34,9 @@ extern "C" { #endif +/** + * @brief POSIX-specific semaphore type + */ typedef sema_t sem_t; /** diff --git a/sys/posix/pthread/include/pthread.h b/sys/posix/pthread/include/pthread.h index df5d5d6092..daa6e3de3b 100644 --- a/sys/posix/pthread/include/pthread.h +++ b/sys/posix/pthread/include/pthread.h @@ -22,9 +22,15 @@ #include +/** + * @cond INTERNAL + */ #ifndef __WITH_AVRLIBC__ #define HAVE_MALLOC_H 1 #endif +/** + * @endcond + */ #include "mutex.h" #include "sched.h"