]> git.sur5r.net Git - freertos/blobdiff - Demo/Common/drivers/LuminaryMicro/hw_types.h
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / Common / drivers / LuminaryMicro / hw_types.h
index c31e2c94be6e28286744bcc3896ecd836761edd4..11da8e471202fd1b629c43ccaf0fc859b9636f48 100644 (file)
@@ -2,7 +2,7 @@
 //\r
 // hw_types.h - Common types and macros.\r
 //\r
-// Copyright (c) 2005-2007 Luminary Micro, Inc.  All rights reserved.\r
+// Copyright (c) 2005-2008 Luminary Micro, Inc.  All rights reserved.\r
 // \r
 // Software License Agreement\r
 // \r
 // exclusively on LMI's microcontroller products.\r
 // \r
 // The software is owned by LMI and/or its suppliers, and is protected under\r
-// applicable copyright laws.  All rights are reserved.  Any use in violation\r
-// of the foregoing restrictions may subject the user to criminal sanctions\r
-// under applicable laws, as well as to civil liability for the breach of the\r
-// terms and conditions of this license.\r
+// applicable copyright laws.  All rights are reserved.  You may not combine\r
+// this software with "viral" open-source software in order to form a larger\r
+// program.  Any use in violation of the foregoing restrictions may subject\r
+// the user to criminal sanctions under applicable laws, as well as to civil\r
+// liability for the breach of the terms and conditions of this license.\r
 // \r
 // THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
@@ -21,7 +22,7 @@
 // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\r
 // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\r
 // \r
-// This is part of revision 1582 of the Stellaris Peripheral Driver Library.\r
+// This is part of revision 2523 of the Stellaris Peripheral Driver Library.\r
 //\r
 //*****************************************************************************\r
 \r
@@ -72,12 +73,12 @@ typedef unsigned char tBoolean;
 // conditional code blocks that will allow a single version of the Driverlib\r
 // "binary" code to support multiple(all) Stellaris silicon revisions.\r
 //\r
-// It is expected that these macros will be used inside of a standard 'C' \r
+// It is expected that these macros will be used inside of a standard 'C'\r
 // conditional block of code, e.g.\r
 //\r
-//     if(DEVICE_IS_SANDSTORM())\r
+//     if(CLASS_IS_SANDSTORM)\r
 //     {\r
-//         do some Sandstorm specific code here.\r
+//         do some Sandstorm-class specific code here.\r
 //     }\r
 //\r
 // By default, these macros will be defined as run-time checks of the\r
@@ -87,43 +88,66 @@ typedef unsigned char tBoolean;
 // However, if code-space optimization is required, these macros can be "hard-\r
 // coded" for a specific version of Stellaris silicon.  Many compilers will\r
 // then detect the "hard-coded" conditionals, and appropriately optimize the\r
-// code blocks, eliminating any "unreachable" code.  This would result in \r
+// code blocks, eliminating any "unreachable" code.  This would result in\r
 // a smaller Driverlib, thus producing a smaller final application size, but\r
 // at the cost of limiting the Driverlib binary to a specific Stellaris\r
 // silicon revision.\r
 //\r
 //*****************************************************************************\r
-#ifndef DEVICE_IS_SANDSTORM\r
-#define DEVICE_IS_SANDSTORM                                                \\r
-    (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_VER_MASK) == SYSCTL_DID0_VER_0) || \\r
-    (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_VER_MASK) == SYSCTL_DID0_VER_1) && \\r
-     ((HWREG(SYSCTL_DID0) & SYSCTL_DID0_CLASS_MASK) ==                     \\r
-        SYSCTL_DID0_CLASS_SANDSTORM)))\r
+#ifndef CLASS_IS_SANDSTORM\r
+#define CLASS_IS_SANDSTORM                                                    \\r
+        (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_VER_M) == SYSCTL_DID0_VER_0) ||   \\r
+         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \\r
+          (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_SANDSTORM)))\r
 #endif\r
 \r
-#ifndef DEVICE_IS_FURY\r
-#define DEVICE_IS_FURY                                                     \\r
-    (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_VER_MASK) == SYSCTL_DID0_VER_1) && \\r
-     ((HWREG(SYSCTL_DID0) & SYSCTL_DID0_CLASS_MASK) ==                     \\r
-        SYSCTL_DID0_CLASS_FURY))\r
+#ifndef CLASS_IS_FURY\r
+#define CLASS_IS_FURY                                                        \\r
+        ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \\r
+         (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_FURY))\r
 #endif\r
 \r
-#ifndef DEVICE_IS_REVA2\r
-#define DEVICE_IS_REVA2                                                    \\r
-    (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_MAJ_MASK) == SYSCTL_DID0_MAJ_A) && \\r
-     ((HWREG(SYSCTL_DID0) & SYSCTL_DID0_MIN_MASK) == SYSCTL_DID0_MIN_2))\r
+#ifndef CLASS_IS_DUSTDEVIL\r
+#define CLASS_IS_DUSTDEVIL                                                   \\r
+        ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \\r
+         (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_DUSTDEVIL))\r
 #endif\r
 \r
-#ifndef DEVICE_IS_REVC1\r
-#define DEVICE_IS_REVC1                                                    \\r
-    (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_MAJ_MASK) == SYSCTL_DID0_MAJ_C) && \\r
-     ((HWREG(SYSCTL_DID0) & SYSCTL_DID0_MIN_MASK) == SYSCTL_DID0_MIN_1))\r
+#ifndef REVISION_IS_A0\r
+#define REVISION_IS_A0                                                     \\r
+        ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \\r
+         (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_0))\r
 #endif\r
 \r
-#ifndef DEVICE_IS_REVC2\r
-#define DEVICE_IS_REVC2                                                    \\r
-    (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_MAJ_MASK) == SYSCTL_DID0_MAJ_C) && \\r
-     ((HWREG(SYSCTL_DID0) & SYSCTL_DID0_MIN_MASK) == SYSCTL_DID0_MIN_2))\r
+#ifndef REVISION_IS_A2\r
+#define REVISION_IS_A2                                                     \\r
+        ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \\r
+         (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_2))\r
+#endif\r
+\r
+#ifndef REVISION_IS_C1\r
+#define REVISION_IS_C1                                                     \\r
+        ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \\r
+         (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_1))\r
+#endif\r
+\r
+#ifndef REVISION_IS_C2\r
+#define REVISION_IS_C2                                                     \\r
+        ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \\r
+         (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_2))\r
+#endif\r
+\r
+//*****************************************************************************\r
+//\r
+// Deprecated silicon class and revision detection macros.\r
+//\r
+//*****************************************************************************\r
+#ifndef DEPRECATED\r
+#define DEVICE_IS_SANDSTORM     CLASS_IS_SANDSTORM\r
+#define DEVICE_IS_FURY          CLASS_IS_FURY\r
+#define DEVICE_IS_REVA2         REVISION_IS_A2\r
+#define DEVICE_IS_REVC1         REVISION_IS_C1\r
+#define DEVICE_IS_REVC2         REVISION_IS_C2\r
 #endif\r
 \r
 #endif // __HW_TYPES_H__\r