Alexandre Lemay / Mbed 2 deprecated APP1_s5_A17

Dependencies:   mbed MMA8452

Revision:
11:09317efe9bb5
Parent:
9:b9ac1d914762
--- a/CommUART.h	Wed Sep 06 01:29:41 2017 +0000
+++ b/CommUART.h	Wed Sep 06 03:46:20 2017 +0000
@@ -8,53 +8,12 @@
 class CommUART3
 {
 public:
-    CommUART3()
-    {
-        // Power 
-        LPC_SC->PCONP |=  (1 << 25) ;//0x400F C0C4  -> PCUART3
-        // Peripheral clock selection -> CCLK
-        
-        // DLab enable divide latch
-        LPC_UART3->LCR |= (1 << 7);
-        
-        //Default Baud rate of 9600 in serial segment
-        // MSB of baud rate divisor
-        LPC_UART3->DLM = 0x2;
-        // MLB of baud rate divisor
-        LPC_UART3->DLL = 0x71;
-        
-        // want 8-bit characters
-        LPC_UART3->LCR = 3;
-        
-        // Enable FIFO
-        LPC_UART3->FCR = 1;
-        
-        // PINSEL0 1:0 : mode p9 -> 
-        LPC_PINCON->PINSEL0 &= ~3;
-        LPC_PINCON->PINSEL0 |= 2;
-        LPC_SC->PCLKSEL1 &=  ~ (3 << 18  ) ; // clear the bits 18-19
-        LPC_SC->PCLKSEL1 |=  1 << 18 ;//0x400F C1AC -> PCLK_UART3 =01
+    //Initialyze UART3 on pin nine
+    CommUART3();
     
-    }
-    
-    void write(char ch)
-    {
-        LPC_UART3->TER = 0x80;
-        Serial pc(USBTX, USBRX); 
-        pc.printf("%c", ch);
-        LPC_UART3->THR = ch;
-    }
-    void write(char* ch, int length, char* unused, int unused2)
-    {
-        Serial pc(USBTX, USBRX); 
-        pc.printf("rip");
-        for(int i = 0 ; i < length ; i ++)
-        {
-            write(ch[i]);
-        } 
-    }
-    
-
+    void write(char ch);
+    // match signature of spi write
+    void write(char* ch, int length, char* unused, int unused2);
 private:    
 };