不韋 呂 / UITDSP_ADDA2

Dependents:   UITDSP_ADDA_Example2

Revision:
1:e997f4e94491
Parent:
0:46d099dfd9d6
--- a/ADC_Interrupt.hpp	Sat Mar 14 06:49:49 2015 +0000
+++ b/ADC_Interrupt.hpp	Mon Mar 16 23:59:49 2015 +0000
@@ -1,17 +1,17 @@
 //------------------------------------------------------
-// Derived class of ADC_Base for use interrupt
+//  Derived class of InternalADC for use interrupt
 //
-// 2015/03/14, Copyright (c) 2015 MIKAMI, Naoki
+//  2015/01/27, Copyright (c) 2015 MIKAMI, Naoki
 //------------------------------------------------------
 
 #ifndef ADC_INTERRUPT_HPP
 #define ADC_INTERRUPT_HPP
 
-#include "ADC_BuiltIn.hpp"
+#include "InternalADC.hpp"
 
 namespace Mikami
 {
-    class ADC_Intr : public ADC_BuiltIn
+    class ADC_Intr : public InternalADC
     {
     private:       
         // for inhibition of copy constructor
@@ -20,10 +20,9 @@
         ADC_Intr& operator=(const ADC_Intr&);
 
     public:
-        ADC_Intr(PinName pin1, int frequency,
-                 PinName pin2 = NC, PinName pin3 = NC)
-            : ADC_BuiltIn(pin1, frequency, pin2, pin3)
-        { myAdc_->CR1 |= ADC_CR1_EOCIE; }   // Interrupt enable
+        ADC_Intr(PinName pin1, PinName pin2 = NC, PinName pin3 = NC)
+            : InternalADC(pin1, pin2, pin3)
+        {   myAdc_->CR1 |= ADC_CR1_EOCIE; }     // EOC interrupt enable
 
         // Set interrupt vector and enable IRQ of ADC
         void SetIntrVec(void (*Func)())
@@ -37,7 +36,7 @@
         { return myAdc_->DR; }
 
         // Read ADC, range: [0, 0x0FFF]
-        virtual uint16_t ReadWait_u16()
+        uint16_t ReadWait_u16()
         {
             WaitDone();
             return myAdc_->DR;
@@ -55,7 +54,7 @@
         }
 
         // Software start with disable IRQ
-        virtual void SoftStart()
+        void SoftStartDisableIRQ()
         {
             NVIC_DisableIRQ(ADC_IRQn);
             myAdc_->CR2 |= ADC_CR2_SWSTART;
@@ -63,3 +62,4 @@
     };
 }
 #endif  // ADC_INTERRUPT_HPP
+