powerbank2 2.0.0.0
powerbank2.h File Reference

This file contains API for POWERBANK 2 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  powerbank2_t
 Click ctx object definition. More...
 
struct  powerbank2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define POWERBANK2_MAP_MIKROBUS(cfg, mikrobus)
 
#define POWERBANK2_RETVAL   uint8_t
 
#define POWERBANK2_OK   0x00
 
#define POWERBANK2_INIT_ERROR   0xFF
 
#define POWERBANK2_SLAVE_ADR   0x4D
 
#define POWERBANK2_RESOLUTION   4096
 
#define POWERBANK2_12_BIT_DATA   0x0FFF
 

Functions

void powerbank2_cfg_setup (powerbank2_cfg_t *cfg)
 Config Object Initialization function.
 
POWERBANK2_RETVAL powerbank2_init (powerbank2_t *ctx, powerbank2_cfg_t *cfg)
 Initialization function.
 
void powerbank2_generic_write (powerbank2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void powerbank2_read (powerbank2_t *ctx, uint16_t *result)
 Read function.
 
uint16_t powerbank2_read_voltage (powerbank2_t *ctx, uint16_t v_ref)
 Read voltage function.
 

Detailed Description

This file contains API for POWERBANK 2 Click driver.