⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad9854_8h-source.html

📁 方便飞利浦arm7tdmi 处理器lpc2100开发的C函数库 Procyon ARMlib-LPC2100 C-Language Function Library for Philips LPC21
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Procyon ARMlib-LPC2100: ad9854.h Source File</title><link href="dox.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.6 --><div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>ad9854.h</h1><a href="ad9854_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*! \file ad9854.h \brief Analog Devices AD9854 Digital Synthesizer Driver. */</span>00002 <span class="comment">//*****************************************************************************</span>00003 <span class="comment">//</span>00004 <span class="comment">// File Name    : 'ad9854.h'</span>00005 <span class="comment">// Title        : Analog Devices AD9854 Digital Synthesizer Driver</span>00006 <span class="comment">// Author       : Pascal Stang - Copyright (C) 2004</span>00007 <span class="comment">// Created      : 2004.05.05</span>00008 <span class="comment">// Revised      : 2004.07.12</span>00009 <span class="comment">// Version      : 0.1</span>00010 <span class="comment">// Target MCU   : ARM processors</span>00011 <span class="comment">// Editor Tabs  : 4</span>00012 <span class="comment">//</span>00013 <span class="comment">// NOTE: This code is currently below version 1.0, and therefore is considered</span>00014 <span class="comment">// to be lacking in some functionality or documentation, or may not be fully</span>00015 <span class="comment">// tested.  Nonetheless, you can expect most functions to work.</span>00016 <span class="comment">//</span>00017 <span class="comment">// This code is distributed under the GNU Public License</span>00018 <span class="comment">//      which can be found at http://www.gnu.org/licenses/gpl.txt</span>00019 <span class="comment">//</span>00020 <span class="comment">//*****************************************************************************</span>00021 00022 <span class="preprocessor">#ifndef AD9854_H</span>00023 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_H</span>00024 <span class="preprocessor"></span>00025 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>00026 00027 <span class="comment">// defines</span>00028 00029 <span class="comment">// hardware</span>00030 <span class="preprocessor">#define AD9854_REFCLK_FREQ      24000000l</span>00031 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_IO_UPDATE        P04</span>00032 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_RESET            P05</span>00033 <span class="preprocessor"></span>00034 <span class="comment">// base address</span>00035 <span class="preprocessor">#define AD9854_REG_BASE         0x8400</span>00036 <span class="preprocessor"></span>00037 <span class="comment">// registers</span>00038 <span class="preprocessor">#define AD9854_REG_PHASE1H      0x00</span>00039 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_PHASE1L      0x01</span>00040 <span class="preprocessor"></span>00041 <span class="preprocessor">#define AD9854_REG_PHASE2H      0x02</span>00042 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_PHASE2L      0x03</span>00043 <span class="preprocessor"></span>00044 <span class="preprocessor">#define AD9854_REG_FREQ15       0x04</span>00045 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ14       0x05</span>00046 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ13       0x06</span>00047 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ12       0x07</span>00048 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ11       0x08</span>00049 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ10       0x09</span>00050 <span class="preprocessor"></span>00051 <span class="preprocessor">#define AD9854_REG_FREQ25       0x0A</span>00052 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ24       0x0B</span>00053 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ23       0x0C</span>00054 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ22       0x0D</span>00055 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ21       0x0E</span>00056 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_FREQ20       0x0F</span>00057 <span class="preprocessor"></span>00058 <span class="preprocessor">#define AD9854_REG_DELTA5       0x10</span>00059 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_DELTA4       0x11</span>00060 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_DELTA3       0x12</span>00061 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_DELTA2       0x13</span>00062 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_DELTA1       0x14</span>00063 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_DELTA0       0x15</span>00064 <span class="preprocessor"></span>00065 <span class="preprocessor">#define AD9854_REG_UPDCLOCK3    0x16</span>00066 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_UPDCLOCK2    0x17</span>00067 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_UPDCLOCK1    0x18</span>00068 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_UPDCLOCK0    0x19</span>00069 <span class="preprocessor"></span>00070 <span class="preprocessor">#define AD9854_REG_RAMPCLOCK2   0x1A</span>00071 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_RAMPCLOCK1   0x1B</span>00072 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_RAMPCLOCK0   0x1C</span>00073 <span class="preprocessor"></span>00074 <span class="preprocessor">#define AD9854_REG_CTRL3        0x1D</span>00075 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_CTRL2        0x1E</span>00076 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_CTRL1        0x1F</span>00077 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_CTRL0        0x20</span>00078 <span class="preprocessor"></span>00079 <span class="preprocessor">#define AD9854_REG_AMPLIH       0x21</span>00080 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_AMPLIL       0x22</span>00081 <span class="preprocessor"></span>00082 <span class="preprocessor">#define AD9854_REG_AMPLQH       0x23</span>00083 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_AMPLQL       0x24</span>00084 <span class="preprocessor"></span>00085 <span class="preprocessor">#define AD9854_REG_OSKEYRAMP    0x25</span>00086 <span class="preprocessor"></span>00087 <span class="preprocessor">#define AD9854_REG_QDACH        0x26</span>00088 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_REG_QDACL        0x27</span>00089 <span class="preprocessor"></span>00090 <span class="comment">// mode defines</span>00091 <span class="preprocessor">#define AD9854_MODE_SINGLE      0x00</span>00092 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE_FSK         0x01</span>00093 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE_RAMPFSK     0x02</span>00094 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE_CHIRP       0x03</span>00095 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE_BPSK        0x04</span>00096 <span class="preprocessor"></span>00097 <span class="comment">// control register</span>00098 <span class="preprocessor">#define AD9854_INVSINC_BYPASS   BIT(6)</span>00099 <span class="preprocessor"></span>00100 <span class="preprocessor">#define AD9854_INT_IO_UPDATE    BIT(8)</span>00101 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE_MASK        0x00000E00</span>00102 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE0            BIT(9)</span>00103 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE1            BIT(10)</span>00104 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_MODE2            BIT(11)</span>00105 <span class="preprocessor"></span>00106 <span class="preprocessor">#define AD9854_TRIANGLE         BIT(13)</span>00107 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_CLR_ACC2         BIT(14)</span>00108 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_CLR_ACC1         BIT(15)</span>00109 <span class="preprocessor"></span>00110 <span class="preprocessor">#define AD9854_PLL_MULT_MASK    0x001F0000</span>00111 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PLL_MULT0        BIT(16)</span>00112 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PLL_MULT1        BIT(17)</span>00113 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PLL_MULT2        BIT(18)</span>00114 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PLL_MULT3        BIT(19)</span>00115 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PLL_MULT4        BIT(20)</span>00116 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PLL_BYPASS       BIT(21)</span>00117 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PLL_RANGE        BIT(22)</span>00118 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PD_DIG           BIT(24)</span>00119 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PD_DAC           BIT(25)</span>00120 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PD_QDAC          BIT(26)</span>00121 <span class="preprocessor"></span><span class="preprocessor">#define AD9854_PD_COMP          BIT(28)</span>00122 <span class="preprocessor"></span>00123 <span class="keywordtype">void</span> ad9854Init(<span class="keywordtype">void</span>);00124 <span class="keywordtype">void</span> ad9854SetupIOUpdate(<span class="keywordtype">int</span> state);00125 <span class="keywordtype">void</span> ad9854ClockIOUpdate(<span class="keywordtype">void</span>);00126 00127 <span class="keywordtype">void</span> ad9854WritePhase1(u16 phase);00128 <span class="keywordtype">void</span> ad9854WritePhase2(u16 phase);00129 <span class="keywordtype">void</span> ad9854WriteFreq1(u64 freq);00130 <span class="keywordtype">void</span> ad9854WriteFreq2(u64 freq);00131 <span class="keywordtype">void</span> ad9854WriteDeltaFreq(u64 freq);00132 <span class="keywordtype">void</span> ad9854WriteUpdateClock(u32 updclock);00133 <span class="keywordtype">void</span> ad9854WriteRampRateClock(u32 rampclock);00134 <span class="keywordtype">void</span> ad9854WriteControlReg(u32 cr);00135 <span class="keywordtype">void</span> ad9854WriteAmplitudeI(u16 ampi);00136 <span class="keywordtype">void</span> ad9854WriteAmplitudeQ(u16 ampq);00137 <span class="keywordtype">void</span> ad9854WriteOSKeyRampRate(u16 ramprate);00138 <span class="keywordtype">void</span> ad9854WriteQDAC(u16 qdac);00139 00140 u32 ad9854ReadControlReg(<span class="keywordtype">void</span>);00141 <span class="keywordtype">void</span> ad9854ControlClear(u32 cr_clear);00142 <span class="keywordtype">void</span> ad9854ControlSet(u32 cr_set);00143 00144 00145 <span class="keywordtype">void</span> ad9854SetMode(<span class="keywordtype">int</span> mode);00146 <span class="keywordtype">void</span> ad9854SetPLL(<span class="keywordtype">int</span> enabled, <span class="keywordtype">int</span> mult);00147 00148 <span class="keywordtype">void</span> ad9854SetFreq1(u32 freqHz);00149 <span class="keywordtype">void</span> ad9854SetUpdateClock(u32 updclockHz);00150 00151 <span class="keywordtype">void</span> ad9854ShowRegisters(<span class="keywordtype">void</span>);00152 00153 00154 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jul 13 03:38:11 2004 for Procyon ARMlib-LPC2100 by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.6 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -