hwmonitor2 2.1.0.0
hwmonitor2.h File Reference

This file contains API for HW Monitor 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  hwmonitor2_t
 HW Monitor 2 Click context object. More...
 
struct  hwmonitor2_cfg_t
 HW Monitor 2 Click configuration object. More...
 
struct  hwmonitor2_config_t
 HW Monitor 2 Click configuration object. More...
 

Macros

#define HWMONITOR2_REG_CONFIGURATION   0x00
 HW Monitor 2 description register.
 
#define HWMONITOR2_REG_INT_STATUS_1   0x01
 
#define HWMONITOR2_REG_INT_STATUS_2   0x02
 
#define HWMONITOR2_REG_INT_MASK_1   0x03
 
#define HWMONITOR2_REG_INT_MASK_2   0x04
 
#define HWMONITOR2_REG_FAN_DIVISOR   0x05
 
#define HWMONITOR2_REG_OS_T_RES_CONFIG   0x06
 
#define HWMONITOR2_REG_CONVERSION_RATE   0x07
 
#define HWMONITOR2_REG_CHANNEL_DISABLE   0x08
 
#define HWMONITOR2_REG_INPUT_MODE   0x09
 
#define HWMONITOR2_REG_ADC_CONTROL   0x0A
 
#define HWMONITOR2_REG_CONVERS_RATE_CNT   0x0B
 
#define HWMONITOR2_REG_RAM_IN_0   0x20
 
#define HWMONITOR2_REG_RAM_IN_1   0x21
 
#define HWMONITOR2_REG_RAM_IN_2   0x22
 
#define HWMONITOR2_REG_RAM_IN_3   0x23
 
#define HWMONITOR2_REG_RAM_IN_4   0x24
 
#define HWMONITOR2_REG_RAM_IN_5   0x25
 
#define HWMONITOR2_REG_RAM_IN_6   0x26
 
#define HWMONITOR2_REG_RAM_TEMPERATURE   0x27
 
#define HWMONITOR2_REG_RAM_FAN_1   0x28
 
#define HWMONITOR2_REG_RAM_FAN_2   0x29
 
#define HWMONITOR2_REG_RAM_LIM_IN_0_H   0x2A
 
#define HWMONITOR2_REG_RAM_LIM_IN_0_L   0x2B
 
#define HWMONITOR2_REG_RAM_LIM_IN_1_H   0x2C
 
#define HWMONITOR2_REG_RAM_LIM_IN_1_L   0x2D
 
#define HWMONITOR2_REG_RAM_LIM_IN_2_H   0x2E
 
#define HWMONITOR2_REG_RAM_LIM_IN_2_L   0x2F
 
#define HWMONITOR2_REG_RAM_LIM_IN_3_H   0x30
 
#define HWMONITOR2_REG_RAM_LIM_IN_3_L   0x31
 
#define HWMONITOR2_REG_RAM_LIM_IN_4_H   0x32
 
#define HWMONITOR2_REG_RAM_LIM_IN_4_L   0x33
 
#define HWMONITOR2_REG_RAM_LIM_IN_5_H   0x34
 
#define HWMONITOR2_REG_RAM_LIM_IN_5_L   0x35
 
#define HWMONITOR2_REG_RAM_LIM_IN_6_H   0x36
 
#define HWMONITOR2_REG_RAM_LIM_IN_6_L   0x37
 
#define HWMONITOR2_REG_RAM_LIM_HOT_H   0x38
 
#define HWMONITOR2_REG_RAM_LIM_HOT_L   0x39
 
#define HWMONITOR2_REG_RAM_LIM_TEMP_H   0x3A
 
#define HWMONITOR2_REG_RAM_LIM_TEMP_L   0x3B
 
#define HWMONITOR2_REG_RAM_CURRENT_LIM_FUN_1   0x3C
 
#define HWMONITOR2_REG_RAM_CURRENT_LIM_FUN_2   0x3D
 
