gossamer 0.0.0
a very lightweight app framework for SAMD and SAML chips
|
Digital to Analog Converter. More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Enumerations | |
enum | dac_channel_mask_t { DAC_CHANNEL_NONE = 0 , DAC_CHANNEL_0 = 1 , DAC_CHANNEL_1 = 2 , DAC_CHANNEL_BOTH = 3 } |
Functions | |
void | dac_init (void) |
Initializes the DAC peripheral, but does not enable it. More... | |
void | dac_enable (dac_channel_mask_t channelmask) |
Enables the DAC channels specified in the mask, and disables others. More... | |
void | dac_set_analog_value (uint16_t channel, uint16_t value) |
Set the analog value of the DAC. More... | |
void | dac_disable (uint16_t channel) |
Disables the given DAC channel. More... | |
Digital to Analog Converter.
void dac_disable | ( | uint16_t | channel | ) |
Disables the given DAC channel.
void dac_enable | ( | dac_channel_mask_t | channelmask | ) |
Enables the DAC channels specified in the mask, and disables others.
channelmask | A bitmask of the channels to enable: 1 for channel 0, 2 for channel 1, 3 for both channels. For MCUs with only one DAC channel, this parameter is ignored. |
void dac_init | ( | void | ) |
Initializes the DAC peripheral, but does not enable it.
channel | The DAC channel to enable. |
TODO: Figure out appropriate clock setup on SAM D51
void dac_set_analog_value | ( | uint16_t | channel, |
uint16_t | value | ||
) |
Set the analog value of the DAC.
channel | The DAC channel to set. |
value | The value to set the DAC to. The range is platform-dependent:
|