#include <otAD9833.h>
Public Types | |
| enum | WaveformType { SINE_WAVE = 0x2000, TRIANGLE_WAVE = 0x2002, SQUARE_WAVE = 0x2028, HALF_SQUARE_WAVE = 0x2020 } |
| enum | Registers { REG0, REG1, SAME_AS_REG0 } |
Public Member Functions | |
| otAD9833 () | |
| void | init (int id, U32 referenceFrequency=25000000UL) |
| void | applySignal (U16 waveType, U8 freqReg, F32 frequencyInHz, U8 phaseReg=SAME_AS_REG0, F32 phaseInDeg=0.0) |
| void | reset () |
| void | setFrequency (U8 freqReg, F32 frequency) |
| void | incrementFrequency (U8 freqReg, F32 freqIncHz) |
| void | setPhase (U8 phaseReg, F32 phaseInDeg) |
| void | incrementPhase (U8 phaseReg, F32 phaseIncDeg) |
| void | setWaveform (U8 waveFormReg, U16 waveType) |
| void | setOutputSource (U8 freqReg, U8 phaseReg=SAME_AS_REG0) |
| void | enableOutput (bool enable) |
| void | sleepMode (bool enable) |
| void | disableDAC (bool enable) |
| void | disableInternalClock (bool enable) |
| F32 | getActualProgrammedFrequency (U8 reg) |
| F32 | getActualProgrammedPhase (U8 reg) |
| F32 | getResolution () |
|
|
|
|
|
|
|
|
Create the class |
|
||||||||||||||||||||||||
|
Setup and apply a signal. Note that any calls to enableOutput, sleepMode, disableDAC, or disableInternalClock remain in effect
|
|
|
Enable / Disable DAC
|
|
|
Enable / Disable Internal Clock
|
|
|
Turn ON / OFF output using the RESET command.
|
|
|
Return actual frequency programmed in register
|
|
|
Return actual phase programmed in register
|
|
|
Return frequency resolution
|
|
||||||||||||
|
Increment the selected frequency register by freqIncHz
|
|
||||||||||||
|
Increment the selected phase register by phaseIncDeg
|
|
||||||||||||
|
Must be the first command after creating the AD9833 object.
|
|
|
Resets internal registers to 0, which corresponds to an output of midscale - digital output at 0. See EnableOutput function |
|
||||||||||||
|
Update just the frequency in REG0 or REG1
|
|
||||||||||||
|
Output based on the contents of REG0 or REG1
|
|
||||||||||||
|
Update just the phase in REG0 or REG1
|
|
||||||||||||
|
Set the output waveform for the selected frequency register
|
|
|
Enable/disable Sleep mode. Internal clock and DAC disabled
|