fan6 2.0.0.0
Public function

Functions

void fan6_cfg_setup (fan6_cfg_t *cfg)
 Config Object Initialization function.
 
FAN6_RETVAL fan6_init (fan6_t *ctx, fan6_cfg_t *cfg)
 Initialization function.
 
void fan6_default_cfg (fan6_t *ctx)
 Click Default Configuration function.
 
void fan6_generic_write (fan6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void fan6_generic_read (fan6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void fan6_write_reg (fan6_t *ctx, const uint8_t register_address, const uint16_t transfer_data)
 Generic write function.
 
uint16_t fan6_read_reg (fan6_t *ctx, const uint8_t register_address)
 Generic read function.
 
uint8_t fan6_receive_byte (fan6_t *ctx, const uint8_t register_address)
 Byte receive function.
 
void fan6_read_eeprom (fan6_t *ctx, uint8_t *data_out)
 EEPROM read function.
 
void fan6_set_pwm_mode (fan6_t *ctx, const uint8_t pwm_duty)
 PWM mode set function.
 
void fan6_set_fan_speed_con_mode (fan6_t *ctx, const uint8_t minimum_drive, const uint8_t tach_count, const uint16_t tach_target)
 Fan Speed Control Mode Set function.
 
void fan6_set_pwm_lut_mode (fan6_t *ctx, const uint8_t tach_count)
 Set PWM With LUT Mode function.
 
void fan6_set_fsc_lut_mode (fan6_t *ctx, const uint8_t minimum_drive, const uint8_t tach_count)
 Set FSC With LUT Mode function.
 
uint32_t fan6_read_tachometer (fan6_t *ctx)
 Tachometer Read function.
 
float fan6_get_temperature (fan6_t *ctx, const uint8_t temp_address)
 Temperature Get function.
 
void fan6_push_temperature (fan6_t *ctx, const uint8_t temp_address, const uint8_t temp_selection)
 Temperature Push function.
 
void fan6_enable_device (fan6_t *ctx, const uint8_t state)
 Device Enable function.
 
uint8_t fan6_indicate_critical_thermal_shutdown (fan6_t *ctx)
 Interrupt Pin Get function.
 
uint8_t fan6_get_gpio_2 (fan6_t *ctx)
 GPIO 2 Get function.
 
void fan6_set_gpio_1 (fan6_t *ctx, const uint8_t state)
 GPIO 1 Set function.
 

Detailed Description

Function Documentation

◆ fan6_cfg_setup()

void fan6_cfg_setup ( fan6_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ fan6_default_cfg()

void fan6_default_cfg ( fan6_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Fan6 click.

◆ fan6_enable_device()

void fan6_enable_device ( fan6_t * ctx,
const uint8_t state )

Device Enable function.

Parameters
ctxClick object.
stateState.

@description This function can enable or disable device.

◆ fan6_generic_read()

void fan6_generic_read ( fan6_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ fan6_generic_write()

void fan6_generic_write ( fan6_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ fan6_get_gpio_2()

uint8_t fan6_get_gpio_2 ( fan6_t * ctx)

GPIO 2 Get function.

Parameters
ctxClick object.

@description This function gets GPIO 2 state.

◆ fan6_get_temperature()

float fan6_get_temperature ( fan6_t * ctx,
const uint8_t temp_address )

Temperature Get function.

Parameters
ctxClick object.
temp_addressAddress where temperature is stored.
temp_signDetermines sign of temperature.

@description This function can read anyone positive or negative temperature value, from external or internal diode.

◆ fan6_indicate_critical_thermal_shutdown()

uint8_t fan6_indicate_critical_thermal_shutdown ( fan6_t * ctx)

Interrupt Pin Get function.

Parameters
ctxClick object.

@description This function gets interrupt pin.

◆ fan6_init()

FAN6_RETVAL fan6_init ( fan6_t * ctx,
fan6_cfg_t * cfg )

Initialization function.

Parameters
fan6Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ fan6_push_temperature()

void fan6_push_temperature ( fan6_t * ctx,
const uint8_t temp_address,
const uint8_t temp_selection )

Temperature Push function.

Parameters
ctxClick object.
temp_addressAddress where temperature which be pushed is stored.
temp_selectionAddress where tempereture be pushed.

@description This function pushes desired temperature value in Temperature 1 or Temperature 2 Pushed register.

◆ fan6_read_eeprom()

void fan6_read_eeprom ( fan6_t * ctx,
uint8_t * data_out )

EEPROM read function.

Parameters
ctxClick object.
data_outBuffer where data be stored.

@description This function reads 256 bytes from EEPROM.

◆ fan6_read_reg()

uint16_t fan6_read_reg ( fan6_t * ctx,
const uint8_t register_address )

Generic read function.

Parameters
ctxClick object.
register_addressRegister address.

@description This function reads 16-bit or 8-bit data from register.

◆ fan6_read_tachometer()

uint32_t fan6_read_tachometer ( fan6_t * ctx)

Tachometer Read function.

Parameters
ctxClick object.

@description This function reads current tachometer value and calculates that value in rpm.

◆ fan6_receive_byte()

uint8_t fan6_receive_byte ( fan6_t * ctx,
const uint8_t register_address )

Byte receive function.

Parameters
ctxClick object.
register_addressRegister address.

@description This function sends register address and reads byte from that address, without writting address again, every time when function be called.

◆ fan6_set_fan_speed_con_mode()

void fan6_set_fan_speed_con_mode ( fan6_t * ctx,
const uint8_t minimum_drive,
const uint8_t tach_count,
const uint16_t tach_target )

Fan Speed Control Mode Set function.

Parameters
ctxClick object.
minimumDriveMinimum drive setting for the RPM.
tach_countMaximum TACH Reading register value.
tach_targetThe target tachometer value that is maintained by the RPM.

@description This function sets Fan on Fan Speed Control (FSC) mode and determines minimum drive setting for the RPM, maximum TACH Reading register value and the target tachometer value that is maintained by the RPM.

◆ fan6_set_fsc_lut_mode()

void fan6_set_fsc_lut_mode ( fan6_t * ctx,
const uint8_t minimum_drive,
const uint8_t tach_count )

Set FSC With LUT Mode function.

Parameters
ctxClick object.
minimum_driveMinimum drive setting for the RPM.
tach_countMaximum TACH Reading register value.

@description This function sets Fan on FSC with LUT mode and determines maximum TACH Reading register value and minimum drive setting for the RPM.

◆ fan6_set_gpio_1()

void fan6_set_gpio_1 ( fan6_t * ctx,
const uint8_t state )

GPIO 1 Set function.

Parameters
ctxClick object.

@description This function sets GPIO 1 on desired state when he is configured as input pin.

◆ fan6_set_pwm_lut_mode()

void fan6_set_pwm_lut_mode ( fan6_t * ctx,
const uint8_t tach_count )

Set PWM With LUT Mode function.

Parameters
ctxClick object.
tach_countMaximum TACH Reading register value.

@description This function sets Fan on PWM with Look Up Table (LUT) mode and determines maximum TACH Reading register value.

◆ fan6_set_pwm_mode()

void fan6_set_pwm_mode ( fan6_t * ctx,
const uint8_t pwm_duty )

PWM mode set function.

Parameters
ctxClick object.
pwm_dutyValue which determines Fan speed.

@description This function sets Fan on PWM mode and determines Fan speed (PWM duty).

◆ fan6_write_reg()

void fan6_write_reg ( fan6_t * ctx,
const uint8_t register_address,
const uint16_t transfer_data )

Generic write function.

Parameters
ctxClick object.
register_addressRegister address.
transfer_dataData which be written.

@description This function writes 16-bit or 8-bit data to register.