modm API documentation
|
#include <modm/platform/dac/dac_1.hpp>
Public Types | |
enum | Channel : uint8_t { Channel1 = 0, Channel2 = 1 } |
enum | Mode { ExternalWithBuffer = 0, ExternalInternalWithBuffer = DAC_MCR_MODE1_0, ExternalWithoutBuffer = DAC_MCR_MODE1_1, Internal = DAC_MCR_MODE1_0 | DAC_MCR_MODE1_1 } |
Static Public Member Functions | |
template<class... Signals> | |
static void | connect () |
static void | initialize () |
static void | enableChannel (Channel chan) |
static void | disableChannel (Channel chan) |
static void | setMode (Channel chan, Mode mode) |
static void | setOutput (Channel chan, uint16_t value) |
static void | setOutput1 (uint16_t value) |
static void | setOutput2 (uint16_t value) |
template<class Gpio > | |
static constexpr Channel | getPinChannel () |
Get the channel for a Pin. | |
Digital-to-Analog Converter (DAC1)
Supports simple synchronous access to the 2-channel DAC found on most STM32 microcontrollers.
|
strong |
The DAC has two output channels, Channel1 and Channel2
|
static |
Disable DAC output for the given channel
chan | The channel to be disabled |
|
static |
Enable DAC output for the given channel
chan | The channel to be enabled |
|
static |
Initialize the D/A converter.
Enables the RCC clock output for the DAC
|
static |
Control the output mode
chan | The channel to configure the mode for |
mode | The channel output mode |
|
inlinestatic |
Set the output voltage for a DAC channel
chan | The channel to set |
value | The 12-bit DAC output value, range 0-4095. |
|
inlinestatic |
Set output value for Channel1
Equivalent to setOutput(modm::platform::Dac::Channel1, value)
value | The 12-bit DAC output value, range 0-4095 |
|
inlinestatic |
Set output value for Channel2
Equivalent to setOutput(modm::platform::Dac::Channel2, value)
value | The 12-bit DAC output value, range 0-4095 |