39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
74#define WAVEFORM3_REG_B28_BIT 1 << 13
81#define WAVEFORM3_REG_HLB_BIT 1 << 12
88#define WAVEFORM3_REG_FSEL_BIT 1 << 11
95#define WAVEFORM3_REG_PSEL_BIT 1 << 10
101#define WAVEFORM3_REG_RESET_BIT 1 << 8
108#define WAVEFORM3_REG_SLEEP1_BIT 1 << 7
115#define WAVEFORM3_REG_SLEEP12_BIT 1 << 6
122#define WAVEFORM3_REG_OPBITEN_BIT 1 << 5
129#define WAVEFORM3_REG_DIV2_BIT 1 << 3
136#define WAVEFORM3_REG_MODE_BIT 1 << 1
142#define WAVEFORM3_REG_RESET_CLEAR 0x0000
160#define WAVEFORM3_CFG_MODE_SINUSOIDAL 0x00
166#define WAVEFORM3_CFG_MODE_TRIANGLE 0x01
173#define WAVEFORM3_CFG_MODE_DAC_2 0x02
179#define WAVEFORM3_CFG_MODE_DAC 0x03
197#define WAVEFORM3_CFG_FREQ_REG0 0x00
203#define WAVEFORM3_CFG_FREQ_REG1 0x01
221#define WAVEFORM3_CFG_PHASE_REG0 0x00
227#define WAVEFORM3_CFG_PHASE_REG1 0x01
245#define WAVEFORM3_DEFAULT_FREQ0 0
251#define WAVEFORM3_DEFAULT_FREQ1 0
257#define WAVEFORM3_DEFAULT_PHASE0 0
263#define WAVEFORM3_DEFAULT_PHASE1 0
281#define WAVEFORM3_MAP_MIKROBUS( cfg, mikrobus ) \
282 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
283 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
284 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
285 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )