currentlimit9 2.1.0.0
currentlimit9.h File Reference

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

Macros

#define CURRENTLIMIT9_CMD_VREG   0x11
 Current Limit 9 description register.
 
#define CURRENTLIMIT9_CMD_NVREG   0x21
 
#define CURRENTLIMIT9_CMD_VREGxNVREG   0x51
 
#define CURRENTLIMIT9_CMD_NVREGxVREG   0x61
 
#define CURRENTLIMIT9_WIPER_POS_MIN   0
 Current Limit 9 wiper and resistance data values.
 
#define CURRENTLIMIT9_WIPER_POS_MIDDLE   127
 
#define CURRENTLIMIT9_WIPER_POS_MAX   255
 
#define CURRENTLIMIT9_RES_200_KOHM   200.0f
 
#define CURRENTLIMIT9_FAULT_FLAG   0
 Current Limit 9 wiper and resistance data values.
 
#define CURRENTLIMIT9_RESISTANCE   200.0f, 39.9f, 10.0f, 5.0f, 2.7f, 2.2f, 1.5f
 Current Limit 9 description setting.
 
#define CURRENTLIMIT9_DEVICE_ADDRESS   0x28
 Current Limit 9 device address setting.
 
#define CURRENTLIMIT9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  currentlimit9_return_value_t { CURRENTLIMIT9_OK = 0 , CURRENTLIMIT9_ERROR = -1 }
 Current Limit 9 Click return value data. More...
 
enum  currentlimit9_limit_t {
  CURRENTLIMIT9_LIMIT_0_11_A = 0 , CURRENTLIMIT9_LIMIT_0_46_A , CURRENTLIMIT9_LIMIT_1_17_A , CURRENTLIMIT9_LIMIT_1_55_A ,
  CURRENTLIMIT9_LIMIT_1_67_A , CURRENTLIMIT9_LIMIT_1_84_A , CURRENTLIMIT9_LIMIT_1_90_A
}
 Current Limit 9 current limit values. More...
 

Functions

void currentlimit9_cfg_setup (currentlimit9_cfg_t *cfg)
 Current Limit 9 configuration object setup function.
 
err_t currentlimit9_init (currentlimit9_t *ctx, currentlimit9_cfg_t *cfg)
 Current Limit 9 initialization function.
 
err_t currentlimit9_default_cfg (currentlimit9_t *ctx)
 Current Limit 9 default configuration function.
 
void currentlimit9_enable (currentlimit9_t *ctx)
 Current Limit 9 enable the device function.
 
void currentlimit9_disable (currentlimit9_t *ctx)
 Current Limit 9 disable the device function.
 
err_t currentlimit9_write_data (currentlimit9_t *ctx, uint8_t cmd, uint8_t data_in)
 Current Limit 9 I2C writing function.
 
err_t currentlimit9_set_wiper_pos (currentlimit9_t *ctx, uint8_t wiper_pos)
 Current Limit 9 sets the wiper position function.
 
err_t currentlimit9_set_resistance (currentlimit9_t *ctx, float res_kohm)
 Current Limit 9 sets the resistance function.
 
err_t currentlimit9_set_limit (currentlimit9_t *ctx, currentlimit9_limit_t current_limit)
 Current Limit 9 sets the current limit function.
 
uint8_t currentlimit9_get_fault (currentlimit9_t *ctx)
 Current Limit 9 get the fault flag function.
 

Detailed Description

This file contains API for Current Limit 9 Click Driver.

Enumeration Type Documentation

◆ currentlimit9_limit_t

Current Limit 9 current limit values.

Predefined enum values for current limits.

Enumerator
CURRENTLIMIT9_LIMIT_0_11_A 
CURRENTLIMIT9_LIMIT_0_46_A 
CURRENTLIMIT9_LIMIT_1_17_A 
CURRENTLIMIT9_LIMIT_1_55_A 
CURRENTLIMIT9_LIMIT_1_67_A 
CURRENTLIMIT9_LIMIT_1_84_A 
CURRENTLIMIT9_LIMIT_1_90_A 

◆ currentlimit9_return_value_t

Current Limit 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
CURRENTLIMIT9_OK 
CURRENTLIMIT9_ERROR