Class library for internal ADC and DAC connected by SPI. ADC is triggered by TIM2. 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. Slave select of SPI for DAC is generated using TIM4. Validated for ST Nucleo F401RE, F411RE. New version. 内蔵 ADC と,SPI 接続の DAC のためのクラスライブラリ.ADC の変換開始トリガは TIM2 で発生.DAC の出力信号を平滑化するためのスイッチトキャパシタフィルタ用のクロックは TIM3 を使用.DAC の SPI 用スレーブ選択信号は TIM4 で発生.ST Nucleo F401RE,F411RE で動作を確認.新バージョン

Dependents:   UIT2_MovingAverage UIT2_AllpassReverb UIT2_CombReverb UIT2_FIR_LPF_Symmetry ... more

Revision:
2:2a3b4ed3eb58
Parent:
0:6e0ed5adfe47
Child:
3:77bc5550dc10
--- a/DAC_MCP4922.hpp	Wed Oct 22 08:59:28 2014 +0000
+++ b/DAC_MCP4922.hpp	Wed Oct 22 12:46:07 2014 +0000
@@ -8,7 +8,7 @@
 //      D12  SPI Slave Select
 //      D10  to MCP4922 LDAC pin
 //
-// 2014/09/29, Copyright (c) 2014 MIKAMI, Naoki
+// 2014/10/22, Copyright (c) 2014 MIKAMI, Naoki
 //------------------------------------------------------
 
 #ifndef DAC_MCP4922_HPP
@@ -37,15 +37,10 @@
         void Write(float value);
         // 0 <= value <= 4095
         void Write(uint16_t value);
-
+        
         // generate LDAC negative-going pulse
         void Ldac();
 
-        // LDAC to H
-        void LdacH() { ld_.write(1); }
-        // LDAC to L
-        void LdacL() { ld_.write(0); }
-
         // Check busy
         bool IsBusy()
         { return (mySpi_->SR & SPI_FLAG_BSY) == SPI_FLAG_BSY; }
@@ -53,7 +48,7 @@
     private:
         uint16_t wcr_;  // write command register
         SPI spi_;       // SPI object of mbed
-        Tim4_ss* ss_;   // for slave select
+        Tim4_ss* ss_;
         DigitalOut ld_; // for LDAC
 
         // Pointer of I2C
@@ -62,11 +57,10 @@
         // for inhibition of copy constructor
         DAC_MCP4922(const DAC_MCP4922&);
         // for inhibition of substitute operator
-        DAC_MCP4922& operator=(const DAC_MCP4922&);
-
+        DAC_MCP4922& operator=(const DAC_MCP4922&);     
+        
         // for internal use
         void WriteDac(uint16_t value);
     };
 }
 #endif  // DAC_MCP4922_HPP
-