#define HWMONITOR2_REG_RAM_MANUFACTURE_ID   0x3E
 
#define HWMONITOR2_REG_RAM_REVISION_ID   0x3F
 
#define HWMONITOR2_SET_CONFIG_START_DIS   0x00
 HW Monitor description HWMONITOR2_REG_CONFIGURATION register value.
 
#define HWMONITOR2_SET_CONFIG_START_EN   0x01
 
#define HWMONITOR2_SET_CONFIG_INT_DIS   0x00
 
#define HWMONITOR2_SET_CONFIG_INT_EN   0x01
 
#define HWMONITOR2_SET_CONFIG_INT_OPEN_DRAIN   0x00
 
#define HWMONITOR2_SET_CONFIG_INT_ACT_LOW   0x01
 
#define HWMONITOR2_SET_CONFIG_INT_CLR_DIS   0x00
 
#define HWMONITOR2_SET_CONFIG_INT_CLR_EN   0x01
 
#define HWMONITOR2_SET_CONFIG_CHA_NCLR_GPI   0x00
 
#define HWMONITOR2_SET_CONFIG_CHA_GPI   0x01
 
#define HWMONITOR2_SET_CONFIG_GPO_LOW   0x00
 
#define HWMONITOR2_SET_CONFIG_GPO_HIGH   0x01
 
#define HWMONITOR2_SET_CONFIG_PWR_ON   0x00
 
#define HWMONITOR2_SET_CONFIG_PWR_DIS   0x01
 
#define HWMONITOR2_SET_FAN1_MODE_COUNT   0x00
 HW Monitor description HWMONITOR2_REG_FAN_DIVISOR register value.
 
#define HWMONITOR2_SET_FAN1_MODE_SENS_INPUT   0x01
 
#define HWMONITOR2_SET_FAN2_MODE_COUNT   0x00
 
#define HWMONITOR2_SET_FAN2_MODE_SENS_INPUT   0x02
 
#define HWMONITOR2_SET_FAN1_CTRL_SPEED_DIV1   0x00
 
#define HWMONITOR2_SET_FAN1_CTRL_SPEED_DIV2   0x04
 
#define HWMONITOR2_SET_FAN1_CTRL_SPEED_DIV4   0x08
 
#define HWMONITOR2_SET_FAN1_CTRL_SPEED_DIV8   0x0C
 
#define HWMONITOR2_SET_FAN2_CTRL_SPEED_DIV1   0x00
 
#define HWMONITOR2_SET_FAN2_CTRL_SPEED_DIV2   0x10
 
#define HWMONITOR2_SET_FAN2_CTRL_SPEED_DIV4   0x20
 
#define HWMONITOR2_SET_FAN2_CTRL_SPEED_DIV8   0x30
 
#define HWMONITOR2_SET_MODE_OS_DISABLE   0x00
 
#define HWMONITOR2_SET_MODE_OS_ENABLE   0x01
 
#define HWMONITOR2_SET_MODE_RST_DISABLE   0x00
 
#define HWMONITOR2_SET_MODE_RST_ENABLE   0x01
 
#define HWMONITOR2_SET_TEMP_RES_8_bit   0x00
 HW Monitor description temperature resolution control data.
 
#define HWMONITOR2_SET_TEMP_RES_11_bit   0x01
 
#define HWMONITOR2_TEMP_RES_11_bit_BIT_MASK   0x08
 
#define HWMONITOR2_SET_ALL_CH_ENABLE   0x00
 HW Monitor description HWMONITOR2_REG_CHANNEL_DISABLE register value.
 
#define HWMONITOR2_SET_ALL_CH_DISABLE   0xFF
 
#define HWMONITOR2_MANUFACTURERS_ID   0x80
 HW Monitor description device ID data.
 
#define HWMONITOR2_STEPPING_DIE_REVISION_ID   0x08
 
