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 MIC33153_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.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
74 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
75 cfg.pg = MIKROBUS( mikrobus, MIKROBUS_INT );
82#define MIC33153_RETVAL uint8_t
84#define MIC33153_OK 0x00
85#define MIC33153_INIT_ERROR 0xFF
92#define MIC33153_OUT_ENABLE 1
93#define MIC33153_OUT_DISABLE 0
100#define MIC33153_MIN_VOLTAGE_800MV 0x0FFF
101#define MIC33153_VOLTAGE_1000MV 0x0EC0
102#define MIC33153_VOLTAGE_1500MV 0x0BE0
103#define MIC33153_VOLTAGE_2000MV 0x08F0
104#define MIC33153_VOLTAGE_2500MV 0x060F
105#define MIC33153_VOLTAGE_3000MV 0x0330
106#define MIC33153_VOLTAGE_3200MV 0x0210
107#define MIC33153_MAX_VOLTAGE_3550MV 0x0000
#define MIC33153_RETVAL
Definition mic33153.h:82
MIC33153_RETVAL mic33153_init(mic33153_t *ctx, mic33153_cfg_t *cfg)
Initialization function.
void mic33153_generic_transfer(mic33153_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void mic33153_enable_out(mic33153_t *ctx, uint8_t state)
Out enable function.
void mic33153_cfg_setup(mic33153_cfg_t *cfg)
Config Object Initialization function.
void mic33153_write_dac(mic33153_t *ctx, const uint16_t value_dac)
Write DAC function.
uint8_t mic33153_check_power_good(mic33153_t *ctx)
Power Good check function.
Click configuration structure definition.
Definition mic33153.h:143
uint8_t spi_mode
Definition mic33153.h:160
spi_master_chip_select_polarity_t cs_polarity
Definition mic33153.h:161
pin_name_t sck
Definition mic33153.h:148
pin_name_t mosi
Definition mic33153.h:147
uint32_t spi_speed
Definition mic33153.h:159
pin_name_t en
Definition mic33153.h:154
pin_name_t miso
Definition mic33153.h:146
pin_name_t pg
Definition mic33153.h:155
pin_name_t an
Definition mic33153.h:153
pin_name_t cs
Definition mic33153.h:149
Click ctx object definition.
Definition mic33153.h:121
digital_out_t cs
Definition mic33153.h:125
spi_master_t spi
Definition mic33153.h:134
digital_in_t an
Definition mic33153.h:129
digital_out_t en
Definition mic33153.h:124
pin_name_t chip_select
Definition mic33153.h:135
digital_in_t pg
Definition mic33153.h:130