/*#*
*#* $Log$
+ *#* Revision 1.20 2006/06/10 05:36:15 bernie
+ *#* Convert to new Doxygen comments.
+ *#*
*#* Revision 1.19 2006/04/11 00:07:33 bernie
*#* Implemenent MF_SAVESEL flag.
*#*
#endif
-/*! Concatenate two different preprocessor tokens (allowing macros to expand) */
+/** Concatenate two different preprocessor tokens (allowing macros to expand) */
#define PP_CAT(x,y) PP_CAT__(x,y)
#define PP_CAT__(x,y) x ## y
#define PP_CAT3(x,y,z) PP_CAT(PP_CAT(x,y),z)
#define PP_CAT4(x,y,z,w) PP_CAT(PP_CAT3(x,y,z),w)
#define PP_CAT5(x,y,z,w,j) PP_CAT(PP_CAT4(x,y,z,w),j)
-/*! String-ize a token (allowing macros to expand) */
+/** String-ize a token (allowing macros to expand) */
#define PP_STRINGIZE(x) PP_STRINGIZE__(x)
#define PP_STRINGIZE__(x) #x
/* Defaults for compiler extensions. */
-/*!
+/**
* \def COMPILER_VARIADIC_MACROS
* Support for macros with variable arguments.
*/
#define COMPILER_VARIADIC_MACROS (COMPILER_C99 != 0)
#endif
-/*!
+/**
* \def COMPILER_TYPEOF
* Support for dynamic type identification.
*/
#define COMPILER_TYPEOF 0
#endif
-/*!
+/**
* \def COMPILER_STATEMENT_EXPRESSIONS
* Support for statement expressions.
*/
#if defined(_MSC_VER) \
|| ((defined(__IAR_SYSTEMS_ICC) || defined(__IAR_SYSTEMS_ICC__)) && CPU_I196)
- /*!
+ /**
* \name ISO C99 fixed-size types
*
* These should be in <stdint.h>, but a few compilers lack them.
* The ATmega8 has a very small Flash, so we can't afford
* to link in support routines for 32bit integer arithmetic.
*/
- typedef int16_t ticks_t; /*!< Type for time expressed in ticks. */
- typedef int16_t mtime_t; /*!< Type for time expressed in milliseconds. */
- typedef int16_t utime_t; /*!< Type for time expressed in microseconds. */
+ typedef int16_t ticks_t; /**< Type for time expressed in ticks. */
+ typedef int16_t mtime_t; /**< Type for time expressed in milliseconds. */
+ typedef int16_t utime_t; /**< Type for time expressed in microseconds. */
#define SIZEOF_MTIME_T (16 / CPU_BITS_PER_CHAR)
#define SIZEOF_UTIME_T (16 / CPU_BITS_PER_CHAR)
#define MTIME_INFINITE 0x7FFFL
#else
- typedef int32_t ticks_t; /*!< Type for time expressed in ticks. */
- typedef int32_t mtime_t; /*!< Type for time expressed in milliseconds. */
- typedef int32_t utime_t; /*!< Type for time expressed in microseconds. */
+ typedef int32_t ticks_t; /**< Type for time expressed in ticks. */
+ typedef int32_t mtime_t; /**< Type for time expressed in milliseconds. */
+ typedef int32_t utime_t; /**< Type for time expressed in microseconds. */
#define SIZEOF_MTIME_T (32 / CPU_BITS_PER_CHAR)
#define SIZEOF_UTIME_T (32 / CPU_BITS_PER_CHAR)
#define MTIME_INFINITE 0x7FFFFFFFL
#endif
-/*! Bulk storage large enough for both pointers or integers. */
+/** Bulk storage large enough for both pointers or integers. */
typedef void * iptr_t;
-/*! Bulk storage large enough for both pointers to constants or integers. */
+/** Bulk storage large enough for both pointers to constants or integers. */
typedef const void * const_iptr_t;
-typedef unsigned char sigbit_t; /*!< Type for signal bits. */
-typedef unsigned char sigmask_t; /*!< Type for signal masks. */
-typedef unsigned char page_t; /*!< Type for banked memory pages. */
+typedef unsigned char sigbit_t; /**< Type for signal bits. */
+typedef unsigned char sigmask_t; /**< Type for signal masks. */
+typedef unsigned char page_t; /**< Type for banked memory pages. */
-/*!
+/**
* \name Standard type definitions.
*
* These should be in <sys/types.h> or <stddef.h>, but many compilers
/*\}*/
-/*!
+/**
* \name Types for hardware registers.
*
* Only use these types for registers whose contents can
/* Quasi-ANSI macros */
#ifndef offsetof
- /*!
+ /**
* Return the byte offset of the member \a m in struct \a s.
*
* \note This macro should be defined in "stddef.h" and is sometimes
#define offsetof(s,m) (size_t)&(((s *)0)->m)
#endif
#ifndef countof
- /*!
+ /**
* Count the number of elements in the static array \a a.
*
* \note This macro is non-standard, but implements a very common idiom
( (type *)((char *)(ptr) - offsetof(type, member)) )
#endif
-/*! Issue a compilation error if the \a condition is false */
+/** Issue a compilation error if the \a condition is false */
#define STATIC_ASSERT(condition) \
UNUSED_VAR(extern char, STATIC_ASSERTION_FAILED__[(condition) ? 1 : -1])
#ifndef ASSERT_TYPE_EQUAL
-/*! Ensure two variables have the same type. */
+/** Ensure two variables have the same type. */
#define ASSERT_TYPE_EQUAL(var1, var2) \
do { (void)(&(var1) == &(var2)); } while(0)
#endif
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.10 2006/06/10 05:37:03 bernie
+ *#* Convert to new Doxygen comments.
+ *#*
*#* Revision 1.9 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#include <cfg/compiler.h>
#include <cfg/cpu.h>
-/*!
+/**
* Swap upper and lower bytes in a 16-bit value.
*/
INLINE uint16_t swab16(uint16_t x)
| ((x & (uint16_t)0xFF00U) >> 8);
}
-/*!
+/**
* Reverse bytes in a 32-bit value (e.g.: 0x12345678 -> 0x78563412).
*/
INLINE uint32_t swab32(uint32_t x)
| ((x & (uint32_t)0xFF000000UL) >> 24);
}
-/*!
+/**
* Reverse bytes in a float value.
*/
INLINE float swab_float(float x)
#ifdef __cplusplus
-//! Type generic byte swapping.
+/// Type generic byte swapping.
template<typename T>
INLINE T swab(T x);
template<> INLINE int32_t swab(int32_t x) { return static_cast<int32_t>(swab32(static_cast<uint32_t>(x))); }
template<> INLINE float swab(float x) { return swab_float(x); }
-//! Type generic conversion from CPU byte order to big-endian byte order.
+/// Type generic conversion from CPU byte order to big-endian byte order.
template<typename T>
INLINE T cpu_to_be(T x)
{
return (CPU_BYTE_ORDER == CPU_LITTLE_ENDIAN) ? swab(x) : x;
}
-//! Type generic conversion from CPU byte-order to little-endian.
+/// Type generic conversion from CPU byte-order to little-endian.
template<typename T>
INLINE T cpu_to_le(T x)
{
return (CPU_BYTE_ORDER == CPU_BIG_ENDIAN) ? swab(x) : x;
}
-//! Type generic conversion from big endian byte-order to CPU byte order.
+/// Type generic conversion from big endian byte-order to CPU byte order.
template<typename T>
INLINE T be_to_cpu(T x)
{
return cpu_to_be(x);
}
-//! Type generic conversion from little-endian byte order to CPU byte order.
+/// Type generic conversion from little-endian byte order to CPU byte order.
template<typename T>
INLINE T le_to_cpu(T x)
{
return cpu_to_le(x);
}
-//! Type generic conversion from network byte order to host byte order.
+/// Type generic conversion from network byte order to host byte order.
template<typename T>
INLINE T net_to_host(T x)
{
return be_to_cpu(x);
}
-//! Type generic conversion from host byte order to network byte order.
+/// Type generic conversion from host byte order to network byte order.
template<typename T>
INLINE T host_to_net(T x)
{