不韋 呂
/
SDR_AM_Rx_CIC
AM中波放送用SDR.CICフィルタのみを使用.CQ出版社「トランジスタ技術」誌,2021年4月号に掲載
SDR_Library/F446_DAC.cpp@3:878a48f15e89, 2021-12-01 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Wed Dec 01 00:37:44 2021 +0000
- Revision:
- 3:878a48f15e89
- Parent:
- 2:4bec6b2be809
4
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 2:4bec6b2be809 | 1 | //-------------------------------------------------------- |
MikamiUitOpen | 2:4bec6b2be809 | 2 | // STM32F446 内蔵の DAC 用のクラス |
MikamiUitOpen | 2:4bec6b2be809 | 3 | // 出力端子: A2 (PA_4) に固定 |
MikamiUitOpen | 2:4bec6b2be809 | 4 | // |
MikamiUitOpen | 2:4bec6b2be809 | 5 | // 2020/07/23, Copyright (c) 2020 MIKAMI, Naoki |
MikamiUitOpen | 2:4bec6b2be809 | 6 | //-------------------------------------------------------- |
MikamiUitOpen | 2:4bec6b2be809 | 7 | |
MikamiUitOpen | 2:4bec6b2be809 | 8 | #include "F446_DAC.hpp" |
MikamiUitOpen | 2:4bec6b2be809 | 9 | #include "pinmap.h" // pin_function() で使用 |
MikamiUitOpen | 2:4bec6b2be809 | 10 | |
MikamiUitOpen | 2:4bec6b2be809 | 11 | namespace Mikami |
MikamiUitOpen | 2:4bec6b2be809 | 12 | { |
MikamiUitOpen | 2:4bec6b2be809 | 13 | // コンストラクタ |
MikamiUitOpen | 2:4bec6b2be809 | 14 | DacF446::DacF446() : DAC_(DAC) |
MikamiUitOpen | 2:4bec6b2be809 | 15 | { |
MikamiUitOpen | 2:4bec6b2be809 | 16 | // A2 に対応する GPIOx_MODER をアナログ・モードに設定する |
MikamiUitOpen | 2:4bec6b2be809 | 17 | pin_function(A2, STM_MODE_ANALOG); |
MikamiUitOpen | 2:4bec6b2be809 | 18 | |
MikamiUitOpen | 2:4bec6b2be809 | 19 | __HAL_RCC_DAC_CLK_ENABLE(); // DAC にクロックを供給する |
MikamiUitOpen | 2:4bec6b2be809 | 20 | // __HAL_RCC_DAC_CLK_ENABLE() の定義:stm32f4xx_hal_rcc_ex.h |
MikamiUitOpen | 2:4bec6b2be809 | 21 | |
MikamiUitOpen | 2:4bec6b2be809 | 22 | DAC_->CR = DAC_CR_EN1; // DAC を有効にする |
MikamiUitOpen | 2:4bec6b2be809 | 23 | } |
MikamiUitOpen | 2:4bec6b2be809 | 24 | } |