Port to LPC1549. Partially tested, not all features ported

Fork of QEI_hw by Hexley Ball

Revision:
2:53f8ae2cf502
Parent:
0:20a27391f6dc
Child:
3:68844cd35e64
--- a/qeihw.cpp	Sat Dec 11 01:51:58 2010 +0000
+++ b/qeihw.cpp	Tue Dec 28 19:32:07 2010 +0000
@@ -8,8 +8,8 @@
  * @brief       Driver file for the QEI hardware. Requires connection to
  *              internal mbed circuit nodes. Adapted from the CMSIS
  *              driver, lpc17xx_qei.c, v 2.0
- * @version     0.0
- * @date        10 Dec 2010
+ * @version     0.1
+ * @date        28 Dec 2010
  * @author      hb
  **************************************************************************/
 #include "mbed.h"
@@ -245,7 +245,9 @@
         div = 8;
         break;
     }
-    LPC_QEI->QEILOAD = cclk;
+    cclk /=div;
+    cclk =((uint64_t)cclk / (1000000/ulReloadValue)) - 1;
+    LPC_QEI->QEILOAD = (uint32_t) cclk;
 }
 
 /*********************************************************************//**