Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
53 #define UPS3_DIR_MODE_BACKUP 0x00
54 #define UPS3_DIR_MODE_CHARGE 0x01
67 #define UPS3_ENABLE_SHUTDOWN 0x00
68 #define UPS3_ENABLE_NORMAL_OPERATION 0x01
82 #define UPS3_GET_ERROR_CMPIN_OK 0x00
83 #define UPS3_GET_ERROR_CMPIN_EMPTY 0x01
97 #define UPS3_GET_CAP_OK_FBV_LOW 0x00
98 #define UPS3_GET_CAP_OK_FBV_HIGH 0x01
112 #define UPS3_GET_CHRG_CHARGE_MODE 0x00
113 #define UPS3_GET_CHRG_BACKUP_MODE 0x01
127 #define UPS3_SUCCESS 0
128 #define UPS3_ERROR -1
147 #define UPS3_MAP_MIKROBUS( cfg, mikrobus ) \
148 cfg.err = MIKROBUS( mikrobus, MIKROBUS_AN ); \
149 cfg.cok = MIKROBUS( mikrobus, MIKROBUS_RST ); \
150 cfg.dir = MIKROBUS( mikrobus, MIKROBUS_CS ); \
151 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
152 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
digital_in_t cok
Definition: ups3.h:171
UPS 3 Click configuration object.
Definition: ups3.h:181
pin_name_t dir
Definition: ups3.h:184
err_t ups3_init(ups3_t *ctx, ups3_cfg_t *cfg)
UPS 3 initialization function.
digital_in_t err
Definition: ups3.h:170
err_t ups3_select_dir_mode(ups3_t *ctx, uint8_t dir_mode)
UPS 3 pin select direction of the operation modes function.
pin_name_t en
Definition: ups3.h:185
err_t ups3_default_cfg(ups3_t *ctx)
UPS 3 default configuration function.
uint8_t ups3_get_error(ups3_t *ctx)
UPS 3 get error function.
pin_name_t int_pin
Definition: ups3.h:186
pin_name_t err
Definition: ups3.h:182
void ups3_cfg_setup(ups3_cfg_t *cfg)
UPS 3 configuration object setup function.
uint8_t ups3_get_chrg(ups3_t *ctx)
UPS 3 get charge/backup mode function.
UPS 3 Click context object.
Definition: ups3.h:162
digital_out_t en
Definition: ups3.h:166
pin_name_t cok
Definition: ups3.h:183
err_t ups3_hw_reset(ups3_t *ctx)
UPS 3 reset the device function.
uint8_t ups3_get_cap_ok(ups3_t *ctx)
UPS 3 pin get capacitor ok function.
digital_out_t dir
Definition: ups3.h:165
digital_in_t int_pin
Definition: ups3.h:172
err_t ups3_set_enable(ups3_t *ctx, uint8_t enable)
UPS 3 enable device function.