42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
68#define WAVEFORM_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
74 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
82#define WAVEFORM_ERROR -1
89#define WAVEFORM_CR_B28_BITMASK 0x2000
90#define WAVEFORM_CR_HLB_BITMASK 0x1000
91#define WAVEFORM_CR_FSELECT_BITMASK 0x0800
92#define WAVEFORM_CR_PSELECT_BITMASK 0x0400
93#define WAVEFORM_CR_RESET_BITMASK 0x0100
94#define WAVEFORM_CR_SLEEP1_BITMASK 0x0080
95#define WAVEFORM_CR_SLEEP12_BITMASK 0x0040
96#define WAVEFORM_CR_OPBITEN_BITMASK 0x0020
97#define WAVEFORM_CR_DIV2_BITMASK 0x0008
98#define WAVEFORM_CR_MODE_BITMASK 0x0002
105#define WAVEFORM_SINE_OUT 0x01
106#define WAVEFORM_TRIANGLE_OUT 0x02
107#define WAVEFORM_SQUARE_OUT 0x03
114#define WAVEFORM_OSC_FREQUENCY 25000000ul
115#define WAVEFORM_FREQ_RESOLUTION 0x0FFFFFFFul