41#ifdef PREINIT_SUPPORTED
45#ifdef MikroCCoreVersion
46 #if MikroCCoreVersion >= 1
51#include "drv_digital_out.h"
52#include "drv_digital_in.h"
53#include "drv_spi_master.h"
66#define DAC2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
68 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
69 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.clr = MIKROBUS( mikrobus, MIKROBUS_RST );
78#define DAC2_RETVAL uint8_t
81#define DAC2_INIT_ERROR 0xFF
142 // End constants group
151 // End variable group
#define DAC2_RETVAL
Definition dac2.h:78
void dac2_write_output_voltage_procentage(dac2_t *ctx, uint8_t value_pct)
Procentage generic write function.
void dac2_clr_dac_2_reg(dac2_t *ctx)
Asynchronous Clear Input function.
void dac2_default_cfg(dac2_t *ctx)
Click Default Configuration function.
void dac2_write_output_voltage_data(dac2_t *ctx, uint16_t value_data)
Data generic write function.
void dac2_generic_transfer(dac2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void dac2_cfg_setup(dac2_cfg_t *cfg)
Config Object Initialization function.
DAC2_RETVAL dac2_init(dac2_t *ctx, dac2_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition dac2.h:113
pin_name_t clr
Definition dac2.h:123
spi_master_chip_select_polarity_t cs_polarity
Definition dac2.h:129
pin_name_t sck
Definition dac2.h:118
spi_master_mode_t spi_mode
Definition dac2.h:128
pin_name_t mosi
Definition dac2.h:117
uint32_t spi_speed
Definition dac2.h:127
pin_name_t miso
Definition dac2.h:116
pin_name_t cs
Definition dac2.h:119
Click ctx object definition.
Definition dac2.h:96
digital_out_t cs
Definition dac2.h:100
spi_master_t spi
Definition dac2.h:104
digital_out_t clr
Definition dac2.h:99
pin_name_t chip_select
Definition dac2.h:105