currentlimit7 2.0.0.0
currentlimit7.h File Reference

This file contains API for Current Limit 7 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  currentlimit7_t
 Current Limit 7 Click context object. More...
 
struct  currentlimit7_cfg_t
 Current Limit 7 Click configuration object. More...
 

Macros

#define CURRENTLIMIT7_CMD_NOP   0x00
 Current Limit 7 description register.
 
#define CURRENTLIMIT7_CMD_WRITE_RDAC   0x04
 
#define CURRENTLIMIT7_CMD_READ_RDAC   0x08
 
#define CURRENTLIMIT7_CMD_STORE_WIPER   0x0C
 
#define CURRENTLIMIT7_CMD_SW_RESET   0x10
 
#define CURRENTLIMIT7_CMD_READ_CONTENTS   0x14
 
#define CURRENTLIMIT7_CMD_READ_MEMORY   0x18
 
#define CURRENTLIMIT7_CMD_WRITE_MEMORY   0x1C
 
#define CURRENTLIMIT7_CMD_READ_CTRL   0x20
 
#define CURRENTLIMIT7_CMD_SW_SHUTDOWN   0x24
 
#define CURRENTLIMIT7_OP_0_CURRENT_LIMIT_260_mA   260
 Current Limit 7 description current limit values.
 
#define CURRENTLIMIT7_OP_0_CURRENT_LIMIT_280_mA   280
 
#define CURRENTLIMIT7_OP_0_CURRENT_LIMIT_330_mA   330
 
#define CURRENTLIMIT7_OP_0_CURRENT_LIMIT_450_mA   450
 
#define CURRENTLIMIT7_OP_0_CURRENT_LIMIT_510_mA   510
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_510_mA   510
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_625_mA   625
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_860_mA   860
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_1320_mA   1320
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_1450_mA   1450
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_1550_mA   1550
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_1750_mA   1750
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_2020_mA   2020
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_2260_mA   2260
 
#define CURRENTLIMIT7_OP_1_CURRENT_LIMIT_2500_mA   2500
 
#define CURRENTLIMIT7_SET_SHUTDOWN_BIT_MASK   0x01
 Current Limit 7 description setting.
 
#define CURRENTLIMIT7_SET_NORMAL_MODE   0x00
 
#define CURRENTLIMIT7_SET_SHUTDOWN_MODE   0x01
 
#define CURRENTLIMIT7_SET_ENABLE_WRITE_MEMORY   0x0002
 
#define CURRENTLIMIT7_OP_MODE_500_mA_2500_mA   0x00
 Current Limit 7 description operation mode.
 
#define CURRENTLIMIT7_OP_MODE_250_mA_500_mA   0x01
 
#define CURRENTLIMIT7_SET_DEV_ADDR_0   0x2E
 Current Limit 7 device address setting.
 
#define CURRENTLIMIT7_SET_DEV_ADDR_1   0x2C
 
#define CURRENTLIMIT7_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  currentlimit7_return_value_t { CURRENTLIMIT7_OK = 0 , CURRENTLIMIT7_ERROR = -1 }
 Current Limit 7 Click return value data. More...
 

Functions

void currentlimit7_cfg_setup (currentlimit7_cfg_t *cfg)
 Current Limit 7 configuration object setup function.
 
err_t currentlimit7_init (currentlimit7_t *ctx, currentlimit7_cfg_t *cfg)
 Current Limit 7 initialization function.
 
err_t currentlimit7_default_cfg (currentlimit7_t *ctx)
 Current Limit 7 default configuration function.
 
err_t currentlimit7_set_slave_address (currentlimit7_t *ctx, uint16_t slave_address)
 Current Limit 7 set I2C Slave address.
 
err_t currentlimit7_hw_reset (currentlimit7_t *ctx)
 Current Limit 7 hardware reset function.
 
err_t currentlimit7_set_enable (currentlimit7_t *ctx)
 Current Limit 7 enable the device function.
 
err_t currentlimit7_set_disable (currentlimit7_t *ctx)
 Current Limit 7 disable the device function.
 
err_t currentlimit7_generic_write (currentlimit7_t *ctx, uint8_t cmd, uint16_t data_byte)
 Current Limit 7 I2C writing function.
 
err_t currentlimit7_generic_read (currentlimit7_t *ctx, uint8_t cmd, uint16_t data_byte, uint16_t *data_out)
 Current Limit 7 I2C reading function.
 
err_t currentlimit7_enable_write (currentlimit7_t *ctx)
 Current Limit 7 enable write function.
 
err_t currentlimit7_write_rdac (currentlimit7_t *ctx, uint16_t data_in)
 Current Limit 7 write RDAC function.
 
err_t currentlimit7_read_rdac (currentlimit7_t *ctx, uint16_t *data_out)
 Current Limit 7 read RDAC function.
 
err_t currentlimit7_sw_reset (currentlimit7_t *ctx)
 Current Limit 7 software reset function.
 
err_t currentlimit7_store_wiper (currentlimit7_t *ctx)
 Current Limit 7 store wiper function.
 
err_t currentlimit7_next_frame_read (currentlimit7_t *ctx, uint8_t wiper_location, uint16_t *data_out)
 Current Limit 7 next frame read function.
 
err_t currentlimit7_read_memory (currentlimit7_t *ctx, uint8_t wiper_location, uint16_t *data_out)
 Current Limit 7 read memory function.
 
err_t currentlimit7_operating_mode (currentlimit7_t *ctx, uint8_t mode)
 Current Limit 7 set operating mode function.
 
err_t currentlimit7_set_digi_pot (currentlimit7_t *ctx, uint16_t wiper_pos)
 Current Limit 7 set DIGI POT function.
 
err_t currentlimit7_set_resistance (currentlimit7_t *ctx, uint32_t res_ohm)
 Current Limit 7 set resistance function.
 
err_t currentlimit7_set_current_limit (currentlimit7_t *ctx, uint8_t op_mode, uint16_t current_limit_ma)
 Current Limit 7 set current limit function.
 
uint8_t currentlimit7_get_fault (currentlimit7_t *ctx)
 Current Limit 7 get fault function.
 

Detailed Description

This file contains API for Current Limit 7 Click Driver.

Enumeration Type Documentation

◆ currentlimit7_return_value_t

Current Limit 7 Click return value data.

Predefined enum values for driver return values.

Enumerator
CURRENTLIMIT7_OK 
CURRENTLIMIT7_ERROR