42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_i2c_master.h"
65#define FAN4_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
74#define FAN4_RETVAL uint8_t
77#define FAN4_INIT_ERROR 0xFF
84#define FAN4_SLAVE_ADDRESS 0x74
91#define FAN4_BOOST_START_TIMER_DIS 0x00
92#define FAN4_BOOST_START_TIMER_EN 0x01
99#define FAN4_VOLT_RANGE_CHECK_MASK 0x01
100#define FAN4_BS_TIMER_CHECK_MASK 0x02
101#define FAN4_THERM_SHTDWN_CHECK_MASK 0x40
102#define FAN4_OVERCURR_CHECK_MASK 0x80
103#define FAN4_CHECK_OK 0x00
110#define FAN4_DAC_LSB 78
111#define FAN4_MIN_VOLT_SCALE 0
112#define FAN4_MAX_VOLT_SCALE 4922
#define FAN4_RETVAL
Definition fan4.h:74
uint8_t fan4_check_diagnostic(fan4_t *ctx)
Check diagnostic.
void fan4_default_cfg(fan4_t *ctx)
Click Default Configuration function.
FAN4_RETVAL fan4_set_output(fan4_t *ctx, uint16_t output_volt, uint8_t boost_start_timer)
Set output voltage.
void fan4_cfg_setup(fan4_cfg_t *cfg)
Config Object Initialization function.
void fan4_generic_write(fan4_t *ctx, uint8_t cmd)
Generic write function.
FAN4_RETVAL fan4_init(fan4_t *ctx, fan4_cfg_t *cfg)
Initialization function.
void fan4_generic_read(fan4_t *ctx, uint8_t *data_out)
Generic read function.
Click configuration structure definition.
Definition fan4.h:141
uint32_t i2c_speed
Definition fan4.h:149
pin_name_t scl
Definition fan4.h:144
pin_name_t sda
Definition fan4.h:145
uint8_t i2c_address
Definition fan4.h:150
Click ctx object definition.
Definition fan4.h:126
i2c_master_t i2c
Definition fan4.h:129
uint8_t slave_address
Definition fan4.h:133