Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
69 #define BUCK15_INSTR_RDAC_SEL_1 0x00
70 #define BUCK15_INSTR_RDAC_SEL_2 0x80
76 #define BUCK15_INSTR_RDAC_MIDSCALE_DIS 0x00
77 #define BUCK15_INSTR_RDAC_MIDSCALE_EN 0x40
83 #define BUCK15_INSTR_RDAC_SHUTDOWN_DIS 0x00
84 #define BUCK15_INSTR_RDAC_SHUTDOWN_EN 0x20
90 #define BUCK15_INSTR_RDAC_OTUPUT_0 0x00
91 #define BUCK15_INSTR_RDAC_OTUPUT_1 0x08
92 #define BUCK15_INSTR_RDAC_OTUPUT_2 0x10
93 #define BUCK15_INSTR_RDAC_OTUPUT_3 0x18
99 #define BUCK15_VOS_WIPER_POS 255, 175, 128, 128, 128, 199, 105, \
100 81, 91, 80, 79, 70, 69, 132, 130, \
101 130, 38, 102, 71, 8, 5, 1
107 #define BUCK15_VSET_WIPER_POS 1, 10, 63, 101, 146, 218, 180, 175, \
108 185, 190, 200, 200, 205, 225, 227, \
109 228, 211, 235, 252, 254, 254, 255
115 #define BUCK15_VOUT_TABLE 0.6f, 0.8f, 1.0f, 1.1f, 1.3f, 1.5f, \
116 1.8f, 1.9f, 2.0f, 2.2f, 2.5f, 2.6f, \
117 2.8f, 3.0f, 3.2f, 3.3f, 3.5f, 3.8f, \
118 4.0f, 4.3f, 4.6f, 5.0f
126 #define BUCK15_DEVICE_ADDRESS_GND 0x2C
127 #define BUCK15_DEVICE_ADDRESS_VCC 0x2D
145 #define BUCK15_MAP_MIKROBUS( cfg, mikrobus ) \
146 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
147 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
148 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
149 cfg.pg = MIKROBUS( mikrobus, MIKROBUS_INT )
@ BUCK15_VOUT_2V8
Definition: buck15.h:220
@ BUCK15_VOUT_4V
Definition: buck15.h:226
@ BUCK15_VOUT_4V6
Definition: buck15.h:228
@ BUCK15_VOUT_5V
Definition: buck15.h:229
void buck15_disable_device(buck15_t *ctx)
Buck 15 disable device function.
@ BUCK15_VOUT_3V5
Definition: buck15.h:224
err_t buck15_generic_read(buck15_t *ctx, uint8_t instr, uint8_t *data_out)
Buck 15 I2C reading function.
Buck 15 Click context object.
Definition: buck15.h:159
@ BUCK15_VOUT_1V5
Definition: buck15.h:213
pin_name_t sda
Definition: buck15.h:181
@ BUCK15_VOUT_1V8
Definition: buck15.h:214
pin_name_t pg
Definition: buck15.h:184
err_t buck15_set_vset(buck15_t *ctx, uint8_t vset_wp)
Buck 15 set VSET function.
@ BUCK15_VOUT_1V
Definition: buck15.h:210
pin_name_t en
Definition: buck15.h:183
@ BUCK15_VOUT_3V8
Definition: buck15.h:225
i2c_master_t i2c
Definition: buck15.h:167
uint8_t slave_address
Definition: buck15.h:170
@ BUCK15_VOUT_3V2
Definition: buck15.h:222
Buck 15 Click configuration object.
Definition: buck15.h:179
@ BUCK15_VOUT_4V3
Definition: buck15.h:227
err_t buck15_default_cfg(buck15_t *ctx)
Buck 15 default configuration function.
@ BUCK15_VOUT_2V6
Definition: buck15.h:219
uint32_t i2c_speed
Definition: buck15.h:186
@ BUCK15_VOUT_2V
Definition: buck15.h:216
pin_name_t scl
Definition: buck15.h:180
@ BUCK15_ERROR
Definition: buck15.h:198
@ BUCK15_VOUT_0V6
Definition: buck15.h:208
uint8_t buck15_get_power_good(buck15_t *ctx)
Buck 15 disable device function.
@ BUCK15_VOUT_2V2
Definition: buck15.h:217
void buck15_cfg_setup(buck15_cfg_t *cfg)
Buck 15 configuration object setup function.
err_t buck15_set_vos(buck15_t *ctx, uint8_t vos_wp)
Buck 15 set VOS function.
buck15_vout_t
Buck 15 output voltage values.
Definition: buck15.h:207
digital_out_t en
Definition: buck15.h:161
err_t buck15_generic_write(buck15_t *ctx, uint8_t instr, uint8_t data_in)
Buck 15 I2C writing function.
err_t buck15_set_vout(buck15_t *ctx, buck15_vout_t vout)
Buck 15 set VOUT function.
@ BUCK15_VOUT_2V5
Definition: buck15.h:218
@ BUCK15_OK
Definition: buck15.h:197
@ BUCK15_VOUT_1V3
Definition: buck15.h:212
@ BUCK15_VOUT_1V1
Definition: buck15.h:211
digital_in_t pg
Definition: buck15.h:164
@ BUCK15_VOUT_1V9
Definition: buck15.h:215
@ BUCK15_VOUT_3V
Definition: buck15.h:221
buck15_return_value_t
Buck 15 Click return value data.
Definition: buck15.h:196
@ BUCK15_VOUT_0V8
Definition: buck15.h:209
@ BUCK15_VOUT_3V3
Definition: buck15.h:223
void buck15_enable_device(buck15_t *ctx)
Buck 15 enable device function.
uint8_t i2c_address
Definition: buck15.h:187
err_t buck15_init(buck15_t *ctx, buck15_cfg_t *cfg)
Buck 15 initialization function.