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 BOOSTONV2_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.en = MIKROBUS( mikrobus, MIKROBUS_AN ); \
74 cfg.csn = MIKROBUS( mikrobus, MIKROBUS_RST ); \
75 cfg.psm = MIKROBUS( mikrobus, MIKROBUS_PWM );
82#define BOOSTONV2_RETVAL uint8_t
84#define BOOSTONV2_OK 0x00
85#define BOOSTONV2_INIT_ERROR 0xFF
91#define BOOSTINV2_POS_VOUT_5V 0x7FFF
92#define BOOSTINV2_POS_VOUT_6V 0x7B00
93#define BOOSTINV2_POS_VOUT_7V 0x7A20
94#define BOOSTINV2_POS_VOUT_8V 0x7950
95#define BOOSTINV2_POS_VOUT_9V 0x7870
96#define BOOSTINV2_POS_VOUT_10V 0x7790
97#define BOOSTINV2_POS_VOUT_11V 0x76B0
98#define BOOSTINV2_POS_VOUT_12V 0x75E0
99#define BOOSTINV2_POS_VOUT_13V 0x7500
100#define BOOSTINV2_POS_VOUT_14V 0x7420
101#define BOOSTINV2_POS_VOUT_15V 0x7340
108#define BOOSTINV2_NEG_VOUT_5V 0x79A2
109#define BOOSTINV2_NEG_VOUT_6V 0x7900
110#define BOOSTINV2_NEG_VOUT_7V 0x786A
111#define BOOSTINV2_NEG_VOUT_8V 0x77D0
112#define BOOSTINV2_NEG_VOUT_9V 0x7744
113#define BOOSTINV2_NEG_VOUT_10V 0x76B0
114#define BOOSTINV2_NEG_VOUT_11V 0x7630
115#define BOOSTINV2_NEG_VOUT_12V 0x75B2
116#define BOOSTINV2_NEG_VOUT_13V 0x7530
117#define BOOSTINV2_NEG_VOUT_14V 0x74B0
118#define BOOSTINV2_NEG_VOUT_15V 0x7474
#define BOOSTONV2_RETVAL
Definition boostinv2.h:82
void boostinv2_cfg_setup(boostinv2_cfg_t *cfg)
Config Object Initialization function.
void boostinv2_set_psn(boostinv2_t *ctx, uint8_t state)
Sets PSN depending on input state.
void boostinv2_enable(boostinv2_t *ctx)
Enable analog pin.
void boostinv2_set_negative_voltage(boostinv2_t *ctx, uint16_t voltage)
Sets negative voltage.
void boostinv2_default_cfg(boostinv2_t *ctx)
Click Default Configuration function.
BOOSTONV2_RETVAL boostinv2_init(boostinv2_t *ctx, boostinv2_cfg_t *cfg)
Initialization function.
void boostinv2_generic_transfer(boostinv2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void boostinv2_set_positive_voltage(boostinv2_t *ctx, uint16_t voltage)
Sets postive voltage.
Click configuration structure definition.
Definition boostinv2.h:151
uint8_t spi_mode
Definition boostinv2.h:168
pin_name_t psm
Definition boostinv2.h:163
pin_name_t csn
Definition boostinv2.h:162
spi_master_chip_select_polarity_t cs_polarity
Definition boostinv2.h:169
pin_name_t sck
Definition boostinv2.h:156
pin_name_t mosi
Definition boostinv2.h:155
uint32_t spi_speed
Definition boostinv2.h:167
pin_name_t en
Definition boostinv2.h:161
pin_name_t miso
Definition boostinv2.h:154
pin_name_t cs
Definition boostinv2.h:157
Click ctx object definition.
Definition boostinv2.h:132
digital_out_t cs
Definition boostinv2.h:138
spi_master_t spi
Definition boostinv2.h:142
digital_out_t psm
Definition boostinv2.h:137
digital_out_t csn
Definition boostinv2.h:136
digital_out_t en
Definition boostinv2.h:135
pin_name_t chip_select
Definition boostinv2.h:143