28#ifndef CURRENTLIMIT9_H
29#define CURRENTLIMIT9_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 CURRENTLIMIT9_CMD_VREG 0x11
74#define CURRENTLIMIT9_CMD_NVREG 0x21
75#define CURRENTLIMIT9_CMD_VREGxNVREG 0x51
76#define CURRENTLIMIT9_CMD_NVREGxVREG 0x61
94#define CURRENTLIMIT9_WIPER_POS_MIN 0
95#define CURRENTLIMIT9_WIPER_POS_MIDDLE 127
96#define CURRENTLIMIT9_WIPER_POS_MAX 255
97#define CURRENTLIMIT9_RES_200_KOHM 200.0f
103#define CURRENTLIMIT9_FAULT_FLAG 0
109#define CURRENTLIMIT9_RESISTANCE 200.0f, 39.9f, 10.0f, 5.0f, 2.7f, 2.2f, 1.5f
116#define CURRENTLIMIT9_DEVICE_ADDRESS 0x28
134#define CURRENTLIMIT9_MAP_MIKROBUS( cfg, mikrobus ) \
135 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
136 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
137 cfg.on = MIKROBUS( mikrobus, MIKROBUS_RST ); \
138 cfg.flt = MIKROBUS( mikrobus, MIKROBUS_INT )
currentlimit9_return_value_t
Current Limit 9 Click return value data.
Definition currentlimit9.h:186
@ CURRENTLIMIT9_ERROR
Definition currentlimit9.h:188
@ CURRENTLIMIT9_OK
Definition currentlimit9.h:187
currentlimit9_limit_t
Current Limit 9 current limit values.
Definition currentlimit9.h:197
@ CURRENTLIMIT9_LIMIT_1_90_A
Definition currentlimit9.h:204
@ CURRENTLIMIT9_LIMIT_1_84_A
Definition currentlimit9.h:203
@ CURRENTLIMIT9_LIMIT_1_55_A
Definition currentlimit9.h:201
@ CURRENTLIMIT9_LIMIT_0_46_A
Definition currentlimit9.h:199
@ CURRENTLIMIT9_LIMIT_1_17_A
Definition currentlimit9.h:200
@ CURRENTLIMIT9_LIMIT_0_11_A
Definition currentlimit9.h:198
@ CURRENTLIMIT9_LIMIT_1_67_A
Definition currentlimit9.h:202
err_t currentlimit9_default_cfg(currentlimit9_t *ctx)
Current Limit 9 default configuration function.
err_t currentlimit9_set_resistance(currentlimit9_t *ctx, float res_kohm)
Current Limit 9 sets the resistance function.
err_t currentlimit9_init(currentlimit9_t *ctx, currentlimit9_cfg_t *cfg)
Current Limit 9 initialization function.
void currentlimit9_enable(currentlimit9_t *ctx)
Current Limit 9 enable the device function.
err_t currentlimit9_set_limit(currentlimit9_t *ctx, currentlimit9_limit_t current_limit)
Current Limit 9 sets the current limit function.
void currentlimit9_cfg_setup(currentlimit9_cfg_t *cfg)
Current Limit 9 configuration object setup function.
uint8_t currentlimit9_get_fault(currentlimit9_t *ctx)
Current Limit 9 get the fault flag function.
void currentlimit9_disable(currentlimit9_t *ctx)
Current Limit 9 disable the device function.
err_t currentlimit9_set_wiper_pos(currentlimit9_t *ctx, uint8_t wiper_pos)
Current Limit 9 sets the wiper position function.
err_t currentlimit9_write_data(currentlimit9_t *ctx, uint8_t cmd, uint8_t data_in)
Current Limit 9 I2C writing function.
Current Limit 9 Click configuration object.
Definition currentlimit9.h:168
uint32_t i2c_speed
Definition currentlimit9.h:176
pin_name_t on
Definition currentlimit9.h:173
pin_name_t flt
Definition currentlimit9.h:174
pin_name_t scl
Definition currentlimit9.h:169
pin_name_t sda
Definition currentlimit9.h:170
uint8_t i2c_address
Definition currentlimit9.h:177
Current Limit 9 Click context object.
Definition currentlimit9.h:148
digital_in_t flt
Definition currentlimit9.h:153
digital_out_t on
Definition currentlimit9.h:150
i2c_master_t i2c
Definition currentlimit9.h:156
uint8_t slave_address
Definition currentlimit9.h:159