charger3 2.0.0.0
charger3.h File Reference

This file contains API for Charger 3 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  charger3_t
 Charger 3 Click context object. More...
 
struct  charger3_cfg_t
 Charger 3 Click configuration object. More...
 

Macros

#define CHARGER3_COMMAND_NOP   0x00
 Charger 3 description commands.
 
#define CHARGER3_COMMAND_WRITE_RDAC   0x04
 
#define CHARGER3_COMMAND_READ_RDAC   0x08
 
#define CHARGER3_COMMAND_STORE_WIPER   0x0C
 
#define CHARGER3_COMMAND_SW_RESET   0x10
 
#define CHARGER3_COMMAND_READ_50TP   0x14
 
#define CHARGER3_COMMAND_READ_MEMORY   0x18
 
#define CHARGER3_COMMAND_WRITE_MEMORY   0x1C
 
#define CHARGER3_COMMAND_READ_CONTROL   0x20
 
#define CHARGER3_COMMAND_SW_SHUTDOWN   0x24
 
#define CHARGER3_CTRL_REG_BIT_MASK   0x0B
 Charger 3 description setting.
 
#define CHARGER3_FUSE_PROGRAM_SUCCESSFUL   0x00
 
#define CHARGER3_FUSE_PROGRAM_UNSUCCESSFUL   0x08
 
#define CHARGER3_WIPER_POS_FROZEN   0x00
 
#define CHARGER3_UPDATE_WIPER_POS   0x02
 
#define CHARGER3_50T_PROGRAM_DISABLED   0x00
 
#define CHARGER3_50T_PROGRAM_ENABLE   0x01
 
#define CHARGER3_SET_DEV_ADDR   0x2F
 Charger 3 device address setting.
 
#define CHARGER3_ENABLE_CHARGING   0x00
 Charger 3 operating mode.
 
#define CHARGER3_DISABLE_CHARGING   0x01
 
#define CHARGER3_STATUS_ERROR_SUCCESS   0x00
 Charger 3 error code.
 
#define CHARGER3_STATUS_ERROR_FAILURE   0x01
 
#define CHARGER3_DUMMY   0x00
 Charger 3 dummy command.
 
#define CHARGER3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Functions

void charger3_cfg_setup (charger3_cfg_t *cfg)
 Charger 3 configuration object setup function.
 
err_t charger3_init (charger3_t *ctx, charger3_cfg_t *cfg)
 Charger 3 initialization function.
 
void charger3_default_cfg (charger3_t *ctx)
 Charger 3 default configuration function.
 
err_t charger3_generic_write (charger3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Charger 3 I2C writing function.
 
err_t charger3_generic_read (charger3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Charger 3 I2C reading function.
 
void charger3_enable_write (charger3_t *ctx)
 Charger 3 enable write function.
 
void charger3_operating_mode (charger3_t *ctx, uint8_t mode)
 Charger 3 set operating mode function.
 
void charger3_write_rdac (charger3_t *ctx, uint16_t rdac_data)
 Charger 3 write to rdac function.
 
uint8_t charger3_set_digipot_res (charger3_t *ctx, uint16_t res_ohm)
 Charger 3 set digital potentiometer resistance function.
 
uint8_t charger3_set_current (charger3_t *ctx, float curr_value)
 Charger 3 set current function.
 
uint16_t charger3_read_rdac (charger3_t *ctx)
 Charger 3 read rdac function.
 
float charger3_calc_digipot_res (charger3_t *ctx)
 Charger 3 calculate digipot resistance function.
 

Detailed Description

This file contains API for Charger 3 Click Driver.