#define HWMONITOR2_CH_0   0
 HW Monitor channel selection setting.
 
#define HWMONITOR2_CH_1   1
 
#define HWMONITOR2_CH_2   2
 
#define HWMONITOR2_CH_3   3
 
#define HWMONITOR2_CH_4   4
 
#define HWMONITOR2_CH_5   5
 
#define HWMONITOR2_CH_6   6
 
#define HWMONITOR2_FAN_1   0
 
#define HWMONITOR2_FAN_2   1
 
#define HWMONITOR2_DEVICE_ADDRESS_0   0x28
 HW Monitor 2 device address setting.
 
#define HWMONITOR2_DEVICE_ADDRESS_1   0x29
 
#define HWMONITOR2_DEVICE_ADDRESS_2   0x2A
 
#define HWMONITOR2_DEVICE_ADDRESS_3   0x2B
 
#define HWMONITOR2_DEVICE_ADDRESS_4   0x2C
 
#define HWMONITOR2_DEVICE_ADDRESS_5   0x2D
 
#define HWMONITOR2_DEVICE_ADDRESS_6   0x2E
 
#define HWMONITOR2_DEVICE_ADDRESS_7   0x2F
 
#define HWMONITOR2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  hwmonitor2_return_value_t { HWMONITOR2_OK = 0 , HWMONITOR2_ERROR = -1 }
 HW Monitor 2 Click return value data. More...
 

Functions

void hwmonitor2_cfg_setup (hwmonitor2_cfg_t *cfg)
 HW Monitor 2 configuration object setup function.
 
err_t hwmonitor2_init (hwmonitor2_t *ctx, hwmonitor2_cfg_t *cfg)
 HW Monitor 2 initialization function.
 
err_t hwmonitor2_default_cfg (hwmonitor2_t *ctx)
 HW Monitor 2 default configuration function.
 
err_t hwmonitor2_generic_write (hwmonitor2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 HW Monitor 2 I2C writing function.
 
err_t hwmonitor2_generic_read (hwmonitor2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 HW Monitor 2 I2C reading function.
 
void hwmonitor2_reset (hwmonitor2_t *ctx)
 HW Monitor 2 reset function.
 
err_t hwmonitor2_get_config (hwmonitor2_t *ctx, hwmonitor2_config_t *config)
 HW Monitor 2 gets configuration function.
 
err_t hwmonitor2_set_config (hwmonitor2_t *ctx, hwmonitor2_config_t config)
 HW Monitor 2 set the configuration function.
 
err_t hwmonitor2_get_device_id (hwmonitor2_t *ctx, uint8_t *manufacture_id, uint8_t *revision_id)
 HW Monitor 2 gets device ID function.
 
err_t hwmonitor2_set_temp_res (hwmonitor2_t *ctx, uint8_t temp_res)
 HW Monitor 2 set temperature resolution function.
 
err_t hwmonitor2_set_ch_out (hwmonitor2_t *ctx, uint8_t ch_out)
 HW Monitor 2 set voltage/temperature channel function.
 
err_t hwmonitor2_get_temperature (hwmonitor2_t *ctx, float *temperature)
 HW Monitor 2 gets temperature function.
 
err_t hwmonitor2_get_analog_inputs (hwmonitor2_t *ctx, uint8_t ch_pos, float *voltage)
 HW Monitor 2 gets analog inputs voltage function.
 
err_t hwmonitor2_get_fan_output (hwmonitor2_t *ctx, uint8_t fan_pos, uint8_t *fan_output)
 HW Monitor 2 gets FAN output function.
 
uint8_t hwmonitor2_get_int_pin (hwmonitor2_t *ctx)
 HW Monitor 2 gets interrupt function.
 

Detailed Description

This file contains API for HW Monitor 2 Click Driver.

Enumeration Type Documentation

◆ hwmonitor2_return_value_t

HW Monitor 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
HWMONITOR2_OK 
HWMONITOR2_ERROR