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 BUCK19_REG_VOUT 0x00
70 #define BUCK19_REG_ILIMIT 0x01
71 #define BUCK19_REG_INT_STATUS 0x02
72 #define BUCK19_REG_INT_LATCH 0x03
73 #define BUCK19_REG_INT_MASK 0x04
74 #define BUCK19_REG_CONFIG_0 0x05
75 #define BUCK19_REG_CONFIG_1 0x06
93 #define BUCK19_VOUT_MIN 3.0f
94 #define BUCK19_VOUT_MAX 20.0f
95 #define BUCK19_VOUT_DEFAULT 5.0f
96 #define BUCK19_VOUT_11V 11.0f
97 #define BUCK19_VOUT_11V_STEP 0.2f
98 #define BUCK19_VOUT_5p9V 5.9f
99 #define BUCK19_VOUT_5p9V_STEP 0.1f
100 #define BUCK19_VOUT_STEP 0.02f
101 #define BUCK19_FLOAT_COMPARE_TOLERANCE 0.0001f
107 #define BUCK19_ILIMIT_MIN 100
108 #define BUCK19_ILIMIT_MAX 3000
109 #define BUCK19_ILIMIT_STEP 100
110 #define BUCK19_ILIMIT_DEFAULT 500
116 #define BUCK19_INT_INDUCTOR_PCP 0x80
117 #define BUCK19_INT_OT_WARNING 0x40
118 #define BUCK19_INT_OT_PROTECT 0x20
119 #define BUCK19_INT_WATCHDOG 0x10
120 #define BUCK19_INT_POWER_ON 0x08
121 #define BUCK19_INT_SHORT_PROTECT 0x04
122 #define BUCK19_INT_CC_FUNCTION 0x02
123 #define BUCK19_INT_OV_PROTECT 0x01
124 #define BUCK19_INT_DISABLE_ALL 0x00
130 #define BUCK19_CONFIG_0_WATCHDOG_100MS 0x00
131 #define BUCK19_CONFIG_0_WATCHDOG_500MS 0x40
132 #define BUCK19_CONFIG_0_WATCHDOG_1S 0x80
133 #define BUCK19_CONFIG_0_WATCHDOG_5S 0xC0
134 #define BUCK19_CONFIG_0_CDC_OFF 0x00
135 #define BUCK19_CONFIG_0_CDC_FULL 0x10
136 #define BUCK19_CONFIG_0_SW_FREQ_500KHZ 0x00
137 #define BUCK19_CONFIG_0_SW_FREQ_750KHZ 0x04
138 #define BUCK19_CONFIG_0_DITHERING_OFF 0x00
139 #define BUCK19_CONFIG_0_DITHERING_ON 0x02
140 #define BUCK19_CONFIG_0_DISCHARGE_OFF 0x00
141 #define BUCK19_CONFIG_0_DISCHARGE_ON 0x01
147 #define BUCK19_CONFIG_1_WATCHDOG_EN_OFF 0x00
148 #define BUCK19_CONFIG_1_WATCHDOG_EN_ON 0x02
149 #define BUCK19_CONFIG_1_DIG_EN_OFF 0x00
150 #define BUCK19_CONFIG_1_DIG_EN_ON 0x01
157 #define BUCK19_DEVICE_ADDRESS_VCC 0x04
158 #define BUCK19_DEVICE_ADDRESS_GND 0x05
159 #define BUCK19_DEVICE_ADDRESS_SDA 0x06
160 #define BUCK19_DEVICE_ADDRESS_SCL 0x07
178 #define BUCK19_MAP_MIKROBUS( cfg, mikrobus ) \
179 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
180 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
181 cfg.pon = MIKROBUS( mikrobus, MIKROBUS_AN ); \
182 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
183 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
pin_name_t sda
Definition: buck19.h:216
err_t buck19_set_vout(buck19_t *ctx, float vout)
Buck 19 set vout function.
digital_in_t int_pin
Definition: buck19.h:199
uint8_t slave_address
Definition: buck19.h:205
pin_name_t en
Definition: buck19.h:219
Buck 19 Click context object.
Definition: buck19.h:193
pin_name_t int_pin
Definition: buck19.h:220
uint8_t buck19_get_int_pin(buck19_t *ctx)
Buck 19 get int pin function.
Buck 19 Click configuration object.
Definition: buck19.h:214
@ BUCK19_ERROR
Definition: buck19.h:234
void buck19_disable_device(buck19_t *ctx)
Buck 19 disable device function.
pin_name_t scl
Definition: buck19.h:215
err_t buck19_init(buck19_t *ctx, buck19_cfg_t *cfg)
Buck 19 initialization function.
@ BUCK19_OK
Definition: buck19.h:233
i2c_master_t i2c
Definition: buck19.h:202
err_t buck19_set_ilimit(buck19_t *ctx, uint16_t ilimit)
Buck 19 set ilimit function.
void buck19_enable_device(buck19_t *ctx)
Buck 19 enable device function.
void buck19_cfg_setup(buck19_cfg_t *cfg)
Buck 19 configuration object setup function.
pin_name_t pon
Definition: buck19.h:218
buck19_return_value_t
Buck 19 Click return value data.
Definition: buck19.h:232
uint32_t i2c_speed
Definition: buck19.h:222
digital_in_t pon
Definition: buck19.h:198
uint8_t buck19_get_pon_pin(buck19_t *ctx)
Buck 19 get pon pin function.
err_t buck19_write_register(buck19_t *ctx, uint8_t reg, uint8_t data_in)
Buck 19 write register function.
uint8_t i2c_address
Definition: buck19.h:223
digital_out_t en
Definition: buck19.h:195
err_t buck19_default_cfg(buck19_t *ctx)
Buck 19 default configuration function.
err_t buck19_read_register(buck19_t *ctx, uint8_t reg, uint8_t *data_out)
Buck 19 read register function.