hwmonitor2  2.1.0.0
Modules | Functions
HW Monitor 2 Click Driver

API for configuring and manipulating HW Monitor 2 Click driver. More...

Modules

 HW Monitor 2 Registers List
 List of registers of HW Monitor 2 Click driver.
 
 HW Monitor 2 Registers Settings
 Settings for registers of HW Monitor 2 Click driver.
 
 HW Monitor 2 MikroBUS Map
 MikroBUS pin mapping of HW Monitor 2 Click driver.
 

Functions

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

Detailed Description

API for configuring and manipulating HW Monitor 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ hwmonitor2_cfg_setup()

void hwmonitor2_cfg_setup ( hwmonitor2_cfg_t cfg)

HW Monitor 2 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See hwmonitor2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ hwmonitor2_default_cfg()

err_t hwmonitor2_default_cfg ( hwmonitor2_t ctx)

HW Monitor 2 default configuration function.

This function executes a default configuration of HW Monitor 2 Click board.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ hwmonitor2_generic_read()

err_t hwmonitor2_generic_read ( hwmonitor2_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

HW Monitor 2 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_generic_write()

err_t hwmonitor2_generic_write ( hwmonitor2_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

HW Monitor 2 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_get_analog_inputs()

err_t hwmonitor2_get_analog_inputs ( hwmonitor2_t ctx,
uint8_t  ch_pos,
float *  voltage 
)

HW Monitor 2 gets analog inputs voltage function.

This function reads an analog inputs voltage of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]ch_pos: Analog inputs channel position [0-6].
[out]voltage: Analog inputs voltage [mV].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_get_config()

err_t hwmonitor2_get_config ( hwmonitor2_t ctx,
hwmonitor2_config_t config 
)

HW Monitor 2 gets configuration function.

This function gets the device configuration data object of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[out]config: Device configuration object. See hwmonitor2_config_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_get_device_id()

err_t hwmonitor2_get_device_id ( hwmonitor2_t ctx,
uint8_t *  manufacture_id,
uint8_t *  revision_id 
)

HW Monitor 2 gets device ID function.

This function reads a manufacturers ID and device stepping/die revision ID of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[out]manufacture_id: Manufacturers ID.
[out]revision_id: Device stepping/die revision ID.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_get_fan_output()

err_t hwmonitor2_get_fan_output ( hwmonitor2_t ctx,
uint8_t  fan_pos,
uint8_t *  fan_output 
)

HW Monitor 2 gets FAN output function.

This function reads a FAN tachometer output data of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]fan_pos: FAN tachometer inputs position [0-1].
[out]fan_output: FAN tachometer output data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_get_int_pin()

uint8_t hwmonitor2_get_int_pin ( hwmonitor2_t ctx)

HW Monitor 2 gets interrupt function.

This function gets states of the Interrupt ( INT ) pin of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ hwmonitor2_get_temperature()

err_t hwmonitor2_get_temperature ( hwmonitor2_t ctx,
float *  temperature 
)

HW Monitor 2 gets temperature function.

This function reads temperature data in degrees Celsius of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[out]temperature: Temperature data [deg C].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_init()

err_t hwmonitor2_init ( hwmonitor2_t ctx,
hwmonitor2_cfg_t cfg 
)

HW Monitor 2 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See hwmonitor2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_reset()

void hwmonitor2_reset ( hwmonitor2_t ctx)

HW Monitor 2 reset function.

This function performs a hardware reset of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ hwmonitor2_set_ch_out()

err_t hwmonitor2_set_ch_out ( hwmonitor2_t ctx,
uint8_t  ch_out 
)

HW Monitor 2 set voltage/temperature channel function.

This function enables or disables voltage/temperature channel of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]ch_out: Voltage/temperature channe data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_set_config()

err_t hwmonitor2_set_config ( hwmonitor2_t ctx,
hwmonitor2_config_t  config 
)

HW Monitor 2 set the configuration function.

This function set the device configuration data object of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]config: Device configuration object. See hwmonitor2_config_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hwmonitor2_set_temp_res()

err_t hwmonitor2_set_temp_res ( hwmonitor2_t ctx,
uint8_t  temp_res 
)

HW Monitor 2 set temperature resolution function.

This function set temperature resolution of the AMC80 System Hardware Monitor with Two-Wire and SMBus Serial Interface on the HW Monitor 2 Click board™.

Parameters
[in]ctx: Click context object. See hwmonitor2_t object definition for detailed explanation.
[in]temp_res:
  • 0x00 (HWMONITOR2_SET_TEMP_RES_8_bit) - 8-bit temperature resolution,
  • 0x01 (HWMONITOR2_SET_TEMP_RES_11_bit) - 11-bit temperature resolution.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.