Fix USB, DOS line endings, integrate and reorganize project
[rapper.git] / new_cmsis / usb / lpc_types.h
index 9cfb3be..d24a9f5 100755 (executable)
-/***********************************************************************//**\r
- * @file               lpc_types.h\r
- * @brief              Contains the NXP ABL typedefs for C standard types.\r
- *                             It is intended to be used in ISO C conforming development\r
- *                             environments and checks for this insofar as it is possible\r
- *                             to do so.\r
- * @version            1.0\r
- * @date               27 Jul. 2008\r
- * @author             wellsk\r
- **************************************************************************\r
- * Software that is described herein is for illustrative purposes only\r
- * which provides customers with programming information regarding the\r
- * products. This software is supplied "AS IS" without any warranties.\r
- * NXP Semiconductors assumes no responsibility or liability for the\r
- * use of the software, conveys no license or title under any patent,\r
- * copyright, or mask work right to the product. NXP Semiconductors\r
- * reserves the right to make changes in the software without\r
- * notification. NXP Semiconductors also make no representation or\r
- * warranty that such application will be suitable for the specified\r
- * use without further testing or modification.\r
- **************************************************************************/\r
-\r
-/* Type group ----------------------------------------------------------- */\r
-/** @defgroup LPC_Types LPC_Types\r
- * @ingroup LPC1700CMSIS_FwLib_Drivers\r
- * @{\r
- */\r
-\r
-#ifndef LPC_TYPES_H\r
-#define LPC_TYPES_H\r
-\r
-/* Includes ------------------------------------------------------------------- */\r
-#include <stdint.h>\r
-\r
-\r
-/* Public Types --------------------------------------------------------------- */\r
-/** @defgroup LPC_Types_Public_Types LPC_Types Public Types\r
- * @{\r
- */\r
-\r
-/**\r
- * @brief Boolean Type definition\r
- */\r
-typedef enum {FALSE = 0, TRUE = !FALSE} Bool;\r
-\r
-/**\r
- * @brief Flag Status and Interrupt Flag Status type definition\r
- */\r
-typedef enum {RESET = 0, SET = !RESET} FlagStatus, IntStatus, SetState;\r
-#define PARAM_SETSTATE(State) ((State==RESET) || (State==SET))\r
-\r
-/**\r
- * @brief Functional State Definition\r
- */\r
-typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;\r
-#define PARAM_FUNCTIONALSTATE(State) ((State==DISABLE) || (State==ENABLE))\r
-\r
-/**\r
- * @ Status type definition\r
- */\r
-typedef enum {ERROR = 0, SUCCESS = !ERROR} Status;\r
-\r
-\r
-/**\r
- * Read/Write transfer type mode (Block or non-block)\r
- */\r
-typedef enum\r
-{\r
-       NONE_BLOCKING = 0,              /**< None Blocking type */\r
-       BLOCKING,                               /**< Blocking type */\r
-} TRANSFER_BLOCK_Type;\r
-\r
-\r
-/** Pointer to Function returning Void (any number of parameters) */\r
-typedef void (*PFV)();\r
-\r
-/** Pointer to Function returning int32_t (any number of parameters) */\r
-typedef int32_t(*PFI)();\r
-\r
-/**\r
- * @}\r
- */\r
-\r
-\r
-/* Public Macros -------------------------------------------------------------- */\r
-/** @defgroup LPC_Types_Public_Macros  LPC_Types Public Macros\r
- * @{\r
- */\r
-\r
-/* _BIT(n) sets the bit at position "n"\r
- * _BIT(n) is intended to be used in "OR" and "AND" expressions:\r
- * e.g., "(_BIT(3) | _BIT(7))".\r
- */\r
-#undef _BIT\r
-/* Set bit macro */\r
-#define _BIT(n)        (1<<n)\r
-\r
-/* _SBF(f,v) sets the bit field starting at position "f" to value "v".\r
- * _SBF(f,v) is intended to be used in "OR" and "AND" expressions:\r
- * e.g., "((_SBF(5,7) | _SBF(12,0xF)) & 0xFFFF)"\r
- */\r
-#undef _SBF\r
-/* Set bit field macro */\r
-#define _SBF(f,v) (v<<f)\r
-\r
-/* _BITMASK constructs a symbol with 'field_width' least significant\r
- * bits set.\r
- * e.g., _BITMASK(5) constructs '0x1F', _BITMASK(16) == 0xFFFF\r
- * The symbol is intended to be used to limit the bit field width\r
- * thusly:\r
- * <a_register> = (any_expression) & _BITMASK(x), where 0 < x <= 32.\r
- * If "any_expression" results in a value that is larger than can be\r
- * contained in 'x' bits, the bits above 'x - 1' are masked off.  When\r
- * used with the _SBF example above, the example would be written:\r
- * a_reg = ((_SBF(5,7) | _SBF(12,0xF)) & _BITMASK(16))\r
- * This ensures that the value written to a_reg is no wider than\r
- * 16 bits, and makes the code easier to read and understand.\r
- */\r
-#undef _BITMASK\r
-/* Bitmask creation macro */\r
-#define _BITMASK(field_width) ( _BIT(field_width) - 1)\r
-\r
-/* NULL pointer */\r
-#ifndef NULL\r
-#define NULL ((void*) 0)\r
-#endif\r
-\r
-/* Number of elements in an array */\r
-#define NELEMENTS(array)  (sizeof (array) / sizeof (array[0]))\r
-\r
-/* Static data/function define */\r
-#define STATIC static\r
-/* External data/function define */\r
-#define EXTERN extern\r
-\r
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))\r
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))\r
-\r
-/**\r
- * @}\r
- */\r
-\r
-\r
-/* Old Type Definition compatibility ------------------------------------------ */\r
-/** @addtogroup LPC_Types_Public_Types LPC_Types Public Types\r
- * @{\r
- */\r
-\r
-/** SMA type for character type */\r
-typedef char CHAR;\r
-\r
-/** SMA type for 8 bit unsigned value */\r
-typedef uint8_t UNS_8;\r
-\r
-/** SMA type for 8 bit signed value */\r
-typedef int8_t INT_8;\r
-\r
-/** SMA type for 16 bit unsigned value */\r
-typedef        uint16_t UNS_16;\r
-\r
-/** SMA type for 16 bit signed value */\r
-typedef        int16_t INT_16;\r
-\r
-/** SMA type for 32 bit unsigned value */\r
-typedef        uint32_t UNS_32;\r
-\r
-/** SMA type for 32 bit signed value */\r
-typedef        int32_t INT_32;\r
-\r
-/** SMA type for 64 bit signed value */\r
-typedef int64_t INT_64;\r
-\r
-/** SMA type for 64 bit unsigned value */\r
-typedef uint64_t UNS_64;\r
-\r
-/** 32 bit boolean type */\r
-typedef Bool BOOL_32;\r
-\r
-/** 16 bit boolean type */\r
-typedef Bool BOOL_16;\r
-\r
-/** 8 bit boolean type */\r
-typedef Bool BOOL_8;\r
-\r
-/**\r
- * @}\r
- */\r
-\r
-\r
-#endif /* LPC_TYPES_H */\r
-\r
-/**\r
- * @}\r
- */\r
-\r
-/* --------------------------------- End Of File ------------------------------ */\r
+/***********************************************************************//**
+ * @file               lpc_types.h
+ * @brief              Contains the NXP ABL typedefs for C standard types.
+ *                             It is intended to be used in ISO C conforming development
+ *                             environments and checks for this insofar as it is possible
+ *                             to do so.
+ * @version            1.0
+ * @date               27 Jul. 2008
+ * @author             wellsk
+ **************************************************************************
+ * Software that is described herein is for illustrative purposes only
+ * which provides customers with programming information regarding the
+ * products. This software is supplied "AS IS" without any warranties.
+ * NXP Semiconductors assumes no responsibility or liability for the
+ * use of the software, conveys no license or title under any patent,
+ * copyright, or mask work right to the product. NXP Semiconductors
+ * reserves the right to make changes in the software without
+ * notification. NXP Semiconductors also make no representation or
+ * warranty that such application will be suitable for the specified
+ * use without further testing or modification.
+ **************************************************************************/
+
+/* Type group ----------------------------------------------------------- */
+/** @defgroup LPC_Types LPC_Types
+ * @ingroup LPC1700CMSIS_FwLib_Drivers
+ * @{
+ */
+
+#ifndef LPC_TYPES_H
+#define LPC_TYPES_H
+
+/* Includes ------------------------------------------------------------------- */
+#include <stdint.h>
+
+
+/* Public Types --------------------------------------------------------------- */
+/** @defgroup LPC_Types_Public_Types LPC_Types Public Types
+ * @{
+ */
+
+/**
+ * @brief Boolean Type definition
+ */
+typedef enum {FALSE = 0, TRUE = !FALSE} Bool;
+
+/**
+ * @brief Flag Status and Interrupt Flag Status type definition
+ */
+typedef enum {RESET = 0, SET = !RESET} FlagStatus, IntStatus, SetState;
+#define PARAM_SETSTATE(State) ((State==RESET) || (State==SET))
+
+/**
+ * @brief Functional State Definition
+ */
+typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
+#define PARAM_FUNCTIONALSTATE(State) ((State==DISABLE) || (State==ENABLE))
+
+/**
+ * @ Status type definition
+ */
+typedef enum {ERROR = 0, SUCCESS = !ERROR} Status;
+
+
+/**
+ * Read/Write transfer type mode (Block or non-block)
+ */
+typedef enum
+{
+       NONE_BLOCKING = 0,              /**< None Blocking type */
+       BLOCKING,                               /**< Blocking type */
+} TRANSFER_BLOCK_Type;
+
+
+/** Pointer to Function returning Void (any number of parameters) */
+typedef void (*PFV)();
+
+/** Pointer to Function returning int32_t (any number of parameters) */
+typedef int32_t(*PFI)();
+
+/**
+ * @}
+ */
+
+
+/* Public Macros -------------------------------------------------------------- */
+/** @defgroup LPC_Types_Public_Macros  LPC_Types Public Macros
+ * @{
+ */
+
+/* _BIT(n) sets the bit at position "n"
+ * _BIT(n) is intended to be used in "OR" and "AND" expressions:
+ * e.g., "(_BIT(3) | _BIT(7))".
+ */
+#undef _BIT
+/* Set bit macro */
+#define _BIT(n)        (1<<n)
+
+/* _SBF(f,v) sets the bit field starting at position "f" to value "v".
+ * _SBF(f,v) is intended to be used in "OR" and "AND" expressions:
+ * e.g., "((_SBF(5,7) | _SBF(12,0xF)) & 0xFFFF)"
+ */
+#undef _SBF
+/* Set bit field macro */
+#define _SBF(f,v) (v<<f)
+
+/* _BITMASK constructs a symbol with 'field_width' least significant
+ * bits set.
+ * e.g., _BITMASK(5) constructs '0x1F', _BITMASK(16) == 0xFFFF
+ * The symbol is intended to be used to limit the bit field width
+ * thusly:
+ * <a_register> = (any_expression) & _BITMASK(x), where 0 < x <= 32.
+ * If "any_expression" results in a value that is larger than can be
+ * contained in 'x' bits, the bits above 'x - 1' are masked off.  When
+ * used with the _SBF example above, the example would be written:
+ * a_reg = ((_SBF(5,7) | _SBF(12,0xF)) & _BITMASK(16))
+ * This ensures that the value written to a_reg is no wider than
+ * 16 bits, and makes the code easier to read and understand.
+ */
+#undef _BITMASK
+/* Bitmask creation macro */
+#define _BITMASK(field_width) ( _BIT(field_width) - 1)
+
+/* NULL pointer */
+#ifndef NULL
+#define NULL ((void*) 0)
+#endif
+
+/* Number of elements in an array */
+#define NELEMENTS(array)  (sizeof (array) / sizeof (array[0]))
+
+/* Static data/function define */
+#define STATIC static
+/* External data/function define */
+#define EXTERN extern
+
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+/**
+ * @}
+ */
+
+
+/* Old Type Definition compatibility ------------------------------------------ */
+/** @addtogroup LPC_Types_Public_Types LPC_Types Public Types
+ * @{
+ */
+
+/** SMA type for character type */
+typedef char CHAR;
+
+/** SMA type for 8 bit unsigned value */
+typedef uint8_t UNS_8;
+
+/** SMA type for 8 bit signed value */
+typedef int8_t INT_8;
+
+/** SMA type for 16 bit unsigned value */
+typedef        uint16_t UNS_16;
+
+/** SMA type for 16 bit signed value */
+typedef        int16_t INT_16;
+
+/** SMA type for 32 bit unsigned value */
+typedef        uint32_t UNS_32;
+
+/** SMA type for 32 bit signed value */
+typedef        int32_t INT_32;
+
+/** SMA type for 64 bit signed value */
+typedef int64_t INT_64;
+
+/** SMA type for 64 bit unsigned value */
+typedef uint64_t UNS_64;
+
+/** 32 bit boolean type */
+typedef Bool BOOL_32;
+
+/** 16 bit boolean type */
+typedef Bool BOOL_16;
+
+/** 8 bit boolean type */
+typedef Bool BOOL_8;
+
+/**
+ * @}
+ */
+
+
+#endif /* LPC_TYPES_H */
+
+/**
+ * @}
+ */
+
+/* --------------------------------- End Of File ------------------------------ */