Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: CW_Decoder_using_FFT_on_F446
Fork of F446_AD_DA by
F446_DAC.cpp
00001 //-------------------------------------------------------- 00002 // Class for buit-in dual DAC on STM32F446 00003 // 00004 // STM32F446 内蔵の DAC 用のクラス 00005 // DAC_OUT1: A2 (PA_4), 左 00006 // DAC_OUT2: D13 (PA_5), 右 00007 // 00008 // 2016/11/12, Copyright (c) 2016 MIKAMI, Naoki 00009 //-------------------------------------------------------- 00010 00011 #include "F446_DAC.hpp" 00012 00013 namespace Mikami 00014 { 00015 void DacDual::ScfClock(uint32_t clock) 00016 { 00017 PwmOut clockSCF(D12); // PA6 00018 00019 uint32_t arr; 00020 if ((RCC->DCKCFGR & RCC_DCKCFGR_TIMPRE) == RCC_DCKCFGR_TIMPRE) 00021 arr = SystemCoreClock/clock - 1; 00022 else 00023 arr = SystemCoreClock/(2*clock) - 1; 00024 TIM3->ARR = arr; 00025 TIM3->PSC = 0; 00026 00027 // Set capture/compare register 1 00028 TIM3->CCR1 = (TIM3->ARR + 1)/2; 00029 } 00030 }
Generated on Tue Jul 12 2022 18:06:48 by
