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 STEPUP_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.mod = MIKROBUS( mikrobus, MIKROBUS_RST ); \
74 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM )
81#define STEPUP_RETVAL uint8_t
84#define STEPUP_INIT_ERROR 0xFF
85#define STEPUP_ERROR (-1)
92#define STEPUP_CFG_VREF_BUFFERED 1
93#define STEPUP_CFG_VREF_UNBUFFERED 0
95#define STEPUP_CFG_GAIN_1X 1
96#define STEPUP_CFG_GAIN_2X 0
98#define STEPUP_CFG_POWER_OUT_ON 1
99#define STEPUP_CFG_POWER_OUT_OFF 0
#define STEPUP_RETVAL
Definition stepup.h:81
void stepup_en_set(stepup_t *ctx, uint8_t pin_state)
En Pin set function.
void stepup_default_cfg(stepup_t *ctx)
Click Default Configuration function.
STEPUP_RETVAL stepup_init(stepup_t *ctx, stepup_cfg_t *cfg)
Initialization function.
err_t stepup_set_percentage(stepup_t *ctx, float percentage)
Set DAC precetage up.
void stepup_mod_set(stepup_t *ctx, uint8_t pin_state)
Mod Pin set function.
void stepup_cfg_setup(stepup_cfg_t *cfg)
Config Object Initialization function.
err_t stepup_dac_write(stepup_t *ctx, uint16_t dac_val)
DAC Write function.
void stepup_dac_setup(stepup_t *ctx, stepup_dac_cfg_t *cfg)
DAC Setup function.
Click configuration structure definition.
Definition stepup.h:143
uint8_t spi_mode
Definition stepup.h:159
spi_master_chip_select_polarity_t cs_polarity
Definition stepup.h:160
pin_name_t sck
Definition stepup.h:148
stepup_dac_cfg_t dac_config
Definition stepup.h:162
pin_name_t mod
Definition stepup.h:153
pin_name_t mosi
Definition stepup.h:147
uint32_t spi_speed
Definition stepup.h:158
pin_name_t en
Definition stepup.h:154
pin_name_t miso
Definition stepup.h:146
pin_name_t cs
Definition stepup.h:149
Click DAC configuration structure definition.
Definition stepup.h:112
uint8_t buf
Definition stepup.h:113
uint8_t shdn
Definition stepup.h:115
uint8_t ga
Definition stepup.h:114
Click ctx object definition.
Definition stepup.h:123
digital_out_t cs
Definition stepup.h:128
digital_out_t mod
Definition stepup.h:126
spi_master_t spi
Definition stepup.h:132
stepup_dac_cfg_t dac_config
Definition stepup.h:135
digital_out_t en
Definition stepup.h:127
pin_name_t chip_select
Definition stepup.h:133