Go to the documentation of this file.
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
261 #endif // _WAVEFORM_H_
void waveform_digipot_dec(waveform_t *ctx)
Decrement function.
void waveform_triangle_output(waveform_t *ctx, uint32_t freq)
Triangle output function.
void waveform_sine_output(waveform_t *ctx, uint32_t freq)
Sinusoide output function.
void waveform_digipot_inc(waveform_t *ctx)
Increment function.
void waveform_square_output(waveform_t *ctx, uint32_t freq)
Square output function.
void waveform_cfg_setup(waveform_cfg_t *cfg)
Config Object Initialization function.
err_t waveform_init(waveform_t *ctx, waveform_cfg_t *cfg)
Initialization function.
void waveform_write_frequency(waveform_t *ctx, uint32_t freq)
Frequency function.
void waveform_write_reg(waveform_t *ctx, uint16_t reg_setting)
Registry function.