PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Functions for up to 2 channels per cog of duty modulated signals for D/A conversion through a low pass filter. More than one cog may be launched, so for example, if 5 signals are desired, use 3 cogs for up to 6 channels. More...
#include "simpletools.h"
Go to the source code of this file.
Classes | |
struct | dac2ch_st |
Typedefs | |
typedef struct dac2ch_st | dac2ch_t |
typedef dac2ch_t | dac2ch |
Functions | |
dac2ch * | dac2ch_start (int bits) |
Start duty modulation process in another cog for D/A conversion through a low pass filter. More... | |
void | dac2ch_set (dac2ch *device, int pin, int channel, int dacVal) |
Set a DAC signal's level. More... | |
void | dac2ch_stop (dac2ch *device) |
Shut down dac2ch process and reclaim cog and I/O pins for other uses. More... | |
Functions for up to 2 channels per cog of duty modulated signals for D/A conversion through a low pass filter. More than one cog may be launched, so for example, if 5 signals are desired, use 3 cogs for up to 6 channels.
Definition in file dac2ch.h.
struct dac2ch_st |
void dac2ch_set | ( | dac2ch * | device, |
int | pin, | ||
int | channel, | ||
int | dacVal | ||
) |
Set a DAC signal's level.
*device | The dac2ch pointer/process ID returned by dac2ch_start. |
pin | The pin to send the duty modulated DAC signal. |
channel | 0 or 1. |
dacVal | For D/A, use 0 to (2^bits) - 1. For example, for 9 bits, that would be 0 to 511. To shut down a channel and set the I/O pin to input, use -1. |
dac2ch* dac2ch_start | ( | int | bits | ) |
Start duty modulation process in another cog for D/A conversion through a low pass filter.
bits | Number of bits for the D/A converter. The number of voltage settings will be 2^bits. For example, setting bits to 8 gives 2^8 = 256 voltage settings, from 0 -> 0 V to 255 -> 3.287 V on a 3.3 V scale. |
Definition at line 26 of file dac2ch.c.