]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/crc32.c
Update MSP432 projects to use updated driver library files.
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / driverlib / crc32.c
index 8db29b402e3af88f6c072ba6f317a56abdc3c622..8747c41c41cdc25ca27f0292ef06a0a7ddf8944e 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * -------------------------------------------
- *    MSP432 DriverLib - v01_04_00_18 
+ *    MSP432 DriverLib - v3_10_00_09 
  * -------------------------------------------
  *
  * --COPYRIGHT--,BSD,BSD
- * Copyright (c) 2015, Texas Instruments Incorporated
+ * Copyright (c) 2014, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include "crc32.h"
 #include <msp.h>
 #include <debug.h>
+#include <hw_memmap.h>
 
 void CRC32_setSeed(uint32_t seed, uint_fast8_t crcType)
 {
     ASSERT((CRC16_MODE == crcType) || (CRC32_MODE == crcType));
 
     if (CRC16_MODE == crcType)
-        CRC32->rCRC16INIRES = seed;
+        CRC32->INIRES16 = seed;
     else
     {
-        CRC32->rCRC32INIRES_HI = ((seed & 0xFFFF0000) >> 16);
-        CRC32->rCRC32INIRES_LO = (seed & 0xFFFF);
+        CRC32->INIRES32_HI = ((seed & 0xFFFF0000) >> 16);
+        CRC32->INIRES32_LO = (seed & 0xFFFF);
     }
 }
 
@@ -56,9 +57,9 @@ void CRC32_set8BitData(uint8_t dataIn, uint_fast8_t crcType)
     ASSERT((CRC16_MODE == crcType) || (CRC32_MODE == crcType));
 
     if (CRC16_MODE == crcType)
-        HWREG8(CRC32_BASE + OFS_CRC16DI) = dataIn;
+        HWREG8(&(CRC32->DI16)) = dataIn;
     else
-        HWREG8(CRC32_BASE + OFS_CRC32DI) = dataIn;
+       HWREG8(&(CRC32->DI32)) = dataIn;
 }
 
 void CRC32_set16BitData(uint16_t dataIn, uint_fast8_t crcType)
@@ -66,18 +67,18 @@ void CRC32_set16BitData(uint16_t dataIn, uint_fast8_t crcType)
     ASSERT((CRC16_MODE == crcType) || (CRC32_MODE == crcType));
 
     if (CRC16_MODE == crcType)
-        CRC32->rCRC16DI = dataIn;
+        CRC32->DI16 = dataIn;
     else
-        CRC32->rCRC32DI = dataIn;
+        CRC32->DI32 = dataIn;
 }
 
 void CRC32_set32BitData(uint32_t dataIn)
 {
-    //CRC32->rCRC32DI = dataIn & 0xFFFF;
-    //CRC32->rCRC32DI = (uint16_t) ((dataIn & 0xFFFF0000) >> 16);
+    //CRC32->DI32 = dataIn & 0xFFFF;
+    //CRC32->DI32 = (uint16_t) ((dataIn & 0xFFFF0000) >> 16);
 
-    HWREG16(CRC32_BASE + OFS_CRC32DI) = dataIn & 0xFFFF;
-    HWREG16(CRC32_BASE + OFS_CRC32DI) = (uint16_t)(
+    HWREG16(&(CRC32->DI32)) = dataIn & 0xFFFF;
+    HWREG16(&(CRC32->DI32)) = (uint16_t)(
             (dataIn & 0xFFFF0000) >> 16);
 }
 
@@ -86,9 +87,9 @@ void CRC32_set8BitDataReversed(uint8_t dataIn, uint_fast8_t crcType)
     ASSERT((CRC16_MODE == crcType) || (CRC32_MODE == crcType));
 
     if (CRC16_MODE == crcType)
-        HWREG8(CRC32_BASE + OFS_CRC16DIRB) = dataIn;
+        HWREG8(&(CRC32->DIRB16)) = dataIn;
     else
-        HWREG8(CRC32_BASE + OFS_CRC32DIRB) = dataIn;
+       HWREG8(&(CRC32->DIRB32)) = dataIn;
 }
 
 void CRC32_set16BitDataReversed(uint16_t dataIn, uint_fast8_t crcType)
@@ -96,18 +97,20 @@ void CRC32_set16BitDataReversed(uint16_t dataIn, uint_fast8_t crcType)
     ASSERT((CRC16_MODE == crcType) || (CRC32_MODE == crcType));
 
     if (CRC16_MODE == crcType)
-        CRC32->rCRC16DIRB = dataIn;
+        CRC32->DIRB16 = dataIn;
     else
-        CRC32->rCRC32DIRB = dataIn;
+        CRC32->DIRB32 = dataIn;
 }
 
 void CRC32_set32BitDataReversed(uint32_t dataIn)
 {
-    HWREG16(CRC32_BASE + OFS_CRC32DIRB) = dataIn & 0xFFFF;
-    HWREG16(CRC32_BASE + OFS_CRC32DIRB) = (uint16_t)(
+    //CRC32->DIRB32 = dataIn & 0xFFFF;
+    //CRC32->DIRB32 = (uint16_t) ((dataIn & 0xFFFF0000) >> 16);
+
+    HWREG16(&(CRC32->DIRB32)) = dataIn & 0xFFFF;
+    HWREG16(&(CRC32->DIRB32)) = (uint16_t)(
             (dataIn & 0xFFFF0000) >> 16);
-    //CRC32->rCRC32DIRB = dataIn & 0xFFFF;
-    //CRC32->rCRC32DIRB = (uint16_t) ((dataIn & 0xFFFF0000) >> 16);
+
 }
 
 uint32_t CRC32_getResult(uint_fast8_t crcType)
@@ -116,12 +119,12 @@ uint32_t CRC32_getResult(uint_fast8_t crcType)
     ASSERT((CRC16_MODE == crcType) || (CRC32_MODE == crcType));
 
     if (CRC16_MODE == crcType)
-        return CRC32->rCRC16INIRES;
+        return CRC32->INIRES16;
     else
     {
-        result = CRC32->rCRC32INIRES_HI;
+        result = CRC32->INIRES32_HI;
         result = (result << 16);
-        result |= CRC32->rCRC32INIRES_LO;
+        result |= CRC32->INIRES32_LO;
         return (result);
     }
 }
@@ -132,12 +135,12 @@ uint32_t CRC32_getResultReversed(uint_fast8_t crcType)
     ASSERT((CRC16_MODE == crcType) || (CRC32_MODE == crcType));
 
     if (CRC16_MODE == crcType)
-        return CRC32->rCRC16RESR;
+        return CRC32->RESR16;
     else
     {
-        result = CRC32->rCRC32RESR_HI;
+        result = CRC32->RESR32_HI;
         result = (result << 16);
-        result |= CRC32->rCRC32RESR_LO;
+        result |= CRC32->RESR32_LO;
         return (result);
     }
 }