fan8 2.0.0.0
fan8.h File Reference

This file contains API for FAN 8 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  fan8_t
 FAN 8 Click context object. More...
 
struct  fan8_cfg_t
 FAN 8 Click configuration object. More...
 

Macros

#define FAN8_REG_TEMP_CH1   0x00
 FAN 8 Register Map.
 
#define FAN8_REG_TEMP_CH2   0x01
 
#define FAN8_REG_CONFIG_BYTE   0x02
 
#define FAN8_REG_CH1_OT_LIMIT   0x03
 
#define FAN8_REG_CH2_OT_LIMIT   0x04
 
#define FAN8_REG_OT_STATUS   0x05
 
#define FAN8_REG_OT_MASK   0x06
 
#define FAN8_REG_PWM1_START_DC   0x07
 
#define FAN8_REG_PWM2_START_DC   0x08
 
#define FAN8_REG_PWM1_MAX_DC   0x09
 
#define FAN8_REG_PWM2_MAX_DC   0x0A
 
#define FAN8_REG_PWM1_TARGET_DC   0x0B
 
#define FAN8_REG_PWM2_TARGET_DC   0x0C
 
#define FAN8_REG_PWM1_INSTANTANEOUS_DC   0x0D
 
#define FAN8_REG_PWM2_INSTANTANEOUS_DC   0x0E
 
#define FAN8_REG_CH1_FAN_START_TEMP   0x0F
 
#define FAN8_REG_CH2_FAN_START_TEMP   0x10
 
#define FAN8_REG_FAN_CONFIGURATION   0x11
 
#define FAN8_REG_DC_ROC   0x12
 
#define FAN8_REG_DC_STEP_SIZE   0x13
 
#define FAN8_REG_PWM_FREQ_SEL   0x14
 
#define FAN8_REG_THERMISTOR_OFFSET   0x17
 
#define FAN8_REG_TACH1_VALUE   0x18
 
#define FAN8_REG_TACH2_VALUE   0x19
 
#define FAN8_REG_TACH1_LIMIT   0x1A
 
#define FAN8_REG_TACH2_LIMIT   0x1B
 
#define FAN8_REG_FAN_STATUS_BYTE   0x1C
 
#define FAN8_REG_CH1_TEMP_LSB   0x1E
 
#define FAN8_REG_CH2_TEMP_LSB   0x1F
 
#define FAN8_REG_DEVICE_REV   0xFD
 
#define FAN8_REG_DEVICE_ID   0xFE
 
#define FAN8_REG_MANUFACTURER_ID   0xFF
 
#define FAN8_DEVICE_ID   0x68
 FAN 8 Device ID value.
 
#define FAN8_RESET   0x40
 FAN 8 Reset value.
 
#define FAN8_FAN_CHANNEL_1   0x01
 FAN 8 fan channels value.
 
#define FAN8_FAN_CHANNEL_2   0x02
 
#define FAN8_FAN_CHANNEL_1   0x01
 FAN 8 fan channels value.
 
#define FAN8_FAN_CHANNEL_2   0x02
 
#define FAN8_TEMP_CHANNEL_1   0x01
 FAN 8 temperature channels value.
 
#define FAN8_TEMP_CHANNEL_2   0x02
 
#define FAN8_TEMPERATURE_RESOLUTION   0.125
 FAN 8 temperature constants.
 
#define FAN8_MAX_DUTY_CYCLE   240
 FAN 8 duty cycle values.
 
#define FAN8_MIN_DUTY_CYCLE   0
 
#define FAN8_DUTY_CYCLE_STEP_2   2
 
#define FAN8_DUTY_CYCLE_STEP_4   4
 
#define FAN8_DUTY_CYCLE_STEP_6   6
 
#define FAN8_DUTY_CYCLE_STEP_8   8
 
#define FAN8_DUTY_CYCLE_STEP_10   10
 
#define FAN8_DUTY_CYCLE_STEP_12   12
 
#define FAN8_DUTY_CYCLE_STEP_14   14
 
#define FAN8_DUTY_CYCLE_STEP_16   16
 
#define FAN8_CLOCK_COUNTER_FREQ   1950
 FAN 8 tachometer constants.
 
#define FAN8_SEC_PER_MIN   60
 
#define FAN8_2_PULSES_PER_REVOLUTION   2
 
#define FAN8_MAX_TACH_VALUE   255
 
#define FAN8_DEV_ADDR_ADD0_GND_ADD1_GND   0x18
 FAN 8 device address setting.
 
#define FAN8_DEV_ADDR_ADD0_GND_ADD1_HIGH_Z   0x19
 
#define FAN8_DEV_ADDR_ADD0_GND_ADD1_VCC   0x1A
 
#define FAN8_DEV_ADDR_ADD0_HIGH_Z_ADD1_GND   0x29
 
#define FAN8_DEV_ADDR_ADD0_HIGH_Z_ADD1_HIGH_Z   0x2A
 
#define FAN8_DEV_ADDR_ADD0_HIGH_Z_ADD1_VCC   0x2B
 
#define FAN8_DEV_ADDR_ADD0_VCC_ADD1_GND   0x4C
 
#define FAN8_DEV_ADDR_ADD0_VCC_ADD1_HIGH_Z   0x4D
 
#define FAN8_DEV_ADDR_ADD0_VCC_ADD1_VCC   0x4E
 
#define FAN8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  fan8_return_value_t { FAN8_OK = 0 , FAN8_ERROR = -1 }
 FAN 8 Click return value data. More...
 

Functions

void fan8_cfg_setup (fan8_cfg_t *cfg)
 FAN 8 configuration object setup function.
 
err_t fan8_init (fan8_t *ctx, fan8_cfg_t *cfg)
 FAN 8 initialization function.
 
err_t fan8_default_cfg (fan8_t *ctx)
 FAN 8 default configuration function.
 
err_t fan8_write_register (fan8_t *ctx, uint8_t reg, uint8_t data_in)
 FAN 8 write register function.
 
err_t fan8_read_register (fan8_t *ctx, uint8_t reg, uint8_t *data_out)
 FAN 8 read register function.
 
uint8_t fan8_check_overtemperature_indicator (fan8_t *ctx)
 FAN 8 check overtemperature indicator function.
 
uint8_t fan8_check_fan_fail_indicator (fan8_t *ctx)
 FAN 8 check fan fail indicator function.
 
uint8_t fan8_check_fault_indicator (fan8_t *ctx)
 FAN 8 check fault indicator function.
 
err_t fan8_check_device_id (fan8_t *ctx)
 FAN 8 check device ID function.
 
err_t fan8_set_duty_cycle (fan8_t *ctx, uint8_t fan_ch, uint8_t duty_cycle)
 FAN 8 set duty cycle function.
 
err_t fan8_measure_rpm (fan8_t *ctx, uint8_t fan_ch, uint8_t num_pulses, uint16_t *fan_rpm)
 FAN 8 measure fan RPM function.
 
err_t fan8_read_temperature (fan8_t *ctx, uint8_t temp_ch, float *temperature)
 FAN 8 read temperature function.
 
err_t fan8_reset (fan8_t *ctx)
 FAN 8 reset function.
 

Detailed Description

This file contains API for FAN 8 Click Driver.

Enumeration Type Documentation

◆ fan8_return_value_t

FAN 8 Click return value data.

Predefined enum values for driver return values.

Enumerator
FAN8_OK 
FAN8_ERROR