28#ifndef CURRENTLIMIT5_H
29#define CURRENTLIMIT5_H
39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define CURRENTLIMIT5_DIGIPOT_MAX_VALUE 5000
74#define CURRENTLIMIT5_DIGIPOT_OFFSET 80
75#define CURRENTLIMIT5_DIGIPOT_RESOLUTION 257
76#define CURRENTLIMIT5_ROUND_TO_NEAREST_INT 0.5
83#define CURRENTLIMIT5_SET_DEV_ADDR 0x2F
101#define CURRENTLIMIT5_MAP_MIKROBUS( cfg, mikrobus ) \
102 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
103 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
104 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
105 cfg.fault = MIKROBUS( mikrobus, MIKROBUS_INT )
currentlimit5_return_value_t
Current Limit 5 Click return value data.
Definition currentlimit5.h:152
@ CURRENTLIMIT5_ERROR
Definition currentlimit5.h:154
@ CURRENTLIMIT5_OK
Definition currentlimit5.h:153
currentlimit5_ilimit_t
Current Limit 5 Click Ilimit values.
Definition currentlimit5.h:163
@ CURRENTLIMIT5_ILIMIT_500mA
Definition currentlimit5.h:168
@ CURRENTLIMIT5_ILIMIT_1100mA
Definition currentlimit5.h:174
@ CURRENTLIMIT5_ILIMIT_300mA
Definition currentlimit5.h:166
@ CURRENTLIMIT5_ILIMIT_200mA
Definition currentlimit5.h:165
@ CURRENTLIMIT5_ILIMIT_700mA
Definition currentlimit5.h:170
@ CURRENTLIMIT5_ILIMIT_100mA
Definition currentlimit5.h:164
@ CURRENTLIMIT5_ILIMIT_1000mA
Definition currentlimit5.h:173
@ CURRENTLIMIT5_ILIMIT_900mA
Definition currentlimit5.h:172
@ CURRENTLIMIT5_ILIMIT_400mA
Definition currentlimit5.h:167
@ CURRENTLIMIT5_ILIMIT_600mA
Definition currentlimit5.h:169
@ CURRENTLIMIT5_ILIMIT_800mA
Definition currentlimit5.h:171
err_t currentlimit5_init(currentlimit5_t *ctx, currentlimit5_cfg_t *cfg)
Current Limit 5 initialization function.
void currentlimit5_enable_limit(currentlimit5_t *ctx)
Current Limit 5 enable limit function.
void currentlimit5_disable_limit(currentlimit5_t *ctx)
Current Limit 5 disable limit function.
void currentlimit5_cfg_setup(currentlimit5_cfg_t *cfg)
Current Limit 5 configuration object setup function.
uint8_t currentlimit5_get_fault_pin(currentlimit5_t *ctx)
Current Limit 5 get fault pin function.
err_t currentlimit5_default_cfg(currentlimit5_t *ctx)
Current Limit 5 default configuration function.
err_t currentlimit5_set_ilimit(currentlimit5_t *ctx, currentlimit5_ilimit_t ilimit)
Current Limit 5 set ilimit function.
Current Limit 5 Click configuration object.
Definition currentlimit5.h:135
uint32_t i2c_speed
Definition currentlimit5.h:142
pin_name_t scl
Definition currentlimit5.h:136
pin_name_t en
Definition currentlimit5.h:139
pin_name_t sda
Definition currentlimit5.h:137
pin_name_t fault
Definition currentlimit5.h:140
uint8_t i2c_address
Definition currentlimit5.h:143
Current Limit 5 Click context object.
Definition currentlimit5.h:115
i2c_master_t i2c
Definition currentlimit5.h:123
digital_out_t en
Definition currentlimit5.h:117
digital_in_t fault
Definition currentlimit5.h:120
uint8_t slave_address
Definition currentlimit5.h:126