Nucleo-F446RE 内蔵の AD/DA を使うためのライブラリ.DA からの出力は,標本化周波数の4倍のレートで行う. このライブラリを登録した際のプログラム: Demo_F446_AD_DA_Multirate. Library for built-in ADC and DAC in Nucleo-F446RE. Sampling rate for DAC is four times of that for ADC.
Dependents: F446_UpSampling_GraphicEqualizer F446_UpSampling_ReverbSystem F446_UpSampling_FrqShifter_Weaver Demo_F446_AD_DA_Multirate ... more
F446_DAC.cpp
- Committer:
- MikamiUitOpen
- Date:
- 2020-02-09
- Revision:
- 9:75bc15678d1b
- Parent:
- 8:9429fb179c38
File content as of revision 9:75bc15678d1b:
//-------------------------------------------------------- // Class for buit-in single DAC on STM32F446 // // STM32F446 内蔵の DAC 用のクラス // DAC_OUT1: A2 (PA_4) // DAC_OUT2: D13 (PA_5) // // 2018/11/28, Copyright (c) 2018 MIKAMI, Naoki //-------------------------------------------------------- #include "F446_DAC.hpp" namespace Mikami { DacF446::DacF446(PinName pin) : da_(pin) { if ( (pin != A2) && (pin != D13) ) { fprintf(stderr, "Invalid pin name\r\n"); while (true) {} } if (pin == A2) { DAC->CR = DAC_CR_EN1; fpWriteDac = &DacF446::WriteDac1; } else { DAC->CR = DAC_CR_EN2; fpWriteDac = &DacF446::WriteDac2; } } }