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 EFUSE5_WRITE_TO_RDAC 0x00
74#define EFUSE5_ONE_TIME_PROG 0x80
93#define EFUSE5_OTP_V_READY 0x00
94#define EFUSE5_OTP_V_TEST_FUSE_OK 0x40
95#define EFUSE5_OTP_V_ERROR 0x80
96#define EFUSE5_OTP_V_PROG_SUCCESS 0xC0
103#define EFUSE5_DEVICE_ADDRESS 0x2C
121#define EFUSE5_MAP_MIKROBUS( cfg, mikrobus ) \
122 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
123 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
124 cfg.mon = MIKROBUS( mikrobus, MIKROBUS_AN ); \
125 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
126 cfg.pgd = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
127 cfg.flt = MIKROBUS( mikrobus, MIKROBUS_INT )
efuse5_return_value_t
eFuse 5 Click return value data.
Definition efuse5.h:197
@ EFUSE5_OK
Definition efuse5.h:198
@ EFUSE5_ERROR
Definition efuse5.h:199
efuse5_current_limit_t
eFuse 5 Click current limit value data.
Definition efuse5.h:178
@ EFUSE5_CURRENT_LIMIT_900_mA
Definition efuse5.h:182
@ EFUSE5_CURRENT_LIMIT_4500_mA
Definition efuse5.h:188
@ EFUSE5_CURRENT_LIMIT_720_mA
Definition efuse5.h:180
@ EFUSE5_CURRENT_LIMIT_2000_mA
Definition efuse5.h:187
@ EFUSE5_CURRENT_LIMIT_865_mA
Definition efuse5.h:181
@ EFUSE5_CURRENT_LIMIT_1550_mA
Definition efuse5.h:186
@ EFUSE5_CURRENT_LIMIT_1445_mA
Definition efuse5.h:185
@ EFUSE5_CURRENT_LIMIT_1030_mA
Definition efuse5.h:183
@ EFUSE5_CURRENT_LIMIT_1200_mA
Definition efuse5.h:184
@ EFUSE5_CURRENT_LIMIT_600_mA
Definition efuse5.h:179
void efuse5_enable_device(efuse5_t *ctx)
eFuse 5 enable the device function.
err_t efuse5_set_current_limit(efuse5_t *ctx, efuse5_current_limit_t current_limit)
eFuse 5 set the current limit function.
void efuse5_cfg_setup(efuse5_cfg_t *cfg)
eFuse 5 configuration object setup function.
err_t efuse5_set_resistance(efuse5_t *ctx, uint16_t res_ohm)
eFuse 5 set the resistance function.
uint8_t efuse5_get_fault(efuse5_t *ctx)
eFuse 5 gets fault condition state function.
err_t efuse5_read_rdac(efuse5_t *ctx, uint8_t *rdac_data)
eFuse 5 read RDAC function.
uint8_t efuse5_get_pgood(efuse5_t *ctx)
eFuse 5 gets power good state function.
uint8_t efuse5_get_imon(efuse5_t *ctx)
eFuse 5 get imon function.
err_t efuse5_init(efuse5_t *ctx, efuse5_cfg_t *cfg)
eFuse 5 initialization function.
err_t efuse5_write_rdac(efuse5_t *ctx, uint8_t rdac_data)
eFuse 5 write RDAC function.
err_t efuse5_write_byte(efuse5_t *ctx, uint8_t inst, uint8_t data_in)
eFuse 5 I2C writing function.
err_t efuse5_default_cfg(efuse5_t *ctx)
eFuse 5 default configuration function.
void efuse5_shutdown(efuse5_t *ctx)
eFuse 5 disable the device function.
err_t efuse5_set_digi_pot(efuse5_t *ctx, uint8_t wiper_pos)
eFuse 5 set the digital potentiometer function.
err_t efuse5_generic_read(efuse5_t *ctx, uint8_t *data_out)
eFuse 5 I2C reading function.
eFuse 5 Click configuration object.
Definition efuse5.h:159
pin_name_t pgd
Definition efuse5.h:165
uint32_t i2c_speed
Definition efuse5.h:168
pin_name_t flt
Definition efuse5.h:166
pin_name_t scl
Definition efuse5.h:160
pin_name_t en
Definition efuse5.h:164
pin_name_t sda
Definition efuse5.h:161
pin_name_t mon
Definition efuse5.h:163
uint8_t i2c_address
Definition efuse5.h:169
eFuse 5 Click context object.
Definition efuse5.h:137
digital_in_t pgd
Definition efuse5.h:143
digital_in_t mon
Definition efuse5.h:142
digital_in_t flt
Definition efuse5.h:144
i2c_master_t i2c
Definition efuse5.h:147
digital_out_t en
Definition efuse5.h:139
uint8_t slave_address
Definition efuse5.h:150