|
M5Unit-DDS 0.1.0 git rev:bcf3c40
|
DDS unit with AD9833. More...
#include <unit_DDS.hpp>
Classes | |
| struct | config_t |
| Settings for begin. More... | |
Public Member Functions | |
| UnitDDS (const uint8_t addr=DEFAULT_ADDRESS) | |
| virtual bool | begin () override |
| bool | readDescription (char str[7]) |
| Read the description. | |
Settings for begin | |
| config_t | config () |
| Gets the configration. | |
| void | config (const config_t &cfg) |
| Set the configration. | |
Properties | |
| uint16_t | frequency0 () const |
| Gets written frequency 0 (Hz) | |
| uint16_t | frequency1 () const |
| Gets written frequency 1 (Hz) | |
Output mode | |
| bool | readMode (dds::Mode &mode) |
| Read the mode. | |
| bool | writeMode (const dds::Mode mode) |
| Write the mode. | |
Settings | |
| bool | writeFrequency (const bool select, const uint32_t freq) |
| Write the frequency. | |
| bool | writeFrequency0 (const uint32_t freq) |
| Write the frequency to bank 0. | |
| bool | writeFrequency1 (const uint32_t freq) |
| Write the frequency to bank 1. | |
| bool | writePhase (const bool select, const uint16_t deg) |
| Write the phase. | |
| bool | writePhase0 (const uint16_t deg) |
| Write the phase to bank 0. | |
| bool | writePhase1 (const uint16_t deg) |
| Write the phase to bank 1. | |
| bool | writeFrequencyAndPhase (const bool select_freq, const uint32_t freq, const bool select_phase, const uint16_t deg) |
| Write the frequency and phase. | |
| bool | writeCurrent (const bool select_freq, const bool select_phase) |
| Write which bank setting to use. | |
| bool | writeCurrentFrequency (const bool select) |
| Write which bank frequency setting to use. | |
| bool | writeCurrentPhase (const bool select) |
| Write which bank phase setting to use. | |
Operation | |
| bool | writeOutput (const dds::Mode mode, const bool select, const uint32_t freq, const uint16_t deg) |
| Write mode and settings. | |
| bool | sleep (const bool mclk=true, const bool DAC=true) |
| Sleep. | |
| bool | wakeup () |
| Wake up. | |
| bool | reset () |
| Reset. | |
Protected Member Functions | |
| bool | read_control (uint8_t &ctrl) |
| bool | write_register8 (const uint8_t reg, const uint8_t v) |
DDS unit with AD9833.
| bool m5::unit::UnitDDS::readDescription | ( | char | str[7] | ) |
Read the description.
| [out] | str | Description string buffer (at least 7 bytes) |
| bool m5::unit::UnitDDS::readMode | ( | dds::Mode & | mode | ) |
Read the mode.
| [out] | mode | Mode |
| bool m5::unit::UnitDDS::reset | ( | ) |
Reset.
| bool m5::unit::UnitDDS::sleep | ( | const bool | mclk = true, |
| const bool | DAC = true ) |
Sleep.
| mclk | Sleep mclk (Keep output current value) |
| DAC | Sleep DAC (Stop output) |
| bool m5::unit::UnitDDS::wakeup | ( | ) |
Wake up.
| bool m5::unit::UnitDDS::writeCurrent | ( | const bool | select_freq, |
| const bool | select_phase ) |
Write which bank setting to use.
| select_freq | Frequecny using bank 0 if false, bank 1 if true |
| select_freq | Phase using bank 0 if false, bank 1 if true |
| bool m5::unit::UnitDDS::writeCurrentFrequency | ( | const bool | select | ) |
Write which bank frequency setting to use.
| select_freq | Frequecny using bank 0 if false, bank 1 if true |
| bool m5::unit::UnitDDS::writeCurrentPhase | ( | const bool | select | ) |
Write which bank phase setting to use.
| select_freq | Phase using bank 0 if false, bank 1 if true |
| bool m5::unit::UnitDDS::writeFrequency | ( | const bool | select, |
| const uint32_t | freq ) |
Write the frequency.
| select | Target bank 0 if false, bank 1 if true |
| freq | Frequency(Hz) 0 - 1Mhz |
|
inline |
Write the frequency to bank 0.
| freq | Frequency(Hz) 0 - 1Mhz |
|
inline |
Write the frequency to bank 1.
| freq | Frequency(Hz) 0 - 1Mhz |
| bool m5::unit::UnitDDS::writeFrequencyAndPhase | ( | const bool | select_freq, |
| const uint32_t | freq, | ||
| const bool | select_phase, | ||
| const uint16_t | deg ) |
Write the frequency and phase.
| select_freq | Frequency target bank 0 if false, bank 1 if true |
| freq | Frequency(Hz) 0 - 1Mhz |
| select_freq | Phase target bank 0 if false, bank 1 if true |
| deg | Phase (degree) |
| bool m5::unit::UnitDDS::writeMode | ( | const dds::Mode | mode | ) |
Write the mode.
| mode | Mode |
| bool m5::unit::UnitDDS::writeOutput | ( | const dds::Mode | mode, |
| const bool | select, | ||
| const uint32_t | freq, | ||
| const uint16_t | deg ) |
Write mode and settings.
| mode | Mode |
| select | Using bank |
| freq | Frequency(Hz) 0 - 1Mhz |
| deg | Phase (degree) |
| bool m5::unit::UnitDDS::writePhase | ( | const bool | select, |
| const uint16_t | deg ) |
Write the phase.
| select | Target bank 0 if false, bank 1 if true |
| deg | Phase (degree) |
|
inline |
Write the phase to bank 0.
| deg | Phase (degree) |
|
inline |
Write the phase to bank 1.
| deg | Phase (degree) |