Class library for internal ADC and DAC connected by SPI. This library support clock generator using TIM3 for switched-capacitor filter to smooth output signal of DAC. This library includes derivative class to support interrupt occured in end of AD conversion. Validated for ST Nucleo F401RE, F411RE. 内蔵 ADC と,SPI 接続の DAC のためのクラスライブラリ.DAC の出力信号を平滑化するためのスイッチトキャパシタフィルタ用のクロックは TIM3 を使用.ST Nucleo F401RE,F411RE で動作を確認.

Dependents:   UITDSP_ADDA_Example UIT2_MovingAv_Intr UIT2_VariableFIR UIT2_VowelSynthesizer ... more

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