39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
67#define UPS3_DIR_MODE_BACKUP 0x00
68#define UPS3_DIR_MODE_CHARGE 0x01
81#define UPS3_ENABLE_SHUTDOWN 0x00
82#define UPS3_ENABLE_NORMAL_OPERATION 0x01
96#define UPS3_GET_ERROR_CMPIN_OK 0x00
97#define UPS3_GET_ERROR_CMPIN_EMPTY 0x01
111#define UPS3_GET_CAP_OK_FBV_LOW 0x00
112#define UPS3_GET_CAP_OK_FBV_HIGH 0x01
126#define UPS3_GET_CHRG_CHARGE_MODE 0x00
127#define UPS3_GET_CHRG_BACKUP_MODE 0x01
141#define UPS3_SUCCESS 0
161#define UPS3_MAP_MIKROBUS( cfg, mikrobus ) \
162 cfg.err = MIKROBUS( mikrobus, MIKROBUS_AN ); \
163 cfg.cok = MIKROBUS( mikrobus, MIKROBUS_RST ); \
164 cfg.dir = MIKROBUS( mikrobus, MIKROBUS_CS ); \
165 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
166 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
uint8_t ups3_get_chrg(ups3_t *ctx)
UPS 3 get charge/backup mode function.
err_t ups3_select_dir_mode(ups3_t *ctx, uint8_t dir_mode)
UPS 3 pin select direction of the operation modes function.
err_t ups3_default_cfg(ups3_t *ctx)
UPS 3 default configuration function.
uint8_t ups3_get_cap_ok(ups3_t *ctx)
UPS 3 pin get capacitor ok function.
void ups3_cfg_setup(ups3_cfg_t *cfg)
UPS 3 configuration object setup function.
err_t ups3_init(ups3_t *ctx, ups3_cfg_t *cfg)
UPS 3 initialization function.
err_t ups3_hw_reset(ups3_t *ctx)
UPS 3 reset the device function.
uint8_t ups3_get_error(ups3_t *ctx)
UPS 3 get error function.
err_t ups3_set_enable(ups3_t *ctx, uint8_t enable)
UPS 3 enable device function.
UPS 3 Click configuration object.
Definition ups3.h:195
pin_name_t cok
Definition ups3.h:197
pin_name_t err
Definition ups3.h:196
pin_name_t dir
Definition ups3.h:198
pin_name_t en
Definition ups3.h:199
pin_name_t int_pin
Definition ups3.h:200
UPS 3 Click context object.
Definition ups3.h:176
digital_in_t int_pin
Definition ups3.h:186
digital_in_t cok
Definition ups3.h:185
digital_out_t en
Definition ups3.h:180
digital_in_t err
Definition ups3.h:184
digital_out_t dir
Definition ups3.h:179