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"
67#define DAC6_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
78#define DAC6_RETVAL uint8_t
81#define DAC6_INIT_ERROR 0xFF
88#define DAC6_CHANNEL_A 0x00
89#define DAC6_CHANNEL_B 0x01
90#define DAC6_CHANNEL_C 0x02
91#define DAC6_CHANNEL_D 0x03
98#define DAC6_WRITE_SPEC_UPDATE_NO 0x00
99#define DAC6_WRITE_SPEC_UPDATE_OUTPUT 0x01
100#define DAC6_WRITE_ALL_AND_UPDATE 0x02
101#define DAC6_POWER_DOWN_OUTPUTS 0x03
108#define DAC6_V_REF_2048 2048
115#define DAC6_OUTPUT_SHORT_CIRC_CURR 0x03FF
#define DAC6_RETVAL
Definition dac6.h:78
float dac6_set_output(dac6_t *ctx)
Set DAC output function.
void dac6_cfg_setup(dac6_cfg_t *cfg)
Config Object Initialization function.
void dac6_generic_transfer(dac6_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void dac6_write_data(dac6_t *ctx, uint16_t wr_data)
Generic write function.
DAC6_RETVAL dac6_init(dac6_t *ctx, dac6_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition dac6.h:150
spi_master_chip_select_polarity_t cs_polarity
Definition dac6.h:162
pin_name_t sck
Definition dac6.h:155
spi_master_mode_t spi_mode
Definition dac6.h:161
pin_name_t mosi
Definition dac6.h:154
uint32_t spi_speed
Definition dac6.h:160
pin_name_t miso
Definition dac6.h:153
pin_name_t cs
Definition dac6.h:156
Click ctx object definition.
Definition dac6.h:128
digital_out_t cs
Definition dac6.h:131
spi_master_t spi
Definition dac6.h:135
uint8_t op_mod
Definition dac6.h:140
uint8_t chan
Definition dac6.h:139
uint16_t set_out
Definition dac6.h:142
pin_name_t chip_select
Definition dac6.h:136
uint16_t v_ref
Definition dac6.h